For AI agents: The documentation index is at https://docs.digitalocean.com/llms.txt. Markdown versions of pages use the same URL with index.html.md in place of the HTML page (for example, append index.html.md to the directory path instead of opening the HTML document).
Usage
client.projects.assign_resources_default(
body={
"resources": [...],
},
)
Returns JSONRaises HttpResponseError
Description
To assign resources to your default project, send a POST request to /v2/projects/default/resources.
You must have both project:update and :read scopes to assign new resources. For example, to assign a Droplet to the default project, include both the project:update and droplet:read scopes.
Parameters
resources array of strings optional
Example: ['do:droplet:13457723']
A list of uniform resource names (URNs) to be added to a project. Only resources that you are authorized to see will be returned.
Request Sample
Show Request Sample
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
req = {
"resources": [
"do:droplet:13457723",
"do:domain:example.com"
]
}
resp = client.projects.assign_resources_default(body=req)
Response Example
Show Response Example
{
"resources": [
{
"urn": "do:droplet:13457723",
"assigned_at": "2018-09-28T19:26:37Z",
"links": {
"self": "https://api.digitalocean.com/v2/droplets/13457723"
},
"status": "ok"
},
{
"urn": "do:domain:example.com",
"assigned_at": "2019-03-31T16:24:14Z",
"links": {
"self": "https://api.digitalocean.com/v2/domains/example.com"
},
"status": "ok"
}
]
}
See /v2/projects/default/resources in the API reference for additional detail on responses, headers, parameters, and more.