Inspect a secret Run in API Explorer

GET /secrets/{id}

Path parameters

  • id string Required

    ID of the secret

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

        Data is the data to store as a secret, formatted as a Base64-url-safe-encoded (RFC 4648) string. It must be empty if the Driver field is set, in which case the data is loaded from an external secret store. The maximum allowed size is 500KB, as defined in MaxSecretSize.

        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
  • 404 application/json

    secret not found

    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 /secrets/{id}
curl \
 --request GET 'http://api.example.com/v1.49/secrets/{id}'
Response examples (200)
{
  "ID": "ktnbjxoalbkvbvedmg1urrz8h",
  "Spec": {
    "Name": "app-dev.crt",
    "Driver": {
      "Name": "secret-bucket",
      "Options": {
        "OptionA": "value for driver option A",
        "OptionB": "value for driver option B"
      }
    },
    "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",
  "Version": {
    "Index": 373531
  },
  "CreatedAt": "2017-07-20T13:55:28.678958722Z",
  "UpdatedAt": "2017-07-20T13:55:28.678958722Z",
  "Spec": {
    "Name": "string",
    "Labels": {
      "com.example.some-label": "some-value",
      "com.example.some-other-label": "some-other-value"
    },
    "Data": "string",
    "Driver": {
      "Name": "some-driver",
      "Options": {
        "OptionA": "value for driver-specific option A",
        "OptionB": "value for driver-specific option B"
      }
    },
    "Templating": {
      "Name": "some-driver",
      "Options": {
        "OptionA": "value for driver-specific option A",
        "OptionB": "value for driver-specific option B"
      }
    }
  }
}
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."
}