VPS device management
The routes in this page handle VPS device updates as well as access to the VPS console and Event viewer.
Route: /api/v2/vps/<int:deviceId>
This resource is used to gain console access to a VPS instance.
Method: DELETE - Delete VPS instance
Provided a valid existing Device ID and the requestor has the appropriate permissions, this method will delete a VPS instance.
Parameters
Name | Description |
---|---|
X-Fields string | An optional fields mask |
deviceId integer (Required) | The unique device ID of the VPS instance to be deleted. |
Sample request
curl -X 'DELETE' \
'https://core.hivelocity.net/api/v2/vps/$deviceId' \
-H 'accept: application/json' \
-H "X-API-KEY: $API_KEY" \
Sample Response
{
"taskId": "string",
"taskCreated": {},
"result": "string",
"taskUpdated": {},
"metaData": "string",
"clientId": 0,
"deviceId": 0
}
Response codes
Code | Message |
---|---|
201 | Success |
403 | You have not been granted permission to complete this action. Please contact your account manager to grant the proper permission. |
Method: PUT - Update VPS instance
Provided a valid existing Device ID and the requestor has the appropriate permissions, this method will update a VPS instance's SSH Keys or do an upgrade to a larger instance.
The VPS instance to be updated/upgraded must be turned off before attempting the change.
VPS devices may only be upgraded, not downgraded
Parameters
Name | Description |
---|---|
sshKeyIds list | List of SSH Key IDs |
productId integer | ID of the product to scale to |
X-Fields string | An optional fields mask |
deviceId integer (Required) | The unique device ID of the VPS instance to be deleted. |
Sample request
curl -X 'PUT' \
'https://core.hivelocity.net/api/v2/vps/$deviceId' \
-H 'accept: application/json' \
-H 'X-API-KEY: $API-KEY' \
-H 'Content-Type: application/json' \
-d '{
"sshKeyIds": [],
"productId": 0
}'
Sample Response
{
"taskId": "string",
"taskCreated": {},
"result": "string",
"taskUpdated": {},
"metaData": "string",
"clientId": 0,
"deviceId": 0
}
Response codes
Code | Message |
---|---|
201 | Success |
403 | You have not been granted permission to complete this action. Please contact your account manager to grant the proper permission. |
Method: GET - GET VPS instance
Provided a valid existing Device ID and the requestor has the appropriate permissions, this method will return details about the VPS device ID provided.
Parameters
Name | Description |
---|---|
X-Fields string | An optional fields mask |
deviceId integer (Required) | The unique device ID of the VPS instance to be deleted. |
Sample request
curl -X 'GET' \
'https://core.hivelocity.net/api/v2/vps/$deviceId' \
-H 'accept: application/json' \
-H "X-API-KEY: $API_KEY" \
Sample Response
{
"taskId": "string",
"taskCreated": {},
"result": "string",
"taskUpdated": {},
"metaData": "string",
"clientId": 0,
"deviceId": 0
}
Response codes
Code | Message |
---|---|
201 | Success |
403 | You have not been granted permission to complete this action. Please contact your account manager to grant the proper permission. |
Route: /api/v2/vps/<int:deviceId>/console
This resource is used to gain console access to a VPS instance.
Provided a valid existing Device ID is provided and the requestor has the appropriate permissions, this method will provide console access to the specified VPS instance via a one time use URL.
Parameters
Name | Description |
---|---|
X-Fields string | An optional fields mask |
deviceId integer | The unique device ID of the VPS instance to connect to with the console through a one time use URL |
Sample request
curl -X 'POST' \
'https://core.hivelocity.net/api/v2/vps/$deviceId/console' \
-H "X-API-KEY: $API_KEY" \
-H 'accept: application/json'
Sample Response
{
"url": "string"
}
Response codes
Code | Message |
---|---|
200 | Success |
403 | You have not been granted permission to complete this action. Please contact your account manager to grant the proper permission. |
Function in myV:
Route: /api/v2/vps/<int:deviceId>/events
This resource is used to fetch VPS Instance Events.
Method: GET - Get VPS instance events
Provided a valid existing Device ID is provided and the requestor has the appropriate permissions, this method will display an array of event logs for the VPS instance specified.
Parameters
Name | Description |
---|---|
X-Fields string | An optional fields mask |
deviceId integer | The unique device ID of the VPS instance to pull events from |
Sample Request
curl -X 'GET' \
'https://core.hivelocity.net/api/v2/vps/$deviceId/events' \
-H "X-API-KEY: $API_KEY" \
-H 'accept: application/json'
Sample Response
[
{
"eventId": "string",
"type": "string",
"createdAt": "2023-07-11T17:41:11.396Z",
"level": "string",
"state": "string"
}
]
Response Codes
Code | Message |
---|---|
200 | Success |
403 | You have not been granted permission to complete this action. Please contact your account manager to grant the proper permission. |
Route: /api/v2/vps/<int:deviceId>/metrics
This resource is used to fetch VPS Instance metrics.
Method: GET - Get metrics for a VPS instance
Provided a valid existing Device ID and the metric type to be returned is provided and the requestor has the appropriate permissions, this method will return image data to display a chart of the specified metric. The image data is returned in Base64 encoded image data.
Parameters
Name | Description |
---|---|
startTime Integer | The desired start time for chart data |
endTime Integer | The desired end time for chart data |
imageWidth Integer | The desired width to render the chart image (In pixels) |
imageHeight Integer | The desired height to render the chart image (In pixels) |
metricType String (Required) | The metric to query against to build the chart data. Accepted inputs: CPU_USAGE: Processor metrics MEMORY_USAGE: Memory metrics DISK_RW: Read/Write metrics for disk operations NETWORK_USAGE: Network activity metrics |
X-Fields string | An optional fields mask |
deviceId integer (Required in path) | The unique device ID of the VPS instance to pull events from |
Sample Request
curl -X 'GET' \
"https://core.hivelocity.net/api/v2/vps/31844/metrics?metricType=$metricType" \
-H 'accept: application/json' \
-H "X-API-KEY: $API_KEY"
Sample Response
{
"endTime": 0,
"startTime": 0,
"metricType": "string",
"imageData": "string"
}
Response Codes
Code | Message |
---|---|
200 | Success |
403 | You have not been granted permission to complete this action. Please contact your account manager to grant the proper permission. |
Updated about 1 year ago