Skip to main content

Get list of virtual private clouds

Contributors netapp-ranuk

You can use this workflow to retrieve a list of the available virtual private clouds (VPCs).

Choose the workflow to use based on the type of Cloud Volumes ONTAP deployment:

Get VPCs for single node

You can use this workflow to retrieve the VPCs for a single node working environment.

Step 1. Select the region to use

Perform the workflow Get regions and choose the code value for the region query parameter.

Step 2. Get the VPCs

You can issue a REST API call to retrieve the virtual private clouds (VPCs).

HTTP method and endpoint

This REST API call uses the following method and endpoint.

HTTP method Path

GET

/occm/api/vsa/metadata/vpcs?region=<REGION>

Curl example
curl --request GET \
--location "https://cloudmanager.cloud.netapp.com/occm/api/vsa/metadata/vpcs?region=<REGION>" \
--header "x-agent-id: <AGENT_ID>" \
--header "Authorization: Bearer <ACCESS_TOKEN>" \
--header "Content-Type: application/json"
Additional input parameters

In addition to the parameters common with all REST API calls, the following parameters are also used in the curl examples for this step.

Parameter Type Required Description

<REGION> region

Query

Yes

Identifies the region of the working environment

JSON output example

The JSON output example includes the list of virtual private clouds.

Example output
[
    {
        "vpcId": "vpc-b16c90d4",
        "state": "available",
        "cidrBlock": "172.31.0.0/16",
        "tags": [
            {
                "key": "Name",
                "value": "VPC for VSA"
            },
            {
                "key": "last",
                "value": "ioio"
            }
        ],
        "default": true,
        "subnets": [
            {
                "subnetId": "subnet-c1d99699",
                "cidr": "172.31.5.0/24",
                "subnetName": "subnet5",
                "availabilityZone": "us-east-1a",
                "availableIps": 247,
                "minimumRequiredIps": 8,
                "outpostArn": null
            },
            {
                "subnetId": "subnet-deebdbe3",
                "cidr": "172.31.6.0/24",
                "subnetName": "Proxy Subnet",
                "availabilityZone": "us-east-1e",
                "availableIps": 248,
                "minimumRequiredIps": 8,
                "outpostArn": null
            }
        ],
        "securityGroups": [
            {
                "securityGroupId": "xx-xxxa1ne9xxx67xcvf",
                "description": "NetApp OCCM Instance External Security Group",
                "name": "hguyiuukOCCM1590415972561-OCCMSecurityGroup-yryrytt"
            },
            {
                "securityGroupId": "xx-xxxa1ne9xxx67xcvf",
                "description": "Enable HTTP and NFS for Cloud Restore Instance",
                "name": "Cloud-Restore-Instance-account-xxxxxx-CloudRestoreInstanceSecurityGroup-sdweretttrrt"
            }
        ],
        "tenancy": "default"
    },
    {
        "vpcId": "vpc-fe5c1f98",
        "state": "available",
        "cidrBlock": "140.30.0.0/16",
        "tags": [
            {
                "key": "Name",
                "value": "VPCWIthNOS3"
            }
        ],
        "default": false,
        "subnets": [
            {
                "subnetId": "subnet-e84722d4",
                "cidr": "140.30.5.0/24",
                "subnetName": "subnet1",
                "availabilityZone": "us-east-1e",
                "availableIps": 250,
                "minimumRequiredIps": 8,
                "outpostArn": null
            }
        ],
        "securityGroups": [
            {
                "securityGroupId": "xx-xxxa1ne9xxx67xcvf",
                "description": "ONTAP Cloud firewall rules for management and data interface",
                "name": "xx-Version10-duahpJbS-NetAppExternalSecurityGroup-rtyunht"
            },
            {
                "securityGroupId": "xx-xxxa1ne9xxx67xcvf",
                "description": "default VPC security group",
                "name": "default"
            }
        ],
        "tenancy": "default"
    }
]

Get VPCs for high availability pair

You can use this workflow to retrieve the VPCs for an HA working environment.

Step 1. Select the region to use

Perform the workflow Get regions and choose the code value for the region query parameter.

Step 2. Get the VPCs

You can issue a REST API call to retrieve the virtual private clouds (VPCs).

HTTP method and endpoint

This REST API call uses the following method and endpoint.

HTTP method Path

GET

/occm/api/aws/ha/metadata/vpcs?region=<REGION>

Curl example
curl --request GET \
--location "https://cloudmanager.cloud.netapp.com/occm/api/aws/ha/metadata/vpcs?region=<REGION>" \
--header "x-agent-id: <AGENT_ID>" \
--header "Authorization: Bearer <ACCESS_TOKEN>" \
--header "Content-Type: application/json"
Additional input parameters

In addition to the parameters common with all REST API calls, the following parameters are also used in the curl examples for this step.

Parameter Type Required Description

<REGION> region

Query

Yes

Identifies the region of the working environment

JSON output example

The JSON output example includes the list of virtual private clouds.

Example output
[
    {
        "vpcId": "vpc-b16c90d4",
        "state": "available",
        "cidrBlock": "172.31.0.0/16",
        "tags": [
            {
                "key": "Name",
                "value": "VPC for VSA"
            },
            {
                "key": "last",
                "value": "ioio"
            }
        ],
        "default": true,
        "subnets": [
            {
                "subnetId": "subnet-c1d99699",
                "cidr": "172.31.5.0/24",
                "subnetName": "subnet5",
                "availabilityZone": "us-east-1a",
                "availableIps": 247,
                "minimumRequiredIps": 8,
                "outpostArn": null
            },
            {
                "subnetId": "subnet-deebdbe3",
                "cidr": "172.31.6.0/24",
                "subnetName": "Proxy Subnet",
                "availabilityZone": "us-east-1e",
                "availableIps": 248,
                "minimumRequiredIps": 8,
                "outpostArn": null
            }
        ],
        "securityGroups": [
            {
                "securityGroupId": "xx-xxxa1ne9xxx67xcvf",
                "description": "NetApp OCCM Instance External Security Group",
                "name": "lilush2000OCCM1590415972561-OCCMSecurityGroup-JDB72N6W90UG"
            },
            {
                "securityGroupId": "xx-xxxa1ne9xxx67xcvf",
                "description": "Enable HTTP and NFS for Cloud Restore Instance",
                "name": "Cloud-Restore-Instance-account-xxxxxx-CloudRestoreInstanceSecurityGroup-sdweretttrrt"
            }
        ],
        "tenancy": "default"
    },
    {
        "vpcId": "vpc-fe5c1f98",
        "state": "available",
        "cidrBlock": "140.30.0.0/16",
        "tags": [
            {
                "key": "Name",
                "value": "VPCWIthNOS3"
            }
        ],
        "default": false,
        "subnets": [
            {
                "subnetId": "subnet-e84722d4",
                "cidr": "140.30.5.0/24",
                "subnetName": "subnet1",
                "availabilityZone": "us-east-1e",
                "availableIps": 250,
                "minimumRequiredIps": 8,
                "outpostArn": null
            }
        ],
        "securityGroups": [
            {
                "securityGroupId": "xx-xxxa1ne9xxx67xcvf",
                "description": "ONTAP Cloud firewall rules for management and data interface",
                "name": "XX-Version10-yuiloJbS-NetAppExternalSecurityGroup-TYUOPR"
            },
            {
                "securityGroupId": "xx-xxxa1ne9xxx67xcvf",
                "description": "default VPC security group",
                "name": "default"
            }
        ],
        "tenancy": "default"
    }
]