-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add vpc peering create and support files * add remaining vpc peering endpoints * remove duplicate model yaml to make linter happy * fix operation ID linting errors * fix alphabetical tags linter error * make linter happy * Update specification/resources/vpcs/responses/vpc_peering.yml Co-authored-by: Andrew Starr-Bochicchio <[email protected]> * add peering update endpoint through vpcs * make happy * update name rules and regex * correct token scope * Apply suggestions from code review Co-authored-by: Andrew Starr-Bochicchio <[email protected]> --------- Co-authored-by: Andrew Starr-Bochicchio <[email protected]>
- Loading branch information
1 parent
e67d14f
commit 705f149
Showing
26 changed files
with
752 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
specification/resources/vpc_peerings/examples/curl/vpc_peerings_create.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
lang: cURL | ||
source: |- | ||
curl -X POST \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
-d '{"name": "my-first-vpc-peering", "vpc_ids": [ "997615ce-132d-4bae-9270-9ee21b395e5d", "e51aed59-3bb1-4a6a-8de0-9d1329e9c997"]}' \ | ||
"https://api.digitalocean.com/v2/vpc_peerings" | ||
7 changes: 7 additions & 0 deletions
7
specification/resources/vpc_peerings/examples/curl/vpc_peerings_delete.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
lang: cURL | ||
source: |- | ||
curl -X DELETE \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
"https://api.digitalocean.com/v2/vpc_peerings/6b5c619c-359c-44ca-87e2-47e98170c01d" | ||
6 changes: 6 additions & 0 deletions
6
specification/resources/vpc_peerings/examples/curl/vpc_peerings_get.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
lang: cURL | ||
source: |- | ||
curl -X GET \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
"https://api.digitalocean.com/v2/vpc_peerings/5a4981aa-9653-4bd1-bef5-d6bff52042e4" |
6 changes: 6 additions & 0 deletions
6
specification/resources/vpc_peerings/examples/curl/vpc_peerings_list.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
lang: cURL | ||
source: |- | ||
curl -X GET \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
"https://api.digitalocean.com/v2/vpc_peerings?region=sfo3&page=1&per_page=20" |
7 changes: 7 additions & 0 deletions
7
specification/resources/vpc_peerings/examples/curl/vpc_peerings_update.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
lang: cURL | ||
source: |- | ||
curl -X PATCH \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
-d '{"name":"renamed-vpc-peering"}' \ | ||
"https://api.digitalocean.com/v2/vpc_peerings/5a4981aa-9653-4bd1-bef5-d6bff52042e4" |
58 changes: 58 additions & 0 deletions
58
specification/resources/vpc_peerings/models/vpc_peering.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
vpc_peering: | ||
type: object | ||
allOf: | ||
- $ref: '#/vpc_peering_base' | ||
- $ref: '#/vpc_peering_create' | ||
- $ref: '#/vpc_peering_updatable' | ||
|
||
vpc_peering_base: | ||
type: object | ||
properties: | ||
id: | ||
type: string | ||
format: uuid | ||
readOnly: true | ||
example: 5a4981aa-9653-4bd1-bef5-d6bff52042e4 | ||
description: A unique ID that can be used to identify and reference the VPC peering. | ||
|
||
created_at: | ||
type: string | ||
format: date-time | ||
readOnly: true | ||
example: "2020-03-13T19:20:47.442049222Z" | ||
description: A time value given in ISO8601 combined date and time format. | ||
|
||
status: | ||
type: string | ||
enum: | ||
- PROVISIONING | ||
- ACTIVE | ||
- DELETING | ||
readOnly: true | ||
example: "ACTIVE" | ||
description: The current status of the VPC peering. | ||
|
||
vpc_peering_create: | ||
type: object | ||
properties: | ||
vpc_ids: | ||
type: array | ||
items: | ||
type: string | ||
format: uuid | ||
minItems: 2 | ||
maxItems: 2 | ||
example: | ||
- c140286f-e6ce-4131-8b7b-df4590ce8d6a | ||
- 994a2735-dc84-11e8-80bc-3cfdfea9fba1 | ||
description: An array of the two peered VPCs IDs. | ||
|
||
vpc_peering_updatable: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
pattern: '^[a-zA-Z0-9\-]+$' | ||
example: nyc1-blr1-peering | ||
description: The name of the VPC peering. Must be unique within the team | ||
and may only contain alphanumeric characters and dashes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
vpc_peering_id: | ||
in: path | ||
name: vpc_peering_id | ||
description: A unique identifier for a VPC peering. | ||
required: true | ||
schema: | ||
type: string | ||
format: uuid | ||
example: 5a4981aa-9653-4bd1-bef5-d6bff52042e4 |
29 changes: 29 additions & 0 deletions
29
specification/resources/vpc_peerings/responses/active_vpc_peering.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
description: The response will be a JSON object with a key called `vpc_peering`. | ||
The value of this will be an object that contains the standard attributes | ||
associated with a VPC peering. | ||
|
||
headers: | ||
ratelimit-limit: | ||
$ref: '../../../shared/headers.yml#/ratelimit-limit' | ||
ratelimit-remaining: | ||
$ref: '../../../shared/headers.yml#/ratelimit-remaining' | ||
ratelimit-reset: | ||
$ref: '../../../shared/headers.yml#/ratelimit-reset' | ||
|
||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
vpc_peering: | ||
$ref: '../models/vpc_peering.yml#/vpc_peering' | ||
|
||
example: | ||
vpc_peering: | ||
id: 5a4981aa-9653-4bd1-bef5-d6bff52042e4 | ||
name: example-vpc-peering | ||
vpc_ids: | ||
- 997615ce-132d-4bae-9270-9ee21b395e5d | ||
- e51aed59-3bb1-4a6a-8de0-9d1329e9c997 | ||
created_at: '2024-01-09T20:44:32Z' | ||
status: ACTIVE |
48 changes: 48 additions & 0 deletions
48
specification/resources/vpc_peerings/responses/all_vpc_peerings.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
description: >- | ||
The response will be a JSON object with a key called `vpc_peerings`. This | ||
will be set to an array of objects, each of which will contain the standard | ||
attributes associated with a VPC peering. | ||
headers: | ||
ratelimit-limit: | ||
$ref: '../../../shared/headers.yml#/ratelimit-limit' | ||
ratelimit-remaining: | ||
$ref: '../../../shared/headers.yml#/ratelimit-remaining' | ||
ratelimit-reset: | ||
$ref: '../../../shared/headers.yml#/ratelimit-reset' | ||
|
||
content: | ||
application/json: | ||
schema: | ||
allOf: | ||
- type: object | ||
properties: | ||
vpc_peerings: | ||
type: array | ||
items: | ||
$ref: '../models/vpc_peering.yml#/vpc_peering' | ||
- $ref: '../../../shared/pages.yml#/pagination' | ||
- $ref: '../../../shared/meta.yml' | ||
|
||
example: | ||
vpc_peerings: | ||
- id: 6b5c619c-359c-44ca-87e2-47e98170c01d | ||
name: example-vpc-peering | ||
vpc_ids: | ||
- 997615ce-132d-4bae-9270-9ee21b395e5d | ||
- e51aed59-3bb1-4a6a-8de0-9d1329e9c997 | ||
created_at: '2024-01-09T20:44:32Z' | ||
status: ACTIVE | ||
- id: c212b274-911c-44cc-a117-23b7da4a2922 | ||
name: another-vpc-peering | ||
vpc_ids: | ||
- 5a100736-b085-4f69-81fd-feee325784bb | ||
- c140286f-e6ce-4131-8b7b-df4590ce8d6a | ||
created_at: '2024-01-10T13:29:58Z' | ||
status: ACTIVE | ||
links: {} | ||
meta: | ||
total: 2 | ||
|
||
|
||
|
29 changes: 29 additions & 0 deletions
29
specification/resources/vpc_peerings/responses/deleting_vpc_peering.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
description: The response will be a JSON object with a key called `vpc_peering`. | ||
The value of this will be an object that contains the standard attributes | ||
associated with a VPC peering. | ||
|
||
headers: | ||
ratelimit-limit: | ||
$ref: '../../../shared/headers.yml#/ratelimit-limit' | ||
ratelimit-remaining: | ||
$ref: '../../../shared/headers.yml#/ratelimit-remaining' | ||
ratelimit-reset: | ||
$ref: '../../../shared/headers.yml#/ratelimit-reset' | ||
|
||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
vpc_peering: | ||
$ref: '../models/vpc_peering.yml#/vpc_peering' | ||
|
||
example: | ||
vpc_peering: | ||
id: 5a4981aa-9653-4bd1-bef5-d6bff52042e4 | ||
name: example-vpc-peering | ||
vpc_ids: | ||
- 997615ce-132d-4bae-9270-9ee21b395e5d | ||
- e51aed59-3bb1-4a6a-8de0-9d1329e9c997 | ||
created_at: '2024-01-09T20:44:32Z' | ||
status: DELETING |
29 changes: 29 additions & 0 deletions
29
specification/resources/vpc_peerings/responses/provisioning_vpc_peering.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
description: The response will be a JSON object with a key called `vpc_peering`. | ||
The value of this will be an object that contains the standard attributes | ||
associated with a VPC peering. | ||
|
||
headers: | ||
ratelimit-limit: | ||
$ref: '../../../shared/headers.yml#/ratelimit-limit' | ||
ratelimit-remaining: | ||
$ref: '../../../shared/headers.yml#/ratelimit-remaining' | ||
ratelimit-reset: | ||
$ref: '../../../shared/headers.yml#/ratelimit-reset' | ||
|
||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
vpc_peering: | ||
$ref: '../models/vpc_peering.yml#/vpc_peering' | ||
|
||
example: | ||
vpc_peering: | ||
id: 5a4981aa-9653-4bd1-bef5-d6bff52042e4 | ||
name: example-vpc-peering | ||
vpc_ids: | ||
- 997615ce-132d-4bae-9270-9ee21b395e5d | ||
- e51aed59-3bb1-4a6a-8de0-9d1329e9c997 | ||
created_at: '2024-01-09T20:44:32Z' | ||
status: PROVISIONING |
51 changes: 51 additions & 0 deletions
51
specification/resources/vpc_peerings/vpc_peerings_create.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
operationId: vpcPeerings_create | ||
|
||
summary: Create a New VPC Peering | ||
|
||
description: | | ||
To create a new VPC Peering, send a POST request to `/v2/vpc_peerings` | ||
specifying a name and a list of two VPC IDs to peer. The response code, 202 | ||
Accepted, does not indicate the success or failure of the operation, just | ||
that the request has been accepted for processing. | ||
tags: | ||
- VPC Peerings | ||
|
||
requestBody: | ||
required: true | ||
|
||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
allOf: | ||
- $ref: 'models/vpc_peering.yml#/vpc_peering_updatable' | ||
- $ref: 'models/vpc_peering.yml#/vpc_peering_create' | ||
|
||
required: | ||
- name | ||
- vpc_ids | ||
|
||
|
||
responses: | ||
'202': | ||
$ref: 'responses/provisioning_vpc_peering.yml' | ||
|
||
'401': | ||
$ref: '../../shared/responses/unauthorized.yml' | ||
|
||
'429': | ||
$ref: '../../shared/responses/too_many_requests.yml' | ||
|
||
'500': | ||
$ref: '../../shared/responses/server_error.yml' | ||
|
||
default: | ||
$ref: '../../shared/responses/unexpected_error.yml' | ||
|
||
x-codeSamples: | ||
- $ref: 'examples/curl/vpc_peerings_create.yml' | ||
|
||
security: | ||
- bearer_auth: | ||
- 'vpc_peering:create' |
38 changes: 38 additions & 0 deletions
38
specification/resources/vpc_peerings/vpc_peerings_delete.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
operationId: vpcPeerings_delete | ||
|
||
summary: Delete a VPC peering | ||
|
||
description: | | ||
To delete a VPC peering, send a DELETE request to `/v2/vpc_peerings/$VPC_PEERING_ID`. | ||
tags: | ||
- VPC Peerings | ||
|
||
parameters: | ||
- $ref: 'parameters.yml#/vpc_peering_id' | ||
|
||
responses: | ||
'202': | ||
$ref: 'responses/deleting_vpc_peering.yml' | ||
|
||
'401': | ||
$ref: '../../shared/responses/unauthorized.yml' | ||
|
||
'404': | ||
$ref: '../../shared/responses/not_found.yml' | ||
|
||
'429': | ||
$ref: '../../shared/responses/too_many_requests.yml' | ||
|
||
'500': | ||
$ref: '../../shared/responses/server_error.yml' | ||
|
||
default: | ||
$ref: '../../shared/responses/unexpected_error.yml' | ||
|
||
x-codeSamples: | ||
- $ref: 'examples/curl/vpc_peerings_delete.yml' | ||
|
||
security: | ||
- bearer_auth: | ||
- 'vpc_peering:delete' |
Oops, something went wrong.