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

      Name of the network.

    • Id string

      ID that uniquely identifies a network on a single machine.

    • Created string(dateTime)

      Date and time at which the network was created in RFC 3339 format with nano-seconds.

    • Scope string

      The level at which the network exists (e.g. swarm for cluster-wide or local for machine level)

    • Driver string

      The name of the driver used to create the network (e.g. bridge, overlay).

    • EnableIPv4 boolean

      Whether the network was created with IPv4 enabled.

    • EnableIPv6 boolean

      Whether the network was created with IPv6 enabled.

    • 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

      Whether the network is created to only allow internal networking connectivity.

      Default value is false.

    • Attachable boolean

      Whether a global / swarm scope network is manually attachable by regular containers from workers in swarm mode.

      Default value is false.

    • Ingress boolean

      Whether the network is providing the routing-mesh for the swarm cluster.

      Default value is false.

    • ConfigFrom object

      The config-only network source to provide the configuration for this network.

      Hide ConfigFrom attribute Show ConfigFrom attribute object
      • Network string

        The name of the config-only network that provides the network's configuration. The specified network must be an existing config-only network. Only network names are allowed, not network IDs.

    • ConfigOnly boolean

      Whether the network is a config-only network. Config-only networks are placeholder networks for network configurations to be used by other networks. Config-only networks cannot be used directly to run containers or services.

      Default value is false.

    • Containers object

      Contains endpoints attached to the network.

      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

      Network-specific options uses when creating the network.

      Hide Options attribute Show Options attribute object
      • * string Additional properties
    • Labels object

      User-defined key/value metadata.

      Hide Labels attribute Show Labels attribute object
      • * string Additional properties
    • Peers array[object]

      List of peer nodes for an overlay network. This field is only present for overlay networks, and omitted for other network types.

      PeerInfo represents one peer of an overlay network.

      Hide Peers attributes Show Peers attributes object
      • Name string

        ID of the peer-node in the Swarm cluster.

      • IP string

        IP-address of the peer-node in the Swarm cluster.

  • 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.49/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,
    "EnableIPv4": true,
    "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": {},
    "EnableIPv4": false,
    "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": {},
    "EnableIPv4": false,
    "EnableIPv6": false
  }
]
Response examples (200)
[
  {
    "Name": "my_network",
    "Id": "7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99",
    "Created": "2016-10-19T04:33:30.360899459Z",
    "Scope": "local",
    "Driver": "overlay",
    "EnableIPv4": true,
    "EnableIPv6": false,
    "IPAM": {
      "Driver": "default",
      "Config": [
        {
          "Subnet": "172.20.0.0/16",
          "IPRange": "172.20.10.0/24",
          "Gateway": "172.20.10.11",
          "AuxiliaryAddresses": {
            "additionalProperty1": "string",
            "additionalProperty2": "string"
          }
        }
      ],
      "Options": {
        "foo": "bar"
      }
    },
    "Internal": false,
    "Attachable": false,
    "Ingress": false,
    "ConfigFrom": {
      "Network": "config_only_network_01"
    },
    "ConfigOnly": false,
    "Containers": {
      "19a4d5d687db25203351ed79d478946f861258f018fe384f229f2efa4b23513c": {
        "Name": "test",
        "EndpointID": "628cadb8bcb92de107b2a1e516cbffe463e321f548feb37697cce00ad694f21a",
        "MacAddress": "02:42:ac:13:00:02",
        "IPv4Address": "172.19.0.2/16",
        "IPv6Address": ""
      }
    },
    "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"
    },
    "Labels": {
      "com.example.some-label": "some-value",
      "com.example.some-other-label": "some-other-value"
    },
    "Peers": [
      {
        "Name": "6869d7c1732b",
        "IP": "10.133.77.91"
      }
    ]
  }
]
Response examples (500)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}