Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnddias/50f6c71a9726cdfdd8edd1b314df4f6d to your computer and use it in GitHub Desktop.
Save johnddias/50f6c71a9726cdfdd8edd1b314df4f6d to your computer and use it in GitHub Desktop.
Get Bootstrap Status of Agent Install for vROps
import requests
import json
import logging
def getBootstrapStatus(context, inputs):
if "verify" not in inputs.keys():
inputs["verify"] = True
headers = {'Content-type':'application/json','Accept':'application/json','Authorization':'vRealizeOpsToken '+ inputs["token"]}
r = requests.request('GET','https://'+inputs["vropsHost"]+'/suite-api/api/applications/agents/'+inputs["taskId"]+'/status', headers=headers, verify=inputs["verify"])
if (r.status_code == 200):
taskStatus = json.loads(r.text)
return(taskStatus["bootstrapObjectStatuses"][0]["stage"])
return("Error retrieving bootstap status: " + str(r.status_code))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment