POST
/secrets/{id}/update 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
id
path
Required
The ID or name of the secret
Type:
string
All schema constraints and annotations
{
"type": "string"
}version
query
Required
The version number of the secret object being updated. This is
required to avoid conflicting writes.
Type:
integer
All schema constraints and annotations
{
"format": "int64",
"type": "integer"
}Request and responses
Request
The spec of the secret to update. Currently, only the Labels field
can be updated. All other fields must remain unchanged from the
SecretInspect endpoint response values.
application/json
Schema:
SecretSpec
Request
The spec of the secret to update. Currently, only the Labels field
can be updated. All other fields must remain unchanged from the
SecretInspect endpoint response values.
text/plain
Schema:
SecretSpec
Response
200
no error
application/json
Response
200
no error
text/plain
Response
400
bad parameter
application/json
Schema:
ErrorResponse
Schema example
{
"message": "Something went wrong."
}Response
404
no such secret
application/json
Schema:
ErrorResponse
Schema example
{
"message": "Something went wrong."
}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/SecretSpec
Complete operation contract
{
"operationId": "SecretUpdate",
"parameters": [
{
"description": "The ID or name of the secret",
"in": "path",
"name": "id",
"required": true,
"schema": {
"type": "string"
}
},
{
"description": "The version number of the secret object being updated. This is\nrequired to avoid conflicting writes.\n",
"in": "query",
"name": "version",
"required": true,
"schema": {
"format": "int64",
"type": "integer"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SecretSpec"
}
},
"text/plain": {
"schema": {
"$ref": "#/components/schemas/SecretSpec"
}
}
},
"description": "The spec of the secret to update. Currently, only the Labels field\ncan be updated. All other fields must remain unchanged from the\n[SecretInspect endpoint](#operation/SecretInspect) response values.\n",
"x-codegen-request-body-name": "body"
},
"responses": {
"200": {
"content": {
"application/json": {},
"text/plain": {}
},
"description": "no error"
},
"400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "bad parameter"
},
"404": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "no such secret"
},
"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": "Update a Secret",
"tags": [
"Secret"
]
}