vms

package
v0.1.0-alpha.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const OperationKindFirewallRule = shared.OperationKindFirewallRule

This is an alias to an internal value.

View Source
const OperationKindVM = shared.OperationKindVM

This is an alias to an internal value.

View Source
const OperationKindVPC = shared.OperationKindVPC

This is an alias to an internal value.

View Source
const OperationStatusDone = shared.OperationStatusDone

This is an alias to an internal value.

View Source
const OperationStatusFailed = shared.OperationStatusFailed

This is an alias to an internal value.

View Source
const OperationStatusPending = shared.OperationStatusPending

This is an alias to an internal value.

View Source
const OperationStatusRunning = shared.OperationStatusRunning

This is an alias to an internal value.

View Source
const OperationTypeCreate = shared.OperationTypeCreate

This is an alias to an internal value.

View Source
const OperationTypeDelete = shared.OperationTypeDelete

This is an alias to an internal value.

View Source
const OperationTypeUpdate = shared.OperationTypeUpdate

This is an alias to an internal value.

View Source
const RegionNameAmsterdam = shared.RegionNameAmsterdam

This is an alias to an internal value.

View Source
const RegionNameChicago = shared.RegionNameChicago

This is an alias to an internal value.

View Source
const RegionNameFrankfurt = shared.RegionNameFrankfurt

This is an alias to an internal value.

View Source
const RegionNameHongkong = shared.RegionNameHongkong

This is an alias to an internal value.

View Source
const RegionNameLondon = shared.RegionNameLondon

This is an alias to an internal value.

View Source
const RegionNameMumbai = shared.RegionNameMumbai

This is an alias to an internal value.

View Source
const RegionNameSaopaulo = shared.RegionNameSaopaulo

This is an alias to an internal value.

View Source
const RegionNameSeattle = shared.RegionNameSeattle

This is an alias to an internal value.

View Source
const RegionNameSiliconvalley = shared.RegionNameSiliconvalley

This is an alias to an internal value.

View Source
const RegionNameSingapore = shared.RegionNameSingapore

This is an alias to an internal value.

View Source
const RegionNameStockholm = shared.RegionNameStockholm

This is an alias to an internal value.

View Source
const RegionNameSydney = shared.RegionNameSydney

This is an alias to an internal value.

View Source
const RegionNameTokyo = shared.RegionNameTokyo

This is an alias to an internal value.

View Source
const RegionNameWashingtondc = shared.RegionNameWashingtondc

This is an alias to an internal value.

View Source
const ResourceStatusCreating = shared.ResourceStatusCreating

This is an alias to an internal value.

View Source
const ResourceStatusDeleted = shared.ResourceStatusDeleted

This is an alias to an internal value.

View Source
const ResourceStatusDeleting = shared.ResourceStatusDeleting

This is an alias to an internal value.

View Source
const ResourceStatusFailed = shared.ResourceStatusFailed

This is an alias to an internal value.

View Source
const ResourceStatusPending = shared.ResourceStatusPending

This is an alias to an internal value.

View Source
const ResourceStatusReady = shared.ResourceStatusReady

This is an alias to an internal value.

View Source
const ResourceStatusUpdating = shared.ResourceStatusUpdating

This is an alias to an internal value.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPU

type CPU struct {
	Cores int64   `json:"cores,required"`
	JSON  cpuJSON `json:"-"`
}

CPU details.

func (*CPU) UnmarshalJSON

func (r *CPU) UnmarshalJSON(data []byte) (err error)

type CPUParam

type CPUParam struct {
	Cores param.Field[int64] `json:"cores,required"`
}

CPU details.

func (CPUParam) MarshalJSON

func (r CPUParam) MarshalJSON() (data []byte, err error)

type Error

type Error = apierror.Error

type Operation

type Operation = shared.Operation

Operation details.

This is an alias to an internal type.

type OperationKind

type OperationKind = shared.OperationKind

This is an alias to an internal type.

type OperationService

type OperationService struct {
	Options []option.RequestOption
}

OperationService 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 NewOperationService method instead.

func NewOperationService

func NewOperationService(opts ...option.RequestOption) (r *OperationService)

NewOperationService 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 (*OperationService) Get

func (r *OperationService) Get(ctx context.Context, operationID string, opts ...option.RequestOption) (res *shared.Operation, err error)

Get details about a specific VM operation

type OperationStatus

type OperationStatus = shared.OperationStatus

This is an alias to an internal type.

type OperationType

type OperationType = shared.OperationType

This is an alias to an internal type.

type Ram

type Ram struct {
	// RAM size
	Size int64   `json:"size,required"`
	JSON ramJSON `json:"-"`
}

RAM details.

func (*Ram) UnmarshalJSON

func (r *Ram) UnmarshalJSON(data []byte) (err error)

type RamParam

type RamParam struct {
	// RAM size
	Size param.Field[int64] `json:"size,required"`
}

RAM details.

func (RamParam) MarshalJSON

func (r RamParam) MarshalJSON() (data []byte, err error)

type RegionName

type RegionName = shared.RegionName

This is an alias to an internal type.

type ResourceStatus

type ResourceStatus = shared.ResourceStatus

This is an alias to an internal type.

type SSHKeyParam

type SSHKeyParam struct {
	PublicKey param.Field[string] `json:"public_key,required"`
}

SSH key details.

func (SSHKeyParam) MarshalJSON

func (r SSHKeyParam) MarshalJSON() (data []byte, err error)

type VM

type VM struct {
	ID string `json:"id,required"`
	// Volume details.
	BootVolume volumes.Volume `json:"boot_volume,required"`
	// CPU details.
	CPUConfig   CPU              `json:"cpu_config,required"`
	CreatedAt   string           `json:"created_at,required"`
	DataVolumes []volumes.Volume `json:"data_volumes,required"`
	// RAM details.
	MemConfig Ram                   `json:"mem_config,required"`
	Name      string                `json:"name,required"`
	PublicIP  string                `json:"public_ip,required"`
	Region    shared.RegionName     `json:"region,required"`
	Status    shared.ResourceStatus `json:"status,required"`
	UpdatedAt string                `json:"updated_at,required"`
	// VPC details.
	VPC  vpcs.VPC `json:"vpc,required"`
	JSON vmJSON   `json:"-"`
}

VM details.

func (*VM) UnmarshalJSON

func (r *VM) UnmarshalJSON(data []byte) (err error)

type VMListParams

type VMListParams struct {
	// Region
	Region param.Field[string] `query:"region,required"`
}

func (VMListParams) URLQuery

func (r VMListParams) URLQuery() (v url.Values)

URLQuery serializes VMListParams's query parameters as `url.Values`.

type VMListResponse

type VMListResponse struct {
	Items []VM               `json:"items,required"`
	JSON  vmListResponseJSON `json:"-"`
}

func (*VMListResponse) UnmarshalJSON

func (r *VMListResponse) UnmarshalJSON(data []byte) (err error)

type VMNewParams

type VMNewParams struct {
	// Boot volume create request.
	BootVolume param.Field[VMNewParamsBootVolume] `json:"boot_volume,required"`
	// CPU details.
	CPU          param.Field[CPUParam] `json:"cpu,required"`
	Name         param.Field[string]   `json:"name,required"`
	NeedPublicIP param.Field[bool]     `json:"need_public_ip,required"`
	OsImageID    param.Field[int64]    `json:"os_image_id,required"`
	Ports        param.Field[[]string] `json:"ports,required"`
	// RAM details.
	Ram           param.Field[RamParam]          `json:"ram,required"`
	Region        param.Field[shared.RegionName] `json:"region,required"`
	SourceAddress param.Field[string]            `json:"source_address,required"`
	// SSH key details.
	SSHKey      param.Field[SSHKeyParam]             `json:"ssh_key,required"`
	DataVolumes param.Field[[]VMNewParamsDataVolume] `json:"data_volumes"`
	SubnetID    param.Field[string]                  `json:"subnet_id"`
}

func (VMNewParams) MarshalJSON

func (r VMNewParams) MarshalJSON() (data []byte, err error)

type VMNewParamsBootVolume

type VMNewParamsBootVolume struct {
	Size param.Field[int64] `json:"size,required"`
}

Boot volume create request.

func (VMNewParamsBootVolume) MarshalJSON

func (r VMNewParamsBootVolume) MarshalJSON() (data []byte, err error)

type VMNewParamsDataVolume

type VMNewParamsDataVolume struct {
	Size param.Field[int64] `json:"size,required"`
	// Storage type.
	Type param.Field[volumes.StorageType] `json:"type"`
}

Data volume create request.

func (VMNewParamsDataVolume) MarshalJSON

func (r VMNewParamsDataVolume) MarshalJSON() (data []byte, err error)

type VMService

type VMService struct {
	Options    []option.RequestOption
	Operations *OperationService
}

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 *shared.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 *VMListResponse, err error)

List all VMs

func (*VMService) New

func (r *VMService) New(ctx context.Context, body VMNewParams, opts ...option.RequestOption) (res *shared.Operation, err error)

Create a VM

func (*VMService) Update

func (r *VMService) Update(ctx context.Context, vmID string, body VMUpdateParams, opts ...option.RequestOption) (res *shared.Operation, err error)

Update a VM

type VMUpdateParams

type VMUpdateParams struct {
	// Boot volume create request.
	BootVolume param.Field[VMUpdateParamsBootVolume] `json:"boot_volume"`
	// CPU details.
	CPU         param.Field[CPUParam]                   `json:"cpu"`
	DataVolumes param.Field[[]VMUpdateParamsDataVolume] `json:"data_volumes"`
	// RAM details.
	Ram param.Field[RamParam] `json:"ram"`
}

func (VMUpdateParams) MarshalJSON

func (r VMUpdateParams) MarshalJSON() (data []byte, err error)

type VMUpdateParamsBootVolume

type VMUpdateParamsBootVolume struct {
	Size param.Field[int64] `json:"size,required"`
}

Boot volume create request.

func (VMUpdateParamsBootVolume) MarshalJSON

func (r VMUpdateParamsBootVolume) MarshalJSON() (data []byte, err error)

type VMUpdateParamsDataVolume

type VMUpdateParamsDataVolume struct {
	Size param.Field[int64] `json:"size,required"`
	// Storage type.
	Type param.Field[volumes.StorageType] `json:"type"`
}

Data volume create request.

func (VMUpdateParamsDataVolume) MarshalJSON

func (r VMUpdateParamsDataVolume) MarshalJSON() (data []byte, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL