peerings
Creates, updates, deletes, gets or lists a peerings
resource.
Overview
Name | peerings |
Type | Resource |
Id | digitalocean.vpcs.peerings |
Fields
The following fields are returned by SELECT
queries:
- vpcs_list_peerings
The response will be a JSON object with a key called peerings
. This will be set to an array of objects, each of which will contain the standard attributes associated with a VPC peering.
Name | Datatype | Description |
---|---|---|
id | string (uuid) | A unique ID that can be used to identify and reference the VPC peering. (example: 5a4981aa-9653-4bd1-bef5-d6bff52042e4) |
name | string | The name of the VPC peering. Must be unique within the team and may only contain alphanumeric characters and dashes. (pattern: ^[a-zA-Z0-9-]+$, example: nyc1-blr1-peering) |
created_at | string (date-time) | A time value given in ISO8601 combined date and time format. (example: 2020-03-13T19:20:47.442049222Z) |
status | string | The current status of the VPC peering. (example: ACTIVE) |
vpc_ids | array | An array of the two peered VPCs IDs. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
vpcs_list_peerings | select | vpc_id | per_page , page | To list all of a VPC's peerings, send a GET request to/v2/vpcs/$VPC_ID/peerings . |
vpcs_create_peerings | insert | vpc_id , data__name , data__vpc_id | To create a new VPC peering for a given VPC, send a POST request to/v2/vpcs/$VPC_ID/peerings . | |
vpcs_patch_peerings | update | vpc_id , vpc_peering_id , data__name | To update the name of a VPC peering in a particular VPC, send a PATCH request to /v2/vpcs/$VPC_ID/peerings/$VPC_PEERING_ID with the new name in the request body. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
vpc_id | string (uuid) | A unique identifier for a VPC. (example: 4de7ac8b-495b-4884-9a69-1050c6793cd6) |
vpc_peering_id | string (uuid) | A unique identifier for a VPC peering. (example: 5a4981aa-9653-4bd1-bef5-d6bff52042e4) |
page | integer | Which 'page' of paginated results to return. (example: 1) |
per_page | integer | Number of items returned per page (example: 2) |
SELECT
examples
- vpcs_list_peerings
To list all of a VPC's peerings, send a GET request to/v2/vpcs/$VPC_ID/peerings
.
SELECT
id,
name,
created_at,
status,
vpc_ids
FROM digitalocean.vpcs.peerings
WHERE vpc_id = '{{ vpc_id }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}';
INSERT
examples
- vpcs_create_peerings
- Manifest
To create a new VPC peering for a given VPC, send a POST request to/v2/vpcs/$VPC_ID/peerings
.
INSERT INTO digitalocean.vpcs.peerings (
data__name,
data__vpc_id,
vpc_id
)
SELECT
'{{ name }}' --required,
'{{ vpc_id }}' --required,
'{{ vpc_id }}'
RETURNING
peering
;
# Description fields are for documentation purposes
- name: peerings
props:
- name: vpc_id
value: string (uuid)
description: Required parameter for the peerings resource.
- name: name
value: string
description: >
The name of the VPC peering. Must be unique and may only contain alphanumeric characters, dashes, and periods.
- name: vpc_id
value: string
description: >
The ID of the VPC to peer with.
UPDATE
examples
- vpcs_patch_peerings
To update the name of a VPC peering in a particular VPC, send a PATCH request
to /v2/vpcs/$VPC_ID/peerings/$VPC_PEERING_ID
with the new name
in the
request body.
UPDATE digitalocean.vpcs.peerings
SET
data__name = '{{ name }}'
WHERE
vpc_id = '{{ vpc_id }}' --required
AND vpc_peering_id = '{{ vpc_peering_id }}' --required
AND data__name = '{{ name }}' --required
RETURNING
peering;