Zum Inhalt springen
Odinex Cloud
API-Referenz

Projekte

Diese Referenz wird aus der OpenAPI-Spezifikation erzeugt; die Beschreibungen der Endpunkte und Felder sind auf Englisch.

GET
/quota

Limits with current use, and the restrictions staff may have set: creating resources disabled altogether (creation_blocked, with a reason) or in some locations (blocked_locations). Readable by every member of the project, so panels can disable create buttons before a request fails.

Autorisierung

headerAutorisierungBearer <token>

Response-Body

Quota

application/json
  1. response
quota*
curl -X GET "https://example.com/quota"
{  "quota": {    "account_status": "active",    "creation_blocked": true,    "creation_block_reason": "string",    "blocked_locations": [      "string"    ],    "limits": {      "property1": {        "limit": 0,        "used": 0      },      "property2": {        "limit": 0,        "used": 0      }    }  }}

Projects the current user can access

GET
/projects

Autorisierung

cookieAuth
cookieodx_session<token>

Response-Body

Projects

application/json
  1. response
projects*array<>
curl -X GET "https://example.com/projects"
{  "projects": [    {      "id": 0,      "name": "string",      "organization_id": 0,      "role": "admin",      "created": "2019-08-24T14:15:22Z"    }  ]}

Create a project in an organization

POST
/projects

Autorisierung

cookieAuth
cookieodx_session<token>

Request-Body

application/json
  1. body
name*string
Länge1 <= length <= 64
organization_id?integer

Defaults to the personal organization

Formatint64

Response-Body

Created

application/json
  1. response
project*
curl -X POST "https://example.com/projects" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "project": {    "id": 0,    "name": "string",    "organization_id": 0,    "role": "admin",    "created": "2019-08-24T14:15:22Z"  }}

Get project

GET
/projects/{id}

Autorisierung

cookieAuth
cookieodx_session<token>

Pfadparameter

id*integer
Formatint64

Response-Body

Project

application/json
  1. response
project*
curl -X GET "https://example.com/projects/0"
{  "project": {    "id": 0,    "name": "string",    "organization_id": 0,    "role": "admin",    "created": "2019-08-24T14:15:22Z"  }}

Update project

PATCH
/projects/{id}

Autorisierung

cookieAuth
cookieodx_session<token>

Pfadparameter

id*integer
Formatint64

Request-Body

application/json
  1. body
name*string
Länge1 <= length <= 64

Response-Body

Updated

application/json
  1. response
project*
curl -X PATCH "https://example.com/projects/0" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "project": {    "id": 0,    "name": "string",    "organization_id": 0,    "role": "admin",    "created": "2019-08-24T14:15:22Z"  }}

Delete an empty project

DELETE
/projects/{id}

Fails with project_not_empty while the project still has resources.

Autorisierung

cookieAuth
cookieodx_session<token>

Pfadparameter

id*integer
Formatint64

Response-Body

Deleted

curl -X DELETE "https://example.com/projects/0"
Leer

List API tokens

GET
/projects/{id}/tokens

Autorisierung

cookieAuth
cookieodx_session<token>

Pfadparameter

id*integer
Formatint64

Response-Body

Tokens (secrets are never returned again)

application/json
  1. response
tokens*array<>
curl -X GET "https://example.com/projects/0/tokens"
{  "tokens": [    {      "allowed_ips": [        "203.0.113.0/24"      ],      "id": 0,      "name": "string",      "prefix": "string",      "scope": "read",      "created": "2019-08-24T14:15:22Z",      "expires": "2019-08-24T14:15:22Z",      "last_used": "2019-08-24T14:15:22Z"    }  ]}

Create API token

POST
/projects/{id}/tokens

Autorisierung

cookieAuth
cookieodx_session<token>

Pfadparameter

id*integer
Formatint64

Request-Body

application/json
  1. body
name*string
Länge1 <= length <= 64
scope*string
Wert in"read""read_write"
expires_in_days?integer
Bereich1 <= value <= 3650
allowed_ips?array<>

IP addresses or CIDR ranges (IPv4 or IPv6) the token may be used from. Empty: any address.

Elementeitems <= 50

Response-Body

Created. secret is shown only in this response.

application/json
  1. response
token*
secret*string
curl -X POST "https://example.com/projects/0/tokens" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "scope": "read"  }'
{  "token": {    "allowed_ips": [      "203.0.113.0/24"    ],    "id": 0,    "name": "string",    "prefix": "string",    "scope": "read",    "created": "2019-08-24T14:15:22Z",    "expires": "2019-08-24T14:15:22Z",    "last_used": "2019-08-24T14:15:22Z"  },  "secret": "odx_k3j2h1_2fK9..."}

Update API token

PATCH
/projects/{id}/tokens/{token_id}

Sets the addresses the token may be used from. An empty list allows any address.

Autorisierung

cookieAuth
cookieodx_session<token>

Pfadparameter

id*integer
Formatint64
token_id*integer
Formatint64

Request-Body

application/json
  1. body
allowed_ips*array<>

IP addresses or CIDR ranges (IPv4 or IPv6) the token may be used from. Empty: any address.

Elementeitems <= 50

Response-Body

Updated

application/json
  1. response
token*
curl -X PATCH "https://example.com/projects/0/tokens/0" \  -H "Content-Type: application/json" \  -d '{    "allowed_ips": [      "203.0.113.0/24"    ]  }'
{  "token": {    "allowed_ips": [      "203.0.113.0/24"    ],    "id": 0,    "name": "string",    "prefix": "string",    "scope": "read",    "created": "2019-08-24T14:15:22Z",    "expires": "2019-08-24T14:15:22Z",    "last_used": "2019-08-24T14:15:22Z"  }}

Revoke API token

DELETE
/projects/{id}/tokens/{token_id}

Autorisierung

cookieAuth
cookieodx_session<token>

Pfadparameter

id*integer
Formatint64
token_id*integer
Formatint64

Response-Body

Revoked

curl -X DELETE "https://example.com/projects/0/tokens/0"
Leer