Table of Contents

Class DockerNetworkManager

Namespace
Bielu.Microservices.Orchestrator.Docker
Assembly
Bielu.Microservices.Orchestrator.Docker.dll

Docker implementation of the network manager.

public class DockerNetworkManager : INetworkManager
Inheritance
DockerNetworkManager
Implements
Inherited Members

Constructors

DockerNetworkManager(DockerClient, ILogger<DockerNetworkManager>)

Docker implementation of the network manager.

public DockerNetworkManager(DockerClient client, ILogger<DockerNetworkManager> logger)

Parameters

client DockerClient
logger ILogger<DockerNetworkManager>

Methods

ConnectAsync(string, string, NetworkAttachment, CancellationToken)

Connects a container to a network using a full NetworkAttachment description (aliases, static IP, gateway, MAC address, links, driver options, DNS names).

public Task ConnectAsync(string networkId, string containerId, NetworkAttachment attachment, CancellationToken cancellationToken = default)

Parameters

networkId string
containerId string
attachment NetworkAttachment
cancellationToken CancellationToken

Returns

Task

ConnectAsync(string, string, IEnumerable<string>?, CancellationToken)

Connects a container to a network.

public Task ConnectAsync(string networkId, string containerId, IEnumerable<string>? aliases = null, CancellationToken cancellationToken = default)

Parameters

networkId string
containerId string
aliases IEnumerable<string>
cancellationToken CancellationToken

Returns

Task

CreateAsync(string, string, CancellationToken)

Creates a new network.

public Task<string> CreateAsync(string name, string driver = "bridge", CancellationToken cancellationToken = default)

Parameters

name string
driver string
cancellationToken CancellationToken

Returns

Task<string>

DisconnectAsync(string, string, CancellationToken)

Disconnects a container from a network.

public Task DisconnectAsync(string networkId, string containerId, CancellationToken cancellationToken = default)

Parameters

networkId string
containerId string
cancellationToken CancellationToken

Returns

Task

ListAsync(CancellationToken)

Lists all networks.

public Task<IReadOnlyList<NetworkInfo>> ListAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<IReadOnlyList<NetworkInfo>>

RemoveAsync(string, CancellationToken)

Removes a network.

public Task RemoveAsync(string networkId, CancellationToken cancellationToken = default)

Parameters

networkId string
cancellationToken CancellationToken

Returns

Task