DockerEngineAPI.Api.Service (elixir_dea v1.45.7)
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
Link to this function
service_create(connection, body, opts \\ [])
@spec service_create( Tesla.Env.client(), DockerEngineAPI.Model.ServiceCreateRequest.t(), keyword() ) :: {:ok, DockerEngineAPI.Model.ServiceCreateResponse.t()} | {:ok, DockerEngineAPI.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Create a service
Parameters
connection
(DockerEngineAPI.Connection): Connection to serverbody
(ServiceCreateRequest):opts
(keyword): 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
{:ok, DockerEngineAPI.Model.ServiceCreateResponse.t}
on success{:error, Tesla.Env.t}
on failure
Link to this function
service_delete(connection, id, opts \\ [])
@spec service_delete(Tesla.Env.client(), String.t(), keyword()) :: {:ok, nil} | {:ok, DockerEngineAPI.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Delete a service
Parameters
connection
(DockerEngineAPI.Connection): Connection to serverid
(String.t): ID or name of service.opts
(keyword): Optional parameters
Returns
{:ok, nil}
on success{:error, Tesla.Env.t}
on failure
Link to this function
service_inspect(connection, id, opts \\ [])
@spec service_inspect(Tesla.Env.client(), String.t(), keyword()) :: {:ok, DockerEngineAPI.Model.Service.t()} | {:ok, DockerEngineAPI.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Inspect a service
Parameters
connection
(DockerEngineAPI.Connection): Connection to serverid
(String.t): ID or name of service.opts
(keyword): Optional parameters:insertDefaults
(boolean()): Fill empty fields with default values.
Returns
{:ok, DockerEngineAPI.Model.Service.t}
on success{:error, Tesla.Env.t}
on failure
Link to this function
service_list(connection, opts \\ [])
@spec service_list( Tesla.Env.client(), keyword() ) :: {:ok, [DockerEngineAPI.Model.Service.t()]} | {:ok, DockerEngineAPI.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
List services
Parameters
connection
(DockerEngineAPI.Connection): Connection to serveropts
(keyword): Optional parameters:filters
(String.t): A JSON encoded value of the filters (amap[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
{:ok, [%Service{}, ...]}
on success{:error, Tesla.Env.t}
on failure
Link to this function
service_logs(connection, id, opts \\ [])
@spec service_logs(Tesla.Env.client(), String.t(), keyword()) :: {:ok, DockerEngineAPI.Model.ErrorResponse.t()} | {:ok, String.t()} | {:error, Tesla.Env.t()}
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 serverid
(String.t): ID or name of the serviceopts
(keyword): Optional parameters:details
(boolean()): Show service context and extra details provided to logs.:follow
(boolean()): Keep connection after returning logs.:stdout
(boolean()): Return logs fromstdout
:stderr
(boolean()): Return logs fromstderr
: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 orall
to output all log lines.
Returns
{:ok, String.t}
on success{:error, Tesla.Env.t}
on failure
Link to this function
service_update(connection, id, version, body, opts \\ [])
@spec service_update( Tesla.Env.client(), String.t(), integer(), DockerEngineAPI.Model.ServiceUpdateRequest.t(), keyword() ) :: {:ok, DockerEngineAPI.Model.ErrorResponse.t()} | {:ok, DockerEngineAPI.Model.ServiceUpdateResponse.t()} | {:error, Tesla.Env.t()}
Update a service
Parameters
connection
(DockerEngineAPI.Connection): Connection to serverid
(String.t): ID or name of service.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 callingGET /services/{id}
body
(ServiceUpdateRequest):opts
(keyword): Optional parameters:registryAuthFrom
(String.t): If theX-Registry-Auth
header is not specified, this parameter indicates where to find registry authorization credentials.:rollback
(String.t): Set to this parameter toprevious
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
{:ok, DockerEngineAPI.Model.ServiceUpdateResponse.t}
on success{:error, Tesla.Env.t}
on failure