Service
Update a service
post/services/{id}/update
Request
- Base URL/v1.49 (relative, and the document was published on a file host, not at the API’s origin)
- URL/v1.49/services/{id}/update
- Authnone declared
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. This version number should be the value as currently set on the service before the update. You can find the current version by calling GET /services/{id}
registryAuthFrom'spec' | 'previous-spec'
If the X-Registry-Auth header is not specified, this parameter indicates where to find registry authorization credentials.
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 base64url-encoded auth configuration for pulling from private registries.
Refer to the authentication section for details.
Request body
Example request
{
"Name": "top",
"TaskTemplate": {
"ContainerSpec": {
"Image": "busybox",
"Args": [
"top"
],
"OomScoreAdj": 0
},
"Resources": {
"Limits": {},
"Reservations": {}
},
"RestartPolicy": {
"Condition": "any",
"MaxAttempts": 0
},
"Placement": {},
"ForceUpdate": 0
},
"Mode": {
"Replicated": {
"Replicas": 1
}
},
"UpdateConfig": {
"Parallelism": 2,
"Delay": 1000000000,
"FailureAction": "pause",
"Monitor": 15000000000,
"MaxFailureRatio": 0.15
},
"RollbackConfig": {
"Parallelism": 1,
"Delay": 1000000000,
"FailureAction": "pause",
"Monitor": 15000000000,
"MaxFailureRatio": 0.15
},
"EndpointSpec": {
"Mode": "vip"
}
}Response
no error
Example response
{
"Warnings": [
"unable to pin image doesnotexist:latest to digest: image library/doesnotexist:latest not found"
]
}Changes
No recorded changes to this operation across all 4 revisions of this API.