DC/OS SDK API Reference

The DC/OS Stateful Service SDK
More information: https://github.com/mesosphere/dcos-commons/
Contact Info: https://dcos-community.slack.com/messages/data-services-dev/
Version: 0.0.1
BasePath:/v1
Apache License V2
https://github.com/mesosphere/dcos-commons/blob/master/LICENSE

Access

Methods

[ Jump to Models ]

Table of Contents

Artifacts

Configurations

Debug

Endpoints

Health

Metrics

Plans

Pod

State

Artifacts

Up
get /artifacts/template/{configurationId}/{podType}/{taskName}/{configurationName}
Produces the content of a configuration file with mustache templating for rendering and use at a task. (artifactsGet)

Path parameters

configurationId (required)
Path Parameter — The ID of the configuration to be retrieved from.
podType (required)
Path Parameter — The pod type for the task.
taskName (required)
Path Parameter — The task name.
configurationName (required)
Path Parameter — The name of the configuration template file.

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Content of the requested file with mustache templating.

400

Invalid request: configurationId couldn't be parsed as a UUID.

404

No file was found at that location.

Configurations

Up
get /configurations/{configurationId}
Produces the content of the requested configuration ID. (configurationsGet)

Path parameters

configurationId (required)
Path Parameter — The ID of the configuration.

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The content of the configuration.

400

Invalid request: configurationId couldn't be parsed as a UUID.

404

Requested configuration was not found.

500

Failed to retrieve configuration with requested ID.

Up
get /configurations
Produces an ID listing of all stored configurations. (configurationsList)

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

List of stored configurations.

500

Failed to fetch list of configuration ids.

Up
get /configurations/target
Produces the content of the current target configuration. (configurationsTargetGet)

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The content of the current target configuration.

404

No target configuration was found.

500

Failed to fetch target configuration.

Up
get /configurations/targetId
Produces the ID of the current target configuration. (configurationsTargetidGet)

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The ID of the current target configuration.

404

No target configuration ID was found.

500

Failed to fetch target configuration ID.

Debug

Up
get /debug/offers
Returns an HTML table of Mesos Offers that were recently evaluated by the Scheduler. Used for manual debugging by operators (debugOffers)

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

HTML table listing offer evaluation outcomes.

Endpoints

Up
get /endpoints/{name}
Returns connection information for the requested endpoint. (endpointsGet)

Path parameters

name (required)
Path Parameter — The name of the endpoint.

Query parameters

format (optional)
Query Parameter — The hostname format in the returned data, either unset for hostnames or 'native' for IPs.

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Connection information for the endpoint.

404

Requested endpoint not found.

500

Failed to retrieve connection information.

Up
get /endpoints
Returns connection information for all endpoints. (endpointsList)

Query parameters

format (optional)
Query Parameter — The hostname format in the returned data, either unset for hostnames or 'native' for IPs.

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Connection information for all endpoints.

500

Failed to retrieve connection information.

Health

Up
get /health
Health check endpoint to be used by Marathon to determine Scheduler health based on the status of the 'deploy' and/or 'recovery' Plans. (healthCheck)

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

All monitored Plans are complete.

202

One or more monitored plans are deploying.

203

One or more monitored plans are degraded (awaiting resources).

204

One or more monitored plans are deploying (awaiting resources).

205

One or more monitored plans are degraded (recovering).

207

One or more monitored plans are awaiting user input.

318

Scheduler is initializing.

320

One or more monitored backup plans is in-progress.

321

One or more monitored restore plans is in-progress.

500

Scheduler encountered an error creating the service.

503

Scheduler encountered an error with one or more monitored plans.

Metrics

Up
get /metrics
Returns a snapshot of the current scheduler metrics in JSON format. (metricsJson)

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The metrics snapshot has been returned.

Up
get /metrics/prometheus
Returns a snapshot of the current scheduler metrics in Prometheus format. (metricsPrometheus)

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The metrics snapshot has been returned.

Plans

Up
post /plans/{plan}/continue
Continues the execution of the plan. (plansContinue)

Path parameters

plan (required)
Path Parameter — The name of the plan.

Responses

200

Received cmd continue.

404

Plan not found.

Up
post /plans/{plan}/forceComplete
Force complete your plan. (plansForcecomplete)

Path parameters

plan (required)
Path Parameter — The name of the plan.

Query parameters

phase (required)
Query Parameter — The name or id of the phase.
step (required)
Query Parameter — The name or id of the step.

Responses

200

Received cmd forceComplete.

404

Plan not found.

Up
get /plans/{name}
Returns a full list of the Plan's contents (incl all Phases/Steps). (plansGet)

Path parameters

name (required)
Path Parameter — The name of the plan.

Responses

200

List of the plan's contents.

404

Plan not found.

417

Plan is in an error state.

Up
post /plans/{plan}/interrupt
Interrupts the execution of the specified plan. (plansInterrupt)

Path parameters

plan (required)
Path Parameter — The name of the plan.

Responses

200

Received cmd interrupt.

404

Plan not found.

Up
get /plans
Returns list of all configured plans. (plansList)

Responses

200

List of plans.

404

Plans not found.

Up
post /plans/{plan}/{phase}/continue
Continues the execution of the phase. (plansPhaseContinue)

Path parameters

plan (required)
Path Parameter — The name of the plan.

Query parameters

phase (optional)
Query Parameter — The name or id of the phase.

Responses

200

Received cmd continue.

404

Plan not found.

Up
post /plans/{plan}/{phase}/interrupt
Interrupts the execution of the specified phase. (plansPhaseInterrupt)

Path parameters

plan (required)
Path Parameter — The name of the plan.

Query parameters

phase (optional)
Query Parameter — The name or id of the phase.

Responses

200

Received cmd interrupt.

404

Plan not found.

Up
post /plans/{plan}/restart
Restarts the specified plan or step regardless of its current state. (plansRestart)

Path parameters

plan (required)
Path Parameter — The name of the plan.

Query parameters

phase (optional)
Query Parameter — The optional name or id of the phase.
step (optional)
Query Parameter — The optional name or id of the step.

Responses

200

Received cmd restart.

400

Only one of phase/step is specified. Either both or neither must be provided.

404

Plan not found.

Up
post /plans/{name}/start
Restarts or resumes the execution of the plan. If the plan is complete, it is restarted. If the plan is stopped, its progress is resumed. If the plan is already in progress this has no effect. (plansStart)

Path parameters

name (required)
Path Parameter — The name of the plan.

Responses

200

Received cmd: start

404

Plan not found.

Up
post /plans/{name}/stop
Stops and resets the execution of the plan. (plansStop)

Path parameters

name (required)
Path Parameter — The name of the plan.

Responses

200

Received cmd: stop

404

Plan not found.

Pod

Up
get /pod/{name}/info
Returns information about the specified pod. (podGet)

Path parameters

name (required)
Path Parameter — The name of the pod.

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Information about the pod.

404

Requested pod was not found.

500

Failed to fetch information for pod.

Up
get /pod
Produces a listing of the names of all pods. (podList)

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

List of pods.

500

Failed to fetch list of pod names.

Up
get /pod/status
Produces a summarized listing of all pod statuses. (podListStatus)

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

List of pod statuses.

500

Failed to fetch list of pod statuses.

Up
post /pod/{name}/replace
Restarts a pod and attempts to relaunch it on the next available cluster node. (podReplace)

Path parameters

name (required)
Path Parameter — The name of the pod.

Responses

200

Pod replaced.

404

Requested pod was not found.

409

Custom replace hook rejected pod replace.

500

Failed to replace pod.

Up
post /pod/{name}/restart
Restarts a pod and attempts to relaunch it on the same cluster node. (podRestart)

Path parameters

name (required)
Path Parameter — The name of the pod.

Responses

200

Pod restarted.

404

Requested pod was not found.

409

Custom restart hook rejected pod restart.

500

Failed to restart pod.

Up
get /pod/{name}/start
Restarts a pod's tasks in normal execution mode following a prior 'stop' request. (podStart)

Path parameters

name (required)
Path Parameter — The name of the pod.

Request body

tasks string (optional)
Body Parameter — List of specific tasks in the pod to be started, otherwise all tasks are started

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Pod started.

404

Requested pod was not found.

500

Failed to start pod.

Up
get /pod/{name}/status
Produces the status for the requested pod name. (podStatus)

Path parameters

name (required)
Path Parameter — The name of the pod.

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Status of the pod.

404

Requested pod was not found.

500

Failed to fetch requested status for pod.

Up
get /pod/{name}/stop
Restarts a pod's tasks in a stopped state, allowing the tasks to be debugged. They may be resumed with a 'start' request. (podStop)

Path parameters

name (required)
Path Parameter — The name of the pod.

Request body

tasks string (optional)
Body Parameter — List of specific tasks in the pod to be stopped, otherwise all tasks are stopped

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

Pod stopped.

404

Requested pod was not found.

500

Failed to stop pod.

State

Up
get /state/frameworkId
Produces the currently registered Mesos Framework ID. (stateFrameworkidGet)

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The current Framework ID.

404

No Framework ID was found.

500

Framework ID not available.

Up
get /state/properties/{key}
Produces the content of the requested property key. (statePropertiesGet)

Path parameters

key (required)
Path Parameter — The name of the property to be retrieved.

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The deserialized content of the property.

404

Requested property wasn't found.

409

No deserializer was provided by the service developer to deserialize custom properties.

500

Failed to fetch requested property.

Up
get /state/properties
Lists any custom property keys in persistent storage. (statePropertiesList)

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The list of custom property keys.

500

Unable to fetch list of properties.

Up
put /state/refresh
Refreshes the state cache. Should only be needed for debugging or if zk was manually edited while the scheduler is running. (stateRefreshCache)

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

The scheduler state cache has been cleared and updated with current zk content.

409

The scheduler isn't using a state cache so there's nothing to do.

500

Failed to retrieve state data from zk.

Up

Models

[ Jump to Methods ]

Table of Contents