CUDO Compute Virtual Machines API

The Virtual Machines API from CUDO Compute — 10 operation(s) for virtual machines.

OpenAPI Specification

cudo-compute-virtual-machines-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: CUDO Compute Billing Virtual Machines API
  description: REST API for the CUDO Compute global GPU and cloud compute platform and marketplace. The API is versioned, resource-oriented, and speaks JSON over HTTPS. It provisions and manages virtual machines, machine types, data centers, disks and snapshots, networks and security groups, images, SSH keys, object storage, and billing. A parallel gRPC API exposes the same services. Authentication uses a Bearer API key created in the CUDO Compute dashboard; requests without a valid key return 401 UNAUTHENTICATED.
  termsOfService: https://www.cudocompute.com/legal/terms-of-service
  contact:
    name: CUDO Compute Support
    url: https://www.cudocompute.com/contact
  version: 1.0.0
servers:
- url: https://rest.compute.cudo.org
security:
- bearerAuth: []
tags:
- name: Virtual Machines
paths:
  /v1/projects/{projectId}/vm:
    post:
      operationId: createVM
      tags:
      - Virtual Machines
      summary: Create a virtual machine
      description: Provisions a new CPU- or GPU-backed virtual machine in a project.
      parameters:
      - $ref: '#/components/parameters/projectId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateVMBody'
      responses:
        '200':
          description: Virtual machine created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateVMResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /v1/projects/{projectId}/vms:
    get:
      operationId: listVMs
      tags:
      - Virtual Machines
      summary: List virtual machines
      parameters:
      - $ref: '#/components/parameters/projectId'
      - name: pageSize
        in: query
        schema:
          type: integer
      - name: startAfter
        in: query
        schema:
          type: string
      responses:
        '200':
          description: A list of virtual machines
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListVMsResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /v1/projects/{projectId}/vms/{id}:
    get:
      operationId: getVM
      tags:
      - Virtual Machines
      summary: Get a virtual machine
      parameters:
      - $ref: '#/components/parameters/projectId'
      - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: The requested virtual machine
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VM'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /v1/projects/{projectId}/vms/{id}/start:
    post:
      operationId: startVM
      tags:
      - Virtual Machines
      summary: Start a virtual machine
      parameters:
      - $ref: '#/components/parameters/projectId'
      - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: Start acknowledged
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
  /v1/projects/{projectId}/vms/{id}/stop:
    post:
      operationId: stopVM
      tags:
      - Virtual Machines
      summary: Stop a virtual machine
      parameters:
      - $ref: '#/components/parameters/projectId'
      - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: Stop acknowledged
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
  /v1/projects/{projectId}/vms/{id}/reboot:
    post:
      operationId: rebootVM
      tags:
      - Virtual Machines
      summary: Reboot a virtual machine
      parameters:
      - $ref: '#/components/parameters/projectId'
      - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: Reboot acknowledged
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
  /v1/projects/{projectId}/vms/{id}/resize:
    post:
      operationId: resizeVM
      tags:
      - Virtual Machines
      summary: Resize a virtual machine
      parameters:
      - $ref: '#/components/parameters/projectId'
      - $ref: '#/components/parameters/id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                vcpus:
                  type: integer
                memoryGib:
                  type: integer
      responses:
        '200':
          description: Resize acknowledged
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
  /v1/projects/{projectId}/vms/{id}/terminate:
    post:
      operationId: terminateVM
      tags:
      - Virtual Machines
      summary: Terminate a virtual machine
      parameters:
      - $ref: '#/components/parameters/projectId'
      - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: Terminate acknowledged
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
  /v1/projects/{projectId}/vms/{id}/connect:
    get:
      operationId: connectVM
      tags:
      - Virtual Machines
      summary: Get virtual machine connection details
      parameters:
      - $ref: '#/components/parameters/projectId'
      - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: Connection details
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
  /v1/projects/{projectId}/vms/{id}/monitor:
    get:
      operationId: monitorVM
      tags:
      - Virtual Machines
      summary: Get virtual machine monitoring metrics
      parameters:
      - $ref: '#/components/parameters/projectId'
      - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: Monitoring metrics
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    ListVMsResponse:
      type: object
      properties:
        vms:
          type: array
          items:
            $ref: '#/components/schemas/VM'
    CreateVMResponse:
      type: object
      properties:
        id:
          type: string
        vm:
          $ref: '#/components/schemas/VM'
    Disk:
      type: object
      properties:
        id:
          type: string
        projectId:
          type: string
        dataCenterId:
          type: string
        vmId:
          type: string
        sizeGib:
          type: integer
        publicImageId:
          type: string
        privateImageId:
          type: string
        createTime:
          type: string
          format: date-time
    VM:
      type: object
      properties:
        id:
          type: string
        datacenterId:
          type: string
        machineType:
          type: string
        regionId:
          type: string
        regionName:
          type: string
        externalIpAddress:
          type: string
        internalIpAddress:
          type: string
        publicIpAddress:
          type: string
        memory:
          type: integer
        cpuModel:
          type: string
        vcpus:
          type: integer
        gpuModel:
          type: string
        gpuModelId:
          type: string
        gpuQuantity:
          type: integer
    Error:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        status:
          type: string
    CreateVMBody:
      type: object
      properties:
        dataCenterId:
          type: string
        machineType:
          type: string
        vmId:
          type: string
        startScript:
          type: string
        password:
          type: string
        bootDiskImageId:
          type: string
        vcpus:
          type: integer
        memoryGib:
          type: integer
        gpus:
          type: integer
        cpuModel:
          type: string
        gpuModel:
          type: string
        customSshKeys:
          type: array
          items:
            type: string
        bootDisk:
          $ref: '#/components/schemas/Disk'
  responses:
    Unauthorized:
      description: Authentication failed; missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  parameters:
    projectId:
      name: projectId
      in: path
      required: true
      description: The project identifier.
      schema:
        type: string
    id:
      name: id
      in: path
      required: true
      description: The resource identifier.
      schema:
        type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'A CUDO Compute API key passed as a Bearer token in the Authorization header, e.g. `Authorization: Bearer $CUDO_API_KEY`. Create keys in the CUDO Compute dashboard. Missing or invalid keys return 401 UNAUTHENTICATED.'