Skip to content
Draft
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
project_id: 88b72d1a-b78a-4d9f-9090-b53c4399073f

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
project_id: 88b72d1a-b78a-4d9f-9090-b53c4399073f
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","project_id":"88b72d1a-b78a-4d9f-9090-b53c4399073f"}' \
"https://api.digitalocean.com/v2/droplets"
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ source: |-
Tags: []string{"env:prod","web"},
UserData: "#cloud-config\nruncmd:\n - touch /test.txt\n",
VPCUUID: "760e09ef-dc84-11e8-981e-3cfdfeaae000",
ProjectID: "88b72d1a-b78a-4d9f-9090-b53c4399073f",
}
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",
"project_id": "88b72d1a-b78a-4d9f-9090-b53c4399073f"
}

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",
project_id: "88b72d1a-b78a-4d9f-9090-b53c4399073f",
)
client.droplets.create(droplet)
6 changes: 6 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,12 @@ 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.

project_id:
type: string
example: 88b72d1a-b78a-4d9f-9090-b53c4399073f
description: The unique identifier of the project to associate the Droplet
with. The Droplet will be created within this project.

with_droplet_agent:
type: boolean
example: true
Expand Down