DockerEngineAPI.Api.Network (testcontainers v1.13.4)
View SourceAPI calls for all endpoints tagged Network.
Summary
Functions
Connect a container to a network
Create a network
Remove a network
Disconnect a container from a network
Inspect a network
List networks Returns a list of networks. For details on the format, see the network inspect endpoint. Note that it uses a different, smaller representation of a network than inspecting a single network. For example, the list of containers attached to the network is not propagated in API versions 1.28 and up.
Delete unused networks
Functions
@spec network_connect( Tesla.Env.client(), String.t(), DockerEngineAPI.Model.NetworkConnectRequest.t(), keyword() ) :: {:ok, nil} | {:ok, DockerEngineAPI.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Connect a container to a network
Parameters
connection(DockerEngineAPI.Connection): Connection to serverid(String.t): Network ID or namecontainer(NetworkConnectRequest):opts(keyword): Optional parameters
Returns
{:ok, nil}on success{:error, Tesla.Env.t}on failure
@spec network_create( Tesla.Env.client(), DockerEngineAPI.Model.NetworkCreateRequest.t(), keyword() ) :: {:ok, DockerEngineAPI.Model.ErrorResponse.t()} | {:ok, DockerEngineAPI.Model.NetworkCreateResponse.t()} | {:error, Tesla.Env.t()}
Create a network
Parameters
connection(DockerEngineAPI.Connection): Connection to servernetwork_config(NetworkCreateRequest): Network configurationopts(keyword): Optional parameters
Returns
{:ok, DockerEngineAPI.Model.NetworkCreateResponse.t}on success{:error, Tesla.Env.t}on failure
@spec network_delete(Tesla.Env.client(), String.t(), keyword()) :: {:ok, nil} | {:ok, DockerEngineAPI.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Remove a network
Parameters
connection(DockerEngineAPI.Connection): Connection to serverid(String.t): Network ID or nameopts(keyword): Optional parameters
Returns
{:ok, nil}on success{:error, Tesla.Env.t}on failure
@spec network_disconnect( Tesla.Env.client(), String.t(), DockerEngineAPI.Model.NetworkDisconnectRequest.t(), keyword() ) :: {:ok, nil} | {:ok, DockerEngineAPI.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Disconnect a container from a network
Parameters
connection(DockerEngineAPI.Connection): Connection to serverid(String.t): Network ID or namecontainer(NetworkDisconnectRequest):opts(keyword): Optional parameters
Returns
{:ok, nil}on success{:error, Tesla.Env.t}on failure
@spec network_inspect(Tesla.Env.client(), String.t(), keyword()) :: {:ok, DockerEngineAPI.Model.Network.t()} | {:ok, DockerEngineAPI.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
Inspect a network
Parameters
connection(DockerEngineAPI.Connection): Connection to serverid(String.t): Network ID or nameopts(keyword): Optional parameters:verbose(boolean()): Detailed inspect output for troubleshooting:scope(String.t): Filter the network by scope (swarm, global, or local)
Returns
{:ok, DockerEngineAPI.Model.Network.t}on success{:error, Tesla.Env.t}on failure
@spec network_list( Tesla.Env.client(), keyword() ) :: {:ok, DockerEngineAPI.Model.ErrorResponse.t()} | {:ok, [DockerEngineAPI.Model.Network.t()]} | {:error, Tesla.Env.t()}
List networks Returns a list of networks. For details on the format, see the network inspect endpoint. Note that it uses a different, smaller representation of a network than inspecting a single network. For example, the list of containers attached to the network is not propagated in API versions 1.28 and up.
Parameters
connection(DockerEngineAPI.Connection): Connection to serveropts(keyword): Optional parameters:filters(String.t): JSON encoded value of the filters (amap[string][]string) to process on the networks list. Available filters: -dangling=<boolean>When set totrue(or1), returns all networks that are not in use by a container. When set tofalse(or0), only networks that are in use by one or more containers are returned. -driver=<driver-name>Matches a network's driver. -id=<network-id>Matches all or part of a network ID. -label=<key>orlabel=<key>=<value>of a network label. -name=<network-name>Matches all or part of a network name. -scope=["swarm"|"global"|"local"]Filters networks by scope (swarm,global, orlocal). -type=["custom"|"builtin"]Filters networks by type. Thecustomkeyword returns all user-defined networks.
Returns
{:ok, [%Network{}, ...]}on success{:error, Tesla.Env.t}on failure
@spec network_prune( Tesla.Env.client(), keyword() ) :: {:ok, DockerEngineAPI.Model.ErrorResponse.t()} | {:ok, DockerEngineAPI.Model.NetworkPruneResponse.t()} | {:error, Tesla.Env.t()}
Delete unused networks
Parameters
connection(DockerEngineAPI.Connection): Connection to serveropts(keyword): Optional parameters:filters(String.t): Filters to process on the prune list, encoded as JSON (amap[string][]string). Available filters: -until=<timestamp>Prune networks created before this timestamp. The<timestamp>can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g.10m,1h30m) computed relative to the daemon machine’s time. -label(label=<key>,label=<key>=<value>,label!=<key>, orlabel!=<key>=<value>) Prune networks with (or without, in caselabel!=...is used) the specified labels.
Returns
{:ok, DockerEngineAPI.Model.NetworkPruneResponse.t}on success{:error, Tesla.Env.t}on failure