List and filter on VPC Subnets.
Field | Type | Required | Description |
---|---|---|---|
api_token |
str |
Required | The Linode account personal access token. It is necessary to run the module. It can be exposed by the environment variable LINODE_API_TOKEN instead. See details in Usage. |
- name: List all of the subnets under a VPC
linode.cloud.vpc_subnet_list:
vpc_id: 12345
- name: List all of the subnets with a given label under a VPC
linode.cloud.vpc_subnet_list:
vpc_id: 12345
filters:
- name: label
values: my-subnet
Field | Type | Required | Description |
---|---|---|---|
vpc_id |
int |
Required | The parent VPC for the VPC Subnets. |
order |
str |
Optional | The order to list VPC Subnets in. (Choices: desc , asc ; Default: asc ) |
order_by |
str |
Optional | The attribute to order VPC Subnets by. |
filters (sub-options) |
list |
Optional | A list of filters to apply to the resulting VPC Subnets. |
count |
int |
Optional | The number of VPC Subnets to return. If undefined, all results will be returned. |
Field | Type | Required | Description |
---|---|---|---|
name |
str |
Required | The name of the field to filter on. Valid filterable fields can be found here. |
values |
list |
Required | A list of values to allow for this field. Fields will pass this filter if at least one of these values matches. |
-
subnets
- The returned VPC Subnets.- Sample Response:
[ { "created": "2023-08-31T18:53:04", "id": 271, "ipv4": "10.0.0.0/24", "label": "test-subnet", "linodes": [ { "id": 1234567, "interfaces": [{"active": false, "id": 654321}] } ], "updated": "2023-08-31T18:53:04" } ]
- See the Linode API response documentation for a list of returned fields
- Sample Response: