v1

latestOpenAPI 3.0.02026-07-1410578280.2 KB
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.

get/networks

Query parameters

filtersstring

JSON encoded value of the filters (a map[string][]string) to process on the networks list. Available filters:

  • 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.

Response

No error

Attachableboolean
Containersobject
Createdstring dateTime
Driverstring
EnableIPv6boolean
Idstring
Ingressboolean
Internalboolean
Labelsobject
Namestring
Optionsobject
Scopestring

Example response

[
  {
    "Attachable": false,
    "Containers": {
      "19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c": {
        "EndpointID": "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a",
        "IPv4Address": "172.19.0.2/16",
        "IPv6Address": "",
        "MacAddress": "02:42:ac:13:00:02",
        "Name": "test"
      }
    },
    "Created": "2016-10-19T04:33:30.360899459Z",
    "Driver": "bridge",
    "EnableIPv6": false,
    "IPAM": {
      "Config": [
        {
          "Gateway": "172.19.0.1",
          "Subnet": "172.19.0.0/16"
        }
      ],
      "Driver": "default",
      "Options": {
        "foo": "bar"
      }
    },
    "Id": "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99",
    "Ingress": false,
    "Internal": false,
    "Labels": {
      "com.example.some-label": "some-value",
      "com.example.some-other-label": "some-other-value"
    },
    "Name": "net01",
    "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"
  }
]