Get Azure VNets

Contributors netapp-ranuk

You can perform this workflow to retrieve the network extended information.

Note Ensure that you’ve the Azure subscription ID. You can easily obtain the ID from the Azure portal.

1. Get the vnets

HTTP method Path

GET

/occm/api/azure/vsa/metadata/vnets

curl example
curl --location --request GET 'https://cloudmanager.cloud.netapp.com/occm/api/azure/vsa/metadata/vnets?region=<REGION>&subscriptionId=<SUBSCRIPTION_ID>' --header 'x-agent-id: <AGENT_ID>' --header 'Authorization: Bearer <ACCESS_TOKEN>' --header 'Content-Type: application/json'
Input

Query parameters:

  • <REGION> region string

  • <SUBSCRIPTION_ID> subscriptionId string

  • (Optional) cloudProviderAccountId string

Output

The JSON output example includes the list of Azure storage account types.

JSON output example
{
    "virtualNetworks": [
        {
            "name": "Vnet1",
            "id": "/subscriptions/x000xx00-0x00-0000-000x-x00xxxx0x00/resourceGroups/occm_group_eastus2/providers/Microsoft.Network/virtualNetworks/Vnet1",
            "cidrs": [
                {
                    "cidr": "10.0.0.0/16",
                    "subnets": [
                        {
                            "id": "/subscriptions/x000xx00-0x00-0000-000x-x00xxxx0x00/resourceGroups/occm_group_eastus2/providers/Microsoft.Network/virtualNetworks/Vnet1/subnets/Subnet1",
                            "cidr": "10.0.0.0/24",
                            "name": "Subnet1",
                            "availableIps": 250,
                            "minimumRequiredIps": 6
                        },
                        {
                            "id": "/subscriptions/x000xx00-0x00-0000-000x-x00xxxx0x00/resourceGroups/occm_group_eastus2/providers/Microsoft.Network/virtualNetworks/Vnet1/subnets/Subnet2",
                            "cidr": "10.0.1.0/24",
                            "name": "Subnet2",
                            "availableIps": 251,
                            "minimumRequiredIps": 6
                        },
                        {
                            "id": "/subscriptions/x000xx00-0x00-0000-000x-x00xxxx0x00/resourceGroups/occm_group_eastus2/providers/Microsoft.Network/virtualNetworks/Vnet1/subnets/ProxySubnet",
                            "cidr": "10.0.2.0/24",
                            "name": "ProxySubnet",
                            "availableIps": 245,
                            "minimumRequiredIps": 6
                        }
                    ]
                }
            ],
            "resourceGroup": "occm_group_eastus2",
            "tags": []
        },
        {
            "name": "Vnet2",
            "id": "/subscriptions/x000xx00-0x00-0000-000x-x00xxxx0x00/resourceGroups/occm_group_eastus2/providers/Microsoft.Network/virtualNetworks/Vnet2",
            "cidrs": [
                {
                    "cidr": "10.1.0.0/16",
                    "subnets": [
                        {
                            "id": "/subscriptions/x000xx00-0x00-0000-000x-x00xxxx0x00/resourceGroups/occm_group_eastus2/providers/Microsoft.Network/virtualNetworks/Vnet2/subnets/Subnet1",
                            "cidr": "10.1.0.0/24",
                            "name": "Subnet1",
                            "availableIps": 251,
                            "minimumRequiredIps": 6
                        },
                        {
                            "id": "/subscriptions/x000xx00-0x00-0000-000x-x00xxxx0x00/resourceGroups/occm_group_eastus2/providers/Microsoft.Network/virtualNetworks/Vnet2/subnets/Subnet2",
                            "cidr": "10.1.1.0/24",
                            "name": "Subnet2",
                            "availableIps": 251,
                            "minimumRequiredIps": 6
                        },
                        {
                            "id": "/subscriptions/x000xx00-0x00-0000-000x-x00xxxx0x00/resourceGroups/occm_group_eastus2/providers/Microsoft.Network/virtualNetworks/Vnet2/subnets/ProxySubnet",
                            "cidr": "10.1.2.0/24",
                            "name": "ProxySubnet",
                            "availableIps": 251,
                            "minimumRequiredIps": 6
                        }
                    ]
                }
            ],
            "resourceGroup": "occm_group_eastus2",
            "tags": []
        }
    ],
    "securityGroups": [
        {
            "id": "/subscriptions/x000xx00-0x00-0000-000x-x00xxxx0x00/resourceGroups/occm_group_eastus2/providers/Microsoft.Network/networkSecurityGroups/OCCM-SG-467",
            "name": "OCCM-SG-467",
            "resourceGroup": "occm_group_eastus2"
        },
        {
            "id": "/subscriptions/x000xx00-0x00-0000-000x-x00xxxx0x00/resourceGroups/occm_group_eastus2/providers/Microsoft.Network/networkSecurityGroups/OCCM-SG-491",
            "name": "OCCM-SG-491",
            "resourceGroup": "occm_group_eastus2"
        },
        {
            "id": "/subscriptions/x000xx00-0x00-0000-000x-x00xxxx0x00/resourceGroups/occm_group_eastus2/providers/Microsoft.Network/networkSecurityGroups/OCCM-SG-589",
            "name": "OCCM-SG-589",
            "resourceGroup": "occm_group_eastus2"
        }
    ]
}