Skip to content

Commit bf5c59a

Browse files
author
LUMASERV
committed
Updated Python Client
1 parent 173181b commit bf5c59a

5 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/client/AddonClient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def __init__(self, api_key, base_url="https://api.lumaserv.com/addon"):
1313

1414
def request(self, method, path, params={}, body={}):
1515
r = self.session.request(method, self.base_url + path, data=body, params=params)
16-
if(r.status_code < 200 or (r.status_code >= 300 and r.status_code < 400):
16+
if r.status_code < 200 or (r.status_code >= 300 and r.status_code < 400):
1717
raise Exception("Status code is " + r.status_code + "!")
1818
return r.json()
1919

src/client/AuthClient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def __init__(self, api_key, base_url="https://auth.lumaserv.com"):
1313

1414
def request(self, method, path, params={}, body={}):
1515
r = self.session.request(method, self.base_url + path, data=body, params=params)
16-
if(r.status_code < 200 or (r.status_code >= 300 and r.status_code < 400):
16+
if r.status_code < 200 or (r.status_code >= 300 and r.status_code < 400):
1717
raise Exception("Status code is " + r.status_code + "!")
1818
return r.json()
1919

src/client/BillingClient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def __init__(self, api_key, base_url="https://api.lumaserv.com/billing"):
1313

1414
def request(self, method, path, params={}, body={}):
1515
r = self.session.request(method, self.base_url + path, data=body, params=params)
16-
if(r.status_code < 200 or (r.status_code >= 300 and r.status_code < 400):
16+
if r.status_code < 200 or (r.status_code >= 300 and r.status_code < 400):
1717
raise Exception("Status code is " + r.status_code + "!")
1818
return r.json()
1919

src/client/ComputeClient.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def __init__(self, api_key, base_url="https://api.lumaserv.com/compute"):
1313

1414
def request(self, method, path, params={}, body={}):
1515
r = self.session.request(method, self.base_url + path, data=body, params=params)
16-
if(r.status_code < 200 or (r.status_code >= 300 and r.status_code < 400):
16+
if r.status_code < 200 or (r.status_code >= 300 and r.status_code < 400):
1717
raise Exception("Status code is " + r.status_code + "!")
1818
return r.json()
1919

@@ -326,6 +326,10 @@ def delete_ssh_key(self, id, query_params={}):
326326
return self.request("DELETE", "/ssh-keys/{id}".format(id=id), query_params)
327327

328328

329+
def update_ssh_key(self, id, body, query_params={}):
330+
return self.request("PUT", "/ssh-keys/{id}".format(id=id), query_params, body)
331+
332+
329333
def create_server_price_range_assignment(self, body, query_params={}):
330334
return self.request("POST", "/server-price-range-assignments", query_params, body)
331335

src/client/DomainClient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def __init__(self, api_key, base_url="https://api.lumaserv.com/domain"):
1313

1414
def request(self, method, path, params={}, body={}):
1515
r = self.session.request(method, self.base_url + path, data=body, params=params)
16-
if(r.status_code < 200 or (r.status_code >= 300 and r.status_code < 400):
16+
if r.status_code < 200 or (r.status_code >= 300 and r.status_code < 400):
1717
raise Exception("Status code is " + r.status_code + "!")
1818
return r.json()
1919

0 commit comments

Comments
 (0)