v1

latestOpenAPI 3.0.02026-07-1410578280.2 KB
Service

Update a service

post/services/{id}/update

Path parameters

idstring required

ID or name of service.

Query parameters

versioninteger required

The version number of the service object being updated. This is required to avoid conflicting writes.

registryAuthFromstring

If the X-Registry-Auth header is not specified, this parameter indicates where to find registry authorization credentials. The valid values are spec and previous-spec.

rollbackstring

Set to this parameter to previous to cause a server-side rollback to the previous service spec. The supplied spec will be ignored in this case.

Headers

X-Registry-Authstring

A base64-encoded auth configuration for pulling from private registries. See the authentication section for details.

Request body

Labelsobject

User-defined key/value metadata.

Namestring

Name of the service.

Example request

{
  "EndpointSpec": {
    "Mode": "vip"
  },
  "Mode": {
    "Replicated": {
      "Replicas": 1
    }
  },
  "Name": "top",
  "RollbackConfig": {
    "Delay": 1000000000,
    "FailureAction": "pause",
    "MaxFailureRatio": 0.15,
    "Monitor": 15000000000,
    "Parallelism": 1
  },
  "TaskTemplate": {
    "ContainerSpec": {
      "Args": [
        "top"
      ],
      "Image": "busybox"
    },
    "ForceUpdate": 0,
    "Placement": {},
    "Resources": {
      "Limits": {},
      "Reservations": {}
    },
    "RestartPolicy": {
      "Condition": "any",
      "MaxAttempts": 0
    }
  },
  "UpdateConfig": {
    "Delay": 1000000000,
    "FailureAction": "pause",
    "MaxFailureRatio": 0.15,
    "Monitor": 15000000000,
    "Parallelism": 2
  }
}

Response

no error

Warningsstring[]

Optional warning messages

Example response

{
  "Warning": "unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found"
}