List networks Run in API Explorer

GET /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.

Query parameters

  • 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"|"local"] Filters networks by scope (swarm, global, or local).
    • type=["custom"|"builtin"] Filters networks by type. The custom keyword returns all user-defined networks.

Responses

  • 200 application/json

    No error

    Hide response attributes Show response attributes object
    • Name string
    • Id string
    • Created string(dateTime)
    • Scope string
    • Driver string
    • EnableIPv6 boolean
    • IPAM object
      Hide IPAM attributes Show IPAM attributes object
      • Driver string

        Name of the IPAM driver to use.

        Default value is default.

      • Config array[object]

        List of IPAM configuration options, specified as a map:

        {"Subnet": <CIDR>, "IPRange": <CIDR>, "Gateway": <IP address>, "AuxAddress": <device_name:IP address>}
        
        Hide Config attributes Show Config attributes object
        • Subnet string
        • IPRange string
        • Gateway string
        • AuxiliaryAddresses object
          Hide AuxiliaryAddresses attribute Show AuxiliaryAddresses attribute object
          • * string Additional properties
      • Options object

        Driver-specific options, specified as a map.

        Hide Options attribute Show Options attribute object
        • * string Additional properties
    • Internal boolean
    • Attachable boolean
    • Ingress boolean
    • Containers object
      Hide Containers attribute Show Containers attribute object
      • * object Additional properties
        Hide * attributes Show * attributes object
        • Name string
        • EndpointID string
        • MacAddress string
        • IPv4Address string
        • IPv6Address string
    • Options object
      Hide Options attribute Show Options attribute object
      • * string Additional properties
    • Labels object
      Hide Labels attribute Show Labels attribute object
      • * string Additional properties
  • 500 application/json

    Server error

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

GET /networks
curl \
 --request GET 'http://api.example.com/v1.44/networks'
Response examples (200)
[
  {
    "Id": "f2de39df4171b0dc801e8002d1d999b77256983dfc63041c0f34030aa3977566",
    "IPAM": {
      "Config": [
        {
          "Subnet": "172.17.0.0/16"
        }
      ],
      "Driver": "default"
    },
    "Name": "bridge",
    "Scope": "local",
    "Driver": "bridge",
    "Created": "2016-10-19T06:21:00.416543526Z",
    "Ingress": false,
    "Options": {
      "com.docker.network.driver.mtu": "1500",
      "com.docker.network.bridge.name": "docker0",
      "com.docker.network.bridge.enable_icc": "true",
      "com.docker.network.bridge.default_bridge": "true",
      "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
      "com.docker.network.bridge.enable_ip_masquerade": "true"
    },
    "Internal": false,
    "Attachable": false,
    "EnableIPv6": false
  },
  {
    "Id": "e086a3893b05ab69242d3c44e49483a3bbbd3a26b46baa8f61ab797c1088d794",
    "IPAM": {
      "Config": [],
      "Driver": "default"
    },
    "Name": "none",
    "Scope": "local",
    "Driver": "null",
    "Created": "0001-01-01T00:00:00Z",
    "Ingress": false,
    "Options": {},
    "Internal": false,
    "Attachable": false,
    "Containers": {},
    "EnableIPv6": false
  },
  {
    "Id": "13e871235c677f196c4e1ecebb9dc733b9b2d2ab589e30c539efeda84a24215e",
    "IPAM": {
      "Config": [],
      "Driver": "default"
    },
    "Name": "host",
    "Scope": "local",
    "Driver": "host",
    "Created": "0001-01-01T00:00:00Z",
    "Ingress": false,
    "Options": {},
    "Internal": false,
    "Attachable": false,
    "Containers": {},
    "EnableIPv6": false
  }
]
Response examples (200)
[
  {
    "Id": "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99",
    "IPAM": {
      "Config": [
        {
          "Subnet": "172.19.0.0/16",
          "Gateway": "172.19.0.1"
        }
      ],
      "Driver": "default",
      "Options": {
        "foo": "bar"
      }
    },
    "Name": "net01",
    "Scope": "local",
    "Driver": "bridge",
    "Labels": {
      "com.example.some-label": "some-value",
      "com.example.some-other-label": "some-other-value"
    },
    "Created": "2016-10-19T04:33:30.360899459Z",
    "Ingress": false,
    "Options": {
      "com.docker.network.driver.mtu": "1500",
      "com.docker.network.bridge.name": "docker0",
      "com.docker.network.bridge.enable_icc": "true",
      "com.docker.network.bridge.default_bridge": "true",
      "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
      "com.docker.network.bridge.enable_ip_masquerade": "true"
    },
    "Internal": false,
    "Attachable": false,
    "Containers": {
      "19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c": {
        "Name": "test",
        "EndpointID": "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a",
        "MacAddress": "02:42:ac:13:00:02",
        "IPv4Address": "172.19.0.2/16",
        "IPv6Address": ""
      }
    },
    "EnableIPv6": false
  }
]
Response examples (500)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}