Zum Inhalt springen
NimbusNexus

Projekte

Ein Projekt ist die Isolationseinheit bei NimbusNexus — für Ressourcen und Zugriffskontrolle. Jedes Projekt gehört zu einem Workspace. Jede Ressource (VM, Volume, Bucket, Netzwerk, …) gehört zu genau einem Projekt, und jeder API-Key ist auf genau ein Projekt beschränkt. Abgerechnet wird pro Workspace: Eine Rechnung deckt alle seine Projekte ab.

Warum Projekte wichtig sind

Zwei Garantien, die Ihnen die Projektgrenze gibt:

  1. Schadensradius. Ein kompromittierter API-Key für das Projekt dev kann keine Ressourcen in prod anfassen. Sie sind aus dev heraus buchstäblich nicht sichtbar.
  2. Kontingent. Kontingente gelten pro Projekt. Ein Projekt, das außer Kontrolle gerät und VMs am laufenden Band erstellt, verbraucht nicht den Spielraum eines anderen Projekts.

Ein Projekt erstellen

POST /api/v1/projects/ nimmt die ID des Workspaces als domain_id, einen project_name und optional eine project_description und enabled entgegen. Der Name muss im Workspace eindeutig sein, sonst antwortet die API mit 409. Ein Workspace kann ein Limit für die Zahl seiner Projekte haben; darüber hinaus antwortet das Erstellen mit 403.

Projekte stehen in ihrem Workspace nebeneinander. Die API kann kein Projekt unter einem anderen anlegen.

Was in einem Projekt liegt

  • VMs, Volumes, Backups
  • Buckets
  • Netzwerke, Subnetze, Router, Sicherheitsgruppen, Floating-IPs, Load Balancer
  • DNS-Zonen + -Einträge
  • Rollenzuweisungen und API-Keys (die Benutzer, denen sie gehören, liegen im Workspace)

Projekte lassen sich nicht zusammenführen. Um zwei Projekte zu konsolidieren, exportieren Sie die Ressourcen, importieren sie erneut und löschen das ursprüngliche Projekt — eine atomare Zusammenführung gibt es bewusst nicht, weil sich die daraus entstehende Zuordnung „was wurde wohin zusammengeführt“ nicht prüfen ließe.

Löschen

DELETE /api/v1/projects/ nimmt die id des Projekts im Request-Body entgegen und ist nicht umkehrbar. Es entfernt das Standardnetzwerk des Projekts und löscht dann das Projekt und seine Rollenzuweisungen. Sonst löscht es nichts, deshalb löschen Sie zuerst die VMs, Volumes, Buckets und anderen Ressourcen des Projekts.

Nächste Schritte

  • Workspaces — der Container, in dem Projekte liegen.
  • Rollen — was Benutzer brauchen, um überhaupt etwas tun zu können.
  • Kontingente — Ressourcenlimits pro Projekt.

Reference

GET/api/v1/projects/

Find Projects

List projects accessible to the caller within the current scope, optionally filtered by a search term.

Parameters

NameInTypeDescription
admin_domainquerystring | null—
admin_projectquerystring | null—
userquerystring | null—
domainquerystring | null—
parentquerystring | null—
searchquerystring | null—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/projects/" \
  -H "Authorization: Bearer $NIMBUS_KEY"
POST/api/v1/projects/

Project Create

Create a new project in the given domain (subject to the per-domain limit) and grant the caller the admin role on it.

Request body

FieldTypeDescription
domain_id*string—
project_name*string—
project_descriptionstring | null—
enabledboolean—

Responses

  • 201Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/projects/" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "domain_id": "<domain_id>",
    "project_name": "example"
  }'
DELETE/api/v1/projects/

Project Delete

Delete a project after first removing any networks attached to it. Needs the manager role in a session scoped to the project's workspace, or a system admin in a session that holds the admin role.

Request body

FieldTypeDescription
id*stringProject ID

Responses

  • 204Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X DELETE "https://api.nimbusnexus.net/api/v1/projects/" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "example"
  }'
POST/api/v1/projects/invite

Invite To Project

Invite a user by email to a project with the specified role and notify them in-app and via email.

Request body

FieldTypeDescription
project_id*stringProject ID
role_id*string—
email*string—

Responses

  • 201Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/projects/invite" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "<project-id>",
    "role_id": "<role_id>",
    "email": "[email protected]"
  }'
POST/api/v1/projects/invite_action

Invite Action

Accept or decline a pending project invitation, applying or revoking the offered role accordingly.

Request body

FieldTypeDescription
access*boolean—
notification_id*string—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/projects/invite_action" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "access": true,
    "notification_id": "<notification_id>"
  }'
PATCH/api/v1/projects/{project_id}

Project Update

Update the mutable attributes (name, description, enabled) of an existing project.

Parameters

NameInTypeDescription
project_id*pathstring—

Request body

FieldTypeDescription
project_namestring | null—
project_descriptionstring | null—
enabledboolean | null—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X PATCH "https://api.nimbusnexus.net/api/v1/projects/<project-id>" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Need to make a real call? Try these endpoints in the live Swagger UI →