List Virtual Machines

List Virtual Machines

Returns information about all virtual machines. If you have not added NSX tags on the VM or removed all the NSX tags that were earlier added to the VM, then tags property is not returned in the API response.

Request
URI
GET
https://nsxmanager.your.domain/api/v1/fabric/virtual-machines
COPY
Query Parameters
string
cursor
Optional

Opaque cursor to be used for getting next page of records (supplied by current result page)

string
display_name
Optional

Display Name of the virtual machine

string
exclude_vm_type
Optional

VM types to be excluded

string
external_id
Optional

External id of the virtual machine

string
host_id
Optional

Id of the host where this vif is located

string
included_fields
Optional

Comma separated list of fields that should be included in query result

integer
page_size
Optional
Constraints: minimum: 0 maximum: 1000 default: 1000

Maximum number of results to return in this page (server may return fewer)

boolean
sort_ascending
Optional

sort_ascending

string
sort_by
Optional

Field by which records are sorted


Authentication
This operation uses the following authentication methods.
Responses
200

OK

Returns VirtualMachineListResult of type(s) application/json
This response body class contains all of the following: InlineVirtualMachineListResult1
{
    "_links": [
        {
            "action": "string",
            "href": "string",
            "rel": "string"
        }
    ],
    "_schema": "string",
    "_self": {},
    "cursor": "string",
    "result_count": 0,
    "sort_ascending": false,
    "sort_by": "string",
    "results": [
        {
            "_links": [
                {
                    "action": "string",
                    "href": "string",
                    "rel": "string"
                }
            ],
            "_schema": "string",
            "_self": {},
            "_last_sync_time": 0,
            "description": "string",
            "display_name": "string",
            "resource_type": "string",
            "scope": [
                {
                    "scope_id": "string",
                    "scope_type": "string"
                }
            ],
            "tags": [
                {
                    "scope": "string",
                    "tag": "string"
                }
            ],
            "compute_ids": [
                "string"
            ],
            "external_id": "string",
            "guest_info": {
                "computer_name": "string",
                "os_name": "string"
            },
            "host_id": "string",
            "local_id_on_host": "string",
            "power_state": "string",
            "runtime_info": {
                "vif_runtime_info": [
                    {
                        "external_id": "string",
                        "uptv2_active": "string"
                    }
                ]
            },
            "source": {
                "is_valid": false,
                "target_display_name": "string",
                "target_id": "string",
                "target_type": "string"
            },
            "type": "string",
            "uptv2_enabled": false
        }
    ]
}

400
Returns BadRequest of type(s) application/json
Operation doesn't return any data structure

403
Returns Forbidden of type(s) application/json
Operation doesn't return any data structure

404
Returns NotFound of type(s) application/json
Operation doesn't return any data structure

412
Returns PreconditionFailed of type(s) application/json
Operation doesn't return any data structure

500
Returns InternalServerError of type(s) application/json
Operation doesn't return any data structure

503
Returns ServiceUnavailable of type(s) application/json
Operation doesn't return any data structure

Code Samples
COPY
                    curl -H 'Authorization: <value>' https://{api_host}/api/v1/fabric/virtual-machines