### Step 2 - Configure connection
config.CONNECTION = HostConnection(
	global_vars["PRI_CLU"],
	username=global_vars["PRI_CLU_USER"],
	password=global_vars["PRI_CLU_PASS"],
	verify=False
)


### Step 3 - Get & print details
# SVMs
print("--> Printing SVM details")
print("{:<20}{:<15}{:<10}{:<30}".format(
	"Name", "IP Space", "State", "Comment")
)
for svm in Svm.get_collection():
	svm.get()
	print("{:<20}{:<15}{:<10}{:<30}".format(
		svm.name,
		svm.ipspace.name,
		svm.state,
		svm.comment
        ))
print("")

# Interfaces
print("--> Printing network interface details")
print("{:<20}{:<25}{:<20}{:<15}".format(
	 "SVM", "Name", "IP", "Current Port")
)
for lif in IpInterface.get_collection(**{"scope": "svm"}):
示例#2
0
print("")

# CIFS Server
print("--> Starting CIFS server delete operation")
try:
    cifs = CifsService.find(name=global_vars["PRI_SVM"])
    if cifs:
        cifs.delete(
            body={
                "ad_domain": {
                    "fqdn": global_vars["PRI_AD_DOMAIN"],
                    "user": global_vars["PRI_AD_USER"],
                    "password": global_vars["PRI_AD_PASS"]
                }
            })
        print("--> CIFS server {} deleted successfully".format(cifs.name))
except NetAppRestError as err:
    print("--> Error: CIFS server was not deleted:\n{}".format(err))
print("")

# SVM
print("--> Starting SVM delete operation")
try:
    svm = Svm.find(**{"name": global_vars["PRI_SVM"]})
    if svm:
        svm.delete()
        print("--> SVM {} deleted successfully".format(svm.name))
except NetAppRestError as err:
    print("--> Error: SVM was not deleted:\n{}".format(err))
print("")