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 VMAvailabilityNewParams
- type VMAvailabilityNewParamsBootVolume
- type VMAvailabilityNewParamsDataVolume
- type VMAvailabilityService
- type VMAvailabilityUpdateParams
- 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) Restart(ctx context.Context, vmID string, 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 VolumeAvailabilityNewParams
- type VolumeAvailabilityService
- type VolumeAvailabilityUpdateParams
- 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
Equals "ap-seo-1"
const RegionNameApSin1 = shared.RegionNameApSin1
Equals "ap-sin-1"
const RegionNameApTyo1 = shared.RegionNameApTyo1
Equals "ap-tyo-1"
const RegionNameEuFrk1 = shared.RegionNameEuFrk1
Equals "eu-frk-1"
const RegionNameUsChi1 = shared.RegionNameUsChi1
Equals "us-chi-1"
const RegionNameUsSea1 = shared.RegionNameUsSea1
Equals "us-sea-1"
const RegionNameUsSva1 = shared.RegionNameUsSva1
Equals "us-sva-1"
const RegionNameUsWdc1 = shared.RegionNameUsWdc1
Equals "us-wdc-1"
const ResourceStatusCreating = shared.ResourceStatusCreating
Equals "creating"
const ResourceStatusDeleted = shared.ResourceStatusDeleted
Equals "deleted"
const ResourceStatusDeleting = shared.ResourceStatusDeleting
Equals "deleting"
const ResourceStatusError = shared.ResourceStatusError
Equals "error"
const ResourceStatusPending = shared.ResourceStatusPending
Equals "pending"
const ResourceStatusReady = shared.ResourceStatusReady
Equals "ready"
const ResourceStatusUpdating = shared.ResourceStatusUpdating
Equals "updating"
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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Vcpu respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
CPU configuration for the VM.
func (CPUConfig) ToParam ¶ added in v1.1.0
func (r CPUConfig) ToParam() CPUConfigParam
ToParam converts this CPUConfig to a CPUConfigParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with CPUConfigParam.Overrides()
func (*CPUConfig) UnmarshalJSON ¶
type CPUConfigParam ¶
type CPUConfigParam struct {
// Number of virtual CPUs.
Vcpu int64 `json:"vcpu,required"`
// contains filtered or unexported fields
}
CPU configuration for the VM.
The property Vcpu is required.
func (CPUConfigParam) MarshalJSON ¶
func (r CPUConfigParam) MarshalJSON() (data []byte, err error)
func (*CPUConfigParam) UnmarshalJSON ¶ added in v1.1.0
func (r *CPUConfigParam) UnmarshalJSON(data []byte) 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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Size respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Memory configuration for the VM.
func (MemoryConfig) RawJSON ¶ added in v1.1.0
func (r MemoryConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (MemoryConfig) ToParam ¶ added in v1.1.0
func (r MemoryConfig) ToParam() MemoryConfigParam
ToParam converts this MemoryConfig to a MemoryConfigParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with MemoryConfigParam.Overrides()
func (*MemoryConfig) UnmarshalJSON ¶
func (r *MemoryConfig) UnmarshalJSON(data []byte) error
type MemoryConfigParam ¶
type MemoryConfigParam struct {
// Size of the memory in GB.
Size int64 `json:"size,required"`
// contains filtered or unexported fields
}
Memory configuration for the VM.
The property Size is required.
func (MemoryConfigParam) MarshalJSON ¶
func (r MemoryConfigParam) MarshalJSON() (data []byte, err error)
func (*MemoryConfigParam) UnmarshalJSON ¶ added in v1.1.0
func (r *MemoryConfigParam) UnmarshalJSON(data []byte) 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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
DisplayName respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `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 string `json:"public_key,required"`
// contains filtered or unexported fields
}
Public SSH key configuration for the VM.
The property PublicKey is required.
func (SSHKeyParam) MarshalJSON ¶
func (r SSHKeyParam) MarshalJSON() (data []byte, err error)
func (*SSHKeyParam) UnmarshalJSON ¶ added in v1.1.0
func (r *SSHKeyParam) UnmarshalJSON(data []byte) error
type StorageType ¶
type StorageType string
Storage type the volume is using.
const (
StorageTypeNvme StorageType = "nvme"
)
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"`
// Public IP of the VM.
PublicIP string `json:"public_ip,required"`
// Whether the public IP is enabled for the VM.
PublicIPEnabled bool `json:"public_ip_enabled,required"`
// Region the resource is in.
//
// Any of "us-sea-1", "us-sva-1", "us-chi-1", "us-wdc-1", "eu-frk-1", "ap-sin-1",
// "ap-seo-1", "ap-tyo-1".
Region shared.RegionName `json:"region,required"`
// Status of the resource.
//
// Any of "pending", "creating", "updating", "ready", "deleting", "deleted",
// "error".
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 contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
BootVolumeID respjson.Field
CPUConfig respjson.Field
CreatedAt respjson.Field
DataVolumeIDs respjson.Field
MemoryConfig respjson.Field
Name respjson.Field
PrivateIP respjson.Field
PublicIP respjson.Field
PublicIPEnabled respjson.Field
Region respjson.Field
Status respjson.Field
SubnetID respjson.Field
UpdatedAt respjson.Field
VPCID respjson.Field
VPCName respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
VM details.
func (*VM) UnmarshalJSON ¶
type VMAvailabilityNewParams ¶ added in v1.2.0
type VMAvailabilityNewParams struct {
// Boot volume for the VM.
BootVolume VMAvailabilityNewParamsBootVolume `json:"boot_volume,omitzero,required"`
// CPU configuration for the VM.
CPUConfig CPUConfigParam `json:"cpu_config,omitzero,required"`
// Memory configuration for the VM.
MemoryConfig MemoryConfigParam `json:"memory_config,omitzero,required"`
// Name of the VM.
Name string `json:"name,required"`
// Name of the OS Image to use for the VM.
OSImageName string `json:"os_image_name,required"`
// Whether to enable public IP for the VM.
PublicIPEnabled bool `json:"public_ip_enabled,required"`
// Region the resource is in.
//
// Any of "us-sea-1", "us-sva-1", "us-chi-1", "us-wdc-1", "eu-frk-1", "ap-sin-1",
// "ap-seo-1", "ap-tyo-1".
Region shared.RegionName `json:"region,omitzero,required"`
// Public SSH key configuration for the VM.
SSHKey SSHKeyParam `json:"ssh_key,omitzero,required"`
// ID of the subnet to use for the VM.
SubnetID string `json:"subnet_id,required"`
// Data volumes for the VM.
DataVolumes []VMAvailabilityNewParamsDataVolume `json:"data_volumes,omitzero"`
// contains filtered or unexported fields
}
func (VMAvailabilityNewParams) MarshalJSON ¶ added in v1.2.0
func (r VMAvailabilityNewParams) MarshalJSON() (data []byte, err error)
func (*VMAvailabilityNewParams) UnmarshalJSON ¶ added in v1.2.0
func (r *VMAvailabilityNewParams) UnmarshalJSON(data []byte) error
type VMAvailabilityNewParamsBootVolume ¶ added in v1.2.0
type VMAvailabilityNewParamsBootVolume struct {
// Size of the volume in GB.
Size int64 `json:"size,required"`
// contains filtered or unexported fields
}
Boot volume for the VM.
The property Size is required.
func (VMAvailabilityNewParamsBootVolume) MarshalJSON ¶ added in v1.2.0
func (r VMAvailabilityNewParamsBootVolume) MarshalJSON() (data []byte, err error)
func (*VMAvailabilityNewParamsBootVolume) UnmarshalJSON ¶ added in v1.2.0
func (r *VMAvailabilityNewParamsBootVolume) UnmarshalJSON(data []byte) error
type VMAvailabilityNewParamsDataVolume ¶ added in v1.2.0
type VMAvailabilityNewParamsDataVolume struct {
// Name of the volume.
Name string `json:"name,required"`
// Size of the volume in GB.
Size int64 `json:"size,required"`
// contains filtered or unexported fields
}
VM data volume create request.
The properties Name, Size are required.
func (VMAvailabilityNewParamsDataVolume) MarshalJSON ¶ added in v1.2.0
func (r VMAvailabilityNewParamsDataVolume) MarshalJSON() (data []byte, err error)
func (*VMAvailabilityNewParamsDataVolume) UnmarshalJSON ¶ added in v1.2.0
func (r *VMAvailabilityNewParamsDataVolume) UnmarshalJSON(data []byte) error
type VMAvailabilityService ¶ added in v1.2.0
type VMAvailabilityService struct {
Options []option.RequestOption
}
VMAvailabilityService 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 NewVMAvailabilityService method instead.
func NewVMAvailabilityService ¶ added in v1.2.0
func NewVMAvailabilityService(opts ...option.RequestOption) (r VMAvailabilityService)
NewVMAvailabilityService 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 (*VMAvailabilityService) New ¶ added in v1.2.0
func (r *VMAvailabilityService) New(ctx context.Context, body VMAvailabilityNewParams, opts ...option.RequestOption) (res *string, err error)
Check VM Create Availability
func (*VMAvailabilityService) Update ¶ added in v1.2.0
func (r *VMAvailabilityService) Update(ctx context.Context, vmID string, body VMAvailabilityUpdateParams, opts ...option.RequestOption) (res *string, err error)
Check VM Update Availability
type VMAvailabilityUpdateParams ¶ added in v1.2.0
type VMAvailabilityUpdateParams struct {
// Name of the VM.
Name param.Opt[string] `json:"name,omitzero"`
// Whether to enable public IP for the VM.
PublicIPEnabled param.Opt[bool] `json:"public_ip_enabled,omitzero"`
// CPU configuration for the VM.
CPUConfig CPUConfigParam `json:"cpu_config,omitzero"`
// Memory configuration for the VM.
MemoryConfig MemoryConfigParam `json:"memory_config,omitzero"`
// contains filtered or unexported fields
}
func (VMAvailabilityUpdateParams) MarshalJSON ¶ added in v1.2.0
func (r VMAvailabilityUpdateParams) MarshalJSON() (data []byte, err error)
func (*VMAvailabilityUpdateParams) UnmarshalJSON ¶ added in v1.2.0
func (r *VMAvailabilityUpdateParams) UnmarshalJSON(data []byte) error
type VMList ¶
type VMList struct {
Items []VM `json:"items,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Items respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*VMList) UnmarshalJSON ¶
type VMNewParams ¶
type VMNewParams struct {
// Boot volume for the VM.
BootVolume VMNewParamsBootVolume `json:"boot_volume,omitzero,required"`
// CPU configuration for the VM.
CPUConfig CPUConfigParam `json:"cpu_config,omitzero,required"`
// Memory configuration for the VM.
MemoryConfig MemoryConfigParam `json:"memory_config,omitzero,required"`
// Name of the VM.
Name string `json:"name,required"`
// Name of the OS Image to use for the VM.
OSImageName string `json:"os_image_name,required"`
// Whether to enable public IP for the VM.
PublicIPEnabled bool `json:"public_ip_enabled,required"`
// Region the resource is in.
//
// Any of "us-sea-1", "us-sva-1", "us-chi-1", "us-wdc-1", "eu-frk-1", "ap-sin-1",
// "ap-seo-1", "ap-tyo-1".
Region shared.RegionName `json:"region,omitzero,required"`
// Public SSH key configuration for the VM.
SSHKey SSHKeyParam `json:"ssh_key,omitzero,required"`
// ID of the subnet to use for the VM.
SubnetID string `json:"subnet_id,required"`
// Data volumes for the VM.
DataVolumes []VMNewParamsDataVolume `json:"data_volumes,omitzero"`
// contains filtered or unexported fields
}
func (VMNewParams) MarshalJSON ¶
func (r VMNewParams) MarshalJSON() (data []byte, err error)
func (*VMNewParams) UnmarshalJSON ¶ added in v1.1.0
func (r *VMNewParams) UnmarshalJSON(data []byte) error
type VMNewParamsBootVolume ¶
type VMNewParamsBootVolume struct {
// Size of the volume in GB.
Size int64 `json:"size,required"`
// contains filtered or unexported fields
}
Boot volume for the VM.
The property Size is required.
func (VMNewParamsBootVolume) MarshalJSON ¶
func (r VMNewParamsBootVolume) MarshalJSON() (data []byte, err error)
func (*VMNewParamsBootVolume) UnmarshalJSON ¶ added in v1.1.0
func (r *VMNewParamsBootVolume) UnmarshalJSON(data []byte) error
type VMNewParamsDataVolume ¶
type VMNewParamsDataVolume struct {
// Name of the volume.
Name string `json:"name,required"`
// Size of the volume in GB.
Size int64 `json:"size,required"`
// contains filtered or unexported fields
}
VM data volume create request.
The properties Name, Size are required.
func (VMNewParamsDataVolume) MarshalJSON ¶
func (r VMNewParamsDataVolume) MarshalJSON() (data []byte, err error)
func (*VMNewParamsDataVolume) UnmarshalJSON ¶ added in v1.1.0
func (r *VMNewParamsDataVolume) UnmarshalJSON(data []byte) 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
Availability VMAvailabilityService
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) Restart ¶ added in v1.13.0
func (r *VMService) Restart(ctx context.Context, vmID string, opts ...option.RequestOption) (res *operations.Operation, err error)
Restart 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 {
// Name of the VM.
Name param.Opt[string] `json:"name,omitzero"`
// Whether to enable public IP for the VM.
PublicIPEnabled param.Opt[bool] `json:"public_ip_enabled,omitzero"`
// CPU configuration for the VM.
CPUConfig CPUConfigParam `json:"cpu_config,omitzero"`
// Memory configuration for the VM.
MemoryConfig MemoryConfigParam `json:"memory_config,omitzero"`
// contains filtered or unexported fields
}
func (VMUpdateParams) MarshalJSON ¶
func (r VMUpdateParams) MarshalJSON() (data []byte, err error)
func (*VMUpdateParams) UnmarshalJSON ¶ added in v1.1.0
func (r *VMUpdateParams) UnmarshalJSON(data []byte) 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.
//
// Any of "boot", "data".
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.
//
// Any of "pending", "creating", "updating", "ready", "deleting", "deleted",
// "error".
Status shared.ResourceStatus `json:"status,required"`
// Storage type the volume is using.
//
// Any of "nvme".
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"`
// Name of the VM the volume is attached to.
VMName string `json:"vm_name,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Kind respjson.Field
Name respjson.Field
Size respjson.Field
Status respjson.Field
Type respjson.Field
UpdatedAt respjson.Field
VMID respjson.Field
VMName respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Volume details.
func (*Volume) UnmarshalJSON ¶
type VolumeAvailabilityNewParams ¶ added in v1.2.0
type VolumeAvailabilityNewParams struct {
// Name of the volume.
Name string `json:"name,required"`
// Size of the volume in GB.
Size int64 `json:"size,required"`
// ID of the VM the volume is attached to.
VMID string `json:"vm_id,required"`
// contains filtered or unexported fields
}
func (VolumeAvailabilityNewParams) MarshalJSON ¶ added in v1.2.0
func (r VolumeAvailabilityNewParams) MarshalJSON() (data []byte, err error)
func (*VolumeAvailabilityNewParams) UnmarshalJSON ¶ added in v1.2.0
func (r *VolumeAvailabilityNewParams) UnmarshalJSON(data []byte) error
type VolumeAvailabilityService ¶ added in v1.2.0
type VolumeAvailabilityService struct {
Options []option.RequestOption
}
VolumeAvailabilityService 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 NewVolumeAvailabilityService method instead.
func NewVolumeAvailabilityService ¶ added in v1.2.0
func NewVolumeAvailabilityService(opts ...option.RequestOption) (r VolumeAvailabilityService)
NewVolumeAvailabilityService 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 (*VolumeAvailabilityService) New ¶ added in v1.2.0
func (r *VolumeAvailabilityService) New(ctx context.Context, body VolumeAvailabilityNewParams, opts ...option.RequestOption) (res *string, err error)
Check Volume Create Availability
func (*VolumeAvailabilityService) Update ¶ added in v1.2.0
func (r *VolumeAvailabilityService) Update(ctx context.Context, volumeID string, body VolumeAvailabilityUpdateParams, opts ...option.RequestOption) (res *string, err error)
Check Volume Update Availability
type VolumeAvailabilityUpdateParams ¶ added in v1.2.0
type VolumeAvailabilityUpdateParams struct {
// Name of the volume.
Name param.Opt[string] `json:"name,omitzero"`
// Size of the volume in GB.
Size param.Opt[int64] `json:"size,omitzero"`
// contains filtered or unexported fields
}
func (VolumeAvailabilityUpdateParams) MarshalJSON ¶ added in v1.2.0
func (r VolumeAvailabilityUpdateParams) MarshalJSON() (data []byte, err error)
func (*VolumeAvailabilityUpdateParams) UnmarshalJSON ¶ added in v1.2.0
func (r *VolumeAvailabilityUpdateParams) UnmarshalJSON(data []byte) error
type VolumeKind ¶
type VolumeKind string
Volume kind.
const ( VolumeKindBoot VolumeKind = "boot" VolumeKindData VolumeKind = "data" )
type VolumeList ¶
type VolumeList struct {
Items []Volume `json:"items,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Items respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (VolumeList) RawJSON ¶ added in v1.1.0
func (r VolumeList) RawJSON() string
Returns the unmodified JSON received from the API
func (*VolumeList) UnmarshalJSON ¶
func (r *VolumeList) UnmarshalJSON(data []byte) error
type VolumeNewParams ¶
type VolumeNewParams struct {
// Name of the volume.
Name string `json:"name,required"`
// Size of the volume in GB.
Size int64 `json:"size,required"`
// ID of the VM the volume is attached to.
VMID string `json:"vm_id,required"`
// contains filtered or unexported fields
}
func (VolumeNewParams) MarshalJSON ¶
func (r VolumeNewParams) MarshalJSON() (data []byte, err error)
func (*VolumeNewParams) UnmarshalJSON ¶ added in v1.1.0
func (r *VolumeNewParams) UnmarshalJSON(data []byte) error
type VolumeService ¶
type VolumeService struct {
Options []option.RequestOption
Availability VolumeAvailabilityService
}
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.Opt[string] `json:"name,omitzero"`
// Size of the volume in GB.
Size param.Opt[int64] `json:"size,omitzero"`
// contains filtered or unexported fields
}
func (VolumeUpdateParams) MarshalJSON ¶
func (r VolumeUpdateParams) MarshalJSON() (data []byte, err error)
func (*VolumeUpdateParams) UnmarshalJSON ¶ added in v1.1.0
func (r *VolumeUpdateParams) UnmarshalJSON(data []byte) error