Retrieve Virtual Machine Details
GET https://infrahub-api.nexgencloud.com/v1/core/virtual-machines/{id}
Retrieves the details of an existing virtual machine. Supply the virtual machine ID in the path, and Infrahub will return the corresponding Virtual Machine object.
Path parameters
id integer
Required
The unique identifier of the virtual machine for which to retrieve details.
Attributes
status boolean
Indicates the result of the request to retrieve a list of VMs. true
signifies success, while false
indicates an encountered error.
message string
A description of the status of the request.
instance object
The instance
object contains details including configuration and specification details about the virtual machine.
For descriptions of the fields within the instance
object returned in response to your request, please refer to the documentation here.
curl -X GET "https://infrahub-api.nexgencloud.com/v1/core/virtual-machines/{id}" \
-H "accept: application/json"\
-H "api_key: YOUR API KEY"
{
"status": true,
"message": "string",
"instance": {
"id": 0,
"name": "string",
"status": "string",
"environment": {
"name": "string"
},
"image": {
"name": "string"
},
"flavor": {
"id": 0,
"name": "string",
"cpu": 0,
"ram": 0,
"disk": 0,
"gpu": "string",
"gpu_count": 0
},
"keypair": {
"name": "string"
},
"volume_attachments": [
{
"volume": {
"id": 0,
"name": "string",
"description": "string",
"volume_type": "string",
"size": 0
},
"status": "string",
"device": "string",
"created_at": "2023-12-18T16:11:25.282Z"
}
],
"security_rules": [
{
"id": 0,
"direction": "string",
"protocol": "string",
"port_range_min": 0,
"port_range_max": 0,
"ethertype": "string",
"remote_ip_prefix": "string",
"status": "string",
"created_at": "2023-12-18T16:11:25.282Z"
}
],
"power_state": "string",
"vm_state": "string",
"contract_id": 1,
"fixed_ip": "string",
"floating_ip": "string",
"floating_ip_status": "string",
"created_at": "2023-12-18T16:11:25.282Z"
}
}
Returns
Returns an instance
object containing details on the specified virtual machine is returned in the response. If details on the specified virtual machine are not retrieved, an error will be returned.