Get named token of a provider by name
Returns the information about a specific provider's named token by token name.
This operation is available for the subject provider (id), or the provider's
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
Get named token of a provider by name
curl -H "x-auth-token: $TOKEN" -X GET \
https://$HOST/api/v3/onezone/providers/$PROVIDER_ID/tokens/named/name/my-token-1
{
"id": "2b5d0dd5aa6443a69277b5ce0544fec2",
"name": "my-token-1",
"subject": {
"type": "provider",
"id": "6ebe7ac282e0188b5336b5d8cfa564d5"
},
"type": {
"inviteToken": {
"inviteType": "userJoinCluster",
"clusterId": "fb73f7ceff5abd995357abbe01c812ce"
}
},
"caveats": [
{
"type": "time",
"validUntil": 1571147494
},
{
"type": "ip",
"whitelist": [
"189.34.15.0/8",
"127.0.0.0/24",
"167.73.12.17"
]
}
],
"metadata": {
"creationTime": 1564721024,
"usageLimit": 15,
"usageCount": 3,
"privileges": [
"space_view",
"space_read_data",
"space_view_views",
"space_view_statistics"
],
"custom": {
"jobName": "experiment-15",
"vm": "worker156.cloud.local"
}
},
"revoked": false,
"token": "MDAxNWxvY2F0aW9uIG9uZXpvbmUKMDAzYmlkZW50aWZpZXIgOEhmSEFSSGdrbHFCa1pWSTR"
}
Path parameters
| Parameter | Type & Description |
|---|---|
| id required | string Provider Id |
| name required | string Token name |
Request Examples
onezone-rest-cli getNamedTokenOfProviderByName id=$PROVIDER_ID name==my-token-1Responses
Returns the details of a specific named token.
| Property | Type & Description | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id string (TokenPropertyId) Unique identifier of the token | |||||||||||||||||||||||||||||||||||||||
name string (TokenPropertyName) Token name (unique for subject user/provider) | |||||||||||||||||||||||||||||||||||||||
subject object (TokenPropertySubject) The subject of the token - the user or Oneprovider in whose name the token was issued. The bearer (consumer) of the token adopts the subject's identity when accessing services with that token.
| |||||||||||||||||||||||||||||||||||||||
type object (TokenPropertyTokenType) The type of the token (object) Enum: {accessToken: {}}{identityToken: {}}{inviteToken: {"...": "..."}}
| |||||||||||||||||||||||||||||||||||||||
caveats array of objects (Caveat) A list of caveats that confine the token.
| |||||||||||||||||||||||||||||||||||||||
metadata object (TokenPropertyMetadata) Metadata describing the token
| |||||||||||||||||||||||||||||||||||||||
revoked boolean (TokenPropertyRevoked) Determines if this token is revoked (cannot be used) - can be toggled at will | |||||||||||||||||||||||||||||||||||||||
token string (SerializedToken) The token in serialized form. | |||||||||||||||||||||||||||||||||||||||
Example
{
"id": "2b5d0dd5aa6443a69277b5ce0544fec2",
"name": "my-token-1",
"subject": {
"type": "user",
"id": "1b510f18b3b05611871c0acdffa9aed4"
},
"type": {
"inviteToken": {
"inviteType": "userJoinCluster",
"clusterId": "fb73f7ceff5abd995357abbe01c812ce"
}
},
"caveats": [
{
"type": "time",
"validUntil": 1571147494
},
{
"type": "ip",
"whitelist": [
"189.34.15.0/8",
"127.0.0.0/24",
"167.73.12.17"
]
}
],
"metadata": {
"creationTime": 1564721024,
"usageLimit": 15,
"usageCount": 3,
"privileges": [
"space_view",
"space_read_data",
"space_view_views",
"space_view_statistics"
],
"custom": {
"jobName": "experiment-15",
"vm": "worker156.cloud.local"
}
},
"revoked": false,
"token": "MDAxNWxvY2F0aW9uIG9uZXpvbmUKMDAzYmlkZW50aWZpZXIgOEhmSEFSSGdrbHFCa1pWSTR"
}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."
}
}