To list all of the resources that are members of a VPC, send a GET request to
/v2/vpcs/$VPC_ID/members
.
To only list resources of a specific type that are members of the VPC,
included a resource_type
query parameter. For example, to only list Droplets
in the VPC, send a GET request to /v2/vpcs/$VPC_ID/members?resource_type=droplet
.
Name | Type | Required | Description | Default Value |
---|---|---|---|---|
vpc_id |
string | True | A unique identifier for a VPC. | |
resource_type |
string | False | Used to filter VPC members by a resource type. | |
per_page |
integer | False | Number of items returned per page | 20 |
page |
integer | False | Which ‘page’ of paginated results to return. | 1 |
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
resp = client.vpcs.list_members(vpc_id="e0fe0f4d")
See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.
The response will be a JSON object with a key called members. This will be set to an array of objects, each of which will contain the standard attributes associated with a VPC member.
Unauthorized
The resource was not found.
API Rate limit exceeded
Server error.
Unexpected error