All URIs are relative to http://localhost/v1.41
Method | HTTP request | Description |
---|---|---|
networkConnect | POST /networks/{id}/connect | Connect a container to a network |
networkCreate | POST /networks/create | Create a network |
networkDelete | DELETE /networks/{id} | Remove a network |
networkDisconnect | POST /networks/{id}/disconnect | Disconnect a container from a network |
networkInspect | GET /networks/{id} | Inspect a network |
networkList | GET /networks | List networks |
networkPrune | POST /networks/prune | Delete unused networks |
networkConnect(id, container)
Connect a container to a network
var DockerEngineApi = require('docker_engine_api');
var apiInstance = new DockerEngineApi.NetworkApi();
var id = "id_example"; // String | Network ID or name
var container = new DockerEngineApi.Container(); // Container |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
apiInstance.networkConnect(id, container, callback);
Name | Type | Description | Notes |
---|---|---|---|
id | String | Network ID or name | |
container | Container |
null (empty response body)
No authorization required
- Content-Type: application/json
- Accept: application/json, text/plain
NetworkCreateResponse networkCreate(networkConfig)
Create a network
var DockerEngineApi = require('docker_engine_api');
var apiInstance = new DockerEngineApi.NetworkApi();
var networkConfig = new DockerEngineApi.NetworkConfig(); // NetworkConfig | Network configuration
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.networkCreate(networkConfig, callback);
Name | Type | Description | Notes |
---|---|---|---|
networkConfig | NetworkConfig | Network configuration |
No authorization required
- Content-Type: application/json
- Accept: application/json
networkDelete(id)
Remove a network
var DockerEngineApi = require('docker_engine_api');
var apiInstance = new DockerEngineApi.NetworkApi();
var id = "id_example"; // String | Network ID or name
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
apiInstance.networkDelete(id, callback);
Name | Type | Description | Notes |
---|---|---|---|
id | String | Network ID or name |
null (empty response body)
No authorization required
- Content-Type: application/json, text/plain
- Accept: application/json, text/plain
networkDisconnect(id, container)
Disconnect a container from a network
var DockerEngineApi = require('docker_engine_api');
var apiInstance = new DockerEngineApi.NetworkApi();
var id = "id_example"; // String | Network ID or name
var container = new DockerEngineApi.Container1(); // Container1 |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
apiInstance.networkDisconnect(id, container, callback);
Name | Type | Description | Notes |
---|---|---|---|
id | String | Network ID or name | |
container | Container1 |
null (empty response body)
No authorization required
- Content-Type: application/json
- Accept: application/json, text/plain
Network networkInspect(id, opts)
Inspect a network
var DockerEngineApi = require('docker_engine_api');
var apiInstance = new DockerEngineApi.NetworkApi();
var id = "id_example"; // String | Network ID or name
var opts = {
'verbose': false, // Boolean | Detailed inspect output for troubleshooting
'scope': "scope_example" // String | Filter the network by scope (swarm, global, or local)
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.networkInspect(id, opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
id | String | Network ID or name | |
verbose | Boolean | Detailed inspect output for troubleshooting | [optional] [default to false] |
scope | String | Filter the network by scope (swarm, global, or local) | [optional] |
No authorization required
- Content-Type: application/json, text/plain
- Accept: application/json
[Network] networkList(opts)
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.
var DockerEngineApi = require('docker_engine_api');
var apiInstance = new DockerEngineApi.NetworkApi();
var opts = {
'filters': "filters_example" // String | JSON encoded value of the filters (a `map[string][]string`) to process on the networks list. Available filters: - `dangling=<boolean>` When set to `true` (or `1`), returns all networks that are not in use by a container. When set to `false` (or `0`), 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>` or `label=<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`, or `local`). - `type=[\"custom\"|\"builtin\"]` Filters networks by type. The `custom` keyword returns all user-defined networks.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.networkList(opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
filters | String | JSON encoded value of the filters (a map[string][]string ) to process on the networks list. Available filters: - dangling=<boolean> When set to true (or 1 ), returns all networks that are not in use by a container. When set to false (or 0 ), 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> or label=<key>=<value> of a network label. - name=<network-name> Matches all or part of a network name. - `scope=["swarm" |
"global" |
No authorization required
- Content-Type: application/json, text/plain
- Accept: application/json
NetworkPruneResponse networkPrune(opts)
Delete unused networks
var DockerEngineApi = require('docker_engine_api');
var apiInstance = new DockerEngineApi.NetworkApi();
var opts = {
'filters': "filters_example" // String | Filters to process on the prune list, encoded as JSON (a `map[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>`, or `label!=<key>=<value>`) Prune networks with (or without, in case `label!=...` is used) the specified labels.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.networkPrune(opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
filters | String | Filters to process on the prune list, encoded as JSON (a map[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> , or label!=<key>=<value> ) Prune networks with (or without, in case label!=... is used) the specified labels. |
[optional] |
No authorization required
- Content-Type: application/json, text/plain
- Accept: application/json