Virtual Server management

The routes in this page handle Virtual server updates as well as access to the Virtual server console and Event viewer.

Route: /api/v2/vps/<int:deviceId>

This resource is used to gain console access to a Virtual Server instance.

Provided a valid existing Device ID and the requestor has the appropriate permissions, this method will delete a Virtual server instance.

Parameters

NameDescription
X-Fields stringAn optional fields mask
deviceId integer (Required)The unique device ID of the Virtual server 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

CodeMessage
201Success
403You have not been granted permission to complete this action. Please contact your account manager to grant the proper permission.

Provided a valid existing Device ID and the requestor has the appropriate permissions, this method will update a Virtual server instance's SSH Keys or do an upgrade to a larger instance.

🚧

The Virtual server instance to be updated/upgraded must be turned off before attempting the change.

Virtual server devices may only be upgraded, not downgraded

Parameters

NameDescription
sshKeyIds listList of SSH Key IDs
productId integerID of the product to scale to
X-Fields stringAn optional fields mask
deviceId integer (Required)The unique device ID of the Virtual server 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

CodeMessage
201Success
403You have not been granted permission to complete this action. Please contact your account manager to grant the proper permission.

Provided a valid existing Device ID and the requestor has the appropriate permissions, this method will return details about the Virtual server device ID provided.

Parameters

NameDescription
X-Fields stringAn optional fields mask
deviceId integer (Required)The unique device ID of the Virtual server 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

CodeMessage
201Success
403You 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 Virtual server instance via a one time use URL.

Parameters

NameDescription
X-Fields stringAn optional fields mask
deviceId integerThe unique device ID of the Virtual server 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

CodeMessage
200Success
403You 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.

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 Virtual server instance specified.

Parameters

NameDescription
X-Fields stringAn optional fields mask
deviceId integerThe unique device ID of the Virtual server 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

CodeMessage
200Success
403You 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.

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

NameDescription
startTime IntegerThe desired start time for chart data
endTime IntegerThe desired end time for chart data
imageWidth IntegerThe desired width to render the chart image (In pixels)
imageHeight IntegerThe 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 stringAn 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

CodeMessage
200Success
403You have not been granted permission to complete this action. Please contact your account manager to grant the proper permission.