Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions sp_orchhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,25 @@ def get_appliances(self):
print ("{0}: unable to get appliance list: {1}".format(self.url, r.text))
return []

def get_all_preconfig(self):
# GET operation to retrieve list of preconfigs
# JSON response is a list object
response = self.get("/gms/appliance/preconfiguration?filter=metadata")
if response.status_code == 200:
return response
else:
print("Failed to retrieve preconfig metadata from Orch at {0}".format(self.ipaddress))
return False

def delete_preconfig(self, pcid):
# DELETE operation to delete specific preconfig by preconfig id number (pcid)
response = self.delete("/gms/appliance/preconfiguration/" + pcid)
if response.status_code == 200:
return True
else:
print("Failed to delete preconfig id:{0} from Orch at {1}".format(pcid,self.ipaddress))
return False

# sample test code - only applies if this module is run as main
# this tests:
# instantiation of an OrchHelper class
Expand Down