Marathon REST API documentation version 2.0
/v2/apps
Get the list of running applications. Several filters can be applied via the following query parameters.
Change multiple applications either by upgrading existing ones or creating new ones. If there is an update to an already running application, the application gets upgraded. All instances of this application get replaced by the new version. The order of dependencies will be applied correctly. The upgradeStrategy defines the behaviour of the upgrade. If the id of the application is not known, the application gets started. The order of dependencies will be applied correctly. It is possible to mix upgrades and installs. If you have more complex scenarios with upgrades, use the groups endpoint. Note: This operation will create a deployment. The operation finishes, if the deployment succeeds. You can query the deployments endoint to see the status of the deployment.
Create and start a new application. Note: This operation will create a deployment. The operation finishes, if the deployment succeeds. You can query the deployments endoint to see the status of the deployment.
get /v2/apps
Get the list of running applications. Several filters can be applied via the following query parameters.
Query Parameters
- cmd: (string)
Filter the result to only return apps whose
cmd
field contains the given valueExample:
java
- id: (string)
Filter the result to only return apps whose
id
is or contains the given valueExample:
/us-east/database/memsql
- label: (string)
A label selector query contains one or more label selectors, which are comma separated. Marathon supports three types of selectors existence-based, equality-based and set-based. In the case of multiple selectors, all must be satisfied so comma separator acts as an AND logical operator. Labels and values must consist of alphanumeric characters plus
-
_
and.
-A-Za-z0-9_.
. Any other character is possible, but must be escaped with a backslash character.Existence based Selector Query
Matches the existence of a label
Example: my_label,environmentEquality based Selector Query
Matches existence of labels and the (non) equality of the value.
Example: environment==production, tier!=frontendSet based Selector Query
Matches existence of labels and the (non) existence of the value in a given set
Example: environment in (stage,production), tier notin (frontend, service)
Example:
my_label, environment==production, tier!=frontend\ tier, deployed in (us, eu), deployed notin (aa, bb)
- embed: (one of apps.tasks, apps.count, apps.deployments, apps.lastTaskFailure, apps.failures, apps.taskStats - repeat: true)
Embeds nested resources that match the supplied path. You can specify this parameter multiple times with different values.
apps.tasks
embed all tasks of each application
Note: if this embed is definded, it automatically setsapps.deployments
but this will change in a future release. Please define all embeds explicit.apps.counts
embed all task counts (tasksStaged, tasksRunning, tasksHealthy, tasksUnhealthy)
Note: currently embedded by default but this will change in a future release. Please define all embeds explicit.apps.deployments
embed all deployment identifier, if the related app currently is in deployment.apps.lastTaskFailure
embeds the lastTaskFailure for the application if there is one.apps.failures
Shorthand for apps.lastTaskFailure, apps.tasks, apps.counts and apps.deployments.
Note: deprecated and will be removed in future versions Please define all embeds explicit.apps.taskStats
exposes task statatistics in the JSON.
Example:
apps.tasks
HTTP status code 200
The list of applications that match the defined filters
Body
Type: application/json
Example:
{
"apps": [
{
"id": "/myapp",
"cmd": "env && sleep 60",
"args": null,
"user": null,
"env": {
"LD_LIBRARY_PATH": "/usr/local/lib/myLib"
},
"instances": 3,
"cpus": 0.1,
"mem": 5,
"disk": 0,
"executor": "",
"constraints": [
[
"hostname",
"UNIQUE",
""
]
],
"uris": [
"https://raw.github.com/mesosphere/marathon/master/README.md"
],
"storeUrls": [],
"ports": [
10013,
10015
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": null,
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 1,
"maximumOverCapacity": 1
},
"labels": {},
"acceptedResourceRoles": null,
"version": "2015-09-25T15:13:48.343Z",
"versionInfo": {
"lastScalingAt": "2015-09-25T15:13:48.343Z",
"lastConfigChangeAt": "2015-09-25T15:13:48.343Z"
},
"tasksStaged": 0,
"tasksRunning": 0,
"tasksHealthy": 0,
"tasksUnhealthy": 0,
"deployments": [
{
"id": "9538079c-3898-4e32-aa31-799bf9097f74"
}
]
}
]
}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
put /v2/apps
Change multiple applications either by upgrading existing ones or creating new ones. If there is an update to an already running application, the application gets upgraded. All instances of this application get replaced by the new version. The order of dependencies will be applied correctly. The upgradeStrategy defines the behaviour of the upgrade. If the id of the application is not known, the application gets started. The order of dependencies will be applied correctly. It is possible to mix upgrades and installs. If you have more complex scenarios with upgrades, use the groups endpoint. Note: This operation will create a deployment. The operation finishes, if the deployment succeeds. You can query the deployments endoint to see the status of the deployment.
Query Parameters
- force: (boolean)
Only one deployment can be applied to one application at the same time. If the existing deployment should be canceled by this change, you can set force=true. Caution: setting force=true will cancel the current deployment. This paramter should be used only, if the current deployment is unsuccessful!
Body
Type: application/json
Example:
[{
"id": "/test/sleep60",
"cmd": "sleep 60",
"cpus": 0.3,
"instances": 2,
"mem": 9,
"dependencies": [ "/test/sleep120", "/other/namespace/or/app"]
},{
"id": "/test/sleep120",
"cmd": "sleep 120",
"cpus": 0.3,
"instances": 2,
"mem": 9
}]
HTTP status code 200
A deployment is started which has a unique deployment identifier. The related deployment can be fetched from the /v2/deployments endpoint. If the deployement is gone from the list of deployments, than this means it is finished. As long as the deployment runs, the effect of that change operation is visible only partially.
Body
Type: application/json
Example:
{
"deploymentId": "5ed4c0c5-9ff8-4a6f-a0cd-f57f59a34b43",
"version": "2015-09-29T15:59:51.164Z"
}
HTTP status code 400
The application definition provided in the body is not valid.
Body
Type: application/json
Example:
{"message":"Invalid JSON","details":[{"path":"/id","errors":["error.expected.jsstring"]}]}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
HTTP status code 409
There is an already deployed application with this name
Body
Type: application/json
Example:
{"message":"An app with id [/existing_app] already exists."}
HTTP status code 422
The entity send can not be preocessed, since there are validation errors
Body
Type: application/json
Example:
{
"message": "Object is not valid",
"details": [
{
"attribute": "upgradeStrategy.minimumHealthCapacity",
"error": "is greater than 1"
}
]
}
post /v2/apps
Create and start a new application. Note: This operation will create a deployment. The operation finishes, if the deployment succeeds. You can query the deployments endoint to see the status of the deployment.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/schema#",
"additionalProperties": false,
"definitions": {
"pathType": {
"pattern": "^(\\/?((\\.{2})|([a-z0-9][a-z0-9\\-.]*[a-z0-9]+)|([a-z0-9]*))($|\\/))+$",
"type": "string"
}
},
"not": {
"allOf": [
{
"required": [
"cmd"
]
},
{
"required": [
"args"
]
}
]
},
"properties": {
"acceptedResourceRoles": {
"items": {
"type": "string"
},
"type": "array",
"description": "Optional. A list of resource roles. Marathon considers only resource offers with roles in this list for launching tasks of this app. If you do not specify this, Marathon considers all resource offers with roles that have been configured by the `--default_accepted_resource_roles` command line flag. If no `--default_accepted_resource_roles` was given on startup, Marathon considers all resource offers. To register Marathon for a role, you need to specify the `--mesos_role` command line flag on startup. If you want to assign all resources of a slave to a role, you can use the `--default_role` argument when starting up the slave. If you need a more fine-grained configuration, you can use the `--resources` argument to specify resource shares per role. The Mesos master needs to be started with `--roles` followed by a comma-separated list of all roles you want to use across your cluster. See [the Mesos command line documentation](http://mesos.apache.org/documentation/latest/configuration/) for details."
},
"args": {
"items": {
"type": "string"
},
"type": "array",
"description": "An array of strings that represents an alternative mode of specifying the command to run. This was motivated by safe usage of containerizer features like a custom Docker ENTRYPOINT. This args field may be used in place of cmd even when using the default command executor. This change mirrors API and semantics changes in the Mesos CommandInfo protobuf message starting with version `0.20.0`. Either `cmd` or `args` must be supplied. It is invalid to supply both `cmd` and `args` in the same app."
},
"backoffFactor": {
"minimum": 1.0,
"type": "number",
"description": "Configures exponential backoff behavior when launching potentially sick apps. This prevents sandboxes associated with consecutively failing tasks from filling up the hard disk on Mesos slaves. The backoff period is multiplied by the factor for each consecutive failure until it reaches maxLaunchDelaySeconds. This applies also to tasks that are killed due to failing too many health checks."
},
"backoffSeconds": {
"description": "Configures exponential backoff behavior when launching potentially sick apps. This prevents sandboxes associated with consecutively failing tasks from filling up the hard disk on Mesos slaves. The backoff period is multiplied by the factor for each consecutive failure until it reaches maxLaunchDelaySeconds. This applies also to tasks that are killed due to failing too many health checks.",
"minimum": 0,
"type": "integer"
},
"cmd": {
"description": "The command that is executed. This value is wrapped by Mesos via `/bin/sh -c ${app.cmd}`. Either `cmd` or `args` must be supplied. It is invalid to supply both `cmd` and `args` in the same app.",
"type": "string",
"minLength": 1
},
"constraints": {
"description": "Valid constraint operators are one of UNIQUE, CLUSTER, GROUP_BY."
},
"container": {
"additionalProperties": false,
"properties": {
"docker": {
"additionalProperties": false,
"properties": {
"forcePullImage": {
"type": "boolean"
},
"image": {
"type": "string",
"minLength": 1
},
"network": {
"type": "string"
},
"parameters": {
"items": {
"additionalProperties": false,
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"key",
"value"
],
"type": "object"
},
"type": "array"
},
"portMappings": {
"items": {
"additionalProperties": false,
"properties": {
"containerPort": {
"maximum": 65535,
"minimum": 0,
"type": "integer"
},
"hostPort": {
"maximum": 65535,
"minimum": 0,
"type": "integer"
},
"protocol": {
"type": "string"
},
"servicePort": {
"maximum": 65535,
"minimum": 0,
"type": "integer"
}
},
"type": "object"
},
"type": "array"
},
"privileged": {
"type": "boolean"
}
},
"required": [
"image"
],
"type": "object"
},
"type": {
"type": "string"
},
"volumes": {
"items": {
"additionalProperties": false,
"properties": {
"containerPath": {
"type": "string"
},
"hostPath": {
"type": "string"
},
"mode": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"cpus": {
"minimum": 0,
"type": "number"
},
"dependencies": {
"items": {
"$ref": "#/definitions/pathType"
},
"type": "array"
},
"disk": {
"minimum": 0,
"type": "number"
},
"env": {
"patternProperties": {
".*": {
"type": "string"
}
},
"type": "object"
},
"executor": {
"pattern": "^(|\\/\\/cmd|\\/?[^\\/]+(\\/[^\\/]+)*)$",
"type": "string"
},
"healthChecks": {
"items": {
"additionalProperties": false,
"properties": {
"command": {
"type": "object",
"items": {
"additionalProperties": false,
"properties": {
"value": {
"type": "string"
}
}
}
},
"gracePeriodSeconds": {
"minimum": 0,
"type": "integer"
},
"ignoreHttp1xx": {
"type": "boolean"
},
"intervalSeconds": {
"minimum": 0,
"type": "integer"
},
"maxConsecutiveFailures": {
"minimum": 0,
"type": "integer"
},
"path": {
"type": "string"
},
"portIndex": {
"minimum": 0,
"type": "integer"
},
"protocol": {
"type": "string"
},
"timeoutSeconds": {
"minimum": 0,
"type": "integer"
}
},
"type": "object"
},
"type": "array"
},
"id": {
"$ref": "#/definitions/pathType",
"description": "Unique identifier for the app consisting of a series of names separated by slashes. Each name must be at least 1 character and may only contain digits (`0-9`), dashes (`-`), dots (`.`), and lowercase letters (`a-z`). The name may not begin or end with a dash."
},
"instances": {
"minimum": 0,
"type": "integer"
},
"labels": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"maxLaunchDelaySeconds": {
"minimum": 0,
"type": "integer"
},
"mem": {
"minimum": 0,
"type": "number"
},
"ports": {
"items": {
"maximum": 65535,
"minimum": 0,
"type": "integer"
},
"type": "array",
"uniqueItems": true
},
"requirePorts": {
"type": "boolean"
},
"storeUrls": {
"items": {
"type": "string"
},
"type": "array"
},
"upgradeStrategy": {
"additionalProperties": false,
"properties": {
"maximumOverCapacity": {
"maximum": 1.0,
"minimum": 0.0,
"type": "number"
},
"minimumHealthCapacity": {
"maximum": 1.0,
"minimum": 0.0,
"type": "number"
}
},
"type": "object"
},
"uris": {
"items": {
"type": "string"
},
"type": "array"
},
"user": {
"type": "string"
},
"version": {
"format": "date-time",
"type": "string"
},
"versionInfo": {
"additionalProperties": false,
"properties": {
"lastScalingAt": {
"format": "date-time",
"type": "string"
},
"lastConfigChangeAt": {
"format": "date-time",
"type": "string"
}
},
"type": "object"
}
},
"required": [
"id"
],
"type": "object"
}
Example:
{
"id": "/tools/docker/registry",
"instances": 1,
"cpus": 0.5,
"mem": 4096,
"disk": 0,
"executor": "",
"constraints": [],
"uris": [],
"storeUrls": [],
"ports": [
5000
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/docker_storage",
"hostPath": "/hdd/tools/docker/registry",
"mode": "RW"
}
],
"docker": {
"image": "registry",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 5000,
"hostPort": 0,
"servicePort": 5000,
"protocol": "tcp"
}
],
"privileged": false,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 1,
"maximumOverCapacity": 1
},
"version": "2015-08-19T21:26:47.616Z"
}
HTTP status code 201
The application has been created and a deployment is started.
Body
Type: application/json
Example:
{
"id": "/tools/docker/registry",
"instances": 1,
"cpus": 0.5,
"mem": 4096,
"disk": 0,
"executor": "",
"constraints": [],
"uris": [],
"storeUrls": [],
"ports": [
5000
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/docker_storage",
"hostPath": "/hdd/tools/docker/registry",
"mode": "RW"
}
],
"docker": {
"image": "registry",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 5000,
"hostPort": 0,
"servicePort": 5000,
"protocol": "tcp"
}
],
"privileged": false,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 1,
"maximumOverCapacity": 1
},
"version": "2015-08-19T21:26:47.616Z"
}
HTTP status code 400
The application definition provided in the body is not valid.
Body
Type: application/json
Example:
{"message":"Invalid JSON","details":[{"path":"/id","errors":["error.expected.jsstring"]}]}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
HTTP status code 409
There is an already deployed application with this name
Body
Type: application/json
Example:
{"message":"An app with id [/existing_app] already exists."}
HTTP status code 422
The entity send can not be preocessed, since there are validation errors
Body
Type: application/json
Example:
{
"message": "Object is not valid",
"details": [
{
"attribute": "upgradeStrategy.minimumHealthCapacity",
"error": "is greater than 1"
}
]
}
Get the application with id app_id
. The response includes some status information besides the current configuration of the app. You can specify optional embed arguments, to get more embedded information.
Replaces parameters of a running application. If no application with the given id exists, it will be created. If there is an application with this id, all running instances get upgraded to the new definition.
Note: This operation will create a deployment. The operation finishes, if the deployment succeeds. You can query the deployments endoint to see the status of the deployment.
Destroy an application. All data about that application will be deleted. Note: This operation will create a deployment. The operation finishes, if the deployment succeeds. You can query the deployments endoint to see the status of the deployment.
get /v2/apps/{app_id}
Get the application with id app_id
. The response includes some status information besides the current configuration of the app. You can specify optional embed arguments, to get more embedded information.
URI Parameters
- app_id: required (string)
Query Parameters
- embed: (one of app.tasks, app.count, app.deployments, app.lastTaskFailure, app.failures, app.taskStats - repeat: true)
Embeds nested resources that match the supplied path. You can specify this parameter multiple times with different values.
app.tasks
. embed tasks Note: if this embed is definded, it automatically setsapps.deployments
but this will change in a future release. Please define all embeds explicit.app.counts
. embed all task counts (tasksStaged, tasksRunning, tasksHealthy, tasksUnhealthy)
Note: currently embedded by default but this will change in a future release. Please define all embeds explicit.app.deployments
. embed all deployment identifier, if the related app currently is in deployment.app.lastTaskFailure
embeds the lastTaskFailure for the application if there is one.app.failures
Shorthand for apps.lastTaskFailure, apps.tasks, apps.counts and apps.deployments.
Note: deprecated and will be removed in future versions Please define all embeds explicit.app.taskStats
exposes task statatistics in the JSON.
Example:
embed=app.deployments&embed=app.lastTaskFailure
HTTP status code 200
Body
Type: application/json
Example:
{
"apps": [
{
"id": "/myapp",
"cmd": "env && sleep 60",
"args": null,
"user": null,
"env": {
"LD_LIBRARY_PATH": "/usr/local/lib/myLib"
},
"instances": 3,
"cpus": 0.1,
"mem": 5,
"disk": 0,
"executor": "",
"constraints": [
[
"hostname",
"UNIQUE",
""
]
],
"uris": [
"https://raw.github.com/mesosphere/marathon/master/README.md"
],
"storeUrls": [],
"ports": [
10013,
10015
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": null,
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 1,
"maximumOverCapacity": 1
},
"labels": {},
"acceptedResourceRoles": null,
"version": "2015-09-25T15:13:48.343Z",
"versionInfo": {
"lastScalingAt": "2015-09-25T15:13:48.343Z",
"lastConfigChangeAt": "2015-09-25T15:13:48.343Z"
},
"tasksStaged": 0,
"tasksRunning": 0,
"tasksHealthy": 0,
"tasksUnhealthy": 0,
"deployments": [
{
"id": "9538079c-3898-4e32-aa31-799bf9097f74"
}
]
}
]
}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
HTTP status code 404
No task found with this app_id
.
Body
Type: application/json
Example:
{ "message": "App '/not_existent' does not exist" }
put /v2/apps/{app_id}
Replaces parameters of a running application. If no application with the given id exists, it will be created. If there is an application with this id, all running instances get upgraded to the new definition.
Note: This operation will create a deployment. The operation finishes, if the deployment succeeds. You can query the deployments endoint to see the status of the deployment.
URI Parameters
- app_id: required (string)
Query Parameters
- force: (boolean)
Only one deployment can be applied to one application at the same time. If the existing deployment should be canceled by this change, you can set force=true. Caution: setting force=true will cancel the current deployment. This paramter should be used only, if the current deployment is unsuccessful!
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/schema#",
"additionalProperties": false,
"definitions": {
"pathType": {
"pattern": "^(\\/?((\\.{2})|([a-z0-9][a-z0-9\\-.]*[a-z0-9]+)|([a-z0-9]*))($|\\/))+$",
"type": "string"
}
},
"not": {
"allOf": [
{
"required": [
"cmd"
]
},
{
"required": [
"args"
]
}
]
},
"properties": {
"acceptedResourceRoles": {
"items": {
"type": "string"
},
"type": "array",
"description": "Optional. A list of resource roles. Marathon considers only resource offers with roles in this list for launching tasks of this app. If you do not specify this, Marathon considers all resource offers with roles that have been configured by the `--default_accepted_resource_roles` command line flag. If no `--default_accepted_resource_roles` was given on startup, Marathon considers all resource offers. To register Marathon for a role, you need to specify the `--mesos_role` command line flag on startup. If you want to assign all resources of a slave to a role, you can use the `--default_role` argument when starting up the slave. If you need a more fine-grained configuration, you can use the `--resources` argument to specify resource shares per role. The Mesos master needs to be started with `--roles` followed by a comma-separated list of all roles you want to use across your cluster. See [the Mesos command line documentation](http://mesos.apache.org/documentation/latest/configuration/) for details."
},
"args": {
"items": {
"type": "string"
},
"type": "array",
"description": "An array of strings that represents an alternative mode of specifying the command to run. This was motivated by safe usage of containerizer features like a custom Docker ENTRYPOINT. This args field may be used in place of cmd even when using the default command executor. This change mirrors API and semantics changes in the Mesos CommandInfo protobuf message starting with version `0.20.0`. Either `cmd` or `args` must be supplied. It is invalid to supply both `cmd` and `args` in the same app."
},
"backoffFactor": {
"minimum": 1.0,
"type": "number",
"description": "Configures exponential backoff behavior when launching potentially sick apps. This prevents sandboxes associated with consecutively failing tasks from filling up the hard disk on Mesos slaves. The backoff period is multiplied by the factor for each consecutive failure until it reaches maxLaunchDelaySeconds. This applies also to tasks that are killed due to failing too many health checks."
},
"backoffSeconds": {
"description": "Configures exponential backoff behavior when launching potentially sick apps. This prevents sandboxes associated with consecutively failing tasks from filling up the hard disk on Mesos slaves. The backoff period is multiplied by the factor for each consecutive failure until it reaches maxLaunchDelaySeconds. This applies also to tasks that are killed due to failing too many health checks.",
"minimum": 0,
"type": "integer"
},
"cmd": {
"description": "The command that is executed. This value is wrapped by Mesos via `/bin/sh -c ${app.cmd}`. Either `cmd` or `args` must be supplied. It is invalid to supply both `cmd` and `args` in the same app.",
"type": "string",
"minLength": 1
},
"constraints": {
"description": "Valid constraint operators are one of UNIQUE, CLUSTER, GROUP_BY."
},
"container": {
"additionalProperties": false,
"properties": {
"docker": {
"additionalProperties": false,
"properties": {
"forcePullImage": {
"type": "boolean"
},
"image": {
"type": "string",
"minLength": 1
},
"network": {
"type": "string"
},
"parameters": {
"items": {
"additionalProperties": false,
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"key",
"value"
],
"type": "object"
},
"type": "array"
},
"portMappings": {
"items": {
"additionalProperties": false,
"properties": {
"containerPort": {
"maximum": 65535,
"minimum": 0,
"type": "integer"
},
"hostPort": {
"maximum": 65535,
"minimum": 0,
"type": "integer"
},
"protocol": {
"type": "string"
},
"servicePort": {
"maximum": 65535,
"minimum": 0,
"type": "integer"
}
},
"type": "object"
},
"type": "array"
},
"privileged": {
"type": "boolean"
}
},
"required": [
"image"
],
"type": "object"
},
"type": {
"type": "string"
},
"volumes": {
"items": {
"additionalProperties": false,
"properties": {
"containerPath": {
"type": "string"
},
"hostPath": {
"type": "string"
},
"mode": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"cpus": {
"minimum": 0,
"type": "number"
},
"dependencies": {
"items": {
"$ref": "#/definitions/pathType"
},
"type": "array"
},
"disk": {
"minimum": 0,
"type": "number"
},
"env": {
"patternProperties": {
".*": {
"type": "string"
}
},
"type": "object"
},
"executor": {
"pattern": "^(|\\/\\/cmd|\\/?[^\\/]+(\\/[^\\/]+)*)$",
"type": "string"
},
"healthChecks": {
"items": {
"additionalProperties": false,
"properties": {
"command": {
"type": "object",
"items": {
"additionalProperties": false,
"properties": {
"value": {
"type": "string"
}
}
}
},
"gracePeriodSeconds": {
"minimum": 0,
"type": "integer"
},
"ignoreHttp1xx": {
"type": "boolean"
},
"intervalSeconds": {
"minimum": 0,
"type": "integer"
},
"maxConsecutiveFailures": {
"minimum": 0,
"type": "integer"
},
"path": {
"type": "string"
},
"portIndex": {
"minimum": 0,
"type": "integer"
},
"protocol": {
"type": "string"
},
"timeoutSeconds": {
"minimum": 0,
"type": "integer"
}
},
"type": "object"
},
"type": "array"
},
"id": {
"$ref": "#/definitions/pathType",
"description": "Unique identifier for the app consisting of a series of names separated by slashes. Each name must be at least 1 character and may only contain digits (`0-9`), dashes (`-`), dots (`.`), and lowercase letters (`a-z`). The name may not begin or end with a dash."
},
"instances": {
"minimum": 0,
"type": "integer"
},
"labels": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"maxLaunchDelaySeconds": {
"minimum": 0,
"type": "integer"
},
"mem": {
"minimum": 0,
"type": "number"
},
"ports": {
"items": {
"maximum": 65535,
"minimum": 0,
"type": "integer"
},
"type": "array",
"uniqueItems": true
},
"requirePorts": {
"type": "boolean"
},
"storeUrls": {
"items": {
"type": "string"
},
"type": "array"
},
"upgradeStrategy": {
"additionalProperties": false,
"properties": {
"maximumOverCapacity": {
"maximum": 1.0,
"minimum": 0.0,
"type": "number"
},
"minimumHealthCapacity": {
"maximum": 1.0,
"minimum": 0.0,
"type": "number"
}
},
"type": "object"
},
"uris": {
"items": {
"type": "string"
},
"type": "array"
},
"user": {
"type": "string"
},
"version": {
"format": "date-time",
"type": "string"
},
"versionInfo": {
"additionalProperties": false,
"properties": {
"lastScalingAt": {
"format": "date-time",
"type": "string"
},
"lastConfigChangeAt": {
"format": "date-time",
"type": "string"
}
},
"type": "object"
}
},
"required": [
"id"
],
"type": "object"
}
Example:
{
"id": "/tools/docker/registry",
"instances": 1,
"cpus": 0.5,
"mem": 4096,
"disk": 0,
"executor": "",
"constraints": [],
"uris": [],
"storeUrls": [],
"ports": [
5000
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/docker_storage",
"hostPath": "/hdd/tools/docker/registry",
"mode": "RW"
}
],
"docker": {
"image": "registry",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 5000,
"hostPort": 0,
"servicePort": 5000,
"protocol": "tcp"
}
],
"privileged": false,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 1,
"maximumOverCapacity": 1
},
"version": "2015-08-19T21:26:47.616Z"
}
HTTP status code 200
A deployment is started which has a unique deployment identifier. The related deployment can be fetched from the /v2/deployments endpoint. If the deployement is gone from the list of deployments, than this means it is finished. As long as the deployment runs, the effect of that change operation is visible only partially.
Body
Type: application/json
Example:
{
"deploymentId": "5ed4c0c5-9ff8-4a6f-a0cd-f57f59a34b43",
"version": "2015-09-29T15:59:51.164Z"
}
HTTP status code 400
The application definition provided in the body is not valid.
Body
Type: application/json
Example:
{"message":"Invalid JSON","details":[{"path":"/id","errors":["error.expected.jsstring"]}]}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
HTTP status code 404
No task found with this app_id
.
Body
Type: application/json
Example:
{ "message": "App '/not_existent' does not exist" }
HTTP status code 409
There is an already running deployment, that affects this application. To override this deployment, use the force=true flag
Body
Type: application/json
Example:
{
"message":"App is locked by one or more deployments. Override with the option '?force=true'. View details at '/v2/deployments/<DEPLOYMENT_ID>'.",
"deployments":[{"id":"97c136bf-5a28-4821-9d94-480d9fbb01c8"}]
}
HTTP status code 422
The entity send can not be preocessed, since there are validation errors
Body
Type: application/json
Example:
{
"message": "Object is not valid",
"details": [
{
"attribute": "upgradeStrategy.minimumHealthCapacity",
"error": "is greater than 1"
}
]
}
delete /v2/apps/{app_id}
Destroy an application. All data about that application will be deleted. Note: This operation will create a deployment. The operation finishes, if the deployment succeeds. You can query the deployments endoint to see the status of the deployment.
URI Parameters
- app_id: required (string)
Query Parameters
- force: (boolean)
Only one deployment can be applied to one application at the same time. If the existing deployment should be canceled by this change, you can set force=true. Caution: setting force=true will cancel the current deployment. This paramter should be used only, if the current deployment is unsuccessful!
HTTP status code 200
A deployment is started which has a unique deployment identifier. The related deployment can be fetched from the /v2/deployments endpoint. If the deployement is gone from the list of deployments, than this means it is finished. As long as the deployment runs, the effect of that change operation is visible only partially.
Body
Type: application/json
Example:
{
"deploymentId": "5ed4c0c5-9ff8-4a6f-a0cd-f57f59a34b43",
"version": "2015-09-29T15:59:51.164Z"
}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
HTTP status code 404
No app with this id known.
Body
Type: application/json
Example:
{"message":"App '/not-existing' does not exist"}
HTTP status code 409
There is an already running deployment, that affects this application. To override this deployment, use the force=true flag
Body
Type: application/json
Example:
{
"message":"App is locked by one or more deployments. Override with the option '?force=true'. View details at '/v2/deployments/<DEPLOYMENT_ID>'.",
"deployments":[{"id":"97c136bf-5a28-4821-9d94-480d9fbb01c8"}]
}
Restart all tasks of this application.
post /v2/apps/{app_id}/restart
Restart all tasks of this application.
URI Parameters
- app_id: required (string)
Query Parameters
- force: (boolean)
Only one deployment can be applied to one application at the same time. If the existing deployment should be canceled by this change, you can set force=true. Caution: setting force=true will cancel the current deployment. This paramter should be used only, if the current deployment is unsuccessful!
HTTP status code 200
A deployment is started which has a unique deployment identifier. The related deployment can be fetched from the /v2/deployments endpoint. If the deployement is gone from the list of deployments, than this means it is finished. As long as the deployment runs, the effect of that change operation is visible only partially.
Body
Type: application/json
Example:
{
"deploymentId": "5ed4c0c5-9ff8-4a6f-a0cd-f57f59a34b43",
"version": "2015-09-29T15:59:51.164Z"
}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
HTTP status code 404
No task found with this app_id
.
Body
Type: application/json
Example:
{ "message": "App '/not_existent' does not exist" }
HTTP status code 409
There is an already running deployment, that affects this application. To override this deployment, use the force=true flag
Body
Type: application/json
Example:
{
"message":"App is locked by one or more deployments. Override with the option '?force=true'. View details at '/v2/deployments/<DEPLOYMENT_ID>'.",
"deployments":[{"id":"97c136bf-5a28-4821-9d94-480d9fbb01c8"}]
}
List all running tasks for application app_id
.
Kill tasks that belong to the application app_id
get /v2/apps/{app_id}/tasks
List all running tasks for application app_id
.
URI Parameters
- app_id: required (string)
HTTP status code 200
The list of running tasks for application app_id
.
Body
Type: application/json
Example:
{
"tasks": [
{
"appId": "/minecraft/survival-world",
"host": "srv7.hw.ca1.mesosphere.com",
"id": "minecraft_survival-world.564bd685-4c30-11e5-98c1-be5b2935a987",
"ports": [
31756
],
"slaveId": null,
"stagedAt": "2015-08-26T20:23:39.463Z",
"startedAt": "2015-08-26T20:23:44.678Z",
"version": "2015-04-17T04:00:14.171Z"
}
]
}
Type: text/plain
Example:
minecraft_survival-world 10013 srv7.hw.ca1.mesosphere.com:31756
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
HTTP status code 404
No task found with this app_id
.
Body
Type: application/json
Example:
{ "message": "App '/not_existent' does not exist" }
delete /v2/apps/{app_id}/tasks
Kill tasks that belong to the application app_id
URI Parameters
- app_id: required (string)
Query Parameters
- force: (boolean)
Only one deployment can be applied to one application at the same time. If the existing deployment should be canceled by this change, you can set force=true. Caution: setting force=true will cancel the current deployment. This paramter should be used only, if the current deployment is unsuccessful!
- host: (string)
all tasks of that application on the supplied slave are killed
- scale: (boolean)
If
scale=true
is specified, then the application is scaled down by the number of killed tasks.
HTTP status code 200
If scale=false, all tasks that were killed are returned. If scale=true, than a deployment is triggered and the deployment is returned.
Body
Type: application/json
Example:
{
"tasks": [
{
"appId": "/minecraft/survival-world",
"host": "srv7.hw.ca1.mesosphere.com",
"id": "minecraft_survival-world.564bd685-4c30-11e5-98c1-be5b2935a987",
"ports": [
31756
],
"slaveId": null,
"stagedAt": "2015-08-26T20:23:39.463Z",
"startedAt": "2015-08-26T20:23:44.678Z",
"version": "2015-04-17T04:00:14.171Z"
}
]
}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
HTTP status code 404
No task found with this app_id
.
Body
Type: application/json
Example:
{ "message": "App '/not_existent' does not exist" }
HTTP status code 409
There is an already running deployment, that affects this application. To override this deployment, use the force=true flag
Body
Type: application/json
Example:
{
"message":"App is locked by one or more deployments. Override with the option '?force=true'. View details at '/v2/deployments/<DEPLOYMENT_ID>'.",
"deployments":[{"id":"97c136bf-5a28-4821-9d94-480d9fbb01c8"}]
}
Kill the task with ID task_id
that belongs to the application app_id
.
delete /v2/apps/{app_id}/tasks/{task_id}
Kill the task with ID task_id
that belongs to the application app_id
.
URI Parameters
- app_id: required (string)
- task_id: required (string)
Query Parameters
- force: (boolean)
Only one deployment can be applied to one application at the same time. If the existing deployment should be canceled by this change, you can set force=true. Caution: setting force=true will cancel the current deployment. This paramter should be used only, if the current deployment is unsuccessful!
- scale: (boolean)
If
scale=true
is specified, then the application is scaled down by the number of killed tasks.
HTTP status code 200
If scale=false, the task that was killed is returned. If scale=true, than a deployment is triggered and the deployment is returned.
Body
Type: application/json
Example:
{
"task": [
{
"appId": "/minecraft/survival-world",
"host": "srv7.hw.ca1.mesosphere.com",
"id": "minecraft_survival-world.564bd685-4c30-11e5-98c1-be5b2935a987",
"ports": [
31756
],
"slaveId": null,
"stagedAt": "2015-08-26T20:23:39.463Z",
"startedAt": "2015-08-26T20:23:44.678Z",
"version": "2015-04-17T04:00:14.171Z"
}
]
}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
HTTP status code 404
No task found with this task_id.
Body
Type: application/json
Example:
{"message":"Task 'not-existing' does not exist"}
HTTP status code 409
There is an already running deployment, that affects this application. To override this deployment, use the force=true flag
Body
Type: application/json
Example:
{
"message":"App is locked by one or more deployments. Override with the option '?force=true'. View details at '/v2/deployments/<DEPLOYMENT_ID>'.",
"deployments":[{"id":"97c136bf-5a28-4821-9d94-480d9fbb01c8"}]
}
List the versions of the application with id app_id
get /v2/apps/{app_id}/versions
List the versions of the application with id app_id
URI Parameters
- app_id: required (string)
HTTP status code 200
The list of versions of the application
Body
Type: application/json
Example:
{ "versions": [ "2014-03-01T23:42:20.938Z" ] }
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
HTTP status code 404
No task found with this app_id
.
Body
Type: application/json
Example:
{ "message": "App '/not_existent' does not exist" }
List the configuration of the application with id app_id
at version version
.
get /v2/apps/{app_id}/versions/{version}
List the configuration of the application with id app_id
at version version
.
URI Parameters
- app_id: required (string)
- version: required (string)
HTTP status code 200
The application definition at that point in time.
Body
Type: application/json
Example:
{
"id": "/tools/docker/registry",
"instances": 1,
"cpus": 0.5,
"mem": 4096,
"disk": 0,
"executor": "",
"constraints": [],
"uris": [],
"storeUrls": [],
"ports": [
5000
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/docker_storage",
"hostPath": "/hdd/tools/docker/registry",
"mode": "RW"
}
],
"docker": {
"image": "registry",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 5000,
"hostPort": 0,
"servicePort": 5000,
"protocol": "tcp"
}
],
"privileged": false,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 1,
"maximumOverCapacity": 1
},
"version": "2015-08-19T21:26:47.616Z"
}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
HTTP status code 404
No task found with this app_id
.
Body
Type: application/json
Example:
{ "message": "App '/not_existent' does not exist" }
/v2/deployments
List all running deployments. A deployment is a change in the service setup. A deployment is identified by an id, affects a set of applications and is composed of deployment steps. Every step contains a list of actions with following types
StartApplication
starts an application, which is currently not running.StopApplication
stops an already running application.ScaleApplication
changes the number of instances of an application and allows to kill specified instances while scaling.RestartApplication
upgrades an already deployed application with a new version.ResolveArtifacts
Resolve all artifacts of an application
get /v2/deployments
List all running deployments. A deployment is a change in the service setup. A deployment is identified by an id, affects a set of applications and is composed of deployment steps. Every step contains a list of actions with following types
StartApplication
starts an application, which is currently not running.StopApplication
stops an already running application.ScaleApplication
changes the number of instances of an application and allows to kill specified instances while scaling.RestartApplication
upgrades an already deployed application with a new version.ResolveArtifacts
Resolve all artifacts of an application
HTTP status code 200
The list of all running deployments.
Body
Type: application/json
Example:
[
{
"id": "97c136bf-5a28-4821-9d94-480d9fbb01c8",
"version": "2015-09-30T09:09:17.614Z",
"affectedApps": [
"/foo"
],
"steps": [
[
{
"action": "StartApplication",
"app": "/foo"
}
],
[
{
"action": "ScaleApplication",
"app": "/foo"
}
]
],
"currentActions": [
{
"action": "ScaleApplication",
"app": "/foo"
}
],
"currentStep": 2,
"totalSteps": 2
}
]
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
Revert the deployment with deployment_id
by creating a new deployment which reverses all changes.
delete /v2/deployments/{deployment_id}
Revert the deployment with deployment_id
by creating a new deployment which reverses all changes.
URI Parameters
- deployment_id: required (string)
Query Parameters
- force: (boolean)
If set to
false
(the default) then the deployment is canceled and a new deployment is created to revert the changes of this deployment. Without concurrent deployments, this restores the configuration before this deployment. If set totrue
, then the deployment is still canceled but no rollback deployment is created.
HTTP status code 200
A deployment is started which has a unique deployment identifier. The related deployment can be fetched from the /v2/deployments endpoint. If the deployement is gone from the list of deployments, than this means it is finished. As long as the deployment runs, the effect of that change operation is visible only partially.
Body
Type: application/json
Example:
{
"deploymentId": "5ed4c0c5-9ff8-4a6f-a0cd-f57f59a34b43",
"version": "2015-09-29T15:59:51.164Z"
}
HTTP status code 202
If the force flag is set to true, the deployment is canceled and no new deployment is triggered. In this case no body is returned.
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
HTTP status code 404
The deployment plan with the given id can not be found.
Body
Type: application/json
Example:
{ "message": "DeploymentPlan unknown_deployment does not exist" }
/v2/groups
Get the group with all applications and all transitive child groups.
Change parameters of a deployed application group. The new group parameters get applied.
- Changes to application parameters will result in a restart of this application.
- A new application added to the group will be started.
- An existing application removed from the group will be stopped.
If there are no changes to the application definition, no restart is triggered. During restart marathon keeps track, that the configured amount of minimal running instances are always available. This method allows 2 special modes for the update operation>
- Provide only the
version
field in the group definition. This will rollback the group to that given version - Provide only the
scaleBy
field will scale all transitive applications instance counts by the given factor.
When one of version or scaleBy are set, nothing else than a version change or transitive instance count scaling will be applied. If both version and scaleBy are set, only a version rollback will be performed – the scaleBy value will not be applied. A deployment can run forever. This is the case, when the new application has a problem and does not become healthy. In this case, human interaction is needed with 2 possible choices
- Rollback to an existing older version
- Update with a newer version of the group which does not have the problems of the old one.
Since the deployment of the group can take a considerable amount of time, this endpoint returns immediately with a version. The failure or success of the action is signalled via event. There is a group_change_success and group_change_failed with the given version.
Create and start a new application group. Application groups can contain other application groups.
Destroy a group. All data about that group and all associated applications will be deleted. The failure or success of the action is signalled via events. There is a group_change_success and group_change_failed with the given version.
get /v2/groups
Get the group with all applications and all transitive child groups.
HTTP status code 200
The group with all transitive dependencies.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": true,
"type": "object",
"properties": {
"id": {
"type": "string"
},
"apps": {
"type": "array",
"items": {
"type": "object",
"properties": { }
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"apps": {
"type": "array",
"items": {}
},
"groups": {
"type": "array",
"items": {}
},
"dependencies": {
"type": "array",
"items": {}
},
"version": {
"type": "string"
}
}
}
},
"dependencies": {
"type": "array",
"items": {}
},
"version": {
"type": "string"
}
}
}
Example:
{
"id": "/",
"apps": [],
"groups": [
{
"id": "/tools",
"apps": [
{
"id": "/tools/oauth-server",
"instances": 2,
"cpus": 1,
"mem": 1024,
"disk": 0,
"constraints": [
[
"hostname",
"UNIQUE"
]
],
"uris": [],
"storeUrls": [],
"ports": [
1980
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "docker-registry/oauth_server:6d7d463cb8b1517002080a81cf23f9cf7b7fc774",
"network": "HOST",
"privileged": false,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [
{
"path": "/",
"protocol": "HTTP",
"portIndex": 0,
"gracePeriodSeconds": 300,
"intervalSeconds": 20,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3,
"ignoreHttp1xx": false
}
],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 0.5,
"maximumOverCapacity": 0
},
"version": "2015-09-28T19:47:37.681Z",
"versionInfo": {
"lastScalingAt": "2015-09-28T19:47:37.681Z",
"lastConfigChangeAt": "2015-09-28T19:47:37.681Z"
}
},
{
"id": "/tools/datadog-agent",
"instances": 5,
"cpus": 1,
"mem": 512,
"disk": 0,
"executor": "",
"constraints": [
[
"hostname",
"UNIQUE"
]
],
"uris": [],
"storeUrls": [],
"ports": [
10018
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/var/run/docker.sock",
"hostPath": "/var/run/docker.sock",
"mode": "RW"
},
{
"containerPath": "/host/proc/mounts",
"hostPath": "/proc/mounts",
"mode": "RO"
},
{
"containerPath": "/host/sys/fs/cgroup",
"hostPath": "/sys/fs/cgroup/",
"mode": "RO"
}
],
"docker": {
"image": "datadog/docker-dd-agent:latest",
"network": "HOST",
"privileged": true,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 0.5,
"maximumOverCapacity": 0
},
"version": "2015-08-26T22:33:24.225Z",
"versionInfo": {
"lastScalingAt": "2015-08-26T22:33:24.225Z",
"lastConfigChangeAt": "2015-05-19T13:59:18.899Z"
}
}
],
"groups": [
{
"id": "/tools/log",
"apps": [],
"groups": [],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
},
{
"id": "/tools/docker",
"apps": [
{
"id": "/tools/docker/registry",
"instances": 1,
"cpus": 0.5,
"mem": 4096,
"disk": 0,
"executor": "",
"constraints": [],
"uris": [],
"storeUrls": [],
"ports": [
5000
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/docker_storage",
"hostPath": "/hdd/tools/docker/registry",
"mode": "RW"
}
],
"docker": {
"image": "registry",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 5000,
"hostPort": 0,
"servicePort": 5000,
"protocol": "tcp"
}
],
"privileged": false,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 1,
"maximumOverCapacity": 1
},
"version": "2015-08-19T21:26:47.616Z",
"versionInfo": {
"lastScalingAt": "2015-08-19T21:26:47.616Z",
"lastConfigChangeAt": "2015-08-19T21:00:54.621Z"
}
}
],
"groups": [],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
}
],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
}
],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
put /v2/groups
Change parameters of a deployed application group. The new group parameters get applied.
- Changes to application parameters will result in a restart of this application.
- A new application added to the group will be started.
- An existing application removed from the group will be stopped.
If there are no changes to the application definition, no restart is triggered. During restart marathon keeps track, that the configured amount of minimal running instances are always available. This method allows 2 special modes for the update operation>
- Provide only the
version
field in the group definition. This will rollback the group to that given version - Provide only the
scaleBy
field will scale all transitive applications instance counts by the given factor.
When one of version or scaleBy are set, nothing else than a version change or transitive instance count scaling will be applied. If both version and scaleBy are set, only a version rollback will be performed – the scaleBy value will not be applied. A deployment can run forever. This is the case, when the new application has a problem and does not become healthy. In this case, human interaction is needed with 2 possible choices
- Rollback to an existing older version
- Update with a newer version of the group which does not have the problems of the old one.
Since the deployment of the group can take a considerable amount of time, this endpoint returns immediately with a version. The failure or success of the action is signalled via event. There is a group_change_success and group_change_failed with the given version.
Query Parameters
- force: (boolean)
Only one deployment can be applied to one application at the same time. If the existing deployment should be canceled by this change, you can set force=true. Caution: setting force=true will cancel the current deployment. This paramter should be used only, if the current deployment is unsuccessful!
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": true,
"type": "object",
"properties": {
"id": {
"type": "string"
},
"apps": {
"type": "array",
"items": {
"type": "object",
"properties": { }
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"apps": {
"type": "array",
"items": {}
},
"groups": {
"type": "array",
"items": {}
},
"dependencies": {
"type": "array",
"items": {}
},
"version": {
"type": "string"
}
}
}
},
"dependencies": {
"type": "array",
"items": {}
},
"version": {
"type": "string"
}
}
}
Example:
{
"id": "/",
"apps": [],
"groups": [
{
"id": "/tools",
"apps": [
{
"id": "/tools/oauth-server",
"instances": 2,
"cpus": 1,
"mem": 1024,
"disk": 0,
"constraints": [
[
"hostname",
"UNIQUE"
]
],
"uris": [],
"storeUrls": [],
"ports": [
1980
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "docker-registry/oauth_server:6d7d463cb8b1517002080a81cf23f9cf7b7fc774",
"network": "HOST",
"privileged": false,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [
{
"path": "/",
"protocol": "HTTP",
"portIndex": 0,
"gracePeriodSeconds": 300,
"intervalSeconds": 20,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3,
"ignoreHttp1xx": false
}
],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 0.5,
"maximumOverCapacity": 0
},
"version": "2015-09-28T19:47:37.681Z",
"versionInfo": {
"lastScalingAt": "2015-09-28T19:47:37.681Z",
"lastConfigChangeAt": "2015-09-28T19:47:37.681Z"
}
},
{
"id": "/tools/datadog-agent",
"instances": 5,
"cpus": 1,
"mem": 512,
"disk": 0,
"executor": "",
"constraints": [
[
"hostname",
"UNIQUE"
]
],
"uris": [],
"storeUrls": [],
"ports": [
10018
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/var/run/docker.sock",
"hostPath": "/var/run/docker.sock",
"mode": "RW"
},
{
"containerPath": "/host/proc/mounts",
"hostPath": "/proc/mounts",
"mode": "RO"
},
{
"containerPath": "/host/sys/fs/cgroup",
"hostPath": "/sys/fs/cgroup/",
"mode": "RO"
}
],
"docker": {
"image": "datadog/docker-dd-agent:latest",
"network": "HOST",
"privileged": true,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 0.5,
"maximumOverCapacity": 0
},
"version": "2015-08-26T22:33:24.225Z",
"versionInfo": {
"lastScalingAt": "2015-08-26T22:33:24.225Z",
"lastConfigChangeAt": "2015-05-19T13:59:18.899Z"
}
}
],
"groups": [
{
"id": "/tools/log",
"apps": [],
"groups": [],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
},
{
"id": "/tools/docker",
"apps": [
{
"id": "/tools/docker/registry",
"instances": 1,
"cpus": 0.5,
"mem": 4096,
"disk": 0,
"executor": "",
"constraints": [],
"uris": [],
"storeUrls": [],
"ports": [
5000
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/docker_storage",
"hostPath": "/hdd/tools/docker/registry",
"mode": "RW"
}
],
"docker": {
"image": "registry",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 5000,
"hostPort": 0,
"servicePort": 5000,
"protocol": "tcp"
}
],
"privileged": false,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 1,
"maximumOverCapacity": 1
},
"version": "2015-08-19T21:26:47.616Z",
"versionInfo": {
"lastScalingAt": "2015-08-19T21:26:47.616Z",
"lastConfigChangeAt": "2015-08-19T21:00:54.621Z"
}
}
],
"groups": [],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
}
],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
}
],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
}
HTTP status code 200
A deployment is started which has a unique deployment identifier. The related deployment can be fetched from the /v2/deployments endpoint. If the deployement is gone from the list of deployments, than this means it is finished. As long as the deployment runs, the effect of that change operation is visible only partially.
Body
Type: application/json
Example:
{
"deploymentId": "5ed4c0c5-9ff8-4a6f-a0cd-f57f59a34b43",
"version": "2015-09-29T15:59:51.164Z"
}
HTTP status code 400
The group definition provided in the body is not valid.
Body
Type: application/json
Example:
{"message":"Invalid JSON","details":[{"path":"/id","errors":["error.expected.jsstring"]}]}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
HTTP status code 409
There is an already running deployment, that affects this application. To override this deployment, use the force=true flag
Body
Type: application/json
Example:
{
"message":"App is locked by one or more deployments. Override with the option '?force=true'. View details at '/v2/deployments/<DEPLOYMENT_ID>'.",
"deployments":[{"id":"97c136bf-5a28-4821-9d94-480d9fbb01c8"}]
}
HTTP status code 422
The entity send can not be preocessed, since there are validation errors
Body
Type: application/json
Example:
{
"message":"Object is not valid",
"details": [
{
"attribute":"apps[0].id",
"error":"identifier /app is not child of /group. Hint: use relative paths."
}
]
}
post /v2/groups
Create and start a new application group. Application groups can contain other application groups.
Query Parameters
- force: (boolean)
Only one deployment can be applied to one application at the same time. If the existing deployment should be canceled by this change, you can set force=true. Caution: setting force=true will cancel the current deployment. This paramter should be used only, if the current deployment is unsuccessful!
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": true,
"type": "object",
"properties": {
"id": {
"type": "string"
},
"apps": {
"type": "array",
"items": {
"type": "object",
"properties": { }
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"apps": {
"type": "array",
"items": {}
},
"groups": {
"type": "array",
"items": {}
},
"dependencies": {
"type": "array",
"items": {}
},
"version": {
"type": "string"
}
}
}
},
"dependencies": {
"type": "array",
"items": {}
},
"version": {
"type": "string"
}
}
}
Example:
{
"id": "/",
"apps": [],
"groups": [
{
"id": "/tools",
"apps": [
{
"id": "/tools/oauth-server",
"instances": 2,
"cpus": 1,
"mem": 1024,
"disk": 0,
"constraints": [
[
"hostname",
"UNIQUE"
]
],
"uris": [],
"storeUrls": [],
"ports": [
1980
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "docker-registry/oauth_server:6d7d463cb8b1517002080a81cf23f9cf7b7fc774",
"network": "HOST",
"privileged": false,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [
{
"path": "/",
"protocol": "HTTP",
"portIndex": 0,
"gracePeriodSeconds": 300,
"intervalSeconds": 20,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3,
"ignoreHttp1xx": false
}
],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 0.5,
"maximumOverCapacity": 0
},
"version": "2015-09-28T19:47:37.681Z",
"versionInfo": {
"lastScalingAt": "2015-09-28T19:47:37.681Z",
"lastConfigChangeAt": "2015-09-28T19:47:37.681Z"
}
},
{
"id": "/tools/datadog-agent",
"instances": 5,
"cpus": 1,
"mem": 512,
"disk": 0,
"executor": "",
"constraints": [
[
"hostname",
"UNIQUE"
]
],
"uris": [],
"storeUrls": [],
"ports": [
10018
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/var/run/docker.sock",
"hostPath": "/var/run/docker.sock",
"mode": "RW"
},
{
"containerPath": "/host/proc/mounts",
"hostPath": "/proc/mounts",
"mode": "RO"
},
{
"containerPath": "/host/sys/fs/cgroup",
"hostPath": "/sys/fs/cgroup/",
"mode": "RO"
}
],
"docker": {
"image": "datadog/docker-dd-agent:latest",
"network": "HOST",
"privileged": true,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 0.5,
"maximumOverCapacity": 0
},
"version": "2015-08-26T22:33:24.225Z",
"versionInfo": {
"lastScalingAt": "2015-08-26T22:33:24.225Z",
"lastConfigChangeAt": "2015-05-19T13:59:18.899Z"
}
}
],
"groups": [
{
"id": "/tools/log",
"apps": [],
"groups": [],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
},
{
"id": "/tools/docker",
"apps": [
{
"id": "/tools/docker/registry",
"instances": 1,
"cpus": 0.5,
"mem": 4096,
"disk": 0,
"executor": "",
"constraints": [],
"uris": [],
"storeUrls": [],
"ports": [
5000
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/docker_storage",
"hostPath": "/hdd/tools/docker/registry",
"mode": "RW"
}
],
"docker": {
"image": "registry",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 5000,
"hostPort": 0,
"servicePort": 5000,
"protocol": "tcp"
}
],
"privileged": false,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 1,
"maximumOverCapacity": 1
},
"version": "2015-08-19T21:26:47.616Z",
"versionInfo": {
"lastScalingAt": "2015-08-19T21:26:47.616Z",
"lastConfigChangeAt": "2015-08-19T21:00:54.621Z"
}
}
],
"groups": [],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
}
],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
}
],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
}
HTTP status code 200
A deployment is started which has a unique deployment identifier. The related deployment can be fetched from the /v2/deployments endpoint. If the deployement is gone from the list of deployments, than this means it is finished. As long as the deployment runs, the effect of that change operation is visible only partially.
Body
Type: application/json
Example:
{
"deploymentId": "5ed4c0c5-9ff8-4a6f-a0cd-f57f59a34b43",
"version": "2015-09-29T15:59:51.164Z"
}
HTTP status code 400
The group definition provided in the body is not valid.
Body
Type: application/json
Example:
{"message":"Invalid JSON","details":[{"path":"/id","errors":["error.expected.jsstring"]}]}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
HTTP status code 409
There is an already deployed group with this name
Body
Type: application/json
Example:
{"message":"Group / is already created. Use PUT to change this group."}
HTTP status code 422
The entity send can not be preocessed, since there are validation errors
Body
Type: application/json
Example:
{
"message":"Object is not valid",
"details": [
{
"attribute":"apps[0].id",
"error":"identifier /app is not child of /group. Hint: use relative paths."
}
]
}
delete /v2/groups
Destroy a group. All data about that group and all associated applications will be deleted. The failure or success of the action is signalled via events. There is a group_change_success and group_change_failed with the given version.
Query Parameters
- force: (boolean)
Only one deployment can be applied to one application at the same time. If the existing deployment should be canceled by this change, you can set force=true. Caution: setting force=true will cancel the current deployment. This paramter should be used only, if the current deployment is unsuccessful!
HTTP status code 200
A deployment is started which has a unique deployment identifier. The related deployment can be fetched from the /v2/deployments endpoint. If the deployement is gone from the list of deployments, than this means it is finished. As long as the deployment runs, the effect of that change operation is visible only partially.
Body
Type: application/json
Example:
{
"deploymentId": "5ed4c0c5-9ff8-4a6f-a0cd-f57f59a34b43",
"version": "2015-09-29T15:59:51.164Z"
}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
HTTP status code 409
There is an already running deployment, that affects this application. To override this deployment, use the force=true flag
Body
Type: application/json
Example:
{
"message":"App is locked by one or more deployments. Override with the option '?force=true'. View details at '/v2/deployments/<DEPLOYMENT_ID>'.",
"deployments":[{"id":"97c136bf-5a28-4821-9d94-480d9fbb01c8"}]
}
List all versions the group with the specified path.
get /v2/groups/versions
List all versions the group with the specified path.
HTTP status code 200
List all available versions of that group.
Body
Type: application/json
Example:
[ "2015-09-25T15:13:48.343Z", "2015-09-11T11:11:22.692Z", "2015-09-11T10:47:21.241Z" ]
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
/v2/groups/{group_id}
Get the group with all applications and all transitive child groups.
Change parameters of a deployed application group. The new group parameters get applied.
- Changes to application parameters will result in a restart of this application.
- A new application added to the group will be started.
- An existing application removed from the group will be stopped.
If there are no changes to the application definition, no restart is triggered. During restart marathon keeps track, that the configured amount of minimal running instances are always available. This method allows 2 special modes for the update operation>
- Provide only the
version
field in the group definition. This will rollback the group to that given version - Provide only the
scaleBy
field will scale all transitive applications instance counts by the given factor.
When one of version or scaleBy are set, nothing else than a version change or transitive instance count scaling will be applied. If both version and scaleBy are set, only a version rollback will be performed – the scaleBy value will not be applied. A deployment can run forever. This is the case, when the new application has a problem and does not become healthy. In this case, human interaction is needed with 2 possible choices
- Rollback to an existing older version
- Update with a newer version of the group which does not have the problems of the old one.
Since the deployment of the group can take a considerable amount of time, this endpoint returns immediately with a version. The failure or success of the action is signalled via event. There is a group_change_success and group_change_failed with the given version.
Create and start a new application group. Application groups can contain other application groups.
Destroy a group. All data about that group and all associated applications will be deleted. The failure or success of the action is signalled via events. There is a group_change_success and group_change_failed with the given version.
get /v2/groups/{group_id}
Get the group with all applications and all transitive child groups.
URI Parameters
- group_id: required (string)
HTTP status code 200
The group with all transitive dependencies.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": true,
"type": "object",
"properties": {
"id": {
"type": "string"
},
"apps": {
"type": "array",
"items": {
"type": "object",
"properties": { }
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"apps": {
"type": "array",
"items": {}
},
"groups": {
"type": "array",
"items": {}
},
"dependencies": {
"type": "array",
"items": {}
},
"version": {
"type": "string"
}
}
}
},
"dependencies": {
"type": "array",
"items": {}
},
"version": {
"type": "string"
}
}
}
Example:
{
"id": "/",
"apps": [],
"groups": [
{
"id": "/tools",
"apps": [
{
"id": "/tools/oauth-server",
"instances": 2,
"cpus": 1,
"mem": 1024,
"disk": 0,
"constraints": [
[
"hostname",
"UNIQUE"
]
],
"uris": [],
"storeUrls": [],
"ports": [
1980
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "docker-registry/oauth_server:6d7d463cb8b1517002080a81cf23f9cf7b7fc774",
"network": "HOST",
"privileged": false,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [
{
"path": "/",
"protocol": "HTTP",
"portIndex": 0,
"gracePeriodSeconds": 300,
"intervalSeconds": 20,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3,
"ignoreHttp1xx": false
}
],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 0.5,
"maximumOverCapacity": 0
},
"version": "2015-09-28T19:47:37.681Z",
"versionInfo": {
"lastScalingAt": "2015-09-28T19:47:37.681Z",
"lastConfigChangeAt": "2015-09-28T19:47:37.681Z"
}
},
{
"id": "/tools/datadog-agent",
"instances": 5,
"cpus": 1,
"mem": 512,
"disk": 0,
"executor": "",
"constraints": [
[
"hostname",
"UNIQUE"
]
],
"uris": [],
"storeUrls": [],
"ports": [
10018
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/var/run/docker.sock",
"hostPath": "/var/run/docker.sock",
"mode": "RW"
},
{
"containerPath": "/host/proc/mounts",
"hostPath": "/proc/mounts",
"mode": "RO"
},
{
"containerPath": "/host/sys/fs/cgroup",
"hostPath": "/sys/fs/cgroup/",
"mode": "RO"
}
],
"docker": {
"image": "datadog/docker-dd-agent:latest",
"network": "HOST",
"privileged": true,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 0.5,
"maximumOverCapacity": 0
},
"version": "2015-08-26T22:33:24.225Z",
"versionInfo": {
"lastScalingAt": "2015-08-26T22:33:24.225Z",
"lastConfigChangeAt": "2015-05-19T13:59:18.899Z"
}
}
],
"groups": [
{
"id": "/tools/log",
"apps": [],
"groups": [],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
},
{
"id": "/tools/docker",
"apps": [
{
"id": "/tools/docker/registry",
"instances": 1,
"cpus": 0.5,
"mem": 4096,
"disk": 0,
"executor": "",
"constraints": [],
"uris": [],
"storeUrls": [],
"ports": [
5000
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/docker_storage",
"hostPath": "/hdd/tools/docker/registry",
"mode": "RW"
}
],
"docker": {
"image": "registry",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 5000,
"hostPort": 0,
"servicePort": 5000,
"protocol": "tcp"
}
],
"privileged": false,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 1,
"maximumOverCapacity": 1
},
"version": "2015-08-19T21:26:47.616Z",
"versionInfo": {
"lastScalingAt": "2015-08-19T21:26:47.616Z",
"lastConfigChangeAt": "2015-08-19T21:00:54.621Z"
}
}
],
"groups": [],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
}
],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
}
],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
put /v2/groups/{group_id}
Change parameters of a deployed application group. The new group parameters get applied.
- Changes to application parameters will result in a restart of this application.
- A new application added to the group will be started.
- An existing application removed from the group will be stopped.
If there are no changes to the application definition, no restart is triggered. During restart marathon keeps track, that the configured amount of minimal running instances are always available. This method allows 2 special modes for the update operation>
- Provide only the
version
field in the group definition. This will rollback the group to that given version - Provide only the
scaleBy
field will scale all transitive applications instance counts by the given factor.
When one of version or scaleBy are set, nothing else than a version change or transitive instance count scaling will be applied. If both version and scaleBy are set, only a version rollback will be performed – the scaleBy value will not be applied. A deployment can run forever. This is the case, when the new application has a problem and does not become healthy. In this case, human interaction is needed with 2 possible choices
- Rollback to an existing older version
- Update with a newer version of the group which does not have the problems of the old one.
Since the deployment of the group can take a considerable amount of time, this endpoint returns immediately with a version. The failure or success of the action is signalled via event. There is a group_change_success and group_change_failed with the given version.
URI Parameters
- group_id: required (string)
Query Parameters
- force: (boolean)
Only one deployment can be applied to one application at the same time. If the existing deployment should be canceled by this change, you can set force=true. Caution: setting force=true will cancel the current deployment. This paramter should be used only, if the current deployment is unsuccessful!
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": true,
"type": "object",
"properties": {
"id": {
"type": "string"
},
"apps": {
"type": "array",
"items": {
"type": "object",
"properties": { }
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"apps": {
"type": "array",
"items": {}
},
"groups": {
"type": "array",
"items": {}
},
"dependencies": {
"type": "array",
"items": {}
},
"version": {
"type": "string"
}
}
}
},
"dependencies": {
"type": "array",
"items": {}
},
"version": {
"type": "string"
}
}
}
Example:
{
"id": "/",
"apps": [],
"groups": [
{
"id": "/tools",
"apps": [
{
"id": "/tools/oauth-server",
"instances": 2,
"cpus": 1,
"mem": 1024,
"disk": 0,
"constraints": [
[
"hostname",
"UNIQUE"
]
],
"uris": [],
"storeUrls": [],
"ports": [
1980
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "docker-registry/oauth_server:6d7d463cb8b1517002080a81cf23f9cf7b7fc774",
"network": "HOST",
"privileged": false,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [
{
"path": "/",
"protocol": "HTTP",
"portIndex": 0,
"gracePeriodSeconds": 300,
"intervalSeconds": 20,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3,
"ignoreHttp1xx": false
}
],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 0.5,
"maximumOverCapacity": 0
},
"version": "2015-09-28T19:47:37.681Z",
"versionInfo": {
"lastScalingAt": "2015-09-28T19:47:37.681Z",
"lastConfigChangeAt": "2015-09-28T19:47:37.681Z"
}
},
{
"id": "/tools/datadog-agent",
"instances": 5,
"cpus": 1,
"mem": 512,
"disk": 0,
"executor": "",
"constraints": [
[
"hostname",
"UNIQUE"
]
],
"uris": [],
"storeUrls": [],
"ports": [
10018
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/var/run/docker.sock",
"hostPath": "/var/run/docker.sock",
"mode": "RW"
},
{
"containerPath": "/host/proc/mounts",
"hostPath": "/proc/mounts",
"mode": "RO"
},
{
"containerPath": "/host/sys/fs/cgroup",
"hostPath": "/sys/fs/cgroup/",
"mode": "RO"
}
],
"docker": {
"image": "datadog/docker-dd-agent:latest",
"network": "HOST",
"privileged": true,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 0.5,
"maximumOverCapacity": 0
},
"version": "2015-08-26T22:33:24.225Z",
"versionInfo": {
"lastScalingAt": "2015-08-26T22:33:24.225Z",
"lastConfigChangeAt": "2015-05-19T13:59:18.899Z"
}
}
],
"groups": [
{
"id": "/tools/log",
"apps": [],
"groups": [],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
},
{
"id": "/tools/docker",
"apps": [
{
"id": "/tools/docker/registry",
"instances": 1,
"cpus": 0.5,
"mem": 4096,
"disk": 0,
"executor": "",
"constraints": [],
"uris": [],
"storeUrls": [],
"ports": [
5000
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/docker_storage",
"hostPath": "/hdd/tools/docker/registry",
"mode": "RW"
}
],
"docker": {
"image": "registry",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 5000,
"hostPort": 0,
"servicePort": 5000,
"protocol": "tcp"
}
],
"privileged": false,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 1,
"maximumOverCapacity": 1
},
"version": "2015-08-19T21:26:47.616Z",
"versionInfo": {
"lastScalingAt": "2015-08-19T21:26:47.616Z",
"lastConfigChangeAt": "2015-08-19T21:00:54.621Z"
}
}
],
"groups": [],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
}
],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
}
],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
}
HTTP status code 200
A deployment is started which has a unique deployment identifier. The related deployment can be fetched from the /v2/deployments endpoint. If the deployement is gone from the list of deployments, than this means it is finished. As long as the deployment runs, the effect of that change operation is visible only partially.
Body
Type: application/json
Example:
{
"deploymentId": "5ed4c0c5-9ff8-4a6f-a0cd-f57f59a34b43",
"version": "2015-09-29T15:59:51.164Z"
}
HTTP status code 400
The group definition provided in the body is not valid.
Body
Type: application/json
Example:
{"message":"Invalid JSON","details":[{"path":"/id","errors":["error.expected.jsstring"]}]}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
HTTP status code 409
There is an already running deployment, that affects this application. To override this deployment, use the force=true flag
Body
Type: application/json
Example:
{
"message":"App is locked by one or more deployments. Override with the option '?force=true'. View details at '/v2/deployments/<DEPLOYMENT_ID>'.",
"deployments":[{"id":"97c136bf-5a28-4821-9d94-480d9fbb01c8"}]
}
HTTP status code 422
The entity send can not be preocessed, since there are validation errors
Body
Type: application/json
Example:
{
"message":"Object is not valid",
"details": [
{
"attribute":"apps[0].id",
"error":"identifier /app is not child of /group. Hint: use relative paths."
}
]
}
post /v2/groups/{group_id}
Create and start a new application group. Application groups can contain other application groups.
URI Parameters
- group_id: required (string)
Query Parameters
- force: (boolean)
Only one deployment can be applied to one application at the same time. If the existing deployment should be canceled by this change, you can set force=true. Caution: setting force=true will cancel the current deployment. This paramter should be used only, if the current deployment is unsuccessful!
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": true,
"type": "object",
"properties": {
"id": {
"type": "string"
},
"apps": {
"type": "array",
"items": {
"type": "object",
"properties": { }
}
},
"groups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"apps": {
"type": "array",
"items": {}
},
"groups": {
"type": "array",
"items": {}
},
"dependencies": {
"type": "array",
"items": {}
},
"version": {
"type": "string"
}
}
}
},
"dependencies": {
"type": "array",
"items": {}
},
"version": {
"type": "string"
}
}
}
Example:
{
"id": "/",
"apps": [],
"groups": [
{
"id": "/tools",
"apps": [
{
"id": "/tools/oauth-server",
"instances": 2,
"cpus": 1,
"mem": 1024,
"disk": 0,
"constraints": [
[
"hostname",
"UNIQUE"
]
],
"uris": [],
"storeUrls": [],
"ports": [
1980
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "docker-registry/oauth_server:6d7d463cb8b1517002080a81cf23f9cf7b7fc774",
"network": "HOST",
"privileged": false,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [
{
"path": "/",
"protocol": "HTTP",
"portIndex": 0,
"gracePeriodSeconds": 300,
"intervalSeconds": 20,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3,
"ignoreHttp1xx": false
}
],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 0.5,
"maximumOverCapacity": 0
},
"version": "2015-09-28T19:47:37.681Z",
"versionInfo": {
"lastScalingAt": "2015-09-28T19:47:37.681Z",
"lastConfigChangeAt": "2015-09-28T19:47:37.681Z"
}
},
{
"id": "/tools/datadog-agent",
"instances": 5,
"cpus": 1,
"mem": 512,
"disk": 0,
"executor": "",
"constraints": [
[
"hostname",
"UNIQUE"
]
],
"uris": [],
"storeUrls": [],
"ports": [
10018
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/var/run/docker.sock",
"hostPath": "/var/run/docker.sock",
"mode": "RW"
},
{
"containerPath": "/host/proc/mounts",
"hostPath": "/proc/mounts",
"mode": "RO"
},
{
"containerPath": "/host/sys/fs/cgroup",
"hostPath": "/sys/fs/cgroup/",
"mode": "RO"
}
],
"docker": {
"image": "datadog/docker-dd-agent:latest",
"network": "HOST",
"privileged": true,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 0.5,
"maximumOverCapacity": 0
},
"version": "2015-08-26T22:33:24.225Z",
"versionInfo": {
"lastScalingAt": "2015-08-26T22:33:24.225Z",
"lastConfigChangeAt": "2015-05-19T13:59:18.899Z"
}
}
],
"groups": [
{
"id": "/tools/log",
"apps": [],
"groups": [],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
},
{
"id": "/tools/docker",
"apps": [
{
"id": "/tools/docker/registry",
"instances": 1,
"cpus": 0.5,
"mem": 4096,
"disk": 0,
"executor": "",
"constraints": [],
"uris": [],
"storeUrls": [],
"ports": [
5000
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "/docker_storage",
"hostPath": "/hdd/tools/docker/registry",
"mode": "RW"
}
],
"docker": {
"image": "registry",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 5000,
"hostPort": 0,
"servicePort": 5000,
"protocol": "tcp"
}
],
"privileged": false,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 1,
"maximumOverCapacity": 1
},
"version": "2015-08-19T21:26:47.616Z",
"versionInfo": {
"lastScalingAt": "2015-08-19T21:26:47.616Z",
"lastConfigChangeAt": "2015-08-19T21:00:54.621Z"
}
}
],
"groups": [],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
}
],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
}
],
"dependencies": [],
"version": "2015-09-17T10:38:20.875Z"
}
HTTP status code 200
A deployment is started which has a unique deployment identifier. The related deployment can be fetched from the /v2/deployments endpoint. If the deployement is gone from the list of deployments, than this means it is finished. As long as the deployment runs, the effect of that change operation is visible only partially.
Body
Type: application/json
Example:
{
"deploymentId": "5ed4c0c5-9ff8-4a6f-a0cd-f57f59a34b43",
"version": "2015-09-29T15:59:51.164Z"
}
HTTP status code 400
The group definition provided in the body is not valid.
Body
Type: application/json
Example:
{"message":"Invalid JSON","details":[{"path":"/id","errors":["error.expected.jsstring"]}]}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
HTTP status code 409
There is an already deployed group with this name
Body
Type: application/json
Example:
{"message":"Group / is already created. Use PUT to change this group."}
HTTP status code 422
The entity send can not be preocessed, since there are validation errors
Body
Type: application/json
Example:
{
"message":"Object is not valid",
"details": [
{
"attribute":"apps[0].id",
"error":"identifier /app is not child of /group. Hint: use relative paths."
}
]
}
delete /v2/groups/{group_id}
Destroy a group. All data about that group and all associated applications will be deleted. The failure or success of the action is signalled via events. There is a group_change_success and group_change_failed with the given version.
URI Parameters
- group_id: required (string)
Query Parameters
- force: (boolean)
Only one deployment can be applied to one application at the same time. If the existing deployment should be canceled by this change, you can set force=true. Caution: setting force=true will cancel the current deployment. This paramter should be used only, if the current deployment is unsuccessful!
HTTP status code 200
A deployment is started which has a unique deployment identifier. The related deployment can be fetched from the /v2/deployments endpoint. If the deployement is gone from the list of deployments, than this means it is finished. As long as the deployment runs, the effect of that change operation is visible only partially.
Body
Type: application/json
Example:
{
"deploymentId": "5ed4c0c5-9ff8-4a6f-a0cd-f57f59a34b43",
"version": "2015-09-29T15:59:51.164Z"
}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
HTTP status code 409
There is an already running deployment, that affects this application. To override this deployment, use the force=true flag
Body
Type: application/json
Example:
{
"message":"App is locked by one or more deployments. Override with the option '?force=true'. View details at '/v2/deployments/<DEPLOYMENT_ID>'.",
"deployments":[{"id":"97c136bf-5a28-4821-9d94-480d9fbb01c8"}]
}
List all versions the group with the specified path.
get /v2/groups/{group_id}/versions
List all versions the group with the specified path.
URI Parameters
- group_id: required (string)
HTTP status code 200
List all available versions of that group.
Body
Type: application/json
Example:
[ "2015-09-25T15:13:48.343Z", "2015-09-11T11:11:22.692Z", "2015-09-11T10:47:21.241Z" ]
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
/v2/tasks
List all running tasks.
get /v2/tasks
List all running tasks.
Query Parameters
- status: (one of TASK_STAGING, TASK_STARTING, TASK_RUNNING - repeat: true)
Filter the list of tasks by status
HTTP status code 200
The list of all tasks disregarding their status, or a list of tasks matching the specified status filter.
Body
Type: application/json
Example:
{
"tasks": [
{
"id": "frontend-foosball.083be411-5d1f-11e5-88f7-56b91e7a505b",
"host": "srv4.example.com",
"ports": [
31292
],
"startedAt": "2015-09-17T09:32:42.598Z",
"stagedAt": "2015-09-17T09:32:36.822Z",
"version": "2015-09-17T09:32:36.583Z",
"slaveId": "20150707-153709-201330860-5050-12052-S0",
"appId": "/frontend-foosball",
"servicePorts": [
10019
]
},
{
"id": "tools_docker_registry.002b4d28-46b9-11e5-b731-525400cce7ed",
"host": "srv2.example.com",
"ports": [
31721
],
"startedAt": "2015-08-19T21:26:50.864Z",
"stagedAt": "2015-08-19T21:26:49.040Z",
"version": "2015-08-19T21:26:47.616Z",
"slaveId": null,
"appId": "/tools/docker/registry",
"servicePorts": [
5000
]
}
]
}
Type: text/plain
Example:
frontend-foosball 10019 srv4.example.com:31292
tools_docker_registry 5000 srv2.example.com:31721
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
Kill a list of running tasks.
post /v2/tasks/delete
Kill a list of running tasks.
Query Parameters
- force: (boolean)
Only one deployment can be applied to one application at the same time. If the existing deployment should be canceled by this change, you can set force=true. Caution: setting force=true will cancel the current deployment. This paramter should be used only, if the current deployment is unsuccessful!
- scale: (boolean)
If
scale=true
is specified, then the related application is scaled down by the number of killed tasks.
Body
Type: application/json
Example:
{ "ids": [ "task1", "task2" ] }
HTTP status code 200
If scale=false, all tasks that were killed are returned. If scale=true, than a deployment is triggered and the deployment is returned.
Body
Type: application/json
Example:
{
"tasks": [
{
"id": "frontend-foosball.083be411-5d1f-11e5-88f7-56b91e7a505b",
"host": "srv4.example.com",
"ports": [
31292
],
"startedAt": "2015-09-17T09:32:42.598Z",
"stagedAt": "2015-09-17T09:32:36.822Z",
"version": "2015-09-17T09:32:36.583Z",
"slaveId": "20150707-153709-201330860-5050-12052-S0",
"appId": "/frontend-foosball",
"servicePorts": [
10019
]
},
{
"id": "tools_docker_registry.002b4d28-46b9-11e5-b731-525400cce7ed",
"host": "srv2.example.com",
"ports": [
31721
],
"startedAt": "2015-08-19T21:26:50.864Z",
"stagedAt": "2015-08-19T21:26:49.040Z",
"version": "2015-08-19T21:26:47.616Z",
"slaveId": null,
"appId": "/tools/docker/registry",
"servicePorts": [
5000
]
}
]
}
HTTP status code 400
There are unknown task ids, that can not be killed.
Body
Type: application/json
Example:
{"message":"Invalid task id not_known"}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
HTTP status code 409
There is an already running deployment, that affects this application. To override this deployment, use the force=true flag
Body
Type: application/json
Example:
{
"message":"App is locked by one or more deployments. Override with the option '?force=true'. View details at '/v2/deployments/<DEPLOYMENT_ID>'.",
"deployments":[{"id":"97c136bf-5a28-4821-9d94-480d9fbb01c8"}]
}
/v2/artifacts
Upload an artifact to the artifact store. A multipart form upload request has to be performed. The form parameter name has to be file
. The filename used in the artifact store, is the same as given by the form parameter. The response holds the URL of the artifact in the artifact store in the Location Header.
post /v2/artifacts
Upload an artifact to the artifact store. A multipart form upload request has to be performed. The form parameter name has to be file
. The filename used in the artifact store, is the same as given by the form parameter. The response holds the URL of the artifact in the artifact store in the Location Header.
Upload an artifact to the artifact store. A multipart form upload request has to be performed. The form parameter name has to be file
. The path used to store the file is taken from the url path. The response holds the URL of the artifact in the artifact store in the Location Header.
Upload an artifact to the artifact store. A multipart form upload request has to be performed. The form parameter name has to be file
. The path used to store the file is taken from the url path. The response holds the URL of the artifact in the artifact store in the Location Header.
Delete an artifact from the artifact store. The path is the relative path in the artifact store.
Download an artifact from the artifact store. The path is the relative path in the artifact store.
put /v2/artifacts/{path}
Upload an artifact to the artifact store. A multipart form upload request has to be performed. The form parameter name has to be file
. The path used to store the file is taken from the url path. The response holds the URL of the artifact in the artifact store in the Location Header.
post /v2/artifacts/{path}
Upload an artifact to the artifact store. A multipart form upload request has to be performed. The form parameter name has to be file
. The path used to store the file is taken from the url path. The response holds the URL of the artifact in the artifact store in the Location Header.
delete /v2/artifacts/{path}
get /v2/artifacts/{path}
Download an artifact from the artifact store. The path is the relative path in the artifact store.
/v2/events
Attach to the marathon event stream. To use this endpoint, the client has to accept the text/event-stream content type. Please note a request to this endpoint will not be closed by the server. If an event happens on the server side, this event will be propagated to the client immediately. See Server Sent Events for a more detailed explanation. Note for ApiConsole: this function will not yield the expected result from inside ApiConsole.
get /v2/events
Attach to the marathon event stream. To use this endpoint, the client has to accept the text/event-stream content type. Please note a request to this endpoint will not be closed by the server. If an event happens on the server side, this event will be propagated to the client immediately. See Server Sent Events for a more detailed explanation. Note for ApiConsole: this function will not yield the expected result from inside ApiConsole.
HTTP status code 200
the list of all tasks waiting to be scheduled.
Body
Type: text/event-stream
Example:
event: event_stream_attached
data: {"remoteAddress":"0:0:0:0:0:0:0:1","eventType":"event_stream_attached","timestamp":"2015-09-30T12:44:30.061Z"}
event: status_update_event
data: {"slaveId":"20150707-153709-218108076-5050-25588-S6","taskId":"foo.0664256e-6771-11e5-94e1-be5b2935a987","taskStatus":"TASK_FAILED","message":"Failed to launch container: Failed to fetch all URIs for container '59d5cd89-091f-4454-940a-d9eb4361c640' with exit status: 256","appId":"/foo","host":"srv5.hw.ca1.mesosphere.com","ports":[31776],"version":"2015-09-30T09:09:17.614Z","eventType":"status_update_event","timestamp":"2015-09-30T12:44:45.681Z"}
event: status_update_event
data: {"slaveId":"20150707-153709-201330860-5050-12052-S0","taskId":"test-app.5dd78972-6771-11e5-94e1-be5b2935a987","taskStatus":"TASK_RUNNING","message":"","appId":"/test-app","host":"srv4.hw.ca1.mesosphere.com","ports":[31182],"version":"2015-09-11T22:11:03.156Z","eventType":"status_update_event","timestamp":"2015-09-30T12:47:11.286Z"}
HTTP status code 405
A request has been made without the correct Accept Header
Body
Type: text/html
Example:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 405 </title>
</head>
<body>
<h2>HTTP ERROR: 405</h2>
<p>Problem accessing /v2/events. Reason:
<pre> HTTP method GET is not supported by this URL</pre></p>
<hr /><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.3.z-SNAPSHOT</a><hr/>
</body>
</html>
/v2/eventSubscriptions
List all event subscriber callback URLs. _NOTE To activate this endpoint, you need to startup a Marathon instance with --event_subscriber http_callback
_
Subscribe to the event callback mechanism with the specified callback URL.
Unregister a callback URL from the event subscribers list.
get /v2/eventSubscriptions
List all event subscriber callback URLs. _NOTE To activate this endpoint, you need to startup a Marathon instance with --event_subscriber http_callback
_
HTTP status code 200
Return the list of all subscription endpoints
Body
Type: application/json
Example:
{
"callbackUrls": [
"http://server123:9090/callback",
"http://server234:9191/callback"
]
}
post /v2/eventSubscriptions
Subscribe to the event callback mechanism with the specified callback URL.
Query Parameters
- callbackUrl: (string - pattern: ^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$)
The URL to an endpoint that is able to handle post requests for every event that is send.
HTTP status code 200
Body
Type: application/json
Example:
{
"callbackUrl": "http://localhost:9292/callback",
"clientIp": "127.0.0.1",
"eventType": "subscribe_event"
}
delete /v2/eventSubscriptions
Unregister a callback URL from the event subscribers list.
Query Parameters
- callbackUrl: (string - pattern: ^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$)
The URL to an endpoint that is able to handle post requests for every event that is send.
HTTP status code 200
Body
Type: application/json
Example:
{
"callbackUrl": "http://localhost:9292/callback",
"clientIp": "127.0.0.1",
"eventType": "unsubscribe_event"
}
/v2/info
Get info about the Marathon Instance
get /v2/info
Get info about the Marathon Instance
HTTP status code 200
General configuration and runtime information about this Marathon instance.
Body
Type: application/json
Example:
{
"name": "marathon",
"version": "0.13.0-SNAPSHOT",
"elected": true,
"leader": "wrk.fritz.box:8080",
"frameworkId": "80ba2050-bf0f-4472-a2f7-2636c4f7b8c8-0000",
"marathon_config": {
"master": "127.0.0.1:5050",
"failover_timeout": 604800,
"framework_name": "marathon",
"ha": true,
"checkpoint": true,
"local_port_min": 10000,
"local_port_max": 20000,
"executor": "//cmd",
"hostname": "wrk.fritz.box",
"webui_url": null,
"mesos_role": null,
"task_launch_timeout": 300000,
"reconciliation_initial_delay": 15000,
"reconciliation_interval": 300000,
"marathon_store_timeout": 2000,
"mesos_user": "matthias",
"leader_proxy_connection_timeout_ms": 5000,
"leader_proxy_read_timeout_ms": 10000,
"mesos_leader_ui_url": null
},
"zookeeper_config": {
"zk": "zk://localhost:2181/marathon",
"zk_timeout": 10000,
"zk_session_timeout": 1800000,
"zk_max_versions": 25
},
"event_subscriber": null,
"http_config": {
"assets_path": null,
"http_port": 8080,
"https_port": 8443
}
}
/v2/leader
Returns the current leader.
Causes the current leader to abdicate, triggering a new election.
get /v2/leader
Returns the current leader.
delete /v2/leader
Causes the current leader to abdicate, triggering a new election.
/v2/queue
List all the tasks queued up or waiting to be scheduled. This is mainly used for troubleshooting and occurs when scaling changes are requested and the volume of scaling changes out paces the ability to schedule those tasks. In addition to the application in the queue, you see also the task count that needs to be started. If the task has a rate limit, then a delay to the start gets applied. You can see this delay for every application with the seconds to wait before the next launch will be tried.
get /v2/queue
List all the tasks queued up or waiting to be scheduled. This is mainly used for troubleshooting and occurs when scaling changes are requested and the volume of scaling changes out paces the ability to schedule those tasks. In addition to the application in the queue, you see also the task count that needs to be started. If the task has a rate limit, then a delay to the start gets applied. You can see this delay for every application with the seconds to wait before the next launch will be tried.
HTTP status code 200
the list of all tasks waiting to be scheduled.
Body
Type: application/json
Example:
{
"queue": [
{
"app": {
"id": "/tools/datadog-agent",
"cmd": null,
"args": null,
"user": null,
"env": { },
"instances": 5,
"cpus": 1.0,
"mem": 512.0,
"disk": 0.0,
"executor": "",
"constraints": [
[
"hostname",
"UNIQUE"
]
],
"uris": [],
"storeUrls": [],
"ports": [
10018
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [ ],
"docker": {
"image": "datadog/docker-dd-agent:latest",
"network": "HOST",
"privileged": true,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 0.5,
"maximumOverCapacity": 0.0
},
"labels": {},
"acceptedResourceRoles": null,
"version": "2015-08-26T22:33:24.225Z",
"versionInfo": {
"lastScalingAt": "2015-08-26T22:33:24.225Z",
"lastConfigChangeAt": "2015-05-19T13:59:18.899Z"
}
},
"count": 1,
"delay": {
"timeLeftSeconds": 0,
"overdue": true
}
},
{
"app": {
"id": "/foo",
"cmd": null,
"args": null,
"user": "root",
"env": {
"MASTER": "zk://172.16.0.12:2181,172.16.0.13:2181,172.16.0.14:2181/mesos"
},
"instances": 1,
"cpus": 0.5,
"mem": 128.0,
"disk": 0.0,
"executor": "//cmd",
"constraints": [
[
"hostname",
"UNIQUE"
]
],
"uris": [
"http://www.mesosphere.io/index.html"
],
"storeUrls": [],
"ports": [
10010
],
"requirePorts": false,
"backoffSeconds": 1,
"backoffFactor": 1.15,
"maxLaunchDelaySeconds": 3600,
"container": {
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "thomasr/dispatch",
"network": "HOST",
"privileged": false,
"parameters": [],
"forcePullImage": false
}
},
"healthChecks": [],
"dependencies": [],
"upgradeStrategy": {
"minimumHealthCapacity": 1.0,
"maximumOverCapacity": 1.0
},
"labels": {},
"acceptedResourceRoles": null,
"version": "2015-09-30T09:09:17.614Z",
"versionInfo": {
"lastScalingAt": "2015-09-30T09:09:17.614Z",
"lastConfigChangeAt": "2015-09-30T09:09:17.614Z"
}
},
"count": 2,
"delay": {
"timeLeftSeconds": 0,
"overdue": true
}
}
]
}
HTTP status code 401
Unauthorized. Authentication is enabled and you did not provide enough or wrong information to authenticate that request.
Body
Type: application/json
Example:
{ "message": "Invalid username or password." }
HTTP status code 403
Forbidden. Authorization is granted but the identity provided does not have sufficient access rights to do that action.
Body
Type: application/json
Example:
{ "message": "Not Authorized to perform this action!" }
If an application fails too often in a specified amount of time (according to the application definition), the task launch will be delayed. This delay can be removed by calling this endpoint. The effect is, that the tasks of this application will be launched immediately.
delete /v2/queue/{app_id}/delay
If an application fails too often in a specified amount of time (according to the application definition), the task launch will be delayed. This delay can be removed by calling this endpoint. The effect is, that the tasks of this application will be launched immediately.
/ping
/metrics
Get metrics data from this Marathon instance
get /metrics
Get metrics data from this Marathon instance
HTTP status code 200
All aggregated runtime metrics for this Marathon instance.
Body
Type: application/json
Example:
{
"counters": {
"name.of.counter": {
"count": 1
}
},
"gauges": {
"name.of.gauge": {
"value": 7248
}
},
"histograms": {
"name.of.histogram": {
"count": 0,
"max": 0,
"mean": 0.0,
"min": 0,
"p50": 0.0,
"p75": 0.0,
"p95": 0.0,
"p98": 0.0,
"p99": 0.0,
"p999": 0.0,
"stddev": 0.0
}
},
"meters": {
"name.of.meter": {
"count": 0,
"m15_rate": 0.0,
"m1_rate": 0.0,
"m5_rate": 0.0,
"mean_rate": 0.0,
"units": "events/second"
}
},
"timers": {
"name.of.timer": {
"count": 1,
"duration_units": "seconds",
"m15_rate": 0.2,
"m1_rate": 0.2,
"m5_rate": 0.2,
"max": 0.0021718640000000003,
"mean": 0.0021718640000000003,
"mean_rate": 0.13897812037014803,
"min": 0.0021718640000000003,
"p50": 0.0021718640000000003,
"p75": 0.0021718640000000003,
"p95": 0.0021718640000000003,
"p98": 0.0021718640000000003,
"p99": 0.0021718640000000003,
"p999": 0.0021718640000000003,
"rate_units": "calls/second",
"stddev": 0.0
}
},
"version": "3.0.0"
}