Skip to content
Docs

VMs

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.

VMsAvailability

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

VMsVolumes

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

VMsOS Images

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