marathon package

Module contents

class marathon.Marathon(host, user=None, password=None)[source]

Create a new marathon client instance to deals with the Marathon API.

Parameters:
  • host (String) – Marathon URL.
  • user (String) – Username required for the HTTP authentication.
  • password (String) – Password required for the HTTP authentication.
endpoints(appId=None)[source]

List tasks of all running applications if appId is not provided. List running tasks for app appId if provided.

Parameters:appId (String) – The app you want to list the endpoints.
Returns:Response from the Marathon API
Return type:text/plain
Raise:requests.exceptions.HTTPError
kill(appId)[source]

Destroy app appId.

Parameters:appId (String) – The app you want to destroy.
Returns:Response from the Marathon API
Return type:application/json
Raise:requests.exceptions.HTTPError
list()[source]

List all running apps.

Returns:Response from the Marathon API
Return type:application/json
Raise:requests.exceptions.HTTPError
list_tasks(appId)[source]

List running tasks for app appId.

Parameters:appId (String) – The app you want to list the tasks.
Returns:Response from the Marathon API
Return type:application/json
Raise:requests.exceptions.HTTPError
scale(appId, instances)[source]

Scale the number of app instances for app appId.

Parameters:
  • appId (String) – The app you want to scale.
  • instances (Integer) – The number of instances you want to have.
Returns:

Response from the Marathon API

Return type:

application/json

Raise:

requests.exceptions.HTTPError

search(appId=None, cmd=None)[source]

List all running apps, filtered by appId and command.

Parameters:
  • appId (String) – The filter you want to use to search an app by appId.
  • cmd (String) – The filter you want to use to search an app by command.
Returns:

Response from the Marathon API

Return type:

application/json

Raise:

requests.exceptions.HTTPError

start(payload)[source]

Create and start a new app.

Parameters:payload – The app definition.
Returns:Response from the Marathon API
Return type:application/json
Raise:requests.exceptions.HTTPError

Table Of Contents

Previous topic

Welcome to marathon-client.py’s documentation!

This Page