Skip to content

Commit 093c531

Browse files
bryan-brancotteschaubl
authored andcommitted
Added 'username', 'abort', 'service_url', 'clouds' and removed 'cloud' from Deployment
* Retrieving username and abort status of deployments * retrieving username and abort status * retrieving ss:url.service for deployments * Minor code improvement 7 times faster xml searching 4 lines less * Provide the list of Clouds a deployment is involved in ... ... instead of providing a CSV string. * Renamed 'service' to 'service_url'
1 parent d897844 commit 093c531

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

src/slipstream/api/api.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,11 @@ def list_deployments(self, inactive=False):
376376
status=elem.get('status').lower(),
377377
started_at=elem.get('startTime'),
378378
last_state_change=elem.get('lastStateChangeTime'),
379-
cloud=elem.get('cloudServiceNames'))
379+
cloud=elem.get('cloudServiceNames'),
380+
username=elem.get('username'),
381+
abort=elem.get('abort'),
382+
service_url=elem.get('serviceUrl'),
383+
)
380384

381385
def get_deployment(self, deployment_id):
382386
"""
@@ -387,12 +391,20 @@ def get_deployment(self, deployment_id):
387391
388392
"""
389393
root = self._xml_get('/run/' + str(deployment_id))
394+
395+
abort = root.findtext('runtimeParameters/entry/runtimeParameter[@key="ss:abort"]')
396+
service_url = root.findtext('runtimeParameters/entry/runtimeParameter[@key="ss:url.service"]')
397+
390398
return models.Deployment(id=uuid.UUID(root.get('uuid')),
391399
module=_mod(root.get('moduleResourceUri')),
392400
status=root.get('state').lower(),
393401
started_at=root.get('startTime'),
394402
last_state_change=root.get('lastStateChangeTime'),
395-
cloud=root.get('cloudServiceNames'))
403+
clouds=root.get('cloudServiceNames','').split(','),
404+
username=root.get('user'),
405+
abort=abort,
406+
service_url=service_url,
407+
)
396408

397409
def list_virtualmachines(self, deployment_id=None, offset=0, limit=20):
398410
"""

src/slipstream/api/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
'status',
1616
'started_at',
1717
'last_state_change',
18-
'cloud',
18+
'clouds',
19+
'username',
20+
'abort',
21+
'service_url',
1922
])
2023

2124
Component = collections.namedtuple('Component', [

0 commit comments

Comments
 (0)