Skip to content
Docs

    Compute

    ComputeVMs

    Create VM
    client.Compute.VMs.New(ctx, body) (*Operation, error)
    POST/v1/compute/vms
    Get VM Details
    client.Compute.VMs.Get(ctx, vmID) (*VM, error)
    GET/v1/compute/vms/{vm_id}
    Update VM
    client.Compute.VMs.Update(ctx, vmID, body) (*Operation, error)
    PATCH/v1/compute/vms/{vm_id}
    Delete VM
    client.Compute.VMs.Delete(ctx, vmID) (*Operation, error)
    DELETE/v1/compute/vms/{vm_id}
    List VMs
    client.Compute.VMs.List(ctx, query) (*Cursor[VM], error)
    GET/v1/compute/vms
    Restart VM
    client.Compute.VMs.Restart(ctx, vmID) (*Operation, error)
    POST/v1/compute/vms/{vm_id}/restart
    ModelsExpand Collapse
    type CPUConfig struct{…}

    CPU configuration for the VM.

    Vcpu int64

    Number of virtual CPUs.

    maximum192
    minimum1
    type MemoryConfig struct{…}

    Memory configuration for the VM.

    Size int64

    Size of the memory in GB.

    maximum768
    minimum1
    type OSImage struct{…}

    OS Image details.

    CreatedAt Time

    When the OS Image was created.

    formatdate-time
    DisplayName string

    Display name of the OS Image.

    Name string

    Name of the OS Image.

    type SSHKeyRequest struct{…}

    Public SSH key configuration for the VM.

    PublicKey string

    Public key to and use to access the VM.

    type VM struct{…}

    VM details.

    ID string

    Unique identifier for the VM.

    BootVolumeID string

    ID of the boot volume attached to the VM.

    CPUConfig CPUConfig

    CPU configuration for the VM.

    Vcpu int64

    Number of virtual CPUs.

    maximum192
    minimum1
    CreatedAt Time

    When the VM was created.

    formatdate-time
    DataVolumeIDs []string

    IDs of the data volumes attached to the VM.

    MemoryConfig MemoryConfig

    Memory configuration for the VM.

    Size int64

    Size of the memory in GB.

    maximum768
    minimum1
    Name string

    Name of the VM.

    PrivateIP string

    Private IP of the VM.

    ProjectID string

    Project ID the VM belongs to.

    PublicIP string

    Public IP of the VM.

    PublicIPEnabled bool

    Whether the public IP is enabled for the VM.

    Region RegionName

    Region the resource is in.

    Status of the resource.

    One of the following:
    const ResourceStatusPending ResourceStatus = "pending"
    const ResourceStatusCreating ResourceStatus = "creating"
    const ResourceStatusUpdating ResourceStatus = "updating"
    const ResourceStatusReady ResourceStatus = "ready"
    const ResourceStatusDeleting ResourceStatus = "deleting"
    const ResourceStatusDeleted ResourceStatus = "deleted"
    const ResourceStatusError ResourceStatus = "error"
    SubnetID string

    ID of the subnet the VM is in.

    Tags []string

    Tags to attach to the VM.

    UpdatedAt Time

    When the VM was updated.

    formatdate-time
    VPCID string

    ID of the VPC the VM is in.

    VPCName string

    Name of the VPC the VM is in.

    InstanceType stringOptional

    Instance type name.

    type VMList struct{…}
    Items []VM
    ID string

    Unique identifier for the VM.

    BootVolumeID string

    ID of the boot volume attached to the VM.

    CPUConfig CPUConfig

    CPU configuration for the VM.

    Vcpu int64

    Number of virtual CPUs.

    maximum192
    minimum1
    CreatedAt Time

    When the VM was created.

    formatdate-time
    DataVolumeIDs []string

    IDs of the data volumes attached to the VM.

    MemoryConfig MemoryConfig

    Memory configuration for the VM.

    Size int64

    Size of the memory in GB.

    maximum768
    minimum1
    Name string

    Name of the VM.

    PrivateIP string

    Private IP of the VM.

    ProjectID string

    Project ID the VM belongs to.

    PublicIP string

    Public IP of the VM.

    PublicIPEnabled bool

    Whether the public IP is enabled for the VM.

    Region RegionName

    Region the resource is in.

    Status of the resource.

    One of the following:
    const ResourceStatusPending ResourceStatus = "pending"
    const ResourceStatusCreating ResourceStatus = "creating"
    const ResourceStatusUpdating ResourceStatus = "updating"
    const ResourceStatusReady ResourceStatus = "ready"
    const ResourceStatusDeleting ResourceStatus = "deleting"
    const ResourceStatusDeleted ResourceStatus = "deleted"
    const ResourceStatusError ResourceStatus = "error"
    SubnetID string

    ID of the subnet the VM is in.

    Tags []string

    Tags to attach to the VM.

    UpdatedAt Time

    When the VM was updated.

    formatdate-time
    VPCID string

    ID of the VPC the VM is in.

    VPCName string

    Name of the VPC the VM is in.

    InstanceType stringOptional

    Instance type name.

    ComputeVMsAvailability

    Check VM Create Availability
    client.Compute.VMs.Availability.New(ctx, body) error
    POST/v1/compute/vms/availability
    Check VM Update Availability
    client.Compute.VMs.Availability.Update(ctx, vmID, body) error
    PATCH/v1/compute/vms/{vm_id}/availability

    ComputeVMsCost

    Estimate VM Create Cost
    client.Compute.VMs.Cost.New(ctx, body) (*CostQuote, error)
    POST/v1/compute/vms/cost
    Estimate VM Update Cost
    client.Compute.VMs.Cost.Update(ctx, vmID, body) (*CostQuoteUpdate, error)
    PATCH/v1/compute/vms/{vm_id}/cost

    ComputeVMsVolumes

    List VM's Volumes
    client.Compute.VMs.Volumes.List(ctx, vmID, query) (*Cursor[Volume], error)
    GET/v1/compute/vms/{vm_id}/volumes

    ComputeVMsOS Images

    List OS Images
    client.Compute.VMs.OSImages.List(ctx, query) (*Cursor[OSImage], error)
    GET/v1/compute/vms/os_images

    ComputeVolumes

    Create Volume
    client.Compute.Volumes.New(ctx, body) (*Operation, error)
    POST/v1/compute/volumes
    Get Volume
    client.Compute.Volumes.Get(ctx, volumeID) (*Volume, error)
    GET/v1/compute/volumes/{volume_id}
    Update Volume
    client.Compute.Volumes.Update(ctx, volumeID, body) (*Operation, error)
    PATCH/v1/compute/volumes/{volume_id}
    Delete Volume
    client.Compute.Volumes.Delete(ctx, volumeID) (*Operation, error)
    DELETE/v1/compute/volumes/{volume_id}
    List Volumes
    client.Compute.Volumes.List(ctx, query) (*Cursor[Volume], error)
    GET/v1/compute/volumes
    Attach Volume
    client.Compute.Volumes.Attach(ctx, volumeID, body) (*Operation, error)
    POST/v1/compute/volumes/{volume_id}/attach
    Detach Volume
    client.Compute.Volumes.Detach(ctx, volumeID) (*Operation, error)
    POST/v1/compute/volumes/{volume_id}/detach
    ModelsExpand Collapse
    type Volume struct{…}

    Volume details.

    ID string

    Unique identifier for the Volume.

    CreatedAt Time

    When the Volume was created.

    formatdate-time

    Volume kind.

    One of the following:
    const VolumeKindBoot VolumeKind = "boot"
    const VolumeKindData VolumeKind = "data"
    Name string

    Name of the Volume.

    ProjectID string

    Project ID the Volume belongs to.

    Region RegionName

    Region the resource is in.

    Size int64

    Size of the Volume in GB.

    Status of the resource.

    One of the following:
    const ResourceStatusPending ResourceStatus = "pending"
    const ResourceStatusCreating ResourceStatus = "creating"
    const ResourceStatusUpdating ResourceStatus = "updating"
    const ResourceStatusReady ResourceStatus = "ready"
    const ResourceStatusDeleting ResourceStatus = "deleting"
    const ResourceStatusDeleted ResourceStatus = "deleted"
    const ResourceStatusError ResourceStatus = "error"
    Tags []string

    Tags to attach to the Volume.

    Type of the Volume.

    One of the following:
    const VolumeTypeNvme VolumeType = "nvme"
    const VolumeTypeABS VolumeType = "abs"
    UpdatedAt Time

    When the Volume was updated.

    formatdate-time
    VMID string

    ID of the VM the Volume is attached to.

    VMName string

    Name of the VM the Volume is attached to.

    type VolumeKind string

    Volume kind.

    One of the following:
    const VolumeKindBoot VolumeKind = "boot"
    const VolumeKindData VolumeKind = "data"
    type VolumeList struct{…}
    Items []Volume
    ID string

    Unique identifier for the Volume.

    CreatedAt Time

    When the Volume was created.

    formatdate-time

    Volume kind.

    One of the following:
    const VolumeKindBoot VolumeKind = "boot"
    const VolumeKindData VolumeKind = "data"
    Name string

    Name of the Volume.

    ProjectID string

    Project ID the Volume belongs to.

    Region RegionName

    Region the resource is in.

    Size int64

    Size of the Volume in GB.

    Status of the resource.

    One of the following:
    const ResourceStatusPending ResourceStatus = "pending"
    const ResourceStatusCreating ResourceStatus = "creating"
    const ResourceStatusUpdating ResourceStatus = "updating"
    const ResourceStatusReady ResourceStatus = "ready"
    const ResourceStatusDeleting ResourceStatus = "deleting"
    const ResourceStatusDeleted ResourceStatus = "deleted"
    const ResourceStatusError ResourceStatus = "error"
    Tags []string

    Tags to attach to the Volume.

    Type of the Volume.

    One of the following:
    const VolumeTypeNvme VolumeType = "nvme"
    const VolumeTypeABS VolumeType = "abs"
    UpdatedAt Time

    When the Volume was updated.

    formatdate-time
    VMID string

    ID of the VM the Volume is attached to.

    VMName string

    Name of the VM the Volume is attached to.

    type VolumeType string

    Type of the Volume.

    One of the following:
    const VolumeTypeNvme VolumeType = "nvme"
    const VolumeTypeABS VolumeType = "abs"

    ComputeVolumesAvailability

    Check Volume Create Availability
    client.Compute.Volumes.Availability.New(ctx, body) error
    POST/v1/compute/volumes/availability
    Check Volume Update Availability
    client.Compute.Volumes.Availability.Update(ctx, volumeID, body) error
    PATCH/v1/compute/volumes/{volume_id}/availability

    ComputeVolumesCost

    Estimate Volume Create Cost
    client.Compute.Volumes.Cost.New(ctx, body) (*CostQuote, error)
    POST/v1/compute/volumes/cost
    Estimate Volume Update Cost
    client.Compute.Volumes.Cost.Update(ctx, volumeID, body) (*CostQuoteUpdate, error)
    PATCH/v1/compute/volumes/{volume_id}/cost