Unsolved
This post is more than 5 years old
2 Posts
0
3435
February 7th, 2017 06:00
How to get ConsistencyGroup status from Rest API?
With the following powershell + REST API cmdlet, I can get ConsistencyGroup name from RP4VM 5, How do I get other information e.g. synchronization status, primary and replica VM name etc. ?
Invoke-RestMethod -Uri https://10.51.11.101:7225/fapi/rest/5_0/groups/940328502/name -Headers $headers
Invoke-RestMethod -Uri https://10.51.11.101:7225/fapi/rest/5_0/groups/2003471281/name -Headers $headers
Thanks.
No Events found!
Idan
675 Posts
0
February 8th, 2017 08:00
Hi,
Try a GET to /groups/{groupId}/state (getGroupState()).
Regards,
Idan Kentor
RecoverPoint Corporate Systems Engineering
@IdanKentor
fpsong
2 Posts
0
April 5th, 2017 11:00
Thank you!
0orellana
2 Posts
0
February 26th, 2018 19:00
Hi fpsong,
Did you get your answer?
I need to do the same thing but using: https://$($urlname)/fapi/rest/5_0/system/health
The issue i have run into is not being able to build the $headers to pass the credentials.
How did you build the headers to pass creds?
I have and still am searching Google for hits on how to invoke this API either in Powershell or Python.
Idan
675 Posts
0
February 27th, 2018 02:00
Hi,
Here you go:
HTTP_REQUEST_HEADERS = {"Content-Type": "application/json"}
req = requests.session()
req.auth = (user, password)
req.headers.update(HTTP_REQUEST_HEADERS)
req.verify:
print ("Session Established")
print ("URL is " + url)
Hope that helps,
Idan
0orellana
2 Posts
0
February 27th, 2018 12:00
Thanks for your quick response Idan :- )
I'm all set and ready to go now . . . .
--OaO