/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.
Connection and access
API connection and authentication guidance
/v1.57
No HTTP authentication requirement is declared for this operation. Transport access controls can still apply.
Parameters
filters
query
JSON encoded value of the filters (a map[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.
Type:
string
All schema constraints and annotations
{
"type": "string"
}Request and responses
Response
200
application/json
Type:
array
Array item
Schema:
NetworkSummary
All schema constraints and annotations
{
"items": {
"$ref": "#/components/schemas/NetworkSummary"
},
"type": "array"
}Example
[
{
"Attachable": false,
"Created": "2016-10-19T06:21:00.416543526Z",
"Driver": "bridge",
"EnableIPv4": true,
"EnableIPv6": false,
"IPAM": {
"Config": [
{
"Subnet": "172.17.0.0/16"
}
],
"Driver": "default"
},
"Id": "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566",
"Ingress": false,
"Internal": false,
"Name": "bridge",
"Options": {
"com.docker.network.bridge.default_bridge": "true",
"com.docker.network.bridge.enable_icc": "true",
"com.docker.network.bridge.enable_ip_masquerade": "true",
"com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
"com.docker.network.bridge.name": "docker0",
"com.docker.network.driver.mtu": "1500"
},
"Scope": "local"
},
{
"Attachable": false,
"Containers": {},
"Created": "0001-01-01T00:00:00Z",
"Driver": "null",
"EnableIPv4": false,
"EnableIPv6": false,
"IPAM": {
"Config": [],
"Driver": "default"
},
"Id": "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794",
"Ingress": false,
"Internal": false,
"Name": "none",
"Options": {},
"Scope": "local"
},
{
"Attachable": false,
"Containers": {},
"Created": "0001-01-01T00:00:00Z",
"Driver": "host",
"EnableIPv4": false,
"EnableIPv6": false,
"IPAM": {
"Config": [],
"Driver": "default"
},
"Id": "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e",
"Ingress": false,
"Internal": false,
"Name": "host",
"Options": {},
"Scope": "local"
}
]Response
500
application/json
Schema:
ErrorResponse
Schema example
{
"message": "Something went wrong."
}Referenced schemas
#/components/schemas/ErrorResponse
#/components/schemas/NetworkSummary
Complete operation contract
{
"description": "Returns a list of networks. For details on the format, see the\n[network inspect endpoint](#operation/NetworkInspect).\n\nNote that it uses a different, smaller representation of a network than\ninspecting a single network. For example, the list of containers attached\nto the network is not propagated in API versions 1.28 and up.\n",
"operationId": "NetworkList",
"parameters": [
{
"description": "JSON encoded value of the filters (a `map[string][]string`) to process\non the networks list.\n\nAvailable filters:\n\n- `dangling=\u003cboolean\u003e` When set to `true` (or `1`), returns all\n networks that are not in use by a container. When set to `false`\n (or `0`), only networks that are in use by one or more\n containers are returned.\n- `driver=\u003cdriver-name\u003e` Matches a network's driver.\n- `id=\u003cnetwork-id\u003e` Matches all or part of a network ID.\n- `label=\u003ckey\u003e` or `label=\u003ckey\u003e=\u003cvalue\u003e` of a network label.\n- `name=\u003cnetwork-name\u003e` Matches all or part of a network name.\n- `scope=[\"swarm\"|\"global\"|\"local\"]` Filters networks by scope (`swarm`, `global`, or `local`).\n- `type=[\"custom\"|\"builtin\"]` Filters networks by type. The `custom` keyword returns all user-defined networks.\n",
"in": "query",
"name": "filters",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"example": [
{
"Attachable": false,
"Created": "2016-10-19T06:21:00.416543526Z",
"Driver": "bridge",
"EnableIPv4": true,
"EnableIPv6": false,
"IPAM": {
"Config": [
{
"Subnet": "172.17.0.0/16"
}
],
"Driver": "default"
},
"Id": "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566",
"Ingress": false,
"Internal": false,
"Name": "bridge",
"Options": {
"com.docker.network.bridge.default_bridge": "true",
"com.docker.network.bridge.enable_icc": "true",
"com.docker.network.bridge.enable_ip_masquerade": "true",
"com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
"com.docker.network.bridge.name": "docker0",
"com.docker.network.driver.mtu": "1500"
},
"Scope": "local"
},
{
"Attachable": false,
"Containers": {},
"Created": "0001-01-01T00:00:00Z",
"Driver": "null",
"EnableIPv4": false,
"EnableIPv6": false,
"IPAM": {
"Config": [],
"Driver": "default"
},
"Id": "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794",
"Ingress": false,
"Internal": false,
"Name": "none",
"Options": {},
"Scope": "local"
},
{
"Attachable": false,
"Containers": {},
"Created": "0001-01-01T00:00:00Z",
"Driver": "host",
"EnableIPv4": false,
"EnableIPv6": false,
"IPAM": {
"Config": [],
"Driver": "default"
},
"Id": "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e",
"Ingress": false,
"Internal": false,
"Name": "host",
"Options": {},
"Scope": "local"
}
],
"schema": {
"items": {
"$ref": "#/components/schemas/NetworkSummary"
},
"type": "array"
}
}
},
"description": "No error"
},
"500": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Server error"
}
},
"summary": "List networks",
"tags": [
"Network"
]
}