Modify named token
Modifies a specific named token. Supports renaming the token, toggling the revoked flag and modifying the metadata.
This operation is available for the token owner (subject), or (in case of
provider tokens) cluster member with cluster_update privilege.
Otherwise requires oz_tokens_manage admin privilege.
You can learn more about named and temporary tokens here.
Example cURL requests
Modify named token
curl -u username:password -H "Content-type: application/json" \
-X PATCH -d '{"revoked": true}' \
https://$HOST/api/v3/onezone/tokens/named/$TOKEN_ID
Path parameters
| Parameter | Type & Description |
|---|---|
| id required | string Token Id |
Request body
Named token update request
| Property | Type & Description |
|---|---|
name string (TokenPropertyName) Token name (unique for subject user/provider) | |
customMetadata object (TokenPropertyCustomMetadata) Arbitrary user metadata (JSON) attached to the token | |
revoked boolean (TokenPropertyRevoked) Determines if this token is revoked (cannot be used) - can be toggled at will | |
Request Examples
{
"name": "My secret Token",
"customMetadata": {
"jobName": "experiment-15",
"vm": "worker156.cloud.local"
},
"revoked": true
}Responses
Named token has been updated successfully.
Invalid request.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authentication error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authorization error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Resource not found.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Internal server Error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}