Zum Inhalt springen
NimbusNexus

Virtuelle Maschinen

Eine virtuelle Maschine von NimbusNexus ist eine Compute-Instanz mit einer Boot-Disk und einer Netzwerkschnittstelle pro Netzwerk, an das sie angebunden ist. Sie erstellen eine mit POST /api/v1/instance/ in der Region Ihrer Sitzung; alles andere (Block-Volumes, öffentliche IPs) wird als separate Ressource an sie angehängt.

Wann eine VM passt

VMs sind der richtige Baustein, wenn Sie Folgendes brauchen:

  • Persistenten Zustand auf der Disk zwischen Requests (eine Datenbank, ein Build-Cache, ein lange laufender Queue-Worker).
  • Volle Kontrolle über das Betriebssystem — Pakete installieren, Kernel-Parameter optimieren, alles ausführen, was Systemzugriff braucht.
  • Eine bestimmte Instanzgröße — die Zahl der vCPUs und den RAM, die Ihr Workload braucht.

Wenn Ihr Workload zustandslos und request-basiert ist, passen Container-Plattformen (verwaltete Kubernetes-Dienste, Serverless-Laufzeitumgebungen) meist besser. Die Grenze verläuft ungefähr so: Wenn es Sie stören würde, dass ein Neustart des Prozesses lokale Dateien löscht, brauchen Sie eine VM.

Ausstattung und Erstellung

POST /api/v1/instance/ nimmt einen name und eine spec entgegen, die die Ausstattung der VM festlegt: architecture und vm_class, cpu (vCPUs) und ram (MB) sowie den volume_type ihrer Boot-Disk (siehe Blockspeicher). Außerdem braucht der Aufruf ein image (oder bootfähige volumes), mindestens ein network und mindestens eine security_group. Zu den optionalen Feldern gehören sshs (der zu installierende SSH-Key), volume_size (die Größe der Boot-Disk in GB, wenn Sie von image booten; Standard 5), user_data, metadata und subscription. Für den Beitritt zu einem Provider-Netzwerk braucht es außerdem bandwidth_mbps und subscription.bandwidth; ohne sie antwortet der Aufruf mit 400.

Größencodes gibt es nicht. GET /api/v1/instance/artifacts listet in vm_options die Auswahl für architecture und vm_class in der Region Ihrer Sitzung auf, dazu die Images, Netzwerke, Sicherheitsgruppen, SSH-Keys, Servergruppen und Volumes, die Sie verwenden können. Die VM läuft auf einem Flavor mit genau Ihren Werten für cpu und ram; gibt es keinen solchen, legt die API ihn an. Die Preise finden Sie unter Preisdaten.

Lebenszyklus

Das Erstellen einer VM ist asynchron: POST /api/v1/instance/ stellt die Arbeit in die Warteschlange und antwortet mit {"success": true}, ohne ID. Suchen Sie die neue VM in GET /api/v1/instance/ und verfolgen Sie ihren status, den eigenen Wert des Compute-Dienstes. Die Werte, die Ihnen am häufigsten begegnen:

  • BUILD — die VM wird erstellt.
  • ACTIVE — läuft.
  • SHUTOFF — gestoppt.
  • VERIFY_RESIZE — Größe geändert, wartet darauf, dass Sie bestätigen oder zurücksetzen (siehe VM-Größen).
  • ERROR — etwas ist fehlgeschlagen; fault sagt, was.

POST /api/v1/instance/action startet, stoppt oder löscht VMs: Führen Sie ihre IDs in servers auf und setzen Sie cmd auf start, stop oder delete. Auch eine gestoppte VM wird abgerechnet: Die Abrechnung läuft vom Erstellen bis zum Löschen, nach dem Plan in subscription.vm (Standard Monthly). Das Löschen einer VM löscht das Boot-Volume, das aus ihrem Image erstellt wurde; Volumes, die in volumes übergeben oder später angehängt wurden, bleiben available.

Benennung und stabile IDs

Jede VM hat zwei Kennungen:

  • id — die UUID der VM. Stabil für die gesamte Lebensdauer der VM. Verwenden Sie sie in URLs, Fremdschlüsseln, Audit-Logs.
  • name — für Menschen lesbar, eine beliebige nicht leere Zeichenkette. Ändern Sie ihn oder die description mit PATCH /api/v1/instance/{instance_id}. Verwenden Sie ihn in keinem Codepfad, den Sie nicht an dem Tag umschreiben wollen, an dem jemand die VM umbenennt.

Die Endpoint-Referenz unten verwendet {instance_id} in Pfadvorlagen ({server_id} bei den Endpoints für VM-Schnittstellen); der Wert, den Sie übergeben, ist die id der VM.

Reference

GET/api/v1/instance/

List Instances

List virtual machine instances visible to the caller (own project, or all projects when called as admin).

Parameters

NameInTypeDescription
admin_domainquerystring | null—
admin_projectquerystring | null—
projectquerystring | null—

Responses

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

Example

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

Create Instance

Provision a new virtual machine instance with the requested flavor, image, networks and security groups.

Request body

FieldTypeDescription
admin_domainstring | null—
admin_projectstring | null—
projectstring | null—
name*string—
descriptionstring | null—
imagestring | null—
spec*ServerSpecParams—
subscriptionSubscriptionSpec—
bandwidth_mbpsinteger | null—
network*array of string—
security_group*array of string—
root_passwordstring | null—
sshsstring | null—
volume_sizeinteger | null—
volumesarray of string | null—
server_groupsarray of string | null—
user_datastring | null—
metadataobject | null—

Responses

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

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/instance/" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Example",
    "spec": {
      "architecture": "example",
      "vm_class": "example",
      "cpu": 1,
      "ram": 1,
      "volume_type": "example"
    },
    "network": [
      "example"
    ],
    "security_group": [
      "example"
    ]
  }'
POST/api/v1/instance/action

Instances Action

Execute a power-state or lifecycle action on one or more instances (start, stop, reboot, pause, suspend, etc.).

Request body

FieldTypeDescription
servers*array of string—
cmd*"start" | "stop" | "delete"—

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/instance/action" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "servers": [
      "00000000-0000-0000-0000-000000000000"
    ],
    "cmd": "start"
  }'
GET/api/v1/instance/artifacts

Instance Create Artifacts

Return reference data needed to provision a new instance (available images, networks, security groups, key pairs).

Parameters

NameInTypeDescription
admin_domainquerystring | null—
admin_projectquerystring | null—
projectquerystring | null—
product_type_namequerystring—

Responses

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

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/instance/artifacts" \
  -H "Authorization: Bearer $NIMBUS_KEY"
GET/api/v1/instance/server-groups

List Instance Groups

List server groups (affinity / anti-affinity policies) for VM placement.

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/instance/server-groups" \
  -H "Authorization: Bearer $NIMBUS_KEY"
POST/api/v1/instance/server-groups

Create Instance Group

Create a new server group with the chosen affinity / anti-affinity policy.

Request body

FieldTypeDescription
name*string—
policy*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/instance/server-groups" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Example",
    "policy": "example"
  }'
DELETE/api/v1/instance/server-groups

Delete Instance Groups

Delete one or more server groups by id.

Request body

FieldTypeDescription
ids*array of string—

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/instance/server-groups" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "ids": [
      "example"
    ]
  }'
GET/api/v1/instance/{instance_id}

Instance Get

Get the full details of a single virtual machine instance.

Parameters

NameInTypeDescription
instance_id*pathstring—
admin_domainquerystring | null—
admin_projectquerystring | null—
projectquerystring | null—

Responses

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

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/instance/<instance_id>" \
  -H "Authorization: Bearer $NIMBUS_KEY"
PATCH/api/v1/instance/{instance_id}

Instance Update

Update mutable properties of an existing instance (e.g. name, metadata).

Parameters

NameInTypeDescription
instance_id*pathstring—

Request body

FieldTypeDescription
namestring | null—
descriptionstring | null—

Responses

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

Example

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

Confirm Instance Resize

Confirm a pending resize, finalising the move to the new flavor and releasing the old one.

Parameters

NameInTypeDescription
instance_id*pathstring—
admin_domainquerystring | null—
admin_projectquerystring | null—
projectquerystring | null—

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/instance/<instance_id>/confirm_resize" \
  -H "Authorization: Bearer $NIMBUS_KEY"
GET/api/v1/instance/{instance_id}/console

Console

Open an interactive console session (VNC/serial) for the given instance.

Parameters

NameInTypeDescription
instance_id*pathstring—

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/instance/<instance_id>/console" \
  -H "Authorization: Bearer $NIMBUS_KEY"
POST/api/v1/instance/{instance_id}/resize

Resize Instance

Begin resizing an instance to a different flavor; must be confirmed or reverted before the resize is finalized.

Parameters

NameInTypeDescription
instance_id*pathstring—

Request body

FieldTypeDescription
admin_domainstring | null—
admin_projectstring | null—
projectstring | null—
spec*productVirtualMachineCreateSpec—

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/instance/<instance_id>/resize" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "spec": {
      "architecture": "example",
      "vm_class": "example",
      "cpu": 1,
      "ram": 1
    }
  }'
POST/api/v1/instance/{instance_id}/revert_resize

Revert Instance Resize

Revert a pending resize, returning the instance to its previous flavor.

Parameters

NameInTypeDescription
instance_id*pathstring—
admin_domainquerystring | null—
admin_projectquerystring | null—
projectquerystring | null—

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/instance/<instance_id>/revert_resize" \
  -H "Authorization: Bearer $NIMBUS_KEY"

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