Packages

The Engine API is an HTTP API served by Docker Engine. It is the API the Docker client uses to communicate with the Engine, so everything the Docker client can do can be done with the API.

Current section

Files

Jump to
ex_docker_engine_api lib docker_engine_api api system.ex
Raw

lib/docker_engine_api/api/system.ex

# NOTE: This file is auto generated by OpenAPI Generator 7.0.1 (https://openapi-generator.tech).
# Do not edit this file manually.
defmodule DockerEngineAPI.Api.System do
@moduledoc """
API calls for all endpoints tagged `System`.
"""
alias DockerEngineAPI.Connection
import DockerEngineAPI.RequestBuilder
@doc """
Check auth configuration
Validate credentials for a registry and, if available, get an identity token for accessing the registry without password.
### Parameters
- `connection` (DockerEngineAPI.Connection): Connection to server
- `opts` (keyword): Optional parameters
- `:body` (AuthConfig): Authentication to check
### Returns
- `{:ok, DockerEngineAPI.Model.SystemAuthResponse.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec system_auth(Tesla.Env.client, keyword()) :: {:ok, nil} | {:ok, DockerEngineAPI.Model.SystemAuthResponse.t} | {:ok, DockerEngineAPI.Model.ErrorResponse.t} | {:error, Tesla.Env.t}
def system_auth(connection, opts \\ []) do
optional_params = %{
:body => :body
}
request =
%{}
|> method(:post)
|> url("/auth")
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, DockerEngineAPI.Model.SystemAuthResponse},
{204, false},
{401, DockerEngineAPI.Model.ErrorResponse},
{500, DockerEngineAPI.Model.ErrorResponse}
])
end
@doc """
Get data usage information
### Parameters
- `connection` (DockerEngineAPI.Connection): Connection to server
- `opts` (keyword): Optional parameters
- `:type` ([String.t]): Object types, for which to compute and return data.
### Returns
- `{:ok, DockerEngineAPI.Model.SystemDataUsageResponse.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec system_data_usage(Tesla.Env.client, keyword()) :: {:ok, DockerEngineAPI.Model.SystemDataUsageResponse.t} | {:ok, DockerEngineAPI.Model.ErrorResponse.t} | {:error, Tesla.Env.t}
def system_data_usage(connection, opts \\ []) do
optional_params = %{
:type => :query
}
request =
%{}
|> method(:get)
|> url("/system/df")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, DockerEngineAPI.Model.SystemDataUsageResponse},
{500, DockerEngineAPI.Model.ErrorResponse}
])
end
@doc """
Monitor events
Stream real-time events from the server. Various objects within Docker report events when something happens to them. Containers report these events: `attach`, `commit`, `copy`, `create`, `destroy`, `detach`, `die`, `exec_create`, `exec_detach`, `exec_start`, `exec_die`, `export`, `health_status`, `kill`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, `update`, and `prune` Images report these events: `delete`, `import`, `load`, `pull`, `push`, `save`, `tag`, `untag`, and `prune` Volumes report these events: `create`, `mount`, `unmount`, `destroy`, and `prune` Networks report these events: `create`, `connect`, `disconnect`, `destroy`, `update`, `remove`, and `prune` The Docker daemon reports these events: `reload` Services report these events: `create`, `update`, and `remove` Nodes report these events: `create`, `update`, and `remove` Secrets report these events: `create`, `update`, and `remove` Configs report these events: `create`, `update`, and `remove` The Builder reports `prune` events
### Parameters
- `connection` (DockerEngineAPI.Connection): Connection to server
- `opts` (keyword): Optional parameters
- `:since` (String.t): Show events created since this timestamp then stream new events.
- `:until` (String.t): Show events created until this timestamp then stop streaming.
- `:filters` (String.t): A JSON encoded value of filters (a `map[string][]string`) to process on the event list. Available filters: - `config=<string>` config name or ID - `container=<string>` container name or ID - `daemon=<string>` daemon name or ID - `event=<string>` event type - `image=<string>` image name or ID - `label=<string>` image or container label - `network=<string>` network name or ID - `node=<string>` node ID - `plugin`=<string> plugin name or ID - `scope`=<string> local or swarm - `secret=<string>` secret name or ID - `service=<string>` service name or ID - `type=<string>` object to filter by, one of `container`, `image`, `volume`, `network`, `daemon`, `plugin`, `node`, `service`, `secret` or `config` - `volume=<string>` volume name
### Returns
- `{:ok, DockerEngineAPI.Model.EventMessage.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec system_events(Tesla.Env.client, keyword()) :: {:ok, DockerEngineAPI.Model.EventMessage.t} | {:ok, DockerEngineAPI.Model.ErrorResponse.t} | {:error, Tesla.Env.t}
def system_events(connection, opts \\ []) do
optional_params = %{
:since => :query,
:until => :query,
:filters => :query
}
request =
%{}
|> method(:get)
|> url("/events")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, DockerEngineAPI.Model.EventMessage},
{400, DockerEngineAPI.Model.ErrorResponse},
{500, DockerEngineAPI.Model.ErrorResponse}
])
end
@doc """
Get system information
### Parameters
- `connection` (DockerEngineAPI.Connection): Connection to server
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, DockerEngineAPI.Model.SystemInfo.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec system_info(Tesla.Env.client, keyword()) :: {:ok, DockerEngineAPI.Model.SystemInfo.t} | {:ok, DockerEngineAPI.Model.ErrorResponse.t} | {:error, Tesla.Env.t}
def system_info(connection, _opts \\ []) do
request =
%{}
|> method(:get)
|> url("/info")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, DockerEngineAPI.Model.SystemInfo},
{500, DockerEngineAPI.Model.ErrorResponse}
])
end
@doc """
Ping
This is a dummy endpoint you can use to test if the server is accessible.
### Parameters
- `connection` (DockerEngineAPI.Connection): Connection to server
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, String.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec system_ping(Tesla.Env.client, keyword()) :: {:ok, DockerEngineAPI.Model.ErrorResponse.t} | {:ok, String.t} | {:error, Tesla.Env.t}
def system_ping(connection, _opts \\ []) do
request =
%{}
|> method(:get)
|> url("/_ping")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, false},
{500, DockerEngineAPI.Model.ErrorResponse}
])
end
@doc """
Ping
This is a dummy endpoint you can use to test if the server is accessible.
### Parameters
- `connection` (DockerEngineAPI.Connection): Connection to server
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, String.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec system_ping_head(Tesla.Env.client, keyword()) :: {:ok, DockerEngineAPI.Model.ErrorResponse.t} | {:ok, String.t} | {:error, Tesla.Env.t}
def system_ping_head(connection, _opts \\ []) do
request =
%{}
|> method(:head)
|> url("/_ping")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, false},
{500, DockerEngineAPI.Model.ErrorResponse}
])
end
@doc """
Get version
Returns the version of Docker that is running and various information about the system that Docker is running on.
### Parameters
- `connection` (DockerEngineAPI.Connection): Connection to server
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, DockerEngineAPI.Model.SystemVersion.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec system_version(Tesla.Env.client, keyword()) :: {:ok, DockerEngineAPI.Model.ErrorResponse.t} | {:ok, DockerEngineAPI.Model.SystemVersion.t} | {:error, Tesla.Env.t}
def system_version(connection, _opts \\ []) do
request =
%{}
|> method(:get)
|> url("/version")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, DockerEngineAPI.Model.SystemVersion},
{500, DockerEngineAPI.Model.ErrorResponse}
])
end
end