From the API call GET /policy/api/v1/infra/realized-state/virtual-machines the fields "cursor" and "result_count" are not listed
search cancel

From the API call GET /policy/api/v1/infra/realized-state/virtual-machines the fields "cursor" and "result_count" are not listed

book

Article ID: 316116

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • The below is an example. "cursor" and "result_count" fields are missing.

 

root@manager:~# curl -k -u 'admin:<password>' -X GET https://localhost/policy/api/v1/infra/realized-state/virtual-machines?page_size=1
{
    "results": [
        {
            "host_id": "########-####-####-####-#########45df",
            "source": {
                "target_id": "########-####-####-#########4a2c",
                "target_display_name": "tn",
                "target_type": "HostNode",
                "is_valid": true
            },
            "external_id": "########-####-####-####-#########34a2",
            "power_state": "VM_STOPPED",
            "local_id_on_host": "4",
            "compute_ids": [
                "moIdOnHost:4",
                "hostLocalId:4",
                "locationId:########-####-####-####-#########c647",
                "instanceUuid:########-####-####-####-#########34a2",
                "externalId:########-####-####-####-#########34a2",
                "biosUuid:########-####-####-####-#########c647"
            ],
            "type": "REGULAR",
            "resource_type": "VirtualMachine",
            "display_name": "vm1",
            "_last_sync_time": 1612518456279
        }
    ]
}

Environment

VMware NSX-T Data Center

Cause

When converting the search result to the return type, the system does not populate the cursor and result count.

Resolution

This issue is resolved in VMware NSX 3.2.0 and later versions, available at Broadcom downloads.

If you are having difficulty finding and downloading software, please review the Download Broadcom products and software KB.

 

Workaround:

Use "GET /api/v1/fabric/virtual-machines" API call.