Documentation
¶
Index ¶
- Constants
- type CPUConfig
- type ComputeService
- type CostQuote
- type CostQuoteUpdate
- type CostQuoteUpdateAfter
- type CostQuoteUpdateAfterUsageDimension
- type CostQuoteUpdateBefore
- type CostQuoteUpdateBeforeUsageDimension
- type CostQuoteUpdateDiff
- type CostQuoteUpdateDiffUsageDimension
- type CostQuoteUpdateDiffUsageDimensionAfter
- type CostQuoteUpdateDiffUsageDimensionBefore
- type CostQuoteUsageDimension
- type Error
- type MemoryConfig
- type OSImage
- type Pagination
- type RegionName
- type ResourceStatus
- type SSHKeyRequestParam
- type SourceIPRuleParam
- type SourceIPRuleResponse
- type VM
- type VMAvailabilityNewParams
- type VMAvailabilityNewParamsBootVolume
- type VMAvailabilityNewParamsDataVolume
- type VMAvailabilityService
- type VMAvailabilityUpdateParams
- type VMCostNewParams
- type VMCostNewParamsBootVolume
- type VMCostNewParamsDataVolume
- type VMCostService
- type VMCostUpdateParams
- type VMList
- type VMListParams
- type VMNewParams
- type VMNewParamsBootVolume
- type VMNewParamsDataVolume
- type VMOSImageListParams
- type VMOSImageService
- func (r *VMOSImageService) List(ctx context.Context, query VMOSImageListParams, opts ...option.RequestOption) (res *pagination.Cursor[OSImage], err error)
- func (r *VMOSImageService) ListAutoPaging(ctx context.Context, query VMOSImageListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[OSImage]
- 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, query VMListParams, opts ...option.RequestOption) (res *pagination.Cursor[VM], err error)
- func (r *VMService) ListAutoPaging(ctx context.Context, query VMListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[VM]
- 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 VMVolumeListParams
- type VMVolumeService
- type Volume
- type VolumeAttachParams
- type VolumeAvailabilityNewParams
- type VolumeAvailabilityService
- type VolumeAvailabilityUpdateParams
- type VolumeCostNewParams
- type VolumeCostService
- type VolumeCostUpdateParams
- type VolumeKind
- type VolumeList
- type VolumeListParams
- type VolumeNewParams
- type VolumeService
- func (r *VolumeService) Attach(ctx context.Context, volumeID string, body VolumeAttachParams, ...) (res *operations.Operation, err error)
- func (r *VolumeService) Delete(ctx context.Context, volumeID string, opts ...option.RequestOption) (res *operations.Operation, err error)
- func (r *VolumeService) Detach(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, query VolumeListParams, opts ...option.RequestOption) (res *pagination.Cursor[Volume], err error)
- func (r *VolumeService) ListAutoPaging(ctx context.Context, query VolumeListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Volume]
- 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 VolumeType
- type VolumeUpdateParams
Constants ¶
const RegionNameUsSva2 = shared.RegionNameUsSva2
Equals "us-sva-2"
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" api:"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) UnmarshalJSON ¶
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 CostQuote ¶ added in v1.88.6
Cost quote returned by POST /cost.
This is an alias to an internal type.
type CostQuoteUpdate ¶ added in v1.88.6
type CostQuoteUpdate = shared.CostQuoteUpdate
Cost quote returned by PATCH /:id/cost: the current-state quote, the post-update quote, and the signed diff.
This is an alias to an internal type.
type CostQuoteUpdateAfter ¶ added in v1.88.6
type CostQuoteUpdateAfter = shared.CostQuoteUpdateAfter
Quote for the proposed (post-update) resource state.
This is an alias to an internal type.
type CostQuoteUpdateAfterUsageDimension ¶ added in v1.88.6
type CostQuoteUpdateAfterUsageDimension = shared.CostQuoteUpdateAfterUsageDimension
Priced row for a single usage dimension emitted by a resource.
This is an alias to an internal type.
type CostQuoteUpdateBefore ¶ added in v1.88.6
type CostQuoteUpdateBefore = shared.CostQuoteUpdateBefore
Quote for the proposed (post-update) resource state.
This is an alias to an internal type.
type CostQuoteUpdateBeforeUsageDimension ¶ added in v1.88.6
type CostQuoteUpdateBeforeUsageDimension = shared.CostQuoteUpdateBeforeUsageDimension
Priced row for a single usage dimension emitted by a resource.
This is an alias to an internal type.
type CostQuoteUpdateDiff ¶ added in v1.88.6
type CostQuoteUpdateDiff = shared.CostQuoteUpdateDiff
Per-dimension and total deltas: after minus before.
This is an alias to an internal type.
type CostQuoteUpdateDiffUsageDimension ¶ added in v1.88.6
type CostQuoteUpdateDiffUsageDimension = shared.CostQuoteUpdateDiffUsageDimension
Per-dimension diff entry. Both before and after are always present.
This is an alias to an internal type.
type CostQuoteUpdateDiffUsageDimensionAfter ¶ added in v1.88.6
type CostQuoteUpdateDiffUsageDimensionAfter = shared.CostQuoteUpdateDiffUsageDimensionAfter
Priced row after the update. Always present.
This is an alias to an internal type.
type CostQuoteUpdateDiffUsageDimensionBefore ¶ added in v1.88.6
type CostQuoteUpdateDiffUsageDimensionBefore = shared.CostQuoteUpdateDiffUsageDimensionBefore
Priced row after the update. Always present.
This is an alias to an internal type.
type CostQuoteUsageDimension ¶ added in v1.88.6
type CostQuoteUsageDimension = shared.CostQuoteUsageDimension
Priced row for a single usage dimension emitted by a resource.
This is an alias to an internal type.
type MemoryConfig ¶
type MemoryConfig struct {
// Size of the memory in GB.
Size int64 `json:"size" api:"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) UnmarshalJSON ¶
func (r *MemoryConfig) UnmarshalJSON(data []byte) error
type OSImage ¶
type OSImage struct {
// When the OS Image was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Display name of the OS Image.
DisplayName string `json:"display_name" api:"required"`
// Name of the OS Image.
Name string `json:"name" api:"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 Pagination ¶ added in v1.21.0
type Pagination = shared.Pagination
Pagination response details.
This is an alias to an internal type.
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 SSHKeyRequestParam ¶ added in v1.14.0
type SSHKeyRequestParam struct {
// Public key to and use to access the VM.
PublicKey string `json:"public_key" api:"required"`
// contains filtered or unexported fields
}
Public SSH key configuration for the VM.
The property PublicKey is required.
func (SSHKeyRequestParam) MarshalJSON ¶ added in v1.14.0
func (r SSHKeyRequestParam) MarshalJSON() (data []byte, err error)
func (*SSHKeyRequestParam) UnmarshalJSON ¶ added in v1.14.0
func (r *SSHKeyRequestParam) UnmarshalJSON(data []byte) error
type SourceIPRuleParam ¶ added in v1.35.0
type SourceIPRuleParam = shared.SourceIPRuleParam
IP filter rules.
This is an alias to an internal type.
type SourceIPRuleResponse ¶ added in v1.54.0
type SourceIPRuleResponse = shared.SourceIPRuleResponse
IP filter rules.
This is an alias to an internal type.
type VM ¶
type VM struct {
// Unique identifier for the VM.
ID string `json:"id" api:"required"`
// ID of the boot volume attached to the VM.
BootVolumeID string `json:"boot_volume_id" api:"required"`
// CPU configuration for the VM.
CPUConfig CPUConfig `json:"cpu_config" api:"required"`
// When the VM was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// IDs of the data volumes attached to the VM.
DataVolumeIDs []string `json:"data_volume_ids" api:"required"`
// Memory configuration for the VM.
MemoryConfig MemoryConfig `json:"memory_config" api:"required"`
// Name of the VM.
Name string `json:"name" api:"required"`
// Private IP of the VM.
PrivateIP string `json:"private_ip" api:"required"`
// Project ID the VM belongs to.
ProjectID string `json:"project_id" api:"required"`
// Public IP of the VM.
PublicIP string `json:"public_ip" api:"required"`
// Whether the public IP is enabled for the VM.
PublicIPEnabled bool `json:"public_ip_enabled" api:"required"`
// Region the resource is in.
//
// Any of "us-sva-2".
Region shared.RegionName `json:"region" api:"required"`
// Status of the resource.
//
// Any of "pending", "creating", "updating", "ready", "deleting", "deleted",
// "error".
Status shared.ResourceStatus `json:"status" api:"required"`
// ID of the subnet the VM is in.
SubnetID string `json:"subnet_id" api:"required"`
// Tags to attach to the VM.
Tags []string `json:"tags" api:"required"`
// When the VM was updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// ID of the VPC the VM is in.
VPCID string `json:"vpc_id" api:"required"`
// Name of the VPC the VM is in.
VPCName string `json:"vpc_name" api:"required"`
// Instance type name.
InstanceType string `json:"instance_type" api:"nullable"`
// 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
ProjectID respjson.Field
PublicIP respjson.Field
PublicIPEnabled respjson.Field
Region respjson.Field
Status respjson.Field
SubnetID respjson.Field
Tags respjson.Field
UpdatedAt respjson.Field
VPCID respjson.Field
VPCName respjson.Field
InstanceType 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" api:"required"`
// Instance type name.
InstanceType string `json:"instance_type" api:"required"`
// Name of the VM.
Name string `json:"name" api:"required"`
// Name of the OS Image to use for the VM.
OSImageName string `json:"os_image_name" api:"required"`
// Project ID to create the VM in.
ProjectID string `json:"project_id" api:"required"`
// Whether to enable public IP for the VM.
PublicIPEnabled bool `json:"public_ip_enabled" api:"required"`
// Region the resource is in.
//
// Any of "us-sva-2".
Region shared.RegionName `json:"region,omitzero" api:"required"`
// Public SSH key configuration for the VM.
SSHKey SSHKeyRequestParam `json:"ssh_key,omitzero" api:"required"`
// ID of the subnet to use for the VM.
SubnetID string `json:"subnet_id" api:"required"`
// Data volumes for the VM.
DataVolumes []VMAvailabilityNewParamsDataVolume `json:"data_volumes,omitzero"`
// Tags to attach to the VM.
Tags []string `json:"tags,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" api:"required"`
// Type of the Volume.
//
// Any of "nvme", "abs".
Type VolumeType `json:"type,omitzero" api:"required"`
// Tags to attach to the Volume.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
Boot volume for the VM.
The properties Size, Type are 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" api:"required"`
// Size of the Volume in GB.
Size int64 `json:"size" api:"required"`
// Type of the Volume.
//
// Any of "nvme", "abs".
Type VolumeType `json:"type,omitzero" api:"required"`
// Tags to attach to the Volume.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
VM data volume create request.
The properties Name, Size, Type 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) (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) (err error)
Check VM Update Availability
type VMAvailabilityUpdateParams ¶ added in v1.2.0
type VMAvailabilityUpdateParams struct {
// Instance type name.
InstanceType param.Opt[string] `json:"instance_type,omitzero"`
// 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"`
// Tags to attach to the VM.
Tags []string `json:"tags,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 VMCostNewParams ¶ added in v1.88.6
type VMCostNewParams struct {
// Boot volume for the VM.
BootVolume VMCostNewParamsBootVolume `json:"boot_volume,omitzero" api:"required"`
// Instance type name.
InstanceType string `json:"instance_type" api:"required"`
// Name of the VM.
Name string `json:"name" api:"required"`
// Name of the OS Image to use for the VM.
OSImageName string `json:"os_image_name" api:"required"`
// Project ID to create the VM in.
ProjectID string `json:"project_id" api:"required"`
// Whether to enable public IP for the VM.
PublicIPEnabled bool `json:"public_ip_enabled" api:"required"`
// Region the resource is in.
//
// Any of "us-sva-2".
Region shared.RegionName `json:"region,omitzero" api:"required"`
// Public SSH key configuration for the VM.
SSHKey SSHKeyRequestParam `json:"ssh_key,omitzero" api:"required"`
// ID of the subnet to use for the VM.
SubnetID string `json:"subnet_id" api:"required"`
// Data volumes for the VM.
DataVolumes []VMCostNewParamsDataVolume `json:"data_volumes,omitzero"`
// Tags to attach to the VM.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (VMCostNewParams) MarshalJSON ¶ added in v1.88.6
func (r VMCostNewParams) MarshalJSON() (data []byte, err error)
func (*VMCostNewParams) UnmarshalJSON ¶ added in v1.88.6
func (r *VMCostNewParams) UnmarshalJSON(data []byte) error
type VMCostNewParamsBootVolume ¶ added in v1.88.6
type VMCostNewParamsBootVolume struct {
// Size of the Volume in GB.
Size int64 `json:"size" api:"required"`
// Type of the Volume.
//
// Any of "nvme", "abs".
Type VolumeType `json:"type,omitzero" api:"required"`
// Tags to attach to the Volume.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
Boot volume for the VM.
The properties Size, Type are required.
func (VMCostNewParamsBootVolume) MarshalJSON ¶ added in v1.88.6
func (r VMCostNewParamsBootVolume) MarshalJSON() (data []byte, err error)
func (*VMCostNewParamsBootVolume) UnmarshalJSON ¶ added in v1.88.6
func (r *VMCostNewParamsBootVolume) UnmarshalJSON(data []byte) error
type VMCostNewParamsDataVolume ¶ added in v1.88.6
type VMCostNewParamsDataVolume struct {
// Name of the Volume.
Name string `json:"name" api:"required"`
// Size of the Volume in GB.
Size int64 `json:"size" api:"required"`
// Type of the Volume.
//
// Any of "nvme", "abs".
Type VolumeType `json:"type,omitzero" api:"required"`
// Tags to attach to the Volume.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
VM data volume create request.
The properties Name, Size, Type are required.
func (VMCostNewParamsDataVolume) MarshalJSON ¶ added in v1.88.6
func (r VMCostNewParamsDataVolume) MarshalJSON() (data []byte, err error)
func (*VMCostNewParamsDataVolume) UnmarshalJSON ¶ added in v1.88.6
func (r *VMCostNewParamsDataVolume) UnmarshalJSON(data []byte) error
type VMCostService ¶ added in v1.88.6
type VMCostService struct {
Options []option.RequestOption
}
VMCostService 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 NewVMCostService method instead.
func NewVMCostService ¶ added in v1.88.6
func NewVMCostService(opts ...option.RequestOption) (r VMCostService)
NewVMCostService 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 (*VMCostService) New ¶ added in v1.88.6
func (r *VMCostService) New(ctx context.Context, body VMCostNewParams, opts ...option.RequestOption) (res *shared.CostQuote, err error)
Return a priced cost quote for the proposed VM.
func (*VMCostService) Update ¶ added in v1.88.6
func (r *VMCostService) Update(ctx context.Context, vmID string, body VMCostUpdateParams, opts ...option.RequestOption) (res *shared.CostQuoteUpdate, err error)
Return a priced cost quote for the proposed VM update plus a diff against the current state.
type VMCostUpdateParams ¶ added in v1.88.6
type VMCostUpdateParams struct {
// Instance type name.
InstanceType param.Opt[string] `json:"instance_type,omitzero"`
// 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"`
// Tags to attach to the VM.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (VMCostUpdateParams) MarshalJSON ¶ added in v1.88.6
func (r VMCostUpdateParams) MarshalJSON() (data []byte, err error)
func (*VMCostUpdateParams) UnmarshalJSON ¶ added in v1.88.6
func (r *VMCostUpdateParams) UnmarshalJSON(data []byte) error
type VMList ¶
type VMList struct {
Items []VM `json:"items" api:"required"`
// Pagination response details.
Pagination shared.Pagination `json:"pagination" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Items respjson.Field
Pagination respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*VMList) UnmarshalJSON ¶
type VMListParams ¶ added in v1.21.0
type VMListParams struct {
// Project ID of resources to request
ProjectID string `query:"project_id" api:"required" json:"-"`
// Pagination cursor returned by a previous request
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Maximum number of items to return
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (VMListParams) URLQuery ¶ added in v1.21.0
func (r VMListParams) URLQuery() (v url.Values, err error)
URLQuery serializes VMListParams's query parameters as `url.Values`.
type VMNewParams ¶
type VMNewParams struct {
// Boot volume for the VM.
BootVolume VMNewParamsBootVolume `json:"boot_volume,omitzero" api:"required"`
// Instance type name.
InstanceType string `json:"instance_type" api:"required"`
// Name of the VM.
Name string `json:"name" api:"required"`
// Name of the OS Image to use for the VM.
OSImageName string `json:"os_image_name" api:"required"`
// Project ID to create the VM in.
ProjectID string `json:"project_id" api:"required"`
// Whether to enable public IP for the VM.
PublicIPEnabled bool `json:"public_ip_enabled" api:"required"`
// Region the resource is in.
//
// Any of "us-sva-2".
Region shared.RegionName `json:"region,omitzero" api:"required"`
// Public SSH key configuration for the VM.
SSHKey SSHKeyRequestParam `json:"ssh_key,omitzero" api:"required"`
// ID of the subnet to use for the VM.
SubnetID string `json:"subnet_id" api:"required"`
// Data volumes for the VM.
DataVolumes []VMNewParamsDataVolume `json:"data_volumes,omitzero"`
// Tags to attach to the VM.
Tags []string `json:"tags,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" api:"required"`
// Type of the Volume.
//
// Any of "nvme", "abs".
Type VolumeType `json:"type,omitzero" api:"required"`
// Tags to attach to the Volume.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
Boot volume for the VM.
The properties Size, Type are 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" api:"required"`
// Size of the Volume in GB.
Size int64 `json:"size" api:"required"`
// Type of the Volume.
//
// Any of "nvme", "abs".
Type VolumeType `json:"type,omitzero" api:"required"`
// Tags to attach to the Volume.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
VM data volume create request.
The properties Name, Size, Type 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 VMOSImageListParams ¶ added in v1.22.0
type VMOSImageListParams struct {
// Pagination cursor returned by a previous request
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Maximum number of items to return
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (VMOSImageListParams) URLQuery ¶ added in v1.22.0
func (r VMOSImageListParams) URLQuery() (v url.Values, err error)
URLQuery serializes VMOSImageListParams's query parameters as `url.Values`.
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, query VMOSImageListParams, opts ...option.RequestOption) (res *pagination.Cursor[OSImage], err error)
List all OS Images
func (*VMOSImageService) ListAutoPaging ¶ added in v1.22.0
func (r *VMOSImageService) ListAutoPaging(ctx context.Context, query VMOSImageListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[OSImage]
List all OS Images
type VMService ¶
type VMService struct {
Options []option.RequestOption
Availability VMAvailabilityService
Cost VMCostService
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, query VMListParams, opts ...option.RequestOption) (res *pagination.Cursor[VM], err error)
List all VMs
func (*VMService) ListAutoPaging ¶ added in v1.21.0
func (r *VMService) ListAutoPaging(ctx context.Context, query VMListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[VM]
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 {
// Instance type name.
InstanceType param.Opt[string] `json:"instance_type,omitzero"`
// 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"`
// Tags to attach to the VM.
Tags []string `json:"tags,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 VMVolumeListParams ¶ added in v1.21.0
type VMVolumeListParams struct {
// Pagination cursor returned by a previous request
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Maximum number of items to return
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (VMVolumeListParams) URLQuery ¶ added in v1.21.0
func (r VMVolumeListParams) URLQuery() (v url.Values, err error)
URLQuery serializes VMVolumeListParams's query parameters as `url.Values`.
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, query VMVolumeListParams, opts ...option.RequestOption) (res *pagination.Cursor[Volume], err error)
List VM's Volumes
func (*VMVolumeService) ListAutoPaging ¶ added in v1.21.0
func (r *VMVolumeService) ListAutoPaging(ctx context.Context, vmID string, query VMVolumeListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Volume]
List VM's Volumes
type Volume ¶
type Volume struct {
// Unique identifier for the Volume.
ID string `json:"id" api:"required"`
// When the Volume was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Volume kind.
//
// Any of "boot", "data".
Kind VolumeKind `json:"kind" api:"required"`
// Name of the Volume.
Name string `json:"name" api:"required"`
// Project ID the Volume belongs to.
ProjectID string `json:"project_id" api:"required"`
// Region the resource is in.
//
// Any of "us-sva-2".
Region shared.RegionName `json:"region" api:"required"`
// Size of the Volume in GB.
Size int64 `json:"size" api:"required"`
// Status of the resource.
//
// Any of "pending", "creating", "updating", "ready", "deleting", "deleted",
// "error".
Status shared.ResourceStatus `json:"status" api:"required"`
// Tags to attach to the Volume.
Tags []string `json:"tags" api:"required"`
// Type of the Volume.
//
// Any of "nvme", "abs".
Type VolumeType `json:"type" api:"required"`
// When the Volume was updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// ID of the VM the Volume is attached to.
VMID string `json:"vm_id" api:"required"`
// Name of the VM the Volume is attached to.
VMName string `json:"vm_name" api:"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
ProjectID respjson.Field
Region respjson.Field
Size respjson.Field
Status respjson.Field
Tags 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 VolumeAttachParams ¶ added in v1.29.0
type VolumeAttachParams struct {
// ID of the VM to attach the Volume to.
VMID string `json:"vm_id" api:"required"`
// contains filtered or unexported fields
}
func (VolumeAttachParams) MarshalJSON ¶ added in v1.29.0
func (r VolumeAttachParams) MarshalJSON() (data []byte, err error)
func (*VolumeAttachParams) UnmarshalJSON ¶ added in v1.29.0
func (r *VolumeAttachParams) UnmarshalJSON(data []byte) error
type VolumeAvailabilityNewParams ¶ added in v1.2.0
type VolumeAvailabilityNewParams struct {
// Name of the Volume.
Name string `json:"name" api:"required"`
// Project ID the Volume belongs to.
ProjectID string `json:"project_id" api:"required"`
// Region the resource is in.
//
// Any of "us-sva-2".
Region shared.RegionName `json:"region,omitzero" api:"required"`
// Size of the Volume in GB.
Size int64 `json:"size" api:"required"`
// Type of the Volume.
//
// Any of "nvme", "abs".
Type VolumeType `json:"type,omitzero" api:"required"`
// ID of the VM the Volume is attached to.
VMID param.Opt[string] `json:"vm_id,omitzero"`
// Tags to attach to the Volume.
Tags []string `json:"tags,omitzero"`
// 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) (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) (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"`
// Tags to attach to the Volume.
Tags []string `json:"tags,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 VolumeCostNewParams ¶ added in v1.88.6
type VolumeCostNewParams struct {
// Name of the Volume.
Name string `json:"name" api:"required"`
// Project ID the Volume belongs to.
ProjectID string `json:"project_id" api:"required"`
// Region the resource is in.
//
// Any of "us-sva-2".
Region shared.RegionName `json:"region,omitzero" api:"required"`
// Size of the Volume in GB.
Size int64 `json:"size" api:"required"`
// Type of the Volume.
//
// Any of "nvme", "abs".
Type VolumeType `json:"type,omitzero" api:"required"`
// ID of the VM the Volume is attached to.
VMID param.Opt[string] `json:"vm_id,omitzero"`
// Tags to attach to the Volume.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (VolumeCostNewParams) MarshalJSON ¶ added in v1.88.6
func (r VolumeCostNewParams) MarshalJSON() (data []byte, err error)
func (*VolumeCostNewParams) UnmarshalJSON ¶ added in v1.88.6
func (r *VolumeCostNewParams) UnmarshalJSON(data []byte) error
type VolumeCostService ¶ added in v1.88.6
type VolumeCostService struct {
Options []option.RequestOption
}
VolumeCostService 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 NewVolumeCostService method instead.
func NewVolumeCostService ¶ added in v1.88.6
func NewVolumeCostService(opts ...option.RequestOption) (r VolumeCostService)
NewVolumeCostService 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 (*VolumeCostService) New ¶ added in v1.88.6
func (r *VolumeCostService) New(ctx context.Context, body VolumeCostNewParams, opts ...option.RequestOption) (res *shared.CostQuote, err error)
Return a priced cost quote for the proposed Volume.
func (*VolumeCostService) Update ¶ added in v1.88.6
func (r *VolumeCostService) Update(ctx context.Context, volumeID string, body VolumeCostUpdateParams, opts ...option.RequestOption) (res *shared.CostQuoteUpdate, err error)
Return a priced cost quote for the proposed Volume update plus a diff against the current state.
type VolumeCostUpdateParams ¶ added in v1.88.6
type VolumeCostUpdateParams 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"`
// Tags to attach to the Volume.
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (VolumeCostUpdateParams) MarshalJSON ¶ added in v1.88.6
func (r VolumeCostUpdateParams) MarshalJSON() (data []byte, err error)
func (*VolumeCostUpdateParams) UnmarshalJSON ¶ added in v1.88.6
func (r *VolumeCostUpdateParams) 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" api:"required"`
// Pagination response details.
Pagination shared.Pagination `json:"pagination" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Items respjson.Field
Pagination 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 VolumeListParams ¶ added in v1.21.0
type VolumeListParams struct {
// Project ID of resources to request
ProjectID string `query:"project_id" api:"required" json:"-"`
// Pagination cursor returned by a previous request
Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
// Maximum number of items to return
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (VolumeListParams) URLQuery ¶ added in v1.21.0
func (r VolumeListParams) URLQuery() (v url.Values, err error)
URLQuery serializes VolumeListParams's query parameters as `url.Values`.
type VolumeNewParams ¶
type VolumeNewParams struct {
// Name of the Volume.
Name string `json:"name" api:"required"`
// Project ID the Volume belongs to.
ProjectID string `json:"project_id" api:"required"`
// Region the resource is in.
//
// Any of "us-sva-2".
Region shared.RegionName `json:"region,omitzero" api:"required"`
// Size of the Volume in GB.
Size int64 `json:"size" api:"required"`
// Type of the Volume.
//
// Any of "nvme", "abs".
Type VolumeType `json:"type,omitzero" api:"required"`
// ID of the VM the Volume is attached to.
VMID param.Opt[string] `json:"vm_id,omitzero"`
// Tags to attach to the Volume.
Tags []string `json:"tags,omitzero"`
// 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
Cost VolumeCostService
}
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) Attach ¶ added in v1.29.0
func (r *VolumeService) Attach(ctx context.Context, volumeID string, body VolumeAttachParams, opts ...option.RequestOption) (res *operations.Operation, err error)
Attach a volume to a VM
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) Detach ¶ added in v1.29.0
func (r *VolumeService) Detach(ctx context.Context, volumeID string, opts ...option.RequestOption) (res *operations.Operation, err error)
Detach a volume from a VM
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, query VolumeListParams, opts ...option.RequestOption) (res *pagination.Cursor[Volume], err error)
List all volumes
func (*VolumeService) ListAutoPaging ¶ added in v1.21.0
func (r *VolumeService) ListAutoPaging(ctx context.Context, query VolumeListParams, opts ...option.RequestOption) *pagination.CursorAutoPager[Volume]
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 VolumeType ¶ added in v1.25.1
type VolumeType string
Type of the Volume.
const ( VolumeTypeNvme VolumeType = "nvme" VolumeTypeABS VolumeType = "abs" )
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"`
// Tags to attach to the Volume.
Tags []string `json:"tags,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