Search or ask Docker

List secrets

GET /secrets — Docker Engine API 1.57.

View Markdown
GET/secrets

Connection and access

API connection and authentication guidance

/v1.57

No HTTP authentication requirement is declared for this operation. Transport access controls can still apply.

Parameters

filters query

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> matches all or part of a secret name (prefix match)
  • names=<secret name> matches a secret name (exact match)

Type: string

All schema constraints and annotations
{
  "type": "string"
}

Request and responses

Response 200

no error

application/json

Type: array

Array item

Schema: Secret

All schema constraints and annotations
{
  "example": [
    {
      "CreatedAt": "2017-07-20T13:55:28.678958722Z",
      "ID": "blt1owaxmitz71s9v5zh81zun",
      "Spec": {
        "Driver": {
          "Name": "secret-bucket",
          "Options": {
            "OptionA": "value for driver option A",
            "OptionB": "value for driver option B"
          }
        },
        "Labels": {
          "some.label": "some.value"
        },
        "Name": "mysql-passwd"
      },
      "UpdatedAt": "2017-07-20T13:55:28.678958722Z",
      "Version": {
        "Index": 85
      }
    },
    {
      "CreatedAt": "2016-11-05T01:20:17.327670065Z",
      "ID": "ktnbjxoalbkvbvedmg1urrz8h",
      "Spec": {
        "Labels": {
          "foo": "bar"
        },
        "Name": "app-dev.crt"
      },
      "UpdatedAt": "2016-11-05T01:20:17.327670065Z",
      "Version": {
        "Index": 11
      }
    }
  ],
  "items": {
    "$ref": "#/components/schemas/Secret"
  },
  "type": "array"
}

Schema example

[
  {
    "CreatedAt": "2017-07-20T13:55:28.678958722Z",
    "ID": "blt1owaxmitz71s9v5zh81zun",
    "Spec": {
      "Driver": {
        "Name": "secret-bucket",
        "Options": {
          "OptionA": "value for driver option A",
          "OptionB": "value for driver option B"
        }
      },
      "Labels": {
        "some.label": "some.value"
      },
      "Name": "mysql-passwd"
    },
    "UpdatedAt": "2017-07-20T13:55:28.678958722Z",
    "Version": {
      "Index": 85
    }
  },
  {
    "CreatedAt": "2016-11-05T01:20:17.327670065Z",
    "ID": "ktnbjxoalbkvbvedmg1urrz8h",
    "Spec": {
      "Labels": {
        "foo": "bar"
      },
      "Name": "app-dev.crt"
    },
    "UpdatedAt": "2016-11-05T01:20:17.327670065Z",
    "Version": {
      "Index": 11
    }
  }
]

Response 500

server error

application/json

Schema: ErrorResponse

Schema example

{
  "message": "Something went wrong."
}

Response 503

node is not part of a swarm

application/json

Schema: ErrorResponse

Schema example

{
  "message": "Something went wrong."
}

Referenced schemas

#/components/schemas/ErrorResponse

#/components/schemas/Secret

Complete operation contract
{
  "operationId": "SecretList",
  "parameters": [
    {
      "description": "A JSON encoded value of the filters (a `map[string][]string`) to\nprocess on the secrets list.\n\nAvailable filters:\n\n- `id=\u003csecret id\u003e`\n- `label=\u003ckey\u003e or label=\u003ckey\u003e=value`\n- `name=\u003csecret name\u003e` matches all or part of a secret name (prefix match)\n- `names=\u003csecret name\u003e` matches a secret name (exact match)\n",
      "in": "query",
      "name": "filters",
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "example": [
              {
                "CreatedAt": "2017-07-20T13:55:28.678958722Z",
                "ID": "blt1owaxmitz71s9v5zh81zun",
                "Spec": {
                  "Driver": {
                    "Name": "secret-bucket",
                    "Options": {
                      "OptionA": "value for driver option A",
                      "OptionB": "value for driver option B"
                    }
                  },
                  "Labels": {
                    "some.label": "some.value"
                  },
                  "Name": "mysql-passwd"
                },
                "UpdatedAt": "2017-07-20T13:55:28.678958722Z",
                "Version": {
                  "Index": 85
                }
              },
              {
                "CreatedAt": "2016-11-05T01:20:17.327670065Z",
                "ID": "ktnbjxoalbkvbvedmg1urrz8h",
                "Spec": {
                  "Labels": {
                    "foo": "bar"
                  },
                  "Name": "app-dev.crt"
                },
                "UpdatedAt": "2016-11-05T01:20:17.327670065Z",
                "Version": {
                  "Index": 11
                }
              }
            ],
            "items": {
              "$ref": "#/components/schemas/Secret"
            },
            "type": "array"
          }
        }
      },
      "description": "no error"
    },
    "500": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "server error"
    },
    "503": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ErrorResponse"
          }
        }
      },
      "description": "node is not part of a swarm"
    }
  },
  "summary": "List secrets",
  "tags": [
    "Secret"
  ]
}