Documentation
¶
Index ¶
- Constants
- type CPUConfig
- type CPUConfigParam
- type ComputeService
- type Error
- type MemoryConfig
- type MemoryConfigParam
- type OSImage
- type RegionName
- type ResourceStatus
- type SSHKeyParam
- type StorageType
- type VM
- type VMList
- type VMNewParams
- type VMNewParamsBootVolume
- type VMNewParamsDataVolume
- type VMOSImageService
- type VMService
- func (r *VMService) Delete(ctx context.Context, vmID string, opts ...option.RequestOption) (res *operations.Operation, err error)
- func (r *VMService) Get(ctx context.Context, vmID string, opts ...option.RequestOption) (res *VM, err error)
- func (r *VMService) List(ctx context.Context, opts ...option.RequestOption) (res *VMList, err error)
- func (r *VMService) New(ctx context.Context, body VMNewParams, opts ...option.RequestOption) (res *operations.Operation, err error)
- func (r *VMService) Update(ctx context.Context, vmID string, body VMUpdateParams, ...) (res *operations.Operation, err error)
- type VMUpdateParams
- type VMVolumeService
- type Volume
- type VolumeKind
- type VolumeList
- type VolumeNewParams
- type VolumeService
- func (r *VolumeService) Delete(ctx context.Context, volumeID string, opts ...option.RequestOption) (res *operations.Operation, err error)
- func (r *VolumeService) Get(ctx context.Context, volumeID string, opts ...option.RequestOption) (res *Volume, err error)
- func (r *VolumeService) List(ctx context.Context, opts ...option.RequestOption) (res *VolumeList, err error)
- func (r *VolumeService) New(ctx context.Context, body VolumeNewParams, opts ...option.RequestOption) (res *operations.Operation, err error)
- func (r *VolumeService) Update(ctx context.Context, volumeID string, body VolumeUpdateParams, ...) (res *operations.Operation, err error)
- type VolumeUpdateParams
Constants ¶
const RegionNameApSeo1 = shared.RegionNameApSeo1
This is an alias to an internal value.
const RegionNameApSin1 = shared.RegionNameApSin1
This is an alias to an internal value.
const RegionNameApTyo1 = shared.RegionNameApTyo1
This is an alias to an internal value.
const RegionNameEuAms1 = shared.RegionNameEuAms1
This is an alias to an internal value.
const RegionNameEuFrk1 = shared.RegionNameEuFrk1
This is an alias to an internal value.
const RegionNameEuLon1 = shared.RegionNameEuLon1
This is an alias to an internal value.
const RegionNameUsChi1 = shared.RegionNameUsChi1
This is an alias to an internal value.
const RegionNameUsSea1 = shared.RegionNameUsSea1
This is an alias to an internal value.
const RegionNameUsSva1 = shared.RegionNameUsSva1
This is an alias to an internal value.
const RegionNameUsWdc1 = shared.RegionNameUsWdc1
This is an alias to an internal value.
const ResourceStatusCreating = shared.ResourceStatusCreating
This is an alias to an internal value.
const ResourceStatusDeleted = shared.ResourceStatusDeleted
This is an alias to an internal value.
const ResourceStatusDeleting = shared.ResourceStatusDeleting
This is an alias to an internal value.
const ResourceStatusError = shared.ResourceStatusError
This is an alias to an internal value.
const ResourceStatusPending = shared.ResourceStatusPending
This is an alias to an internal value.
const ResourceStatusReady = shared.ResourceStatusReady
This is an alias to an internal value.
const ResourceStatusUpdating = shared.ResourceStatusUpdating
This is an alias to an internal value.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CPUConfig ¶
type CPUConfig struct {
// Number of virtual CPUs.
Vcpu int64 `json:"vcpu,required"`
JSON cpuConfigJSON `json:"-"`
}
CPU configuration for the VM.
func (*CPUConfig) UnmarshalJSON ¶
type CPUConfigParam ¶
type CPUConfigParam struct {
// Number of virtual CPUs.
Vcpu param.Field[int64] `json:"vcpu,required"`
}
CPU configuration for the VM.
func (CPUConfigParam) MarshalJSON ¶
func (r CPUConfigParam) MarshalJSON() (data []byte, err error)
type ComputeService ¶
type ComputeService struct {
Options []option.RequestOption
VMs *VMService
Volumes *VolumeService
}
ComputeService contains methods and other services that help with interacting with the Nirvana Labs API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewComputeService method instead.
func NewComputeService ¶
func NewComputeService(opts ...option.RequestOption) (r *ComputeService)
NewComputeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type MemoryConfig ¶
type MemoryConfig struct {
// Size of the memory in GB.
Size int64 `json:"size,required"`
JSON memoryConfigJSON `json:"-"`
}
Memory configuration for the VM.
func (*MemoryConfig) UnmarshalJSON ¶
func (r *MemoryConfig) UnmarshalJSON(data []byte) (err error)
type MemoryConfigParam ¶
type MemoryConfigParam struct {
// Size of the memory in GB.
Size param.Field[int64] `json:"size,required"`
}
Memory configuration for the VM.
func (MemoryConfigParam) MarshalJSON ¶
func (r MemoryConfigParam) MarshalJSON() (data []byte, err error)
type OSImage ¶
type OSImage struct {
// When the OS Image was created.
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
// Display name of the OS Image.
DisplayName string `json:"display_name,required"`
// Name of the OS Image.
Name string `json:"name,required"`
JSON osImageJSON `json:"-"`
}
OS Image details.
func (*OSImage) UnmarshalJSON ¶
type RegionName ¶
type RegionName = shared.RegionName
Region the resource is in.
This is an alias to an internal type.
type ResourceStatus ¶
type ResourceStatus = shared.ResourceStatus
Status of the resource.
This is an alias to an internal type.
type SSHKeyParam ¶
type SSHKeyParam struct {
// Public key to and and use to access the VM.
PublicKey param.Field[string] `json:"public_key,required"`
}
Public SSH key configuration for the VM.
func (SSHKeyParam) MarshalJSON ¶
func (r SSHKeyParam) MarshalJSON() (data []byte, err error)
type StorageType ¶
type StorageType string
Storage type the volume is using.
const (
StorageTypeNvme StorageType = "nvme"
)
func (StorageType) IsKnown ¶
func (r StorageType) IsKnown() bool
type VM ¶
type VM struct {
// Unique identifier for the VM.
ID string `json:"id,required"`
// ID of the boot volume attached to the VM.
BootVolumeID string `json:"boot_volume_id,required"`
// CPU configuration for the VM.
CPUConfig CPUConfig `json:"cpu_config,required"`
// When the VM was created.
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
// IDs of the data volumes attached to the VM.
DataVolumeIDs []string `json:"data_volume_ids,required"`
// Memory configuration for the VM.
MemoryConfig MemoryConfig `json:"memory_config,required"`
// Name of the VM.
Name string `json:"name,required"`
// Private IP of the VM.
PrivateIP string `json:"private_ip,required,nullable"`
// Public IP of the VM.
PublicIP string `json:"public_ip,required,nullable"`
// Region the resource is in.
Region shared.RegionName `json:"region,required"`
// Status of the resource.
Status shared.ResourceStatus `json:"status,required"`
// ID of the subnet the VM is in.
SubnetID string `json:"subnet_id,required"`
// When the VM was updated.
UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
// ID of the VPC the VM is in.
VPCID string `json:"vpc_id,required"`
// Name of the VPC the VM is in.
VPCName string `json:"vpc_name,required"`
JSON vmJSON `json:"-"`
}
VM details.
func (*VM) UnmarshalJSON ¶
type VMList ¶
type VMList struct {
Items []VM `json:"items,required"`
JSON vmListJSON `json:"-"`
}
func (*VMList) UnmarshalJSON ¶
type VMNewParams ¶
type VMNewParams struct {
// Boot volume for the VM.
BootVolume param.Field[VMNewParamsBootVolume] `json:"boot_volume,required"`
// CPU configuration for the VM.
CPUConfig param.Field[CPUConfigParam] `json:"cpu_config,required"`
// Memory configuration for the VM.
MemoryConfig param.Field[MemoryConfigParam] `json:"memory_config,required"`
// Name of the VM.
Name param.Field[string] `json:"name,required"`
// Name of the OS Image to use for the VM.
OSImageName param.Field[string] `json:"os_image_name,required"`
// Whether to enable public IP for the VM.
PublicIPEnabled param.Field[bool] `json:"public_ip_enabled,required"`
// Region the resource is in.
Region param.Field[shared.RegionName] `json:"region,required"`
// Public SSH key configuration for the VM.
SSHKey param.Field[SSHKeyParam] `json:"ssh_key,required"`
// ID of the subnet to use for the VM.
SubnetID param.Field[string] `json:"subnet_id,required"`
// Data volumes for the VM.
DataVolumes param.Field[[]VMNewParamsDataVolume] `json:"data_volumes"`
}
func (VMNewParams) MarshalJSON ¶
func (r VMNewParams) MarshalJSON() (data []byte, err error)
type VMNewParamsBootVolume ¶
type VMNewParamsBootVolume struct {
// Size of the volume in GB.
Size param.Field[int64] `json:"size,required"`
}
Boot volume for the VM.
func (VMNewParamsBootVolume) MarshalJSON ¶
func (r VMNewParamsBootVolume) MarshalJSON() (data []byte, err error)
type VMNewParamsDataVolume ¶
type VMNewParamsDataVolume struct {
// Name of the volume.
Name param.Field[string] `json:"name,required"`
// Size of the volume in GB.
Size param.Field[int64] `json:"size,required"`
}
VM data volume create request.
func (VMNewParamsDataVolume) MarshalJSON ¶
func (r VMNewParamsDataVolume) MarshalJSON() (data []byte, err error)
type VMOSImageService ¶
type VMOSImageService struct {
Options []option.RequestOption
}
VMOSImageService contains methods and other services that help with interacting with the Nirvana Labs API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVMOSImageService method instead.
func NewVMOSImageService ¶
func NewVMOSImageService(opts ...option.RequestOption) (r *VMOSImageService)
NewVMOSImageService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*VMOSImageService) List ¶
func (r *VMOSImageService) List(ctx context.Context, opts ...option.RequestOption) (res *[]OSImage, err error)
List all OS Images
type VMService ¶
type VMService struct {
Options []option.RequestOption
Volumes *VMVolumeService
OSImages *VMOSImageService
}
VMService contains methods and other services that help with interacting with the Nirvana Labs API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVMService method instead.
func NewVMService ¶
func NewVMService(opts ...option.RequestOption) (r *VMService)
NewVMService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*VMService) Delete ¶
func (r *VMService) Delete(ctx context.Context, vmID string, opts ...option.RequestOption) (res *operations.Operation, err error)
Delete a VM
func (*VMService) Get ¶
func (r *VMService) Get(ctx context.Context, vmID string, opts ...option.RequestOption) (res *VM, err error)
Get details about a VM
func (*VMService) List ¶
func (r *VMService) List(ctx context.Context, opts ...option.RequestOption) (res *VMList, err error)
List all VMs
func (*VMService) New ¶
func (r *VMService) New(ctx context.Context, body VMNewParams, opts ...option.RequestOption) (res *operations.Operation, err error)
Create a VM
func (*VMService) Update ¶
func (r *VMService) Update(ctx context.Context, vmID string, body VMUpdateParams, opts ...option.RequestOption) (res *operations.Operation, err error)
Update a VM
type VMUpdateParams ¶
type VMUpdateParams struct {
// CPU configuration for the VM.
CPUConfig param.Field[CPUConfigParam] `json:"cpu_config"`
// Memory configuration for the VM.
MemoryConfig param.Field[MemoryConfigParam] `json:"memory_config"`
// Name of the VM.
Name param.Field[string] `json:"name"`
// Whether to enable public IP for the VM.
PublicIPEnabled param.Field[bool] `json:"public_ip_enabled"`
}
func (VMUpdateParams) MarshalJSON ¶
func (r VMUpdateParams) MarshalJSON() (data []byte, err error)
type VMVolumeService ¶
type VMVolumeService struct {
Options []option.RequestOption
}
VMVolumeService contains methods and other services that help with interacting with the Nirvana Labs API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVMVolumeService method instead.
func NewVMVolumeService ¶
func NewVMVolumeService(opts ...option.RequestOption) (r *VMVolumeService)
NewVMVolumeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*VMVolumeService) List ¶
func (r *VMVolumeService) List(ctx context.Context, vmID string, opts ...option.RequestOption) (res *VolumeList, err error)
List VM's Volumes
type Volume ¶
type Volume struct {
// Unique identifier for the volume.
ID string `json:"id,required"`
// When the volume was created.
CreatedAt time.Time `json:"created_at,required" format:"date-time"`
// Volume kind.
Kind VolumeKind `json:"kind,required"`
// Name of the volume.
Name string `json:"name,required"`
// Size of the volume in GB.
Size int64 `json:"size,required"`
// Status of the resource.
Status shared.ResourceStatus `json:"status,required"`
// Storage type the volume is using.
Type StorageType `json:"type,required"`
// When the volume was updated.
UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
// ID of the VM the volume is attached to.
VMID string `json:"vm_id,required,nullable"`
// Name of the VM the volume is attached to.
VMName string `json:"vm_name,required,nullable"`
JSON volumeJSON `json:"-"`
}
Volume details.
func (*Volume) UnmarshalJSON ¶
type VolumeKind ¶
type VolumeKind string
Volume kind.
const ( VolumeKindBoot VolumeKind = "boot" VolumeKindData VolumeKind = "data" )
func (VolumeKind) IsKnown ¶
func (r VolumeKind) IsKnown() bool
type VolumeList ¶
type VolumeList struct {
Items []Volume `json:"items,required"`
JSON volumeListJSON `json:"-"`
}
func (*VolumeList) UnmarshalJSON ¶
func (r *VolumeList) UnmarshalJSON(data []byte) (err error)
type VolumeNewParams ¶
type VolumeNewParams struct {
// Name of the volume.
Name param.Field[string] `json:"name,required"`
// Size of the volume in GB.
Size param.Field[int64] `json:"size,required"`
// ID of the VM the volume is attached to.
VMID param.Field[string] `json:"vm_id,required"`
}
func (VolumeNewParams) MarshalJSON ¶
func (r VolumeNewParams) MarshalJSON() (data []byte, err error)
type VolumeService ¶
type VolumeService struct {
Options []option.RequestOption
}
VolumeService contains methods and other services that help with interacting with the Nirvana Labs API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVolumeService method instead.
func NewVolumeService ¶
func NewVolumeService(opts ...option.RequestOption) (r *VolumeService)
NewVolumeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*VolumeService) Delete ¶
func (r *VolumeService) Delete(ctx context.Context, volumeID string, opts ...option.RequestOption) (res *operations.Operation, err error)
Delete a Volume. Boot or data volumes can be deleted.
func (*VolumeService) Get ¶
func (r *VolumeService) Get(ctx context.Context, volumeID string, opts ...option.RequestOption) (res *Volume, err error)
Get a Volume.
func (*VolumeService) List ¶
func (r *VolumeService) List(ctx context.Context, opts ...option.RequestOption) (res *VolumeList, err error)
List all volumes
func (*VolumeService) New ¶
func (r *VolumeService) New(ctx context.Context, body VolumeNewParams, opts ...option.RequestOption) (res *operations.Operation, err error)
Create a Volume. Only data volumes can be created.
func (*VolumeService) Update ¶
func (r *VolumeService) Update(ctx context.Context, volumeID string, body VolumeUpdateParams, opts ...option.RequestOption) (res *operations.Operation, err error)
Update a Volume. Boot or data volumes can be updated.
type VolumeUpdateParams ¶
type VolumeUpdateParams struct {
// Name of the volume.
Name param.Field[string] `json:"name"`
// Size of the volume in GB.
Size param.Field[int64] `json:"size"`
}
func (VolumeUpdateParams) MarshalJSON ¶
func (r VolumeUpdateParams) MarshalJSON() (data []byte, err error)