Skip to main content

List Virtual Machines

GET https://infrahub-api.nexgencloud.com/v1/core/virtual-machines

Retrieves a list of your current virtual machines, offering comprehensive details for each, such as hardware configuration, ID, operating system, operational status, firewall rules, and more.


Query string parameters


search string or integer  optional

Search for the name or ID of the virtual machine to retrieve it.


page integer  optional

The page number to retrieve virtual machines from.


pageSize integer  optional

Specify the number of virtual machines to return per page.


Attributes


status boolean

Indicates the result of the request to retrieve a list of VMs. true signifies success, while false indicates an error.


message string

A description of the status of the request.


instances array of objects

An array of instances objects, each containing details about a VM.

For descriptions of the fields within the instances object returned in response to your request, please refer to the documentation here.


Example request
curl -X GET "https://infrahub-api.nexgencloud.com/v1/core/virtual-machines" \
-H "accept: application/json"\
-H "api_key: YOUR API KEY"
Response
{
"status": true,
"message": "string",
"instances": [
{
"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-18T15:41:25.069Z"
}
],
"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-18T15:41:25.069Z"
}
],
"power_state": "string",
"vm_state": "string",
"fixed_ip": "string",
"floating_ip": "string",
"floating_ip_status": "string",
"created_at": "2023-12-18T15:41:25.069Z"
}
]
}

Returns


Returns a list of your virtual machines as instances objects, each containing details about the VM.



Back to top