pydo.projects.create()

Description

To create a project, send a POST request to /v2/projects.

Request Sample

import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "name": "my-web-api",
  "description": "My website API",
  "purpose": "Service or API",
  "environment": "Production"
}

resp = client.projects.create(body=req)

Responses

See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.

The response will be a JSON object with a key called project. The value of this will be an object with the standard project attributes

Click to expand an example response.
{
  "project": {
    "id": "4e1bfbc3-dc3e-41f2-a18f-1b4d7ba71679",
    "owner_uuid": "99525febec065ca37b2ffe4f852fd2b2581895e7",
    "owner_id": 258992,
    "name": "my-web-api",
    "description": "My website API",
    "purpose": "Service or API",
    "environment": "Production",
    "created_at": "2018-09-27T20:10:35Z",
    "updated_at": "2018-09-27T20:10:35Z",
    "is_default": false
  }
}

Unauthorized

Click to expand an example response.
{
  "id": "unauthorized",
  "message": "Unable to authenticate you."
}

API Rate limit exceeded

Click to expand an example response.
{
  "id": "too_many_requests",
  "message": "API Rate limit exceeded."
}

Server error.

Click to expand an example response.
{
  "id": "server_error",
  "message": "Unexpected server-side error"
}

Unexpected error

Click to expand an example response.
{
  "id": "example_error",
  "message": "some error message"
}