Inspect swarm Run in API Explorer

GET /swarm

Responses

  • 200 application/json

    no error

    Hide response attributes Show response attributes object
    • ID string

      The ID of the swarm.

    • 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 swarm was initialised in RFC 3339 format with nano-seconds.

    • UpdatedAt string(dateTime)

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

    • Spec object

      User modifiable swarm configuration.

      Hide Spec attributes Show Spec attributes object
      • Name string

        Name of the swarm.

      • Labels object

        User-defined key/value metadata.

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

        Orchestration configuration.

        Hide Orchestration attribute Show Orchestration attribute object
        • TaskHistoryRetentionLimit integer(int64)

          The number of historic tasks to keep per instance or node. If negative, never remove completed or failed tasks.

      • Raft object

        Raft configuration.

        Hide Raft attributes Show Raft attributes object
        • SnapshotInterval integer(uint64)

          The number of log entries between snapshots.

        • KeepOldSnapshots integer(uint64)

          The number of snapshots to keep beyond the current snapshot.

        • LogEntriesForSlowFollowers integer(uint64)

          The number of log entries to keep around to sync up slow followers after a snapshot is created.

        • ElectionTick integer

          The number of ticks that a follower will wait for a message from the leader before becoming a candidate and starting an election. ElectionTick must be greater than HeartbeatTick.

          A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed.

        • HeartbeatTick integer

          The number of ticks between heartbeats. Every HeartbeatTick ticks, the leader will send a heartbeat to the followers.

          A tick currently defaults to one second, so these translate directly to seconds currently, but this is NOT guaranteed.

      • Dispatcher object

        Dispatcher configuration.

        Hide Dispatcher attribute Show Dispatcher attribute object
        • HeartbeatPeriod integer(int64)

          The delay for an agent to send a heartbeat to the dispatcher.

      • CAConfig object

        CA configuration.

        Hide CAConfig attributes Show CAConfig attributes object
        • NodeCertExpiry integer(int64)

          The duration node certificates are issued for.

        • ExternalCAs array[object]

          Configuration for forwarding signing requests to an external certificate authority.

          Hide ExternalCAs attributes Show ExternalCAs attributes object
          • Protocol string

            Protocol for communication with the external CA (currently only cfssl is supported).

            Value is cfssl. Default value is cfssl.

          • URL string

            URL where certificate signing requests should be sent.

          • Options object

            An object with key/value pairs that are interpreted as protocol-specific options for the external CA driver.

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

            The root CA certificate (in PEM format) this external CA uses to issue TLS certificates (assumed to be to the current swarm root CA certificate if not provided).

        • SigningCACert string

          The desired signing CA certificate for all swarm node TLS leaf certificates, in PEM format.

        • SigningCAKey string

          The desired signing CA key for all swarm node TLS leaf certificates, in PEM format.

        • ForceRotate integer(uint64)

          An integer whose purpose is to force swarm to generate a new signing CA certificate and key, if none have been specified in SigningCACert and SigningCAKey

      • EncryptionConfig object

        Parameters related to encryption-at-rest.

        Hide EncryptionConfig attribute Show EncryptionConfig attribute object
        • AutoLockManagers boolean

          If set, generate a key and use it to lock data stored on the managers.

      • TaskDefaults object

        Defaults for creating tasks in this cluster.

        Hide TaskDefaults attribute Show TaskDefaults attribute object
        • LogDriver object

          The log driver to use for tasks created in the orchestrator if unspecified by a service.

          Updating this value only affects new tasks. Existing tasks continue to use their previously configured log driver until recreated.

          Hide LogDriver attributes Show LogDriver attributes object
          • Name string

            The log driver to use as a default for new tasks.

          • Options object

            Driver-specific options for the selectd log driver, specified as key/value pairs.

            Hide Options attribute Show Options attribute object
            • * string Additional properties
    • 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.

    • RootRotationInProgress boolean

      Whether there is currently a root CA rotation in progress for the swarm

    • DataPathPort integer(uint32)

      DataPathPort specifies the data path port number for data traffic. Acceptable port range is 1024 to 49151. If no port is set or is set to 0, the default port (4789) is used.

      Default value is 4789.

    • DefaultAddrPool array[string(CIDR)]

      Default Address Pool specifies default subnet pools for global scope networks.

    • SubnetSize integer(uint32)

      SubnetSize specifies the subnet size of the networks created from the default subnet pool.

      Maximum value is 29. Default value is 24.

    • JoinTokens object

      JoinTokens contains the tokens workers and managers need to join the swarm.

      Hide JoinTokens attributes Show JoinTokens attributes object
      • Worker string

        The token workers can use to join the swarm.

      • Manager string

        The token managers can use to join the swarm.

  • 404 application/json

    no such swarm

    Hide response attribute Show response attribute object
    • message string Required

      The error message.

  • 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 /swarm
curl \
 --request GET 'http://api.example.com/v1.44/swarm'
Response examples (200)
{
  "ID": "abajmipo7b4xz5ip2nrla6b11",
  "Version": {
    "Index": 373531
  },
  "CreatedAt": "2016-08-18T10:44:24.496525531Z",
  "UpdatedAt": "2017-08-09T07:09:37.632105588Z",
  "Spec": {
    "Name": "default",
    "Labels": {
      "com.example.corp.type": "production",
      "com.example.corp.department": "engineering"
    },
    "Orchestration": {
      "TaskHistoryRetentionLimit": 10
    },
    "Raft": {
      "SnapshotInterval": 10000,
      "KeepOldSnapshots": 42,
      "LogEntriesForSlowFollowers": 500,
      "ElectionTick": 3,
      "HeartbeatTick": 1
    },
    "Dispatcher": {
      "HeartbeatPeriod": 5000000000
    },
    "CAConfig": {
      "NodeCertExpiry": 7776000000000000,
      "ExternalCAs": [
        {
          "Protocol": "cfssl",
          "URL": "string",
          "Options": {
            "additionalProperty1": "string",
            "additionalProperty2": "string"
          },
          "CACert": "string"
        }
      ],
      "SigningCACert": "string",
      "SigningCAKey": "string",
      "ForceRotate": 42
    },
    "EncryptionConfig": {
      "AutoLockManagers": false
    },
    "TaskDefaults": {
      "LogDriver": {
        "Name": "json-file",
        "Options": {
          "max-file": "10",
          "max-size": "100m"
        }
      }
    }
  },
  "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=="
  },
  "RootRotationInProgress": false,
  "DataPathPort": 4789,
  "DefaultAddrPool": [
    "10.10.0.0/16",
    "20.20.0.0/16"
  ],
  "SubnetSize": 24,
  "JoinTokens": {
    "Worker": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-1awxwuwd3z9j1z3puu7rcgdbx",
    "Manager": "SWMTKN-1-3pu6hszjas19xyp7ghgosyx9k8atbfcr8p2is99znpy26u2lkl-7p73s1dx5in4tatdymyhg9hu2"
  }
}
Response examples (404)
{
  "message": "Something went wrong."
}
Response examples (404)
{
  "message": "Something went wrong."
}
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."
}