Agent tokens are used to authenticate Monitoring Agents to the Monitoring Service. Multiple Agents on an account can share a single token.
Attribute
The following table describes the attribute for the Agent token resource.
Name | Description | Validation |
---|---|---|
label | Label | Optional String |
Use the following Agent tokens API operations to create and manage agent tokens.
- Create an agent token
- List agent tokens
- Get an agent token by ID
- Update an agent token
- Delete an agent token
Create an agent token
POST /agent_tokens
Create agent tokens using a valid set of parameters from the agent token attributes table.
The following table shows the possible response codes for this operation:
Response Code | Name | Description |
---|---|---|
201 | Accepted | ‘Location’ header contains a link to the newly created check. |
400 | Bad request | The system received an invalid value in a request. |
401 | Unauthorized | The system received a request from a user that is not authenticated. |
403 | Forbidden | The system received a request that the user is not authorized to make. |
500 | Internal Server Error | An unexpected condition was encountered. |
503 | Service Unavailable | The system is experiencing heavy load or another system failure. |
The following table shows the header parameters for the request:
Name | Type | Description |
---|---|---|
X-Auth-Token | String (Required) | A valid authentication token with administrative access. For details, see Get your credentials |
Example Create agent token: JSON request
{
"label": "Some Label"
}
This operation does not return a response body.
The newly created agent token is conveyed in the X-Object-ID
response header, as shown in the following example:
HTTP/1.1 201 Created
Date: Wed, 30 May 2018 18:43:04 GMT
Server: Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f
Location: https://monitoring.api.rackspacecloud.com/v1.0/hybrid:000000/agent_tokens/d9208af....hybrid:000000
Via: 1.1 Repose (Repose/8.8.3.0)
X-Object-ID: d9208af....hybrid:000000
List agent tokens
GET /agent_tokens
List the agent tokens.
This operation can be paginated. For information, see Paginated collections.
The following table shows the possible response codes for this operation:
Response Code | Name | Description |
---|---|---|
200 | OK | The request completed. |
401 | Unauthorized | The system received a request from a user that is not authenticated. |
403 | Forbidden | The system received a request that the user is not authorized to make. |
500 | Internal Server Error | An unexpected condition was encountered. |
503 | Service Unavailable | The system is experiencing heavy load or another system failure. |
The following table shows the header parameters for the request:
Name | Type | Description |
---|---|---|
X-Auth-Token | String (Required) | A valid authentication token with administrative access. For details, see Get your credentials |
Note
This operation does not accept a request body.
Example List agent tokens: JSON response
{
"values": [
{
"token": "4c5e28f0-0b3f-11e1-860d-c55c4705a286:1234",
"label": "aLabel"
}
],
"metadata": {
"count": 1,
"limit": 50,
"marker": null,
"next_marker": null,
"next_href": null
}
}
Get an agent token by ID
GET /agent_tokens/{tokenId}
Get information for the specified agent token.
The following table shows the possible response codes for this operation:
Response Code | Name | Description |
---|---|---|
200 | OK | The request completed. |
401 | Unauthorized | The system received a request from a user that is not authenticated. |
403 | Forbidden | The system received a request that the user is not authorized to make. |
500 | Internal Server Error | An unexpected condition was encountered. |
503 | Service Unavailable | The system is experiencing heavy load or another system failure. |
The following table shows the header parameters for the request:
Name | Type | Description |
---|---|---|
X-Auth-Token | String (Required) | A valid authentication token with administrative access. For details, see Get your credentials |
Note
This operation does not accept a request body.
Example Get agent token by ID: JSON response
{
"id": "someId",
"token": "4c5e28f0-0b3f-11e1-860d-c55c4705a286:1234",
"label": "aLabel"
}
Update an agent token
PUT /agent_tokens/{tokenId}
Update agent tokens using a valid set of parameters from the agent tokens attributes table.
The following table shows the possible response codes for this operation:
Response Code | Name | Description |
---|---|---|
204 | No Content | The server has fulfilled the request. Does not return a response body. |
400 | Bad request | The system received an invalid value in a request. |
401 | Unauthorized | The system received a request from a user that is not authenticated. |
403 | Forbidden | The system received a request that the user is not authorized to make. |
404 | Not Found | The URL, entity, or account requested is not found in the system. |
500 | Internal Server Error | An unexpected condition was encountered. |
503 | Service Unavailable | The system is experiencing heavy load or another system failure. |
The following table shows the header parameters for the request:
Name | Type | Description |
---|---|---|
X-Auth-Token | String (Required) | A valid authentication token with administrative access. For details, see Get your credentials |
Example Update agent token: JSON request
{
"label": "aNewLabel"
}
This operation does not return a response body.
Delete an agent token
DELETE /agent_tokens/{tokenId}
Delete the agent token with the specified tokenId
(label).
The following table shows the possible response codes for this operation:
Response Code | Name | Description |
---|---|---|
204 | No Content | The server has fulfilled the request. Does not return a response body. |
401 | Unauthorized | The system received a request from a user that is not authenticated. |
403 | Forbidden | The system received a request that the user is not authorized to make. |
404 | Not Found | The URL, entity, or account requested is not found in the system. |
500 | Internal Server Error | An unexpected condition was encountered. |
503 | Service Unavailable | The system is experiencing heavy load or another system failure. |
The following table shows the header parameters for the request:
Name | Type | Description |
---|---|---|
X-Auth-Token | String (Required) | A valid authentication token with administrative access. For details, see Get your credentials |
Note
This operation does not accept a request body.
This operation does not return a response body.