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

    ComputeVMsMetrics

    List VM's Metrics
    client.Compute.VMs.Metrics.List(ctx, vmID, query) (*VMMetrics, error)
    GET/v1/compute/vms/{vm_id}/metrics
    ModelsExpand Collapse
    type VMMetricPoint struct{…}

    One period’s value.

    Timestamp Time

    End of the period the value covers, so a point timestamped 00:05 over five-minute periods describes 00:00 through 00:05.

    formatdate-time
    Value float64

    Value over the period, in the series’ unit. Null means the VM reported no observation for this period, which is what a stopped VM looks like.

    type VMMetricSeries struct{…}

    One metric’s values over the interval served.

    Metric string

    Fully-qualified name of the metric.

    Points []VMMetricPoint

    Values over the interval, oldest first. Every series in a response covers the same periods, so they line up index for index.

    Timestamp Time

    End of the period the value covers, so a point timestamped 00:05 over five-minute periods describes 00:00 through 00:05.

    formatdate-time
    Value float64

    Value over the period, in the series’ unit. Null means the VM reported no observation for this period, which is what a stopped VM looks like.

    Unit the values are expressed in.

    One of the following:
    const VMMetricUnitRatio VMMetricUnit = "ratio"
    const VMMetricUnitBytes VMMetricUnit = "bytes"
    const VMMetricUnitCores VMMetricUnit = "cores"
    const VMMetricUnitBytesPerSecond VMMetricUnit = "bytes_per_second"
    const VMMetricUnitOperationsPerSecond VMMetricUnit = "operations_per_second"
    type VMMetrics struct{…}

    A VM’s metrics over an interval: one series per metric, on a shared grid of periods.

    Aggregation VMMetricsAggregation

    How the samples inside one period were folded into a single value.

    One of the following:
    const VMMetricsAggregationMean VMMetricsAggregation = "mean"
    const VMMetricsAggregationMax VMMetricsAggregation = "max"
    const VMMetricsAggregationMin VMMetricsAggregation = "min"
    EndTime Time

    End of the interval served, exclusive.

    formatdate-time
    Metrics []VMMetricSeries

    One series per requested metric, in the order they were requested.

    Metric string

    Fully-qualified name of the metric.

    Points []VMMetricPoint

    Values over the interval, oldest first. Every series in a response covers the same periods, so they line up index for index.

    Timestamp Time

    End of the period the value covers, so a point timestamped 00:05 over five-minute periods describes 00:00 through 00:05.

    formatdate-time
    Value float64

    Value over the period, in the series’ unit. Null means the VM reported no observation for this period, which is what a stopped VM looks like.

    Unit the values are expressed in.

    One of the following:
    const VMMetricUnitRatio VMMetricUnit = "ratio"
    const VMMetricUnitBytes VMMetricUnit = "bytes"
    const VMMetricUnitCores VMMetricUnit = "cores"
    const VMMetricUnitBytesPerSecond VMMetricUnit = "bytes_per_second"
    const VMMetricUnitOperationsPerSecond VMMetricUnit = "operations_per_second"
    Period VMMetricsPeriod

    Width of one period, and so the spacing between consecutive points.

    One of the following:
    const VMMetricsPeriod5m VMMetricsPeriod = "5m"
    const VMMetricsPeriod15m VMMetricsPeriod = "15m"
    const VMMetricsPeriod1h VMMetricsPeriod = "1h"
    const VMMetricsPeriod6h VMMetricsPeriod = "6h"
    const VMMetricsPeriod24h VMMetricsPeriod = "24h"
    StartTime Time

    Start of the interval served, inclusive. It can be later than the requested start when the request asked for more than the available history.

    formatdate-time
    VMID string

    ID of the VM the series belong to.

    ComputeVMsMetric Descriptors

    List VM Metric Descriptors
    client.Compute.VMs.MetricDescriptors.List(ctx) (*VMMetricDescriptorList, error)
    GET/v1/compute/metric_descriptors
    ModelsExpand Collapse
    type VMMetricDescriptor struct{…}

    Describes one metric a VM reports: how to name it, what its values mean, and the range they fall in.

    Description string

    What the metric measures.

    MaxValue float64

    Highest value the metric reports, or null when it has no ceiling of its own.

    Metric string

    Fully-qualified name of the metric, and the only spelling the metric query parameter accepts.

    MinValue float64

    Lowest value the metric reports.

    Nullable bool

    Whether a point’s value can be null. A null means the VM reported no observation for that period, which is what a stopped VM looks like.

    Unit the values are expressed in.

    One of the following:
    const VMMetricUnitRatio VMMetricUnit = "ratio"
    const VMMetricUnitBytes VMMetricUnit = "bytes"
    const VMMetricUnitCores VMMetricUnit = "cores"
    const VMMetricUnitBytesPerSecond VMMetricUnit = "bytes_per_second"
    const VMMetricUnitOperationsPerSecond VMMetricUnit = "operations_per_second"
    type VMMetricDescriptorList struct{…}
    Description string

    What the metric measures.

    MaxValue float64

    Highest value the metric reports, or null when it has no ceiling of its own.

    Metric string

    Fully-qualified name of the metric, and the only spelling the metric query parameter accepts.

    MinValue float64

    Lowest value the metric reports.

    Nullable bool

    Whether a point’s value can be null. A null means the VM reported no observation for that period, which is what a stopped VM looks like.

    Unit the values are expressed in.

    One of the following:
    const VMMetricUnitRatio VMMetricUnit = "ratio"
    const VMMetricUnitBytes VMMetricUnit = "bytes"
    const VMMetricUnitCores VMMetricUnit = "cores"
    const VMMetricUnitBytesPerSecond VMMetricUnit = "bytes_per_second"
    const VMMetricUnitOperationsPerSecond VMMetricUnit = "operations_per_second"

    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