emc-openstack / storops

Python storage management library for VNX and Unity.
Apache License 2.0
53 stars 29 forks source link

How to get the IP's of NAS_servers? #329

Closed nehatomar12 closed 3 years ago

nehatomar12 commented 3 years ago

nas_servers = conn.get_nas_server()

we get the information of nas_servers How can we get the IP's associated Nas_servers?

Murray-LIANG commented 3 years ago
for nas_server in nas_servers:
    interfaces = nas_server.file_interface
    ip_addresses = [e.ip_address for e in interfaces]

nas_server.file_interface will return a list of file interfaces. Then each interface has a property named ip_address.

nehatomar12 commented 3 years ago

@Murray-LIANG Thanks, It is working

Can you tell me how can I get information about the protocols enabled on the Nas Servers?

Murray-LIANG commented 3 years ago

If the nas server enabled NFS, there is at least one NFS server whose nas server is that nas server.

nas_server = conn.get_nas_server()[0]
nfs_servers = [e for e in conn.get_nfs_server() if e.nas_server.id == nas_server.id]
nfs_enabled = len(nfs_servers) != 0