Hi,
I am not sure if i should reach out for Python stuff but i hope you may help out.. which is really helpful.
Normally below script will execute for given one cluster.
Requirement: I would like to run same script for multiple clusters at a single execute ( like I need to call all clusters from one file e.g C:\Users\u630850\cluster_list.txt ) and then execute. Since I am not familiar with loops, I am reaching out for assistance. Thank you. 🙂
print("\n ~~ This script is to gather volume list for one cluster ~~\n")
cluster= input('Enter ONTAP Cluster Name:')
if (str(is_valid_hostname(cluster))=="True"):
username = input('Enter cluster login userid:')
password = getpass.getpass()
print("\nValidating connection.. please wait..\n")
conn = HostConnection(cluster, username, password, verify=False)
config.CONNECTION = conn
try:
for volume in Volume.get_collection(**{"fields": '*', "state": 'offline', "svm.name": '*'}, max_records=500):