Skip to content

Commit

Permalink
Merge pull request #210 from thefactory/include-embed-lastUnusedOffers
Browse files Browse the repository at this point in the history
add embed option for /v2/queue
  • Loading branch information
solarkennedy authored Jul 28, 2017
2 parents 828b964 + 367930f commit 75f476a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions marathon/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,13 +668,17 @@ def list_deployments(self):
response = self._do_request('GET', '/v2/deployments')
return self._parse_response(response, MarathonDeployment, is_list=True)

def list_queue(self):
def list_queue(self, embed_last_unused_offers=False):
"""List all the tasks queued up or waiting to be scheduled.
:returns: list of queue items
:rtype: list[:class:`marathon.models.queue.MarathonQueueItem`]
"""
response = self._do_request('GET', '/v2/queue')
if embed_last_unused_offers:
params = {'embed': 'lastUnusedOffers'}
else:
params = {}
response = self._do_request('GET', '/v2/queue', params=params)
return self._parse_response(response, MarathonQueueItem, is_list=True, resource_name='queue')

def delete_deployment(self, deployment_id, force=False):
Expand Down

0 comments on commit 75f476a

Please sign in to comment.