Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion samples/appassigntosla.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get_db_info():
for db in options.dbs:
dbdata = {}
searchdata = {"name":db}
dbsearch = client.SppAPI(session, 'apiapp').post(path="/search?resourceType=database&applicationType="+options.type+"&from=hlo", data=searchdata)['databases']
dbsearch = client.SppAPI(session, 'apiapp').post(path="/search?resourceType=database&applicationType="+options.type+"&from=hlo", data=searchdata)['contents']
if not dbsearch:
logger.warning("Did not find database " + db)
break
Expand Down
5 changes: 2 additions & 3 deletions samples/changeuserpassword.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ def change_password():
print("Password changed for " + options.username)
except requests.exceptions.HTTPError as err:
errmsg = json.loads(err.response.content)
print errmsg['description']
print(errmsg['description'])

validate_input()
session = client.SppSession(options.host, options.username, options.password)
session.login()
change_password()
session.logout()
change_password()
2 changes: 1 addition & 1 deletion samples/createsite.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Script to create a new vSnap site in SPP
# Use registervsnap.py -h for help
# Use createsite.py -h for help

import json
import logging
Expand Down
2 changes: 1 addition & 1 deletion samples/createslapolicy.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def build_start_date():
sdt = datetime.datetime.strptime(options.starttime, '%m/%d/%Y %H:%M')
sdt += datetime.timedelta(minutes=2.5)
sdt -= datetime.timedelta(minutes=sdt.minute %5, seconds=sdt.second, microseconds=sdt.microsecond)
starttime = int(sdt.strftime("%s"))*1000
starttime = int(sdt.strftime("%S"))*1000
return starttime

def build_weekly_dowlist(adate):
Expand Down
2 changes: 1 addition & 1 deletion samples/deletesite.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def delete_site():
print(options.sitename + " is deleted")
except client.requests.exceptions.HTTPError as err:
errmsg = json.loads(err.response.content)
print(errmsg['response'])
print(errmsg['description'])

validate_input()
session = client.SppSession(options.host, options.username, options.password)
Expand Down
2 changes: 1 addition & 1 deletion samples/spplicinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def install_license():
hdrs = {'Content-Type': 'application/json','Accept': 'application/json'}
r = requests.post(options.host + '/api/endeavour/session?action=installLicense',
auth=requests.auth.HTTPBasicAuth('admin','password'), verify=False, headers=hdrs)
if(r.status_code is 204):
if(r.status_code == 204):
logger.info("License installed.")
else:
logger.info("Error installing license.")
Expand Down
2 changes: 1 addition & 1 deletion samples/sppvmbackupinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get_vm_backup_info():

def get_vm_version_info(vm):
vmbuinfo = []
urlpath = vm['config']['hypervisorKey'] + "/vm/" + vm['id'] + "/version?from=hlo"
urlpath = vm['hypervisorKey'] + "/vm/" + vm['id'] + "/version?from=hlo"
versions = client.SppAPI(session, 'corehv').get(path=urlpath)['versions']
for version in versions:
data = {}
Expand Down
2 changes: 1 addition & 1 deletion samples/sqladhocbackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def validate_input():

def find_db():
searchdata = {"name":options.db}
dbsearch = client.SppAPI(session, 'apiapp').post(path="/search?resourceType=database&applicationType=sql&from=hlo", data=searchdata)['databases']
dbsearch = client.SppAPI(session, 'apiapp').post(path="/search?resourceType=database&applicationType=sql&from=hlo", data=searchdata)['contents']
if not dbsearch:
logger.warning("Did not find db " + options.db)
session.logout()
Expand Down
2 changes: 1 addition & 1 deletion samples/sqlcopies.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def validate_input():

def find_db():
searchdata = {"name":options.db}
dbsearch = client.SppAPI(session, 'apiapp').post(path="/search?resourceType=database&applicationType=sql&from=recovery", data=searchdata)['databases']
dbsearch = client.SppAPI(session, 'apiapp').post(path="/search?resourceType=database&applicationType=sql&from=recovery", data=searchdata)['contents']
if not dbsearch:
logger.warning("Did not find recoverable db " + options.db)
session.logout()
Expand Down
2 changes: 1 addition & 1 deletion samples/sqlrestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def validate_input():

def find_db():
searchdata = {"name":options.db}
dbsearch = client.SppAPI(session, 'apiapp').post(path="/search?resourceType=database&applicationType=sql&from=recovery", data=searchdata)['databases']
dbsearch = client.SppAPI(session, 'apiapp').post(path="/search?resourceType=database&applicationType=sql&from=recovery", data=searchdata)['contents']
if not dbsearch:
logger.warning("Did not find recoverable db " + options.db)
session.logout()
Expand Down