List nodes Run in API Explorer

GET /nodes

Query parameters

  • filters string

    Filters to process on the nodes list, encoded as JSON (a map[string][]string).

    Available filters:

    • id=<node id>
    • label=<engine label>
    • membership=(accepted|pending)`
    • name=<node name>
    • node.label=<node label>
    • role=(manager|worker)`

Responses

  • 200 application/json

    no error

    Hide response attributes Show response attributes object
    • ID string
    • Version object

      The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. The client must send the version number along with the modified specification when updating these objects.

      This approach ensures safe concurrency and determinism in that the change on the object may not be applied if the version number has changed from the last read. In other words, if two update requests specify the same base version, only one of the requests can succeed. As a result, two separate update requests that happen at the same time will not unintentionally overwrite each other.

      Hide Version attribute Show Version attribute object
      • Index integer(uint64)
    • CreatedAt string(dateTime)

      Date and time at which the node was added to the swarm in RFC 3339 format with nano-seconds.

    • UpdatedAt string(dateTime)

      Date and time at which the node was last updated in RFC 3339 format with nano-seconds.

    • Spec object
      Hide Spec attributes Show Spec attributes object
      • Name string

        Name for the node.

      • Labels object

        User-defined key/value metadata.

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

        Role of the node.

        Values are worker or manager.

      • Availability string

        Availability of the node.

        Values are active, pause, or drain.

    • Description object

      NodeDescription encapsulates the properties of the Node as reported by the agent.

      Hide Description attributes Show Description attributes object
      • Hostname string
      • Platform object

        Platform represents the platform (Arch/OS).

        Hide Platform attributes Show Platform attributes object
        • Architecture string

          Architecture represents the hardware architecture (for example, x86_64).

        • OS string

          OS represents the Operating System (for example, linux or windows).

      • Resources object

        An object describing the resources which can be advertised by a node and requested by a task.

        Hide Resources attributes Show Resources attributes object
        • NanoCPUs integer(int64)
        • MemoryBytes integer(int64)
        • GenericResources array[object]

          User-defined resources can be either Integer resources (e.g, SSD=3) or String resources (e.g, GPU=UUID1).

          Hide GenericResources attributes Show GenericResources attributes object
          • NamedResourceSpec object
            Hide NamedResourceSpec attributes Show NamedResourceSpec attributes object
            • Kind string
            • Value string
          • DiscreteResourceSpec object
            Hide DiscreteResourceSpec attributes Show DiscreteResourceSpec attributes object
            • Kind string
            • Value integer(int64)
      • Engine object

        EngineDescription provides information about an engine.

        Hide Engine attributes Show Engine attributes object
        • EngineVersion string
        • Labels object
          Hide Labels attribute Show Labels attribute object
          • * string Additional properties
        • Plugins array[object]
          Hide Plugins attributes Show Plugins attributes object
          • Type string
          • Name string
      • TLSInfo object

        Information about the issuer of leaf TLS certificates and the trusted root CA certificate.

        Hide TLSInfo attributes Show TLSInfo attributes object
        • TrustRoot string

          The root CA certificate(s) that are used to validate leaf TLS certificates.

        • CertIssuerSubject string

          The base64-url-safe-encoded raw subject bytes of the issuer.

        • CertIssuerPublicKey string

          The base64-url-safe-encoded raw public key bytes of the issuer.

    • Status object

      NodeStatus represents the status of a node.

      It provides the current status of the node, as seen by the manager.

      Hide Status attributes Show Status attributes object
      • State string

        NodeState represents the state of a node.

        Values are unknown, down, ready, or disconnected.

      • Message string
      • Addr string

        IP address of the node.

    • ManagerStatus object

      ManagerStatus represents the status of a manager.

      It provides the current status of a node's manager component, if the node is a manager.

      Hide ManagerStatus attributes Show ManagerStatus attributes object
      • Leader boolean

        Default value is false.

      • Reachability string

        Reachability represents the reachability of a node.

        Values are unknown, unreachable, or reachable.

      • Addr string

        The IP address and port at which the manager is reachable.

  • 500 application/json

    server error

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

  • 503 application/json

    node is not part of a swarm

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

GET /nodes
curl \
 --request GET 'http://api.example.com/v1.44/nodes'
Response examples (200)
[
  {
    "ID": "24ifsmvkjbyhk",
    "Version": {
      "Index": 373531
    },
    "CreatedAt": "2016-08-18T10:44:24.496525531Z",
    "UpdatedAt": "2017-08-09T07:09:37.632105588Z",
    "Spec": {
      "Name": "node-name",
      "Role": "manager",
      "Labels": {
        "foo": "bar"
      },
      "Availability": "active"
    },
    "Description": {
      "Hostname": "bf3067039e47",
      "Platform": {
        "Architecture": "x86_64",
        "OS": "linux"
      },
      "Resources": {
        "NanoCPUs": 4000000000,
        "MemoryBytes": 8272408576,
        "GenericResources": [
          {
            "DiscreteResourceSpec": {
              "Kind": "SSD",
              "Value": 3
            }
          },
          {
            "NamedResourceSpec": {
              "Kind": "GPU",
              "Value": "UUID1"
            }
          },
          {
            "NamedResourceSpec": {
              "Kind": "GPU",
              "Value": "UUID2"
            }
          }
        ]
      },
      "Engine": {
        "EngineVersion": "17.06.0",
        "Labels": {
          "foo": "bar"
        },
        "Plugins": [
          {
            "Name": "awslogs",
            "Type": "Log"
          },
          {
            "Name": "fluentd",
            "Type": "Log"
          },
          {
            "Name": "gcplogs",
            "Type": "Log"
          },
          {
            "Name": "gelf",
            "Type": "Log"
          },
          {
            "Name": "journald",
            "Type": "Log"
          },
          {
            "Name": "json-file",
            "Type": "Log"
          },
          {
            "Name": "splunk",
            "Type": "Log"
          },
          {
            "Name": "syslog",
            "Type": "Log"
          },
          {
            "Name": "bridge",
            "Type": "Network"
          },
          {
            "Name": "host",
            "Type": "Network"
          },
          {
            "Name": "ipvlan",
            "Type": "Network"
          },
          {
            "Name": "macvlan",
            "Type": "Network"
          },
          {
            "Name": "null",
            "Type": "Network"
          },
          {
            "Name": "overlay",
            "Type": "Network"
          },
          {
            "Name": "local",
            "Type": "Volume"
          },
          {
            "Name": "localhost:5000/vieux/sshfs:latest",
            "Type": "Volume"
          },
          {
            "Name": "vieux/sshfs:latest",
            "Type": "Volume"
          }
        ]
      },
      "TLSInfo": {
        "TrustRoot": "-----BEGIN CERTIFICATE-----\nMIIBajCCARCgAwIBAgIUbYqrLSOSQHoxD8CwG6Bi2PJi9c8wCgYIKoZIzj0EAwIw\nEzERMA8GA1UEAxMIc3dhcm0tY2EwHhcNMTcwNDI0MjE0MzAwWhcNMzcwNDE5MjE0\nMzAwWjATMREwDwYDVQQDEwhzd2FybS1jYTBZMBMGByqGSM49AgEGCCqGSM49AwEH\nA0IABJk/VyMPYdaqDXJb/VXh5n/1Yuv7iNrxV3Qb3l06XD46seovcDWs3IZNV1lf\n3Skyr0ofcchipoiHkXBODojJydSjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\nAf8EBTADAQH/MB0GA1UdDgQWBBRUXxuRcnFjDfR/RIAUQab8ZV/n4jAKBggqhkjO\nPQQDAgNIADBFAiAy+JTe6Uc3KyLCMiqGl2GyWGQqQDEcO3/YG36x7om65AIhAJvz\npxv6zFeVEkAEEkqIYi0omA9+CjanB/6Bz4n1uw8H\n-----END CERTIFICATE-----\n",
        "CertIssuerSubject": "MBMxETAPBgNVBAMTCHN3YXJtLWNh",
        "CertIssuerPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmT9XIw9h1qoNclv9VeHmf/Vi6/uI2vFXdBveXTpcPjqx6i9wNazchk1XWV/dKTKvSh9xyGKmiIeRcE4OiMnJ1A=="
      }
    },
    "Status": {
      "State": "ready",
      "Message": "string",
      "Addr": "172.17.0.2"
    },
    "ManagerStatus": {
      "Leader": true,
      "Reachability": "reachable",
      "Addr": "10.0.0.46:2377"
    }
  }
]
Response examples (500)
{
  "message": "Something went wrong."
}
Response examples (500)
{
  "message": "Something went wrong."
}
Response examples (503)
{
  "message": "Something went wrong."
}
Response examples (503)
{
  "message": "Something went wrong."
}