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
cmdfield contains the given valueExample:
java
- id: (string)
Filter the result to only return apps whose
idis 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 QueryMatches the existence of a label
Example: my_label,environmentEquality based Selector QueryMatches existence of labels and the (non) equality of the value.
Example: environment==production, tier!=frontendSet based Selector QueryMatches 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.tasksembed all tasks of each application
Note: if this embed is definded, it automatically setsapps.deploymentsbut this will change in a future release. Please define all embeds explicitly.apps.countsembed all task counts (tasksStaged, tasksRunning, tasksHealthy, tasksUnhealthy)
Note: currently embedded by default but this will change in a future release. Please define all embeds explicitly.apps.deploymentsembed all deployment identifier, if the related app currently is in deployment.apps.readinessembed all readiness check resultsapps.lastTaskFailureembeds the lastTaskFailure for the application if there is one.apps.failuresShorthand for apps.lastTaskFailure, apps.tasks, apps.counts and apps.deployments.
Note: deprecated and will be removed in future versions Please define all embeds explicitly.apps.taskStatsexposes 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 - default: false)
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, it means that 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": [
{
"path": "/upgradeStrategy/minimumHealthCapacity",
"errors": [
"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": {
"type": "string",
"pattern": "^(\\/?((\\.{2})|([a-z0-9][a-z0-9\\-.]*[a-z0-9]+)|([a-z0-9]*))($|\\/))+$",
"minLength": 1
}
},
"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. See [the Mesos attribute and resources documentation](http://mesos.apache.org/documentation/latest/attributes-resources/) 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": {
"type": "array",
"items": {
"type": "array",
"items": [
{
"type": "string"
},
{
"type": "string",
"enum": ["UNIQUE", "CLUSTER", "GROUP_BY", "LIKE", "UNLIKE", "MAX_PER"]
},
{
"type": "string"
}
],
"minItems": 2,
"additionalItems": false
},
"description": "Valid constraint operators are one of UNIQUE, CLUSTER, GROUP_BY, LIKE, UNLIKE, MAX_PER."
},
"container": {
"additionalProperties": false,
"properties": {
"docker": {
"additionalProperties": false,
"properties": {
"credential": {
"type": "object",
"description": "Credential to authenticate with the docker registry.",
"additionalProperties": false,
"properties": {
"principal": {
"type": "string",
"description": "Principal to authenticate with the docker registry."
},
"secret": {
"type": "string",
"description": "Secret to authenticate with the docker registry."
}
},
"required": [ "principal" ]
},
"forcePullImage": {
"type": "boolean",
"description": "The container will be pulled, regardless if it is already available on the local system."
},
"image": {
"type": "string",
"minLength": 1,
"description": "The name of the docker image to use."
},
"network": {
"type": "string",
"description": "The networking mode, this container should operate in. One of BRIDGE|HOST|NONE|USER",
"enum": ["BRIDGE", "HOST", "NONE", "USER"]
},
"parameters": {
"type": "array",
"description": "Allowing arbitrary parameters to be passed to docker CLI. Note that anything passed to this field is not guaranteed to be supported moving forward, as we might move away from the docker CLI.",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"key": {
"type": "string",
"minLength": 1,
"description": "Key of this parameter"
},
"value": {
"type": "string",
"description": "Value of this parameter"
}
},
"required": [ "key", "value" ]
}
},
"portMappings": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"containerPort": {
"type": "integer",
"description": "Refers to the port the application listens to inside of the container. It is optional and defaults to 0. For each containerPort with a value of 0 Marathon assigns the containerPort the same value as the assigned hostPort. This is especially useful for apps that advertise the port they are listening on to the outside world for P2P communication. Without containerPort: 0 they would erroneously advertise their private container port which is usually not the same as the externally visible host port.",
"maximum": 65535,
"minimum": 0
},
"hostPort": {
"type": "integer",
"description": "Retains the traditional meaning in Marathon, which is a random port from the range included in the Mesos resource offer. The resulting host ports for each task are exposed via the task details in the REST API and the Marathon web UI. hostPort is optional. In BRIDGE mode it defaults to 0 if left unspecified. In USER mode an unspecified hostPort does not allocate a port from a Mesos offer.",
"maximum": 65535,
"minimum": 0
},
"labels": {
"type": "object",
"description": "This can be used to add metadata to be interpreted by external applications such as firewalls.",
"additionalProperties": {
"type": "string"
}
},
"name": {
"type": "string",
"description": "Name of the service hosted on this port. If provided, it must be unique over all port mappings.",
"pattern": "^[a-z][a-z0-9-]*$"
},
"protocol": {
"type": "string",
"enum": ["tcp", "udp", "udp,tcp"],
"description": "Protocol of the port (one of ['tcp', 'udp'] or 'udp,tcp' for both). Defaults to 'tcp'."
},
"servicePort": {
"type": "integer",
"description": "Is a helper port intended for doing service discovery using a well-known port per service. The assigned servicePort value is not used/interpreted by Marathon itself but supposed to used by load balancer infrastructure. See Service Discovery Load Balancing doc page. The servicePort parameter is optional and defaults to 0. Like hostPort, If the value is 0, a random port will be assigned. If a servicePort value is assigned by Marathon then Marathon guarantees that its value is unique across the cluster. The values for random service ports are in the range [local_port_min, local_port_max] where local_port_min and local_port_max are command line options with default values of 10000 and 20000, respectively.",
"maximum": 65535,
"minimum": 0
}
}
}
},
"privileged": {
"type": "boolean",
"description": "Run this docker image in privileged mode."
}
},
"required": [
"image"
],
"type": "object"
},
"appc": {
"additionalProperties": false,
"properties": {
"image": {
"type": "string",
"minLength": 1,
"description": "The name of the AppC image to use."
},
"id": {
"type": "string",
"minLength": 7,
"description": "An image ID is a string of the format 'hash-value', where 'hash' is the hash algorithm used and 'value' is the hex-encoded digest. Currently the only permitted hash algorithm is sha512."
},
"labels": {
"type": "object",
"description": "Optional labels. Suggested labels: 'version', 'os', and 'arch'.",
"additionalProperties": {
"type": "string"
}
},
"forcePullImage": {
"type": "boolean",
"description": "The container will be pulled, regardless if it is already available on the local system."
}
},
"required": [ "image" ],
"type": "object"
},
"type": {
"type": "string",
"description": "Container engine type. Supported engine types at the moment are DOCKER and MESOS.",
"enum": ["MESOS", "DOCKER"]
},
"volumes": {
"items": {
"additionalProperties": false,
"properties": {
"containerPath": {
"type": "string",
"description": "The path of the volume in the container",
"minLength": 1
},
"hostPath": {
"type": "string",
"description": "The path of the volume on the host",
"minLength": 1
},
"persistent": {
"additionalProperties": false,
"properties": {
"size": {
"type": "integer",
"description": "The size of the persistent volume in MiB",
"minimum": 0
}
},
"type": "object"
},
"external": {
"additionalProperties": false,
"properties": {
"size": {
"type": "integer",
"description": "The size of the external volume in MiB",
"minimum": 0
},
"name": {
"type": "string",
"description": "The name of the volume"
},
"provider": {
"type": "string",
"description": "The name of the volume provider"
},
"options": {
"type": "object",
"description": "Provider-specific volume configuration options"
}
},
"type": "object"
},
"mode": {
"type": "string",
"description": "Possible values are RO for ReadOnly and RW for Read/Write",
"enum": ["RO", "RW"]
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"cpus": {
"type": "number",
"description": "The number of CPU shares this application needs per instance. This number does not have to be integer, but can be a fraction.",
"minimum": 0
},
"dependencies": {
"type": "array",
"description": "A list of services upon which this application depends. An order is derived from the dependencies for performing start/stop and upgrade of the application. For example, an application /a relies on the services /b which itself relies on /c. To start all 3 applications, first /c is started than /b than /a.",
"items": {
"$ref": "#/definitions/pathType"
}
},
"disk": {
"type": "number",
"description": "How much disk space in MB is needed for this application. This number does not have to be an integer, but can be a fraction.",
"minimum": 0
},
"env": {
"patternProperties": {
".*": {
"oneOf": [
{ "type": "string" },
{
"type": "object",
"description": "An environment variable set to a secret.",
"properties": {
"secret": {
"type": "string",
"description": "The key of the secret to be used as a value.",
"minLength": 1
}
},
"required": [ "secret" ],
"additionalProperties": false
}
]
}
},
"type": "object"
},
"executor": {
"type": "string",
"description": "The executor to use to launch this application. Different executors are available. The simplest one (and the default if none is given) is //cmd, which takes the cmd and executes that on the shell level.",
"pattern": "^(|\\/\\/cmd|\\/?[^\\/]+(\\/[^\\/]+)*)$"
},
"fetch": {
"type": "array",
"description": "Provided URIs are passed to Mesos fetcher module and resolved in runtime.",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"uri": {
"type": "string",
"description": "URI to be fetched by Mesos fetcher module"
},
"executable": {
"type": "boolean",
"description": "Set fetched artifact as executable"
},
"extract": {
"type": "boolean",
"description": "Extract fetched artifact if supported by Mesos fetcher module"
},
"cache": {
"type": "boolean",
"description": "Cache fetched artifact if supported by Mesos fetcher module"
},
"outputFile": {
"type": "string",
"description": "Rename fetched artifact with the given name"
}
},
"required": [ "uri" ]
}
},
"healthChecks": {
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"command": {
"type": "object",
"items": {
"additionalProperties": false,
"properties": {
"value": {
"type": "string",
"description": "The health check command to execute."
}
}
}
},
"gracePeriodSeconds": {
"type": "integer",
"description": "Health check failures are ignored within this number of seconds of the task being started or until the task becomes healthy for the first time.",
"minimum": 0
},
"ignoreHttp1xx": {
"type": "boolean",
"description": "Ignore HTTP 1xx responses."
},
"intervalSeconds": {
"type": "integer",
"description": "Number of seconds to wait between health checks.",
"minimum": 0
},
"maxConsecutiveFailures": {
"type": "integer",
"description": "Number of consecutive health check failures after which the unhealthy task should be killed.",
"minimum": 0
},
"path": {
"type": "string",
"description": "Path to endpoint exposed by the task that will provide health status. Example: /path/to/health. Note: only used if protocol == HTTP[S]."
},
"port": {
"type": "integer",
"description": "The specific port to connect to. In case of dynamic ports, see portIndex.",
"maximum": 65535,
"minimum": 0
},
"portIndex": {
"type": "integer",
"description": "Index in this app's ports array to be used for health requests. An index is used so the app can use random ports, like [0, 0, 0] for example, and tasks could be started with port environment variables like $PORT1.",
"minimum": 0
},
"protocol": {
"type": "string",
"description": "Protocol of the requests to be performed. One of HTTP, HTTPS, TCP or COMMAND.",
"enum": ["HTTP", "HTTPS", "TCP", "COMMAND"]
},
"timeoutSeconds": {
"type": "integer",
"description": "Number of seconds after which a health check is considered a failure regardless of the response.",
"minimum": 0
}
}
},
"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": {
"type": "integer",
"description": "The number of instances of this application to start. Please note: this number can be changed any time as needed to scale the application.",
"minimum": 0
},
"labels": {
"type": "object",
"description": "Attaching metadata to apps can be useful to expose additional information to other services, so we added the ability to place labels on apps (for example, you could label apps staging and production to mark services by their position in the pipeline).",
"additionalProperties": {
"type": "string"
}
},
"maxLaunchDelaySeconds": {
"type": "integer",
"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
},
"mem": {
"type": "number",
"description": "The amount of memory in MB that is needed for the application per instance.",
"minimum": 0
},
"gpus": {
"type": "integer",
"description": "The amount of GPU cores that is needed for the application per instance.",
"minimum": 0
},
"ipAddress": {
"type": "object",
"description": "If an application definition includes the 'ipAddress' field, then Marathon will request a per-task IP from Mesos. A separate ports/portMappings configuration is then disallowed.",
"properties": {
"discovery": {
"type": "object",
"description": "Information useful for service discovery.",
"properties": {
"ports": {
"type": "array",
"description": "Array of objects describing the ports exposed by each task.",
"items": {
"type": "object",
"description": "Port",
"properties": {
"number": {
"maximum": 65535,
"minimum": 0,
"type": "integer",
"description": "The port number."
},
"name": {
"type": "string",
"description": "Name of the port.",
"pattern": "^[a-z][a-z0-9-]*$"
},
"protocol": {
"enum": ["tcp", "udp"],
"description": "Protocol of the port (one of ['tcp', 'udp'])."
}
}
}
}
}
},
"groups": {
"type": "array",
"description": "Array of network groups. One IP address can belong to zero or more network groups. The idea is that containers can only reach containers with which they share at least one network group.",
"items": {
"type": "string",
"description": "The name of the network group."
}
},
"labels": {
"type": "object",
"description": "Key value pair for meta data on that network interface.",
"properties": {},
"additionalProperties": true
},
"networkName": {
"type": "string",
"description": "If present, declares the name of the network that the container should join. In practice it is up to the IPAM to decide how to interpret this field."
}
}
},
"ports": {
"type": "array",
"description": "An array of required port resources on the agent host. The number of items in the array determines how many dynamic ports are allocated for every task. For every port that is zero, a globally unique (cluster-wide) port is assigned and provided as part of the app definition to be used in load balancing definitions.",
"items": {
"maximum": 65535,
"minimum": 0,
"type": "integer"
}
},
"portDefinitions": {
"type": "array",
"description": "An array of required port resources on the agent host. The number of items in the array determines how many dynamic ports are allocated for every task. For every port definition with port number zero, a globally unique (cluster-wide) service port is assigned and provided as part of the app definition to be used in load balancing definitions.",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"port": {
"type": "integer",
"description": "if requirePorts is set to true, then this port number will be used on the agent host Otherwise if the requirePorts is set to false and this port number is not zero, then it will be used as a service port and a dynamic port will be used on the agent host. If it is set to zero, a dynamic port will be used on the host and a unique service port will be assigned by Marathon.",
"maximum": 65535,
"minimum": 0
},
"labels": {
"type": "object",
"description": "This can be used to add metadata to be interpreted by external applications such as firewalls.",
"additionalProperties": {
"type": "string"
}
},
"name": {
"type": "string",
"description": "Name of the service hosted on this port. If provided, it must be unique over all port definitions.",
"pattern": "^[a-z][a-z0-9-]*$"
},
"protocol": {
"type": "string",
"enum": ["tcp", "udp"],
"description": "Protocol of the port (one of ['tcp', 'udp']). Defaults to 'tcp'."
}
}
}
},
"readinessChecks": {
"items": {
"type": "object",
"additionalProperties": false,
"description": "Query these readiness checks to determine if a task is ready to serve requests.",
"properties": {
"name": {
"type": "string",
"description": "The name used to identify this readiness check."
},
"protocol": {
"type": "string",
"description": "Protocol of the requests to be performed. One of HTTP, HTTPS.",
"enum": ["HTTP", "HTTPS"]
},
"path": {
"type": "string",
"description": "Path to endpoint exposed by the task that will provide readiness status. Example: /path/to/health."
},
"portName": {
"type": "string",
"description": "Name of the port to query as described in the portDefinitions. Example: http-api."
},
"intervalSeconds": {
"type": "integer",
"description": "Number of seconds to wait between readiness checks. Defaults to 30 seconds",
"minimum": 0
},
"timeoutSeconds": {
"type": "integer",
"description": "Number of seconds after which a health check is considered a failure regardless of the response. Must be smaller than intervalSeconds. Defaults to 10 seconds.",
"minimum": 0
},
"httpStatusCodesForReady": {
"items": {
"type": "integer",
"minimum": 100,
"maximum": 999
},
"description": "The HTTP(s) status code to treat as 'ready'.",
"type": "array"
},
"preserveLastResponse": {
"type": "boolean",
"description": "If and only if true, preserve the last readiness check responses and expose them in the API as part of a deployment.."
}
}
},
"type": "array"
},
"residency": {
"type": "object",
"description": "When using local persistent volumes that pin tasks onto agents, these values define how Marathon handles terminal states of these tasks.",
"properties": {
"relaunchEscalationTimeoutSeconds": {
"type": "integer",
"description": "When a task using persistent local volumes cannot be restarted on the agent it's been pinned to, Marathon will try to launch this task on another node after this timeout. Defaults to 3600 (one hour).",
"minimum": 0,
"additionalProperties": false
},
"taskLostBehavior": {
"type": "string",
"description": "When Marathon receives a TASK_LOST status update indicating that the agent running the task is gone, this property defines whether Marathon will launch the task on another node or not. Defaults to WAIT_FOREVER",
"enum": ["WAIT_FOREVER", "RELAUNCH_AFTER_TIMEOUT"],
"additionalProperties": false
}
},
"additionalProperties": false
},
"requirePorts": {
"type": "boolean",
"description": "Normally, the host ports of your tasks are automatically assigned. This corresponds to the requirePorts value false which is the default. If you need more control and want to specify your host ports in advance, you can set requirePorts to true. This way the ports you have specified are used as host ports. That also means that Marathon can schedule the associated tasks only on hosts that have the specified ports available."
},
"secrets": {
"type": "object",
"description": "A map with named secret declarations. The key is used to reference the values from other places in the app definition.",
"patternProperties": {
".*": {
"type": "object",
"description": "A secret declaration.",
"properties": {
"source": {
"type": "string",
"description": "The source of the secret's value. The format depends on the secret store used by Mesos.",
"minLength": 1
}
},
"required": [ "source" ],
"additionalProperties": false
}
}
},
"storeUrls": {
"type": "array",
"description": "URL's that have to be resolved and put into the artifact store, before the task will be started.",
"items": {
"type": "string",
"minLength": 1
}
},
"taskKillGracePeriodSeconds": {
"type": "integer",
"description": "Configures the number of seconds between escalating from SIGTERM to SIGKILL when signalling tasks to terminate. Using this grace period, tasks should perform orderly shut down immediately upon receiving SIGTERM.",
"minimum": 0
},
"upgradeStrategy": {
"type": "object",
"description": "During an upgrade all instances of an application get replaced by a new version. The upgradeStrategy controls how Marathon stops old versions and launches new versions.",
"additionalProperties": false,
"properties": {
"maximumOverCapacity": {
"type": "number",
"description": "A number between 0 and 1 which is multiplied with the instance count. This is the maximum number of additional instances launched at any point of time during the upgrade process.",
"maximum": 1.0,
"minimum": 0.0
},
"minimumHealthCapacity": {
"type": "number",
"description": "A number between 0 and 1 that is multiplied with the instance count. This is the minimum number of healthy nodes that do not sacrifice overall application purpose. Marathon will make sure, during the upgrade process, that at any point of time this number of healthy instances are up.",
"maximum": 1.0,
"minimum": 0.0
}
}
},
"uris": {
"type": "array",
"description": "URIs defined here are resolved, before the application gets started. If the application has external dependencies, they should be defined here.",
"items": {
"type": "string",
"minLength": 1
}
},
"user": {
"type": "string",
"description": "The user to use to run the tasks on the agent."
},
"version": {
"type": "string",
"description": "The version of this definition.",
"format": "date-time"
},
"versionInfo": {
"type": "object",
"description": "Detailed version information.",
"additionalProperties": false,
"properties": {
"lastScalingAt": {
"type": "string",
"description": "Contains the time stamp of the last change to this app which was not simply a scaling or a restarting configuration.",
"format": "date-time"
},
"lastConfigChangeAt": {
"type": "string",
"description": "Contains the time stamp of the last change including changes like scaling or restarting the app. Since our versions are time based, this is currently equal to version.",
"format": "date-time"
}
}
}
},
"required": [
"id"
],
"type": "object"
}
Example:
{
"id": "/foo",
"instances": 2,
"cmd": "sleep 1000",
"cpus": 0.1,
"disk": 0,
"mem": 16,
"acceptedResourceRoles": [
"mesos_role"
],
"args": [
"sleep",
"100"
],
"backoffFactor": 1.15,
"backoffSeconds": 1,
"constraints": [
[
"hostname",
"LIKE",
"srv2.*"
]
],
"container": {
"docker": {
"forcePullImage": false,
"image": "mesosphere:marathon/latest",
"network": "BRIDGE",
"parameters": [
{
"key": "name",
"value": "kdc"
}
],
"portMappings": [
{
"containerPort": 80,
"hostPort": 0,
"protocol": "tcp",
"servicePort": 10019,
"name": "http",
"labels": { "vip": "192.168.0.1:80" }
}
],
"privileged": false
},
"type": "DOCKER",
"volumes": [
{
"containerPath": "/docker_storage",
"hostPath": "/hdd/tools/docker/registry",
"mode": "RW"
}
]
},
"dependencies": [
"/prod/group"
],
"env": {
"XPS1": "Test",
"XPS2": "Rest",
"PASSWORD": { "secret": "/db/password" }
},
"executor": "",
"healthChecks": [
{
"gracePeriodSeconds": 300,
"ignoreHttp1xx": false,
"intervalSeconds": 20,
"maxConsecutiveFailures": 3,
"path": "/",
"portIndex": 0,
"protocol": "HTTP",
"timeoutSeconds": 20
}
],
"readinessChecks": [
{
"name": "myReadyCheck",
"protocol": "HTTP",
"path": "/v1/plan",
"portName": "http",
"intervalSeconds": 10,
"timeoutSeconds": 3,
"httpStatusCodesForReady": [ 200 ],
"preserveLastResponse": true
}
],
"labels": {
"owner": "zeus",
"note": "Away from olympus"
},
"maxLaunchDelaySeconds": 3600,
"ipAddress": {
"discovery": {
"ports": [
{
"number": 8080,
"name": "rest_endpoint",
"protocol": "tcp"
}
]
},
"groups": [
"dev"
],
"labels": {
"environment": "dev"
}
},
"portDefinitions": [
{
"port": 0,
"protocol": "tcp",
"name": "http",
"labels": { "vip": "192.168.0.1:80" }
}
],
"requirePorts": false,
"upgradeStrategy": {
"maximumOverCapacity": 1,
"minimumHealthCapacity": 1
},
"fetch": [
{ "uri": "https://foo.com/setup.py" },
{ "uri": "https://foo.com/archive.zip", "executable": false, "extract": true, "cache": true, "outputFile": "newname.zip" }
],
"user": "root",
"secrets": {
"secret1": { "source": "/db/password" },
"secret3": { "source": "/foo2" }
},
"taskKillGracePeriodSeconds": 30
}
HTTP status code 201
The application has been created and a deployment is started.
Body
Type: application/json
Example:
{
"id": "/foo",
"instances": 2,
"cmd": "sleep 1000",
"cpus": 0.1,
"disk": 0,
"mem": 16,
"acceptedResourceRoles": [
"mesos_role"
],
"args": [
"sleep",
"100"
],
"backoffFactor": 1.15,
"backoffSeconds": 1,
"constraints": [
[
"hostname",
"LIKE",
"srv2.*"
]
],
"container": {
"docker": {
"forcePullImage": false,
"image": "mesosphere:marathon/latest",
"network": "BRIDGE",
"parameters": [
{
"key": "name",
"value": "kdc"
}
],
"portMappings": [
{
"containerPort": 80,
"hostPort": 0,
"protocol": "tcp",
"servicePort": 10019,
"name": "http",
"labels": { "vip": "192.168.0.1:80" }
}
],
"privileged": false
},
"type": "DOCKER",
"volumes": [
{
"containerPath": "/docker_storage",
"hostPath": "/hdd/tools/docker/registry",
"mode": "RW"
}
]
},
"dependencies": [
"/prod/group"
],
"env": {
"XPS1": "Test",
"XPS2": "Rest",
"PASSWORD": { "secret": "/db/password" }
},
"executor": "",
"healthChecks": [
{
"gracePeriodSeconds": 300,
"ignoreHttp1xx": false,
"intervalSeconds": 20,
"maxConsecutiveFailures": 3,
"path": "/",
"portIndex": 0,
"protocol": "HTTP",
"timeoutSeconds": 20
}
],
"readinessChecks": [
{
"name": "myReadyCheck",
"protocol": "HTTP",
"path": "/v1/plan",
"portName": "http",
"intervalSeconds": 10,
"timeoutSeconds": 3,
"httpStatusCodesForReady": [ 200 ],
"preserveLastResponse": true
}
],
"labels": {
"owner": "zeus",
"note": "Away from olympus"
},
"maxLaunchDelaySeconds": 3600,
"ipAddress": {
"discovery": {
"ports": [
{
"number": 8080,
"name": "rest_endpoint",
"protocol": "tcp"
}
]
},
"groups": [
"dev"
],
"labels": {
"environment": "dev"
}
},
"portDefinitions": [
{
"port": 0,
"protocol": "tcp",
"name": "http",
"labels": { "vip": "192.168.0.1:80" }
}
],
"requirePorts": false,
"upgradeStrategy": {
"maximumOverCapacity": 1,
"minimumHealthCapacity": 1
},
"fetch": [
{ "uri": "https://foo.com/setup.py" },
{ "uri": "https://foo.com/archive.zip", "executable": false, "extract": true, "cache": true, "outputFile": "newname.zip" }
],
"user": "root",
"secrets": {
"secret1": { "source": "/db/password" },
"secret3": { "source": "/foo2" }
},
"taskKillGracePeriodSeconds": 30
}
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": [
{
"path": "/upgradeStrategy/minimumHealthCapacity",
"errors": [
"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.deploymentsbut this will change in a future release. Please define all embeds explicitly.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 explicitly.app.deployments. embed all deployment identifier, if the related app currently is in deployment.app.readinessembed all readiness check resultsapp.lastTaskFailureembeds the lastTaskFailure for the application if there is one.app.failuresShorthand for apps.lastTaskFailure, apps.tasks, apps.counts and apps.deployments.
Note: deprecated and will be removed in future versions Please define all embeds explicitly.app.taskStatsexposes 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 - default: false)
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": {
"type": "string",
"pattern": "^(\\/?((\\.{2})|([a-z0-9][a-z0-9\\-.]*[a-z0-9]+)|([a-z0-9]*))($|\\/))+$",
"minLength": 1
}
},
"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. See [the Mesos attribute and resources documentation](http://mesos.apache.org/documentation/latest/attributes-resources/) 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": {
"type": "array",
"items": {
"type": "array",
"items": [
{
"type": "string"
},
{
"type": "string",
"enum": ["UNIQUE", "CLUSTER", "GROUP_BY", "LIKE", "UNLIKE", "MAX_PER"]
},
{
"type": "string"
}
],
"minItems": 2,
"additionalItems": false
},
"description": "Valid constraint operators are one of UNIQUE, CLUSTER, GROUP_BY, LIKE, UNLIKE, MAX_PER."
},
"container": {
"additionalProperties": false,
"properties": {
"docker": {
"additionalProperties": false,
"properties": {
"credential": {
"type": "object",
"description": "Credential to authenticate with the docker registry.",
"additionalProperties": false,
"properties": {
"principal": {
"type": "string",
"description": "Principal to authenticate with the docker registry."
},
"secret": {
"type": "string",
"description": "Secret to authenticate with the docker registry."
}
},
"required": [ "principal" ]
},
"forcePullImage": {
"type": "boolean",
"description": "The container will be pulled, regardless if it is already available on the local system."
},
"image": {
"type": "string",
"minLength": 1,
"description": "The name of the docker image to use."
},
"network": {
"type": "string",
"description": "The networking mode, this container should operate in. One of BRIDGE|HOST|NONE|USER",
"enum": ["BRIDGE", "HOST", "NONE", "USER"]
},
"parameters": {
"type": "array",
"description": "Allowing arbitrary parameters to be passed to docker CLI. Note that anything passed to this field is not guaranteed to be supported moving forward, as we might move away from the docker CLI.",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"key": {
"type": "string",
"minLength": 1,
"description": "Key of this parameter"
},
"value": {
"type": "string",
"description": "Value of this parameter"
}
},
"required": [ "key", "value" ]
}
},
"portMappings": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"containerPort": {
"type": "integer",
"description": "Refers to the port the application listens to inside of the container. It is optional and defaults to 0. For each containerPort with a value of 0 Marathon assigns the containerPort the same value as the assigned hostPort. This is especially useful for apps that advertise the port they are listening on to the outside world for P2P communication. Without containerPort: 0 they would erroneously advertise their private container port which is usually not the same as the externally visible host port.",
"maximum": 65535,
"minimum": 0
},
"hostPort": {
"type": "integer",
"description": "Retains the traditional meaning in Marathon, which is a random port from the range included in the Mesos resource offer. The resulting host ports for each task are exposed via the task details in the REST API and the Marathon web UI. hostPort is optional. In BRIDGE mode it defaults to 0 if left unspecified. In USER mode an unspecified hostPort does not allocate a port from a Mesos offer.",
"maximum": 65535,
"minimum": 0
},
"labels": {
"type": "object",
"description": "This can be used to add metadata to be interpreted by external applications such as firewalls.",
"additionalProperties": {
"type": "string"
}
},
"name": {
"type": "string",
"description": "Name of the service hosted on this port. If provided, it must be unique over all port mappings.",
"pattern": "^[a-z][a-z0-9-]*$"
},
"protocol": {
"type": "string",
"enum": ["tcp", "udp", "udp,tcp"],
"description": "Protocol of the port (one of ['tcp', 'udp'] or 'udp,tcp' for both). Defaults to 'tcp'."
},
"servicePort": {
"type": "integer",
"description": "Is a helper port intended for doing service discovery using a well-known port per service. The assigned servicePort value is not used/interpreted by Marathon itself but supposed to used by load balancer infrastructure. See Service Discovery Load Balancing doc page. The servicePort parameter is optional and defaults to 0. Like hostPort, If the value is 0, a random port will be assigned. If a servicePort value is assigned by Marathon then Marathon guarantees that its value is unique across the cluster. The values for random service ports are in the range [local_port_min, local_port_max] where local_port_min and local_port_max are command line options with default values of 10000 and 20000, respectively.",
"maximum": 65535,
"minimum": 0
}
}
}
},
"privileged": {
"type": "boolean",
"description": "Run this docker image in privileged mode."
}
},
"required": [
"image"
],
"type": "object"
},
"appc": {
"additionalProperties": false,
"properties": {
"image": {
"type": "string",
"minLength": 1,
"description": "The name of the AppC image to use."
},
"id": {
"type": "string",
"minLength": 7,
"description": "An image ID is a string of the format 'hash-value', where 'hash' is the hash algorithm used and 'value' is the hex-encoded digest. Currently the only permitted hash algorithm is sha512."
},
"labels": {
"type": "object",
"description": "Optional labels. Suggested labels: 'version', 'os', and 'arch'.",
"additionalProperties": {
"type": "string"
}
},
"forcePullImage": {
"type": "boolean",
"description": "The container will be pulled, regardless if it is already available on the local system."
}
},
"required": [ "image" ],
"type": "object"
},
"type": {
"type": "string",
"description": "Container engine type. Supported engine types at the moment are DOCKER and MESOS.",
"enum": ["MESOS", "DOCKER"]
},
"volumes": {
"items": {
"additionalProperties": false,
"properties": {
"containerPath": {
"type": "string",
"description": "The path of the volume in the container",
"minLength": 1
},
"hostPath": {
"type": "string",
"description": "The path of the volume on the host",
"minLength": 1
},
"persistent": {
"additionalProperties": false,
"properties": {
"size": {
"type": "integer",
"description": "The size of the persistent volume in MiB",
"minimum": 0
}
},
"type": "object"
},
"external": {
"additionalProperties": false,
"properties": {
"size": {
"type": "integer",
"description": "The size of the external volume in MiB",
"minimum": 0
},
"name": {
"type": "string",
"description": "The name of the volume"
},
"provider": {
"type": "string",
"description": "The name of the volume provider"
},
"options": {
"type": "object",
"description": "Provider-specific volume configuration options"
}
},
"type": "object"
},
"mode": {
"type": "string",
"description": "Possible values are RO for ReadOnly and RW for Read/Write",
"enum": ["RO", "RW"]
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"cpus": {
"type": "number",
"description": "The number of CPU shares this application needs per instance. This number does not have to be integer, but can be a fraction.",
"minimum": 0
},
"dependencies": {
"type": "array",
"description": "A list of services upon which this application depends. An order is derived from the dependencies for performing start/stop and upgrade of the application. For example, an application /a relies on the services /b which itself relies on /c. To start all 3 applications, first /c is started than /b than /a.",
"items": {
"$ref": "#/definitions/pathType"
}
},
"disk": {
"type": "number",
"description": "How much disk space in MB is needed for this application. This number does not have to be an integer, but can be a fraction.",
"minimum": 0
},
"env": {
"patternProperties": {
".*": {
"oneOf": [
{ "type": "string" },
{
"type": "object",
"description": "An environment variable set to a secret.",
"properties": {
"secret": {
"type": "string",
"description": "The key of the secret to be used as a value.",
"minLength": 1
}
},
"required": [ "secret" ],
"additionalProperties": false
}
]
}
},
"type": "object"
},
"executor": {
"type": "string",
"description": "The executor to use to launch this application. Different executors are available. The simplest one (and the default if none is given) is //cmd, which takes the cmd and executes that on the shell level.",
"pattern": "^(|\\/\\/cmd|\\/?[^\\/]+(\\/[^\\/]+)*)$"
},
"fetch": {
"type": "array",
"description": "Provided URIs are passed to Mesos fetcher module and resolved in runtime.",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"uri": {
"type": "string",
"description": "URI to be fetched by Mesos fetcher module"
},
"executable": {
"type": "boolean",
"description": "Set fetched artifact as executable"
},
"extract": {
"type": "boolean",
"description": "Extract fetched artifact if supported by Mesos fetcher module"
},
"cache": {
"type": "boolean",
"description": "Cache fetched artifact if supported by Mesos fetcher module"
},
"outputFile": {
"type": "string",
"description": "Rename fetched artifact with the given name"
}
},
"required": [ "uri" ]
}
},
"healthChecks": {
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"command": {
"type": "object",
"items": {
"additionalProperties": false,
"properties": {
"value": {
"type": "string",
"description": "The health check command to execute."
}
}
}
},
"gracePeriodSeconds": {
"type": "integer",
"description": "Health check failures are ignored within this number of seconds of the task being started or until the task becomes healthy for the first time.",
"minimum": 0
},
"ignoreHttp1xx": {
"type": "boolean",
"description": "Ignore HTTP 1xx responses."
},
"intervalSeconds": {
"type": "integer",
"description": "Number of seconds to wait between health checks.",
"minimum": 0
},
"maxConsecutiveFailures": {
"type": "integer",
"description": "Number of consecutive health check failures after which the unhealthy task should be killed.",
"minimum": 0
},
"path": {
"type": "string",
"description": "Path to endpoint exposed by the task that will provide health status. Example: /path/to/health. Note: only used if protocol == HTTP[S]."
},
"port": {
"type": "integer",
"description": "The specific port to connect to. In case of dynamic ports, see portIndex.",
"maximum": 65535,
"minimum": 0
},
"portIndex": {
"type": "integer",
"description": "Index in this app's ports array to be used for health requests. An index is used so the app can use random ports, like [0, 0, 0] for example, and tasks could be started with port environment variables like $PORT1.",
"minimum": 0
},
"protocol": {
"type": "string",
"description": "Protocol of the requests to be performed. One of HTTP, HTTPS, TCP or COMMAND.",
"enum": ["HTTP", "HTTPS", "TCP", "COMMAND"]
},
"timeoutSeconds": {
"type": "integer",
"description": "Number of seconds after which a health check is considered a failure regardless of the response.",
"minimum": 0
}
}
},
"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": {
"type": "integer",
"description": "The number of instances of this application to start. Please note: this number can be changed any time as needed to scale the application.",
"minimum": 0
},
"labels": {
"type": "object",
"description": "Attaching metadata to apps can be useful to expose additional information to other services, so we added the ability to place labels on apps (for example, you could label apps staging and production to mark services by their position in the pipeline).",
"additionalProperties": {
"type": "string"
}
},
"maxLaunchDelaySeconds": {
"type": "integer",
"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
},
"mem": {
"type": "number",
"description": "The amount of memory in MB that is needed for the application per instance.",
"minimum": 0
},
"gpus": {
"type": "integer",
"description": "The amount of GPU cores that is needed for the application per instance.",
"minimum": 0
},
"ipAddress": {
"type": "object",
"description": "If an application definition includes the 'ipAddress' field, then Marathon will request a per-task IP from Mesos. A separate ports/portMappings configuration is then disallowed.",
"properties": {
"discovery": {
"type": "object",
"description": "Information useful for service discovery.",
"properties": {
"ports": {
"type": "array",
"description": "Array of objects describing the ports exposed by each task.",
"items": {
"type": "object",
"description": "Port",
"properties": {
"number": {
"maximum": 65535,
"minimum": 0,
"type": "integer",
"description": "The port number."
},
"name": {
"type": "string",
"description": "Name of the port.",
"pattern": "^[a-z][a-z0-9-]*$"
},
"protocol": {
"enum": ["tcp", "udp"],
"description": "Protocol of the port (one of ['tcp', 'udp'])."
}
}
}
}
}
},
"groups": {
"type": "array",
"description": "Array of network groups. One IP address can belong to zero or more network groups. The idea is that containers can only reach containers with which they share at least one network group.",
"items": {
"type": "string",
"description": "The name of the network group."
}
},
"labels": {
"type": "object",
"description": "Key value pair for meta data on that network interface.",
"properties": {},
"additionalProperties": true
},
"networkName": {
"type": "string",
"description": "If present, declares the name of the network that the container should join. In practice it is up to the IPAM to decide how to interpret this field."
}
}
},
"ports": {
"type": "array",
"description": "An array of required port resources on the agent host. The number of items in the array determines how many dynamic ports are allocated for every task. For every port that is zero, a globally unique (cluster-wide) port is assigned and provided as part of the app definition to be used in load balancing definitions.",
"items": {
"maximum": 65535,
"minimum": 0,
"type": "integer"
}
},
"portDefinitions": {
"type": "array",
"description": "An array of required port resources on the agent host. The number of items in the array determines how many dynamic ports are allocated for every task. For every port definition with port number zero, a globally unique (cluster-wide) service port is assigned and provided as part of the app definition to be used in load balancing definitions.",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"port": {
"type": "integer",
"description": "if requirePorts is set to true, then this port number will be used on the agent host Otherwise if the requirePorts is set to false and this port number is not zero, then it will be used as a service port and a dynamic port will be used on the agent host. If it is set to zero, a dynamic port will be used on the host and a unique service port will be assigned by Marathon.",
"maximum": 65535,
"minimum": 0
},
"labels": {
"type": "object",
"description": "This can be used to add metadata to be interpreted by external applications such as firewalls.",
"additionalProperties": {
"type": "string"
}
},
"name": {
"type": "string",
"description": "Name of the service hosted on this port. If provided, it must be unique over all port definitions.",
"pattern": "^[a-z][a-z0-9-]*$"
},
"protocol": {
"type": "string",
"enum": ["tcp", "udp"],
"description": "Protocol of the port (one of ['tcp', 'udp']). Defaults to 'tcp'."
}
}
}
},
"readinessChecks": {
"items": {
"type": "object",
"additionalProperties": false,
"description": "Query these readiness checks to determine if a task is ready to serve requests.",
"properties": {
"name": {
"type": "string",
"description": "The name used to identify this readiness check."
},
"protocol": {
"type": "string",
"description": "Protocol of the requests to be performed. One of HTTP, HTTPS.",
"enum": ["HTTP", "HTTPS"]
},
"path": {
"type": "string",
"description": "Path to endpoint exposed by the task that will provide readiness status. Example: /path/to/health."
},
"portName": {
"type": "string",
"description": "Name of the port to query as described in the portDefinitions. Example: http-api."
},
"intervalSeconds": {
"type": "integer",
"description": "Number of seconds to wait between readiness checks. Defaults to 30 seconds",
"minimum": 0
},
"timeoutSeconds": {
"type": "integer",
"description": "Number of seconds after which a health check is considered a failure regardless of the response. Must be smaller than intervalSeconds. Defaults to 10 seconds.",
"minimum": 0
},
"httpStatusCodesForReady": {
"items": {
"type": "integer",
"minimum": 100,
"maximum": 999
},
"description": "The HTTP(s) status code to treat as 'ready'.",
"type": "array"
},
"preserveLastResponse": {
"type": "boolean",
"description": "If and only if true, preserve the last readiness check responses and expose them in the API as part of a deployment.."
}
}
},
"type": "array"
},
"residency": {
"type": "object",
"description": "When using local persistent volumes that pin tasks onto agents, these values define how Marathon handles terminal states of these tasks.",
"properties": {
"relaunchEscalationTimeoutSeconds": {
"type": "integer",
"description": "When a task using persistent local volumes cannot be restarted on the agent it's been pinned to, Marathon will try to launch this task on another node after this timeout. Defaults to 3600 (one hour).",
"minimum": 0,
"additionalProperties": false
},
"taskLostBehavior": {
"type": "string",
"description": "When Marathon receives a TASK_LOST status update indicating that the agent running the task is gone, this property defines whether Marathon will launch the task on another node or not. Defaults to WAIT_FOREVER",
"enum": ["WAIT_FOREVER", "RELAUNCH_AFTER_TIMEOUT"],
"additionalProperties": false
}
},
"additionalProperties": false
},
"requirePorts": {
"type": "boolean",
"description": "Normally, the host ports of your tasks are automatically assigned. This corresponds to the requirePorts value false which is the default. If you need more control and want to specify your host ports in advance, you can set requirePorts to true. This way the ports you have specified are used as host ports. That also means that Marathon can schedule the associated tasks only on hosts that have the specified ports available."
},
"secrets": {
"type": "object",
"description": "A map with named secret declarations. The key is used to reference the values from other places in the app definition.",
"patternProperties": {
".*": {
"type": "object",
"description": "A secret declaration.",
"properties": {
"source": {
"type": "string",
"description": "The source of the secret's value. The format depends on the secret store used by Mesos.",
"minLength": 1
}
},
"required": [ "source" ],
"additionalProperties": false
}
}
},
"storeUrls": {
"type": "array",
"description": "URL's that have to be resolved and put into the artifact store, before the task will be started.",
"items": {
"type": "string",
"minLength": 1
}
},
"taskKillGracePeriodSeconds": {
"type": "integer",
"description": "Configures the number of seconds between escalating from SIGTERM to SIGKILL when signalling tasks to terminate. Using this grace period, tasks should perform orderly shut down immediately upon receiving SIGTERM.",
"minimum": 0
},
"upgradeStrategy": {
"type": "object",
"description": "During an upgrade all instances of an application get replaced by a new version. The upgradeStrategy controls how Marathon stops old versions and launches new versions.",
"additionalProperties": false,
"properties": {
"maximumOverCapacity": {
"type": "number",
"description": "A number between 0 and 1 which is multiplied with the instance count. This is the maximum number of additional instances launched at any point of time during the upgrade process.",
"maximum": 1.0,
"minimum": 0.0
},
"minimumHealthCapacity": {
"type": "number",
"description": "A number between 0 and 1 that is multiplied with the instance count. This is the minimum number of healthy nodes that do not sacrifice overall application purpose. Marathon will make sure, during the upgrade process, that at any point of time this number of healthy instances are up.",
"maximum": 1.0,
"minimum": 0.0
}
}
},
"uris": {
"type": "array",
"description": "URIs defined here are resolved, before the application gets started. If the application has external dependencies, they should be defined here.",
"items": {
"type": "string",
"minLength": 1
}
},
"user": {
"type": "string",
"description": "The user to use to run the tasks on the agent."
},
"version": {
"type": "string",
"description": "The version of this definition.",
"format": "date-time"
},
"versionInfo": {
"type": "object",
"description": "Detailed version information.",
"additionalProperties": false,
"properties": {
"lastScalingAt": {
"type": "string",
"description": "Contains the time stamp of the last change to this app which was not simply a scaling or a restarting configuration.",
"format": "date-time"
},
"lastConfigChangeAt": {
"type": "string",
"description": "Contains the time stamp of the last change including changes like scaling or restarting the app. Since our versions are time based, this is currently equal to version.",
"format": "date-time"
}
}
}
},
"required": [
"id"
],
"type": "object"
}
Example:
{
"id": "/foo",
"instances": 2,
"cmd": "sleep 1000",
"cpus": 0.1,
"disk": 0,
"mem": 16,
"acceptedResourceRoles": [
"mesos_role"
],
"args": [
"sleep",
"100"
],
"backoffFactor": 1.15,
"backoffSeconds": 1,
"constraints": [
[
"hostname",
"LIKE",
"srv2.*"
]
],
"container": {
"docker": {
"forcePullImage": false,
"image": "mesosphere:marathon/latest",
"network": "BRIDGE",
"parameters": [
{
"key": "name",
"value": "kdc"
}
],
"portMappings": [
{
"containerPort": 80,
"hostPort": 0,
"protocol": "tcp",
"servicePort": 10019,
"name": "http",
"labels": { "vip": "192.168.0.1:80" }
}
],
"privileged": false
},
"type": "DOCKER",
"volumes": [
{
"containerPath": "/docker_storage",
"hostPath": "/hdd/tools/docker/registry",
"mode": "RW"
}
]
},
"dependencies": [
"/prod/group"
],
"env": {
"XPS1": "Test",
"XPS2": "Rest",
"PASSWORD": { "secret": "/db/password" }
},
"executor": "",
"healthChecks": [
{
"gracePeriodSeconds": 300,
"ignoreHttp1xx": false,
"intervalSeconds": 20,
"maxConsecutiveFailures": 3,
"path": "/",
"portIndex": 0,
"protocol": "HTTP",
"timeoutSeconds": 20
}
],
"readinessChecks": [
{
"name": "myReadyCheck",
"protocol": "HTTP",
"path": "/v1/plan",
"portName": "http",
"intervalSeconds": 10,
"timeoutSeconds": 3,
"httpStatusCodesForReady": [ 200 ],
"preserveLastResponse": true
}
],
"labels": {
"owner": "zeus",
"note": "Away from olympus"
},
"maxLaunchDelaySeconds": 3600,
"ipAddress": {
"discovery": {
"ports": [
{
"number": 8080,
"name": "rest_endpoint",
"protocol": "tcp"
}
]
},
"groups": [
"dev"
],
"labels": {
"environment": "dev"
}
},
"portDefinitions": [
{
"port": 0,
"protocol": "tcp",
"name": "http",
"labels": { "vip": "192.168.0.1:80" }
}
],
"requirePorts": false,
"upgradeStrategy": {
"maximumOverCapacity": 1,
"minimumHealthCapacity": 1
},
"fetch": [
{ "uri": "https://foo.com/setup.py" },
{ "uri": "https://foo.com/archive.zip", "executable": false, "extract": true, "cache": true, "outputFile": "newname.zip" }
],
"user": "root",
"secrets": {
"secret1": { "source": "/db/password" },
"secret3": { "source": "/foo2" }
},
"taskKillGracePeriodSeconds": 30
}
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, it means that 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": [
{
"path": "/upgradeStrategy/minimumHealthCapacity",
"errors": [
"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 - default: false)
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, it means that 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 - default: false)
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, it means that 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 - default: false)
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 - default: false)
If
scale=trueis specified, then the application is scaled down by the number of killed tasks. Only possible ifwipe=falseor not specified. - wipe: (boolean - default: false)
If
wipe=trueis specified and the app uses local persistent volumes, associated dynamic reservations will be unreserved, and persistent volumes will be destroyed. Only possible ifscale=falseor not specified.
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 - default: false)
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 - default: false)
If
scale=trueis specified, then the application is scaled down by the number of killed tasks. Only possible ifwipe=falseor not specified. - wipe: (boolean - default: false)
If
wipe=trueis specified and the app uses local persistent volumes, associated dynamic reservations will be unreserved, and persistent volumes will be destroyed. Only possible ifscale=falseor not specified.
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": "/foo",
"instances": 2,
"cmd": "sleep 1000",
"cpus": 0.1,
"disk": 0,
"mem": 16,
"acceptedResourceRoles": [
"mesos_role"
],
"args": [
"sleep",
"100"
],
"backoffFactor": 1.15,
"backoffSeconds": 1,
"constraints": [
[
"hostname",
"LIKE",
"srv2.*"
]
],
"container": {
"docker": {
"forcePullImage": false,
"image": "mesosphere:marathon/latest",
"network": "BRIDGE",
"parameters": [
{
"key": "name",
"value": "kdc"
}
],
"portMappings": [
{
"containerPort": 80,
"hostPort": 0,
"protocol": "tcp",
"servicePort": 10019,
"name": "http",
"labels": { "vip": "192.168.0.1:80" }
}
],
"privileged": false
},
"type": "DOCKER",
"volumes": [
{
"containerPath": "/docker_storage",
"hostPath": "/hdd/tools/docker/registry",
"mode": "RW"
}
]
},
"dependencies": [
"/prod/group"
],
"env": {
"XPS1": "Test",
"XPS2": "Rest",
"PASSWORD": { "secret": "/db/password" }
},
"executor": "",
"healthChecks": [
{
"gracePeriodSeconds": 300,
"ignoreHttp1xx": false,
"intervalSeconds": 20,
"maxConsecutiveFailures": 3,
"path": "/",
"portIndex": 0,
"protocol": "HTTP",
"timeoutSeconds": 20
}
],
"readinessChecks": [
{
"name": "myReadyCheck",
"protocol": "HTTP",
"path": "/v1/plan",
"portName": "http",
"intervalSeconds": 10,
"timeoutSeconds": 3,
"httpStatusCodesForReady": [ 200 ],
"preserveLastResponse": true
}
],
"labels": {
"owner": "zeus",
"note": "Away from olympus"
},
"maxLaunchDelaySeconds": 3600,
"ipAddress": {
"discovery": {
"ports": [
{
"number": 8080,
"name": "rest_endpoint",
"protocol": "tcp"
}
]
},
"groups": [
"dev"
],
"labels": {
"environment": "dev"
}
},
"portDefinitions": [
{
"port": 0,
"protocol": "tcp",
"name": "http",
"labels": { "vip": "192.168.0.1:80" }
}
],
"requirePorts": false,
"upgradeStrategy": {
"maximumOverCapacity": 1,
"minimumHealthCapacity": 1
},
"fetch": [
{ "uri": "https://foo.com/setup.py" },
{ "uri": "https://foo.com/archive.zip", "executable": false, "extract": true, "cache": true, "outputFile": "newname.zip" }
],
"user": "root",
"secrets": {
"secret1": { "source": "/db/password" },
"secret3": { "source": "/foo2" }
},
"taskKillGracePeriodSeconds": 30
}
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
StartApplicationstarts an application, which is currently not running.StopApplicationstops an already running application.ScaleApplicationchanges the number of instances of an application and allows to kill specified instances while scaling.RestartApplicationupgrades an already deployed application with a new version.ResolveArtifactsResolve 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
StartApplicationstarts an application, which is currently not running.StopApplicationstops an already running application.ScaleApplicationchanges the number of instances of an application and allows to kill specified instances while scaling.RestartApplicationupgrades an already deployed application with a new version.ResolveArtifactsResolve 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": [
{
"actions": [
{
"action": "StartApplication",
"app": "/foo"
}
]
},
{
"actions": [
{
"action": "ScaleApplication",
"app": "/foo"
}
]
}
],
"currentActions": [
{
"action": "ScaleApplication",
"app": "/foo",
"readinessCheckResults": {
"/foo": [
{
"taskId": "foo.c9de6033",
"lastResponse": {
"body": "{}",
"contentType": "application/json",
"status": 500
},
"name": "myReadyCheck",
"ready": false
}
]
}
}
],
"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 - default: false)
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, it means that 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
versionfield in the group definition. This will rollback the group to that given version - Provide only the
scaleByfield 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.
Query Parameters
- embed: (one of group.groups, group.apps, group.apps.tasks, group.apps.count, group.apps.deployments, group.apps.lastTaskFailure, group.apps.failures, group.apps.taskStats - repeat: true)
Embeds nested resources that match the supplied path. You can specify this parameter multiple times with different values. Unknown embed parameters are ignored. If you omit this parameter, it defaults to
group.groups,group.appsgroup.groupsembed all child groups of each groupgroup.appsembed all apps of each groupgroup.apps.tasksembed all tasks of each applicationgroup.apps.countsembed all task counts (tasksStaged, tasksRunning, tasksHealthy, tasksUnhealthy)group.apps.deploymentsembed all deployment identifier, if the related app currently is in deployment.group.apps.readinessembed all readiness check resultsgroup.apps.lastTaskFailureembeds the lastTaskFailure for the application if there is one.group.apps.taskStatsexposes task statistics in the JSON.
Example:
group.apps
HTTP status code 200
The group with all transitive dependencies.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/schema#",
"id": "https://raw.githubusercontent.com/mesosphere/marathon/master/docs/docs/rest-api/public/api/v2/schema/Group.json",
"additionalProperties": false,
"definitions": {
"pathType": {
"type": "string",
"pattern": "^(\\/?((\\.{2})|([a-z0-9][a-z0-9\\-.]*[a-z0-9]+)|([a-z0-9]*))($|\\/))+$",
"minLength": 1
}
},
"type": "object",
"properties": {
"id": {
"type": "string",
"$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."
},
"apps": {
"type": "array",
"description": "The list of AppDefinitions in this group. See AppDefinition.json for the schema.",
"items": {
"$ref": "./AppDefinition.json"
}
},
"groups": {
"type": "array",
"description": "Groups can build a tree. Each group can contain sub-groups. The sub-groups are defined here.",
"items": {
"$ref": "#"
}
},
"dependencies": {
"type": "array",
"description": "A list of services upon which this application depends. An order is derived from the dependencies for performing start/stop and upgrade of the application. For example, an application /a relies on the services /b which itself relies on /c. To start all 3 applications, first /c is started than /b than /a.",
"items": {
"$ref": "#/definitions/pathType"
}
},
"version": {
"type": "string",
"description": "The version of this definition.",
"format": "date-time"
}
},
"required": [
"id"
]
}
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
versionfield in the group definition. This will rollback the group to that given version - Provide only the
scaleByfield 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 - default: false)
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#",
"id": "https://raw.githubusercontent.com/mesosphere/marathon/master/docs/docs/rest-api/public/api/v2/schema/Group.json",
"additionalProperties": false,
"definitions": {
"pathType": {
"type": "string",
"pattern": "^(\\/?((\\.{2})|([a-z0-9][a-z0-9\\-.]*[a-z0-9]+)|([a-z0-9]*))($|\\/))+$",
"minLength": 1
}
},
"type": "object",
"properties": {
"id": {
"type": "string",
"$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."
},
"apps": {
"type": "array",
"description": "The list of AppDefinitions in this group. See AppDefinition.json for the schema.",
"items": {
"$ref": "./AppDefinition.json"
}
},
"groups": {
"type": "array",
"description": "Groups can build a tree. Each group can contain sub-groups. The sub-groups are defined here.",
"items": {
"$ref": "#"
}
},
"dependencies": {
"type": "array",
"description": "A list of services upon which this application depends. An order is derived from the dependencies for performing start/stop and upgrade of the application. For example, an application /a relies on the services /b which itself relies on /c. To start all 3 applications, first /c is started than /b than /a.",
"items": {
"$ref": "#/definitions/pathType"
}
},
"version": {
"type": "string",
"description": "The version of this definition.",
"format": "date-time"
}
},
"required": [
"id"
]
}
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, it means that 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": [
{
"path":"/apps(0)/id",
"errors": [
"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 - default: false)
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#",
"id": "https://raw.githubusercontent.com/mesosphere/marathon/master/docs/docs/rest-api/public/api/v2/schema/Group.json",
"additionalProperties": false,
"definitions": {
"pathType": {
"type": "string",
"pattern": "^(\\/?((\\.{2})|([a-z0-9][a-z0-9\\-.]*[a-z0-9]+)|([a-z0-9]*))($|\\/))+$",
"minLength": 1
}
},
"type": "object",
"properties": {
"id": {
"type": "string",
"$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."
},
"apps": {
"type": "array",
"description": "The list of AppDefinitions in this group. See AppDefinition.json for the schema.",
"items": {
"$ref": "./AppDefinition.json"
}
},
"groups": {
"type": "array",
"description": "Groups can build a tree. Each group can contain sub-groups. The sub-groups are defined here.",
"items": {
"$ref": "#"
}
},
"dependencies": {
"type": "array",
"description": "A list of services upon which this application depends. An order is derived from the dependencies for performing start/stop and upgrade of the application. For example, an application /a relies on the services /b which itself relies on /c. To start all 3 applications, first /c is started than /b than /a.",
"items": {
"$ref": "#/definitions/pathType"
}
},
"version": {
"type": "string",
"description": "The version of this definition.",
"format": "date-time"
}
},
"required": [
"id"
]
}
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, it means that 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": [
{
"path":"/apps(0)/id",
"errors": [
"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 - default: false)
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, it means that 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
versionfield in the group definition. This will rollback the group to that given version - Provide only the
scaleByfield 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)
Query Parameters
- embed: (one of group.groups, group.apps, group.apps.tasks, group.apps.count, group.apps.deployments, group.apps.lastTaskFailure, group.apps.failures, group.apps.taskStats - repeat: true)
Embeds nested resources that match the supplied path. You can specify this parameter multiple times with different values. Unknown embed parameters are ignored. If you omit this parameter, it defaults to
group.groups,group.appsgroup.groupsembed all child groups of each groupgroup.appsembed all apps of each groupgroup.apps.tasksembed all tasks of each applicationgroup.apps.countsembed all task counts (tasksStaged, tasksRunning, tasksHealthy, tasksUnhealthy)group.apps.deploymentsembed all deployment identifier, if the related app currently is in deployment.group.apps.readinessembed all readiness check resultsgroup.apps.lastTaskFailureembeds the lastTaskFailure for the application if there is one.group.apps.taskStatsexposes task statistics in the JSON.
Example:
group.apps
HTTP status code 200
The group with all transitive dependencies.
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/schema#",
"id": "https://raw.githubusercontent.com/mesosphere/marathon/master/docs/docs/rest-api/public/api/v2/schema/Group.json",
"additionalProperties": false,
"definitions": {
"pathType": {
"type": "string",
"pattern": "^(\\/?((\\.{2})|([a-z0-9][a-z0-9\\-.]*[a-z0-9]+)|([a-z0-9]*))($|\\/))+$",
"minLength": 1
}
},
"type": "object",
"properties": {
"id": {
"type": "string",
"$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."
},
"apps": {
"type": "array",
"description": "The list of AppDefinitions in this group. See AppDefinition.json for the schema.",
"items": {
"$ref": "./AppDefinition.json"
}
},
"groups": {
"type": "array",
"description": "Groups can build a tree. Each group can contain sub-groups. The sub-groups are defined here.",
"items": {
"$ref": "#"
}
},
"dependencies": {
"type": "array",
"description": "A list of services upon which this application depends. An order is derived from the dependencies for performing start/stop and upgrade of the application. For example, an application /a relies on the services /b which itself relies on /c. To start all 3 applications, first /c is started than /b than /a.",
"items": {
"$ref": "#/definitions/pathType"
}
},
"version": {
"type": "string",
"description": "The version of this definition.",
"format": "date-time"
}
},
"required": [
"id"
]
}
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
versionfield in the group definition. This will rollback the group to that given version - Provide only the
scaleByfield 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 - default: false)
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#",
"id": "https://raw.githubusercontent.com/mesosphere/marathon/master/docs/docs/rest-api/public/api/v2/schema/Group.json",
"additionalProperties": false,
"definitions": {
"pathType": {
"type": "string",
"pattern": "^(\\/?((\\.{2})|([a-z0-9][a-z0-9\\-.]*[a-z0-9]+)|([a-z0-9]*))($|\\/))+$",
"minLength": 1
}
},
"type": "object",
"properties": {
"id": {
"type": "string",
"$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."
},
"apps": {
"type": "array",
"description": "The list of AppDefinitions in this group. See AppDefinition.json for the schema.",
"items": {
"$ref": "./AppDefinition.json"
}
},
"groups": {
"type": "array",
"description": "Groups can build a tree. Each group can contain sub-groups. The sub-groups are defined here.",
"items": {
"$ref": "#"
}
},
"dependencies": {
"type": "array",
"description": "A list of services upon which this application depends. An order is derived from the dependencies for performing start/stop and upgrade of the application. For example, an application /a relies on the services /b which itself relies on /c. To start all 3 applications, first /c is started than /b than /a.",
"items": {
"$ref": "#/definitions/pathType"
}
},
"version": {
"type": "string",
"description": "The version of this definition.",
"format": "date-time"
}
},
"required": [
"id"
]
}
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, it means that 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": [
{
"path":"/apps(0)/id",
"errors": [
"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 - default: false)
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#",
"id": "https://raw.githubusercontent.com/mesosphere/marathon/master/docs/docs/rest-api/public/api/v2/schema/Group.json",
"additionalProperties": false,
"definitions": {
"pathType": {
"type": "string",
"pattern": "^(\\/?((\\.{2})|([a-z0-9][a-z0-9\\-.]*[a-z0-9]+)|([a-z0-9]*))($|\\/))+$",
"minLength": 1
}
},
"type": "object",
"properties": {
"id": {
"type": "string",
"$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."
},
"apps": {
"type": "array",
"description": "The list of AppDefinitions in this group. See AppDefinition.json for the schema.",
"items": {
"$ref": "./AppDefinition.json"
}
},
"groups": {
"type": "array",
"description": "Groups can build a tree. Each group can contain sub-groups. The sub-groups are defined here.",
"items": {
"$ref": "#"
}
},
"dependencies": {
"type": "array",
"description": "A list of services upon which this application depends. An order is derived from the dependencies for performing start/stop and upgrade of the application. For example, an application /a relies on the services /b which itself relies on /c. To start all 3 applications, first /c is started than /b than /a.",
"items": {
"$ref": "#/definitions/pathType"
}
},
"version": {
"type": "string",
"description": "The version of this definition.",
"format": "date-time"
}
},
"required": [
"id"
]
}
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, it means that 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": [
{
"path":"/apps(0)/id",
"errors": [
"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 - default: false)
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, it means that 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 running, staging - 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 - default: false)
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 - default: false)
If
scale=trueis specified, then the related application is scaled down by the number of killed tasks. Only possible ifwipe=falseor not specified. - wipe: (boolean - default: false)
If
wipe=trueis specified and the app uses local persistent volumes, associated dynamic reservations will be unreserved, and persistent volumes will be destroyed. Only possible ifscale=falseor not specified.
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/plugins
Returns the list of all loaded plugins
get /v2/plugins
Returns the list of all loaded plugins
HTTP status code 200
The list of all loaded plugins
Body
Type: application/json
Example:
{
"plugins": [
{
"id": "webjar",
"implementation": "mesosphere.marathon.example.plugin.http.WebJarHandler",
"info": {
"version": "1.2.3",
"array": [ 1, 2, 3, 4, 5, 6 ],
"test": true
},
"plugin": "mesosphere.marathon.plugin.http.HttpRequestHandler",
"tags": [ "webjar", "test" ]
}
]
}
Get request is handled by the plugin.
Put request is handled by the plugin.
Post request is handled by the plugin.
Delete request is handled by the plugin.
get /v2/plugins/{plugin_id}/{path}
Get request is handled by the plugin.
URI Parameters
- plugin_id: required (string)
- path: required (string)
put /v2/plugins/{plugin_id}/{path}
Put request is handled by the plugin.
URI Parameters
- plugin_id: required (string)
- path: required (string)
post /v2/plugins/{plugin_id}/{path}
Post request is handled by the plugin.
URI Parameters
- plugin_id: required (string)
- path: required (string)
delete /v2/plugins/{plugin_id}/{path}
Delete request is handled by the plugin.
URI Parameters
- plugin_id: required (string)
- path: required (string)
/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"
}