NSX-T Data Center REST API

Returns a list of Azure virtual networks

Returns a list of Azure virtual networks with information about each
virtual network like IPv4 CIDR, gateway information and transport zones.
Optional query parameters can be utilized to filter the list.

Request:

Method:
GET
URI Path(s):
/api/v1/csm/azure/vnets
Request Headers:
n/a
Query Parameters:
AzureVnetListRequestParameters+
Request Body:
n/a

Example Request:

GET https://<nsx-csm>/api/v1/csm/azure/vnets

Successful Response:

Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
AzureVnetListResult+

Example Response:

{ "cursor": "000002", "sort_ascending": true, "result_count": 3, "results": [ { "resource_type": "AzureVnet", "id": "3054a504-4c09-4df7-8420", "display_name": "NSX-Vnet-1", "cidr_blocks": [ "10.59.1.224/28", "172.20.10.0/24", "172.20.11.0/24", "172.20.12.0/24", "172.20.13.0/24", "172.20.14.0/24" ], "resource_group": "NSX-Vnet-1-RG", "associated_account_ids": [ "28984eef-d296-4a40-979e" ], "region_id": "westus", "resource_id": "/subscriptions/1234567890/resourceGroups/NSX-Vnet-1-RG/providers/Microsoft.Network/virtualNetworks/NSX-Vnet-1", "capabilities":["HORIZON"], "instance_stats": { "total": 6, "managed": 0, "unmanaged": 5, "error": 0, "powered_off": 1 }, "vdi_stats": { "total": 4, "managed": 0, "unmanaged": 3, "error": 0, "powered_off": 1 }, "op_status": "NSX_UNMANAGED", "gateway_info": { "gateway_status": { "gateway_cluster_id": "" } }, "is_management_vnet": false, "_protection": "NOT_PROTECTED" }, { "resource_type": "AzureVnet", "id": "e8e719ff-6a40-48e2-8cf7", "display_name": "NSX-Int-Vnet-Ind-3", "cidr_blocks": [ "10.59.4.112/28", "172.18.35.0/24", "172.18.36.0/24", "172.18.37.0/24", "172.18.38.0/24", "172.18.39.0/24" ], "resource_group": "NSX-Vnet-2-RG", "associated_account_ids": [ "28984eef-d296-4a40-979e" ], "transport_zones": [ { "is_underlay_transport_zone": false, "logical_switches": [ { "is_default_logical_switch": false, "instances_count": 0, "nsx_switch_tag": "a2aad0f1-a48a-474b-8423-41767f538ee0#/E=", "logical_switch_display_name": "DefaultSwitch-Overlay-NSX-Vnet-2", "logical_switch_id": "ls54321" } ], "transport_zone_id": "tz54321", "transport_zone_display_name": "NSX-Vnet-2-Overlay" }, { "is_underlay_transport_zone": true, "logical_switches": [ { "is_default_logical_switch": true, "instances_count": 0, "nsx_switch_tag": "default", "logical_switch_display_name": "DefaultSwitch-VLAN-NSX-Vnet-2", "logical_switch_id": "ls12345" } ], "transport_zone_id": "tz12345", "transport_zone_display_name": "NSX-Vnet-2-VLAN" } ], "region_id": "westus", "resource_id": "/subscriptions/1234567890/resourceGroups/NSX-Vnet-2-RG/providers/Microsoft.Network/virtualNetworks/NSX-Vnet-2", "instance_stats": { "total": 6, "managed": 0, "unmanaged": 6, "error": 0, "powered_off": 0 }, "managed_vnets": [ { "virtual_private_cloud_id": "3034a504-4509-4df7-8429", "associated_account_ids: ["28984eef-d296-4a40-979e"], "virtual_private_cloud_name": "NSX-Vnet-4" } ], "op_status": "NSX_MANAGED", "gateway_info": { "configuration": { "default_quarantine_policy_enabled": false, "managed_without_agents": false, "proxy_server_profile":"a491bc83-5fc8-4e05-adb1-af8274422141", "nsx_manager_connection": "PRIVATE_IP", "is_ha_enabled": false, "form_factor": "LARGE", "gateway_ha_configuration": [], "dns_settings": { "dns_mode": "DHCP" }, "ssh_key": "abcxyzabcxyz", "image_id": "https://abcxyz.windows.net/public-cloud-gateway2/nsx-public-gateway.vhd" }, "gateway_status": { "gateway_cluster_id": "abc123", "gateway_instances_status": [ { "gateway_tn_id": "abcde12345", "deployment_step": "DEPLOYMENT_SUCCESSFUL", "public_ip": "1.2.3.4", "gateway_node_id": "12345abcde", "gateway_status": "UP", "gateway_instance_id": "abcde12345", "private_ip": "4.3.2.1", "gateway_ha_index": 0, "is_gateway_active": false, "gateway_name": "nsx-gw-test" } ] } }, "is_management_vnet": false, "_protection": "NOT_PROTECTED" }, { "resource_type": "AzureVnet", "id": "3034a504-4509-4df7-8429", "display_name": "NSX-Vnet-4", "cidr_blocks": [ "10.59.1.224/28", "172.20.10.0/24" ], "resource_group": "NSX-Vnet-4-RG", "associated_account_ids": [ "28984eef-d296-4a40-979e" ], "region_id": "westus", "resource_id": "/subscriptions/1234567890/resourceGroups/NSX-Vnet-4-RG/providers/Microsoft.Network/virtualNetworks/NSX-Vnet-4", "instance_stats": { "total": 6, "managed": 0, "unmanaged": 5, "error": 0, "powered_off": 1 }, "associated_transit_vnet": { "virtual_private_cloud_id": "e8e719ff-6a40-48e2-8cf7", "associated_account_ids: ["28984eef-d296-4a40-979e"], "virtual_private_cloud_name": "NSX-Int-Vnet-Ind-3" }, "op_status": "NSX_MANAGED_BY_TRANSIT_VNET", "gateway_info": { "gateway_status": { "gateway_cluster_id": "" } }, "is_management_vnet": false, "_protection": "NOT_PROTECTED" }, ] }

Required Permissions:

read

Feature:

cloud_resources

Additional Errors: