Discovering the Network File Server
In this example, we need to perform a number of tasks. First, it is necessary to obtain the server ID for an Admin Server that is used to perform administrative tasks on the filer. Second, it is also necessary to obtain the ID for the Oracle VM Storage Connect plug-in used to connect to the filer. In this example, we use the server ID object that we created earlier, and we loop through the Oracle VM Storage Connect plug-in options to select the ID for the "Oracle Generic Network File System".
adminserver=sid for i in client.service.fileServerPluginGetIds(): if i.name=="Oracle Generic Network File System": plugin_id=i
Now we can use the Suds Client Factory to construct the SOAP object for the network file server discovery and send the initial request:
fileServer=client.factory.create('fileServer') fileServer.adminServerIds=adminserver fileServer.name="MyNFSServer
" fileServer.accessHost='10.172.76.125
' // Set the Fileserver Type, can be LOCAL, NETWORK or UNKNOWN fileServer.fileServerType="NETWORK
" fileServer.fileServerPluginId=plugin_id // Set the FileServer as having Uniform Exports fileserver.setUniformExports="true" job=client.service.fileServerDiscover(fileServer) nfsid=wait_for_job(client,job.id)
Refresh The Network File Server
To make use of the file systems that are exported by the network file server, you need to refresh the network file server. :
job=client.service.fileServerRefresh(nfsid) wait_for_job(client,job.id)
Refresh File Systems
Now you finally need to obtain the file system ID values for each file system exported by the network file server, and refresh the file system for each of these:
nfs=client.service.fileServerGetById(nfsid) for fsid in nfs.fileSystemIds: job=client.service.fileSystemRefresh(fsid) wait_for_job(client,job.id)