View Source DockerEngineAPI.Api.Service (docker_engine_api v1.43.0)
API calls for all endpoints tagged Service
.
Summary
Functions
Create a service
Delete a service
Inspect a service
List services
Get service logs Get `stdout` and `stderr` logs from a service. See also `/containers/{id}/logs`. Note: This endpoint works only for services with the `local`, `json-file` or `journald` logging drivers.
Update a service
Functions
Create a service
Parameters
- connection (DockerEngineAPI.Connection): Connection to server
- body (object):
- opts (KeywordList): [optional] Optional parameters
- :x_registry_auth (String.t): A base64url-encoded auth configuration for pulling from private registries. Refer to the authentication section for details.
Returns
} on success {:error, info} on failure
Delete a service
Parameters
- connection (DockerEngineAPI.Connection): Connection to server
- id (String.t): ID or name of service.
- opts (KeywordList): [optional] Optional parameters
Returns
} on success {:error, info} on failure
Inspect a service
Parameters
- connection (DockerEngineAPI.Connection): Connection to server
- id (String.t): ID or name of service.
- opts (KeywordList): [optional] Optional parameters
- :insert_defaults (boolean()): Fill empty fields with default values.
Returns
} on success {:error, info} on failure
List services
Parameters
- connection (DockerEngineAPI.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
- :filters (String.t): A JSON encoded value of the filters (a `map[string][]string`) to process on the services list. Available filters: - `id=<service id>` - `label=<service label>` - `mode=["replicated"|"global"]` - `name=<service name>`
- :status (boolean()): Include service status, with count of running and desired tasks.
Returns
, ...]} on success {:error, info} on failure
Get service logs Get `stdout` and `stderr` logs from a service. See also `/containers/{id}/logs`. Note: This endpoint works only for services with the `local`, `json-file` or `journald` logging drivers.
Parameters
- connection (DockerEngineAPI.Connection): Connection to server
- id (String.t): ID or name of the service
- opts (KeywordList): [optional] Optional parameters
- :details (boolean()): Show service context and extra details provided to logs.
- :follow (boolean()): Keep connection after returning logs.
- :stdout (boolean()): Return logs from `stdout`
- :stderr (boolean()): Return logs from `stderr`
- :since (integer()): Only return logs since this time, as a UNIX timestamp
- :timestamps (boolean()): Add timestamps to every log line
- :tail (String.t): Only return this number of log lines from the end of the logs. Specify as an integer or `all` to output all log lines.
Returns
} on success {:error, info} on failure
Update a service
Parameters
- connection (DockerEngineAPI.Connection): Connection to server
- id (String.t): ID or name of service.
- body (object):
- version (integer()): 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}`
- opts (KeywordList): [optional] Optional parameters
- :registry_auth_from (String.t): If the `X-Registry-Auth` header is not specified, this parameter indicates where to find registry authorization credentials.
- :rollback (String.t): 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.
- :x_registry_auth (String.t): A base64url-encoded auth configuration for pulling from private registries. Refer to the authentication section for details.
Returns
} on success {:error, info} on failure