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 distribution.ex
Raw

lib/docker_engine_api/api/distribution.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.Distribution do
@moduledoc """
API calls for all endpoints tagged `Distribution`.
"""
alias DockerEngineAPI.Connection
import DockerEngineAPI.RequestBuilder
@doc """
Get image information from the registry
Return image digest and platform information by contacting the registry.
### Parameters
- `connection` (DockerEngineAPI.Connection): Connection to server
- `name` (String.t): Image name or id
- `opts` (keyword): Optional parameters
### Returns
- `{:ok, DockerEngineAPI.Model.DistributionInspect.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec distribution_inspect(Tesla.Env.client, String.t, keyword()) :: {:ok, DockerEngineAPI.Model.DistributionInspect.t} | {:ok, DockerEngineAPI.Model.ErrorResponse.t} | {:error, Tesla.Env.t}
def distribution_inspect(connection, name, _opts \\ []) do
request =
%{}
|> method(:get)
|> url("/distribution/#{name}/json")
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, DockerEngineAPI.Model.DistributionInspect},
{401, DockerEngineAPI.Model.ErrorResponse},
{500, DockerEngineAPI.Model.ErrorResponse}
])
end
end