List secrets Run in API Explorer

GET /secrets

Query parameters

  • filters string

    A JSON encoded value of the filters (a map[string][]string) to process on the secrets list.

    Available filters:

    • id=<secret id>
    • label=<key> or label=<key>=value
    • name=<secret name>
    • names=<secret name>

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)
    • UpdatedAt string(dateTime)
    • Spec object
      Hide Spec attributes Show Spec attributes object
      • Name string

        User-defined name of the secret.

      • Labels object

        User-defined key/value metadata.

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

        Base64-url-safe-encoded (RFC 4648) data to store as secret.

        This field is only used to create a secret, and is not returned by other endpoints.

      • Driver object

        Name of the secrets driver used to fetch the secret's value from an external secret store.

        Hide Driver attributes Show Driver attributes object
        • Name string Required

          Name of the driver.

        • Options object

          Key/value map of driver-specific options.

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

        Name of the secrets driver used to fetch the secret's value from an external secret store.

        Hide Templating attributes Show Templating attributes object
        • Name string Required

          Name of the driver.

        • Options object

          Key/value map of driver-specific options.

          Hide Options attribute Show Options attribute object
          • * string Additional properties
  • 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 /secrets
curl \
 --request GET 'http://api.example.com/v1.44/secrets'
Response examples (200)
[
  {
    "ID": "blt1owaxmitz71s9v5zh81zun",
    "Spec": {
      "Name": "mysql-passwd",
      "Driver": {
        "Name": "secret-bucket",
        "Options": {
          "OptionA": "value for driver option A",
          "OptionB": "value for driver option B"
        }
      },
      "Labels": {
        "some.label": "some.value"
      }
    },
    "Version": {
      "Index": 85
    },
    "CreatedAt": "2017-07-20T13:55:28.678958722Z",
    "UpdatedAt": "2017-07-20T13:55:28.678958722Z"
  },
  {
    "ID": "ktnbjxoalbkvbvedmg1urrz8h",
    "Spec": {
      "Name": "app-dev.crt",
      "Labels": {
        "foo": "bar"
      }
    },
    "Version": {
      "Index": 11
    },
    "CreatedAt": "2016-11-05T01:20:17.327670065Z",
    "UpdatedAt": "2016-11-05T01:20:17.327670065Z"
  }
]
Response examples (200)
[
  {
    "ID": "blt1owaxmitz71s9v5zh81zun",
    "Spec": {
      "Name": "mysql-passwd",
      "Driver": {
        "Name": "secret-bucket",
        "Options": {
          "OptionA": "value for driver option A",
          "OptionB": "value for driver option B"
        }
      },
      "Labels": {
        "some.label": "some.value"
      }
    },
    "Version": {
      "Index": 85
    },
    "CreatedAt": "2017-07-20T13:55:28.678958722Z",
    "UpdatedAt": "2017-07-20T13:55:28.678958722Z"
  },
  {
    "ID": "ktnbjxoalbkvbvedmg1urrz8h",
    "Spec": {
      "Name": "app-dev.crt",
      "Labels": {
        "foo": "bar"
      }
    },
    "Version": {
      "Index": 11
    },
    "CreatedAt": "2016-11-05T01:20:17.327670065Z",
    "UpdatedAt": "2016-11-05T01:20:17.327670065Z"
  }
]
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."
}