Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion specification/resources/droplets/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ droplet_create_request:
- web
user_data: "#cloud-config\nruncmd:\n - touch /test.txt\n"
vpc_uuid: 760e09ef-dc84-11e8-981e-3cfdfeaae000
subnet_uuid: 9c7a0d63-3c4e-4d3d-9f56-3b0fb0e5e4a1

droplet_multi_create_request:
value:
Expand All @@ -34,4 +35,5 @@ droplet_multi_create_request:
- env:prod
- web
user_data: "#cloud-config\nruncmd:\n - touch /test.txt\n"
vpc_uuid: 760e09ef-dc84-11e8-981e-3cfdfeaae000
vpc_uuid: 760e09ef-dc84-11e8-981e-3cfdfeaae000
subnet_uuid: 9c7a0d63-3c4e-4d3d-9f56-3b0fb0e5e4a1
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ source: |-
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"name":"example.com","region":"nyc3","size":"s-1vcpu-1gb","image":"ubuntu-20-04-x64","ssh_keys":[289794,"3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45"],"backups":true,"ipv6":true,"monitoring":true,"tags":["env:prod","web"],"user_data":"#cloud-config\nruncmd:\n - touch /test.txt\n","vpc_uuid":"760e09ef-dc84-11e8-981e-3cfdfeaae000"}' \
-d '{"name":"example.com","region":"nyc3","size":"s-1vcpu-1gb","image":"ubuntu-20-04-x64","ssh_keys":[289794,"3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45"],"backups":true,"ipv6":true,"monitoring":true,"tags":["env:prod","web"],"user_data":"#cloud-config\nruncmd:\n - touch /test.txt\n","vpc_uuid":"760e09ef-dc84-11e8-981e-3cfdfeaae000","subnet_uuid":"9c7a0d63-3c4e-4d3d-9f56-3b0fb0e5e4a1"}' \
"https://api.digitalocean.com/v2/droplets"
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ source: |-
"web"
],
"user_data": "#cloud-config\nruncmd:\n - touch /test.txt\n",
"vpc_uuid": "760e09ef-dc84-11e8-981e-3cfdfeaae000"
"vpc_uuid": "760e09ef-dc84-11e8-981e-3cfdfeaae000",
"subnet_uuid": "9c7a0d63-3c4e-4d3d-9f56-3b0fb0e5e4a1"
}

resp = client.droplets.create(body=req)
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ source: |-
tags: ["env:prod","web"],
user_data: "#cloud-config\nruncmd:\n - touch /test.txt\n",
vpc_uuid: "760e09ef-dc84-11e8-981e-3cfdfeaae000",
subnet_uuid: "9c7a0d63-3c4e-4d3d-9f56-3b0fb0e5e4a1",
)
client.droplets.create(droplet)
7 changes: 7 additions & 0 deletions specification/resources/droplets/models/droplet_create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ properties:
will be assigned. If excluded, the Droplet will be assigned to your
account's default VPC for the region.<br>Requires `vpc:read` scope.

subnet_uuid:
type: string
example: 9c7a0d63-3c4e-4d3d-9f56-3b0fb0e5e4a1
description: An optional string specifying the UUID of the VPC subnet to
which the Droplet will be assigned. If excluded, the Droplet will be
assigned to a default subnet of the VPC.<br>Requires `vpc:read` scope.

with_droplet_agent:
type: boolean
example: true
Expand Down