Bc provisioning manage vps server

From breatheco-de/apiv2 · View interactive version

Bc provisioning manage vps server is an AI agent skill from the GitHub repository breatheco-de/apiv2. Use when a user, student or academy staff needs to request, list, view, or deprovision a VPS via the API (including staff requesting a VPS on behalf of a student); do NOT use for granting VPS credits via plans or payments.

How to use this skill

Skill file

Skill: Manage VPS Provisioning via the API

When to Use

Use this skill when the user asks to request a VPS, list my VPSs, get VPS connection details (including root password), list academy VPSs, request a VPS for a student (staff), or deprovision a student's VPS — all via the API. Do not use when the user only asks how to configure vendor credentials or create/update provisioning profiles — use bc-provisioning-settings-and-credentials for that. Do not use for granting VPS credits through plans or subscriptions.

Concepts

Workflow

  1. Student: list my VPSs. Call GET /v1/provisioning/me/vps. Use returned id values for details.
  1. Academy staff: fetch vendor options (unfiltered universe) first (when the VPS vendor requires selection). Call GET /v1/provisioning/academy/provisioningacademy/<provisioning_academy_id>/vendor-options with Authorization and Academy: <academy_id>. Hostinger: use catalog_items, templates, data_centers. DigitalOcean: use regions, sizes, images. Save only the allowed slugs/IDs into the academy config (vendor_settings) per vendor via PUT /v1/provisioning/academy/provisioningacademy/<provisioning_academy_id> (see bc-provisioning-settings-and-credentials). VPS requests must use vendor_selection values that match those allowlists.
  1. Student: request a new VPS. Call POST /v1/provisioning/me/vps with optional plan_slug and optional nested vendor_selection. Hostinger: item_id, template_id, data_center_id. DigitalOcean: region_slug, size_slug, image_slug. Values must come from the allowlists in academy vendor_settings.
  1. Student: get one VPS (including root password). Call GET /v1/provisioning/me/vps/<vps_id>. Only the owner gets root_password.
  1. Academy: list all VPSs. Call GET /v1/provisioning/academy/vps with headers Authorization and Academy: <academy_id>. Optional query: user_id=<user_id>.
  1. Academy: request a VPS for a student (staff). Call POST /v1/provisioning/academy/vps with headers Authorization and Academy: <academy_id>. Body requires user_id; supports optional plan_slug and optional nested vendor_selection.
  1. Academy: deprovision a VPS. Call DELETE /v1/provisioning/academy/vps/<vps_id> with headers Authorization and Academy: <academy_id>.

Prerequisite: Vendor, academy profile, and credentials must already be configured. If the user has no academy or the academy has no VPS configuration, the API returns errors; tell the user setup must be completed first. VPS credits are managed via plans/subscriptions or other APIs, not this one.

Endpoints

| Action | Method | Path | Headers | Body / Query | Response |

|--------|--------|------|---------|--------------|----------|

| List my VPSs | GET | /v1/provisioning/me/vps | Authorization | — | List of VPSs; see response sample. |

| Request a VPS | POST | /v1/provisioning/me/vps | Authorization | Optional; supports plan_slug and nested vendor_selection. | 202 Accepted, VPS object; see response sample. |

| Get one VPS (with password) | GET | /v1/provisioning/me/vps/<vps_id> | Authorization | — | VPS detail including root_password for owner; see response sample. |

| List academy VPSs | GET | /v1/provisioning/academy/vps | Authorization, Academy: <academy_id> | Optional: ?user_id=<user_id> | List of VPSs for academy (no root_password). |

| Request VPS for student | POST | /v1/provisioning/academy/vps | Authorization, Academy: <academy_id> | user_id required; optional plan_slug and nested vendor_selection. | 202 Accepted, VPS object (no root_password). |

| Deprovision VPS | DELETE | /v1/provisioning/academy/vps/<vps_id> | Authorization, Academy: <academy_id> | — | 204 No Content. |

| Get academy vendor options | GET | /v1/provisioning/academy/provisioningacademy/<provisioning_academy_id>/vendor-options | Authorization, Academy: <academy_id> | — | Hostinger: catalog_items, templates, data_centers (raw payloads). DigitalOcean: regions, sizes, images (raw payloads). Other vendors may return empty objects. |

Request a VPS — request Hostinger (POST /v1/provisioning/me/vps):

{
  "plan_slug": "default",
  "vendor_selection": {
    "item_id": "12345",
    "template_id": 101,
    "data_center_id": 7
  }
}

Request a VPS — request DigitalOcean (POST /v1/provisioning/me/vps):

{
  "plan_slug": "default",
  "vendor_selection": {
    "region_slug": "nyc1",
    "size_slug": "s-1vcpu-1gb",
    "image_slug": "ubuntu-22-04-x64"
  }
}

Body is optional; omit vendor_selection to let backend auto-pick when an allowlist has exactly one option (per dimension).

Request a VPS — response (202 Accepted):

{
  "id": 100,
  "status": "PENDING",
  "hostname": "",
  "ip_address": null,
  "ssh_user": "",
  "ssh_port": 22,
  "plan_slug": "default",
  "error_message": "",
  "requested_at": "2026-03-26T15:20:00Z",
  "provisioned_at": null,
  "deleted_at": null,
  "created_at": "2026-03-26T15:20:00Z",
  "updated_at": "2026-03-26T15:20:00Z"
}

Later the VPS may move to ACTIVE or ERROR; use GET to fetch updated details and root_password when ACTIVE.

Request VPS for student — request Hostinger (POST /v1/provisioning/academy/vps):

{
  "user_id": 50,
  "plan_slug": "default",
  "vendor_selection": {
    "item_id": "12345",
    "template_id": 101,
    "data_center_id": 7
  }
}

Request VPS for student — request DigitalOcean (POST /v1/provisioning/academy/vps):

{
  "user_id": 50,
  "plan_slug": "default",
  "vendor_selection": {
    "region_slug": "nyc1",
    "size_slug": "s-1vcpu-1gb",
    "image_slug": "ubuntu-22-04-x64"
  }
}

Get academy vendor options — Hostinger example (GET /v1/provisioning/academy/provisioningacademy/<provisioning_academy_id>/vendor-options):

{
  "catalog_items": [
    {
      "id": "hostingercom-vps-kvm1",
      "name": "KVM 1",
      "category": "VPS",
      "metadata": {"cpus": "1", "memory": "4096", "bandwidth": "4096000", "disk_space": "51200", "network": "300"},
      "prices": [
        {"id": "hostingercom-vps-kvm1-usd-1m", "name": "KVM 1 (billed every month)", "currency": "USD", "price": 1949, "first_period_price": 999, "period": 1, "period_unit": "month"}
      ]
    }
  ],
  "templates": [
    {
      "id": 1007,
      "name": "Ubuntu 22.04 LTS",
      "description": "Ubuntu is a complete Linux operating system...",
      "documentation": null
    }
  ],
  "data_centers": [
    {
      "id": 11,
      "name": "bnk",
      "location": "lt",
      "city": "Vilnius",
      "continent": "Europe"
    }
  ]
}

Get academy vendor options — DigitalOcean example (same path; vendor is DigitalOcean):

{
  "regions": [
    {"slug": "nyc1", "name": "New York 1", "available": true}
  ],
  "sizes": [
    {"slug": "s-1vcpu-1gb", "memory": 1024, "vcpus": 1}
  ],
  "images": [
    {"slug": "ubuntu-22-04-x64", "distribution": "Ubuntu", "name": "22.04 x64"}
  ]
}

Get one VPS — response (GET /v1/provisioning/me/vps/<vps_id>, owner only):

{
  "id": 100,
  "status": "ACTIVE",
  "hostname": "vps-100.example.com",
  "ip_address": "192.168.1.10",
  "ssh_user": "root",
  "ssh_port": 22,
  "root_password": "generated-secret-password",
  "plan_slug": "default",
  "error_message": "",
  "requested_at": "2026-03-26T15:20:00Z",
  "provisioned_at": "2026-03-26T15:25:00Z",
  "deleted_at": null,
  "created_at": "2026-03-26T15:20:00Z",
  "updated_at": "2026-03-26T15:25:00Z"
}

Base path for all: /v1/provisioning/. Academy endpoints require capability crud_provisioning_activity.

Edge Cases

Checklist

  1. For listing or requesting a VPS as a student: call GET /v1/provisioning/me/vps or POST /v1/provisioning/me/vps with Authorization.
  2. For VPS connection details (including root password): call GET /v1/provisioning/me/vps/<vps_id> as the owning user.
  3. For vendor-constrained VPS requests: call GET /v1/provisioning/academy/provisioningacademy/<provisioning_academy_id>/vendor-options first, then send selected IDs in nested vendor_selection.
  4. For academy list: call GET /v1/provisioning/academy/vps with Authorization and Academy: <academy_id> (user must have crud_provisioning_activity).
  5. For staff requesting a VPS for a student: call POST /v1/provisioning/academy/vps with Authorization, Academy: <academy_id>, and body user_id plus optional nested vendor_selection; consumes the student’s vps_server credit.
  6. For deprovisioning: call DELETE /v1/provisioning/academy/vps/<vps_id> with Authorization and Academy: <academy_id>.
  7. If the API returns allowlist-selection or vendor-options errors, explain the cause and guide the user to refresh allowed options or fix academy credentials before retrying.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.