Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Getting All snapmirror relationships slowly from ONTAP API
2020-12-09
06:45 PM
3,652 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 "===================================="
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What ONTAP version you are on? I would open a support request as that doesn't seem right...
Gidi Marcus (Linkedin) - Storage and Microsoft technologies consultant - Hydro IT LTD - UK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My ONTAP OS is 9.7P9.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My ONTAP OS is 9.7P9.
