Hello, I am trying to use python script to get "all snapmirrror relationships" from ONTAP API, when I run the script that it's took very long time to finished(around 30-50 minutes ), but using "snapmirror show" via ssh that it's very quickly to finished job(around 3-5 seconds ).
Is anyone else has same problem?
====================================================================
SSH cmd example:
ssh admin@10.255.1.10 "snapmirror show"
====================================================================
python script code:
#!/usr/bin/python [2/148]
import requests
import json
import urllib3
urllib3.disable_warnings()
auth_user = "admin"
auth_pass = "12345678"
api_url="https://10.255.1.10/api/snapmirror/relationships/"
headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}
r = requests.get(api_url, auth=(auth_user,auth_pass), headers=headers, verify=False)
rs = r.json()
total = rs["records"]
for r in rs["records"]:
#print api_url + r["uuid"]
api_url_list = api_url + r["uuid"]
print api_url_list
r1 = requests.get(api_url_list, auth=(auth_user,auth_pass), headers=headers, verify=False)
rs1 = r1.json()
#print rs1
print rs1["source"]["path"]
print rs1["destination"]["path"]
print rs1["healthy"]
print "===================================="