converged

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTaskNotComplete     = errors.New("task not yet complete")
	ErrTaskResultsNotReady = errors.New("task results not ready")
	ErrTaskFailed          = errors.New("task failed")
)

Custom errors for different states Prism Central asynchronous task.

View Source
var (
	ErrNotFound        = errors.New("resource not found")
	ErrRateLimit       = errors.New("rate limit exceeded")
	ErrInternal        = errors.New("internal error")
	ErrUnauthenticated = errors.New("unauthenticated") // HTTP 401: missing/invalid credentials
	ErrUnauthorized    = errors.New("unauthorized")    // HTTP 403: authenticated but not allowed
)

Functions

func IsInternal added in v0.6.4

func IsInternal(err error) bool

IsInternal returns true if the error is or wraps an ErrInternal.

func IsNotFound added in v0.6.4

func IsNotFound(err error) bool

IsNotFound returns true if the error is or wraps an ErrNotFound.

func IsRateLimit added in v0.6.4

func IsRateLimit(err error) bool

IsRateLimit returns true if the error is or wraps an ErrRateLimit.

func IsUnauthenticated added in v0.8.2

func IsUnauthenticated(err error) bool

IsUnauthenticated returns true if the error is or wraps an ErrUnauthenticated (HTTP 401 — missing or invalid credentials).

func IsUnauthorized added in v0.8.2

func IsUnauthorized(err error) bool

IsUnauthorized returns true if the error is or wraps an ErrUnauthorized (HTTP 403 — authenticated but not permitted).

Types

type APIError added in v0.6.4

type APIError struct {
	Kind    error
	Cause   error
	Message string
}

APIError wraps SDK errors with a classified Kind. Kind is one of the sentinel errors above, or nil for unclassified errors. Cause is the original error (e.g. GenericOpenAPIError from the SDK).

func (*APIError) Error added in v0.6.4

func (e *APIError) Error() string

func (*APIError) Is added in v0.6.4

func (e *APIError) Is(target error) bool

func (*APIError) Unwrap added in v0.6.4

func (e *APIError) Unwrap() error

type Alerts added in v0.8.0

type Alerts[Alert any] interface {
	// Getter is the interface for Get operations.
	Getter[Alert]

	// Lister is the interface for List operations.
	Lister[Alert]
}

Alerts defines the interface for managing alerts.

type AntiAffinityPolicies

type AntiAffinityPolicies[AntiAffinityPolicy any] interface {
	// Getter is the interface for Get operations.
	Getter[AntiAffinityPolicy]

	// Lister is the interface for List operations.
	Lister[AntiAffinityPolicy]

	// Creator is the interface for Create operations.
	Creator[AntiAffinityPolicy]

	// Updater is the interface for Update operations.
	Updater[AntiAffinityPolicy]

	// Deleter is the interface for Delete operations.
	Deleter[AntiAffinityPolicy]

	// AsyncCreator is the interface for Async Create operations.
	AsyncCreator[AntiAffinityPolicy]

	// AsyncUpdater is the interface for Async Update operations.
	AsyncUpdater[AntiAffinityPolicy]

	// AsyncDeleter is the interface for Async Delete operations.
	AsyncDeleter[AntiAffinityPolicy]
}

type AsyncCreator

type AsyncCreator[T any] interface {
	// Create creates a new entity.
	CreateAsync(ctx context.Context, entity *T) (Operation[T], error)
}

AsyncCreator is the interface for Async Create operations.

type AsyncDeleter

type AsyncDeleter[T any] interface {
	// Delete deletes an existing entity.
	DeleteAsync(ctx context.Context, uuid string) (Operation[NoEntity], error)
}

AsyncDeleter is the interface for Async Delete operations.

type AsyncUpdater

type AsyncUpdater[T any] interface {
	// Update updates an existing entity.
	UpdateAsync(ctx context.Context, uuid string, entity *T) (Operation[T], error)
}

AsyncUpdater is the interface for Async Update operations.

type AuthorizationPolicies added in v0.8.0

type AuthorizationPolicies[AuthorizationPolicy, AuthorizationPolicyProjection any] interface {
	// Getter is the interface for Get operations.
	Getter[AuthorizationPolicy]

	// Lister is the interface for List operations.
	Lister[AuthorizationPolicyProjection]

	// Creator is the interface for Create operations.
	Creator[AuthorizationPolicy]

	// Deleter is the interface for Delete operations.
	Deleter[AuthorizationPolicy]
}

AuthorizationPolicies defines the interface for IAM Authorization Policies API operations.

type Categories

type Categories[Category any] interface {
	// Getter is the interface for Get operations.
	Getter[Category]

	// Lister is the interface for List operations.
	Lister[Category]

	// Creator is the interface for Create operations.
	Creator[Category]

	// Updater is the interface for Update operations.
	Updater[Category]

	// Deleter is the interface for Delete operations.
	Deleter[Category]
}

type Client

type Client[
	AntiAffinityPolicy,
	Cluster,
	VirtualGpuProfile,
	PhysicalGpuProfile,
	AHVVirtualGpuProfile,
	AHVPhysicalGpuProfile,
	Host,
	Category,
	Image,
	ImageFile,
	StorageContainer,
	Subnet,
	SubnetTaskReference,
	VM,
	NIC,
	VMDisk,
	Task,
	AppMessage,
	VolumeGroup,
	VmAttachment,
	VMProfile,
	DeployParams,
	DomainManagerEntity,
	User,
	Role,
	RoleMembership,
	RoleMembershipProjection,
	AuthorizationPolicy,
	AuthorizationPolicyProjection,
	Operation,
	Template,
	TemplateDeployParams,
	Ova,
	OvaFile,
	ProtectionPolicy,
	RecoveryPlan,
	Project,
	ResourceGroup,
	Disk,
	Alert any] struct {
	AntiAffinityPolicies  AntiAffinityPolicies[AntiAffinityPolicy]
	Clusters              Clusters[Cluster, VirtualGpuProfile, PhysicalGpuProfile, AHVVirtualGpuProfile, AHVPhysicalGpuProfile, Host]
	Categories            Categories[Category]
	Images                Images[Image, ImageFile]
	StorageContainers     StorageContainers[StorageContainer]
	Subnets               Subnets[Subnet, SubnetTaskReference]
	VMs                   VMs[VM, NIC, VMDisk]
	Tasks                 Tasks[Task, AppMessage]
	VolumeGroups          VolumeGroups[VolumeGroup, VmAttachment]
	VMProfiles            VMProfiles[VMProfile, VM, DeployParams]
	DomainManager         DomainManager[DomainManagerEntity]
	Users                 Users[User]
	Roles                 Roles[Role]
	RoleMemberships       RoleMemberships[RoleMembership, RoleMembershipProjection]
	AuthorizationPolicies AuthorizationPolicies[AuthorizationPolicy, AuthorizationPolicyProjection]
	Operations            Operations[Operation]
	Templates             Templates[Template, VM, TemplateDeployParams]
	Ovas                  Ovas[Ova, OvaFile]
	DataPolicies          DataPolicies[ProtectionPolicy, RecoveryPlan]
	Projects              Projects[Project]
	ResourceGroups        ResourceGroups[ResourceGroup]
	Disks                 Disks[Disk]
	Alerts                Alerts[Alert]
}

Client is the main struct for the converged client.

type Clusters

type Clusters[
	Cluster,
	VirtualGpuProfile,
	PhysicalGpuProfile,
	AHVVirtualGpuProfile,
	AHVPhysicalGpuProfile,
	Host any] interface {
	// Getter is the interface for Get operations.
	Getter[Cluster]

	// Lister is the interface for List operations.
	Lister[Cluster]

	// ListClusterVirtualGPUs returns the virtual GPU configuration for the given cluster UUID.
	ListClusterVirtualGPUs(ctx context.Context, clusterUuid string, opts ...ODataOption) ([]VirtualGpuProfile, error)

	// ListClusterPhysicalGPUs returns the physical GPU configuration for the given cluster UUID.
	ListClusterPhysicalGPUs(ctx context.Context, clusterUuid string, opts ...ODataOption) ([]PhysicalGpuProfile, error)

	// ListAHVVirtualGPUProfiles returns AHV virtual GPU profile templates for the given cluster.
	// This calls the AHV global endpoint which returns profile templates with configuration name.
	ListAHVVirtualGPUProfiles(ctx context.Context, clusterUuid string, opts ...ODataOption) ([]AHVVirtualGpuProfile, error)

	// ListAHVPhysicalGPUProfiles returns AHV physical GPU profile templates for the given cluster.
	// This calls the AHV global endpoint which returns profile templates with configuration name.
	ListAHVPhysicalGPUProfiles(ctx context.Context, clusterUuid string, opts ...ODataOption) ([]AHVPhysicalGpuProfile, error)

	// GetClusterHost returns the host for the given cluster UUID and host id.
	GetClusterHost(ctx context.Context, clusterUuid string, hostId string) (*Host, error)

	// ListClusterHosts returns the hosts for the given cluster UUID.
	ListClusterHosts(ctx context.Context, clusterUuid string, opts ...ODataOption) ([]Host, error)

	// NewClusterHostsIterator returns an iterator for listing cluster hosts.
	NewClusterHostsIterator(ctx context.Context, clusterUuid string, opts ...ODataOption) Iterator[Host]

	// ListAllHosts returns all hosts.
	ListAllHosts(ctx context.Context, opts ...ODataOption) ([]Host, error)

	// NewAllHostsIterator returns an iterator for listing all hosts.
	NewAllHostsIterator(ctx context.Context, opts ...ODataOption) Iterator[Host]
}

type Creator

type Creator[T any] interface {
	// Create creates a new entity.
	Create(ctx context.Context, entity *T) (*T, error)
}

Creator is the interface for Create operations.

type DataPolicies added in v0.7.2

type DataPolicies[ProtectionPolicy, RecoveryPlan any] struct {
	ProtectionPolicies ProtectionPolicies[ProtectionPolicy]
	RecoveryPlans      RecoveryPlans[RecoveryPlan]
}

DataPolicies groups the datapolicies namespace services (v4.2 API): protection policies and recovery plans.

type Deleter

type Deleter[T any] interface {
	// Delete deletes an existing entity.
	Delete(ctx context.Context, uuid string) error
}

Deleter is the interface for Delete operations.

type Disks added in v0.8.0

type Disks[Disk any] interface {
	// Getter is the interface for Get operations.
	Getter[Disk]

	// Lister is the interface for List operations.
	Lister[Disk]

	// Deleter is the interface for blocking Delete operations.
	Deleter[Disk]

	// AsyncDeleter is the interface for async Delete operations.
	AsyncDeleter[Disk]
}

Disks defines the interface for managing disks.

type DomainManager added in v0.6.2

type DomainManager[DomainManagerEntity any] interface {
	// Getter is the interface for Get operations.
	Getter[DomainManagerEntity]

	// Lister is the interface for List operations.
	Lister[DomainManagerEntity]

	// GetPrismCentralVersion gets the Prism Central version from Domain Manager API.
	// This is a lightweight alternative to V3 GetPrismCentral() API.
	GetPrismCentralVersion(ctx context.Context) (string, error)
}

DomainManager defines the interface for Domain Manager operations.

type Getter

type Getter[T any] interface {
	// Get returns the entity for the given UUID.
	Get(ctx context.Context, uuid string) (*T, error)
}

Getter is the interface for Get operations.

type Images

type Images[Image, FileDetail any] interface {
	// Getter is the interface for Get operations.
	Getter[Image]

	// Lister is the interface for List operations.
	Lister[Image]

	// Creator is the interface for Create operations.
	Creator[Image]

	// Deleter is the interface for Delete operations.
	Deleter[Image]

	// GetFile downloads the image file for the given UUID.
	GetFile(ctx context.Context, uuid string) (*FileDetail, error)

	// Upload uploads the image file to the given UUID. Optional UploadOptions
	// configure the upload — see WithUploadProjectUUID and WithExtraHeaders.
	// Calling Upload with no options preserves the pre-options behaviour exactly.
	Upload(ctx context.Context, uuid, filepath string, opts ...UploadOption) error
}

Images defines the interface for Prism Central images.

type Iterator

type Iterator[T any] iter.Seq2[T, error]

ListIterator is the interface for the list iterator.

type Lister

type Lister[T any] interface {
	// List returns a list of entities.
	// If no page and limit are provided, the API will return all entities.
	List(ctx context.Context, opts ...ODataOption) ([]T, error)

	// NewIterator returns an iterator for listing entities.
	NewIterator(ctx context.Context, opts ...ODataOption) Iterator[T]
}

Lister is the interface for List operations.

type NoEntity

type NoEntity any

NoEntity is a placeholder for cases where no entity is returned (e.g. delete operations).

func NoEntityGetter

func NoEntityGetter(ctx context.Context, uuid string) (*NoEntity, error)

NoEntityGetter is a placeholder for cases where no entity is returned (e.g. delete operations).

type ODataOption

type ODataOption func(params ODataOptions) error

ODataOption is a functional option for the ODataOptions.

func WithApply

func WithApply(apply string) ODataOption

WithApply is a functional option for the ODataOptions.

func WithExpand

func WithExpand(expand string) ODataOption

WithExpand is a functional option for the ODataOptions.

func WithFilter

func WithFilter(filter string) ODataOption

WithFilter is a functional option for the ODataOptions.

func WithLimit

func WithLimit(limit int) ODataOption

WithLimit is a functional option for the ODataOptions.

func WithOrderBy

func WithOrderBy(orderBy string) ODataOption

WithOrderBy is a functional option for the ODataOptions.

func WithPage

func WithPage(page int) ODataOption

WithPage is a functional option for the ODataOptions.

func WithSelect

func WithSelect(selectFields string) ODataOption

WithSelect is a functional option for the ODataOptions.

type ODataOptions

type ODataOptions interface {
	SetPageOption(page int) error
	SetLimitOption(limit int) error
	SetFilterOption(filter string) error
	SetOrderByOption(orderBy string) error
	SetExpandOption(expand string) error
	SetSelectOption(selectFields string) error
	SetApplyOption(apply string) error
}

ODataOptions is the interface for the ODataOptions.

type Operation

type Operation[T any] interface {
	// Blocking wait for task completion
	Wait(ctx context.Context) ([]*T, error)

	// Non-blocking results
	Results() ([]*T, error)                // Returns results if complete, error if not ready
	GetAffectedEntityRefs() ([]any, error) // Returns the affected entity references

	// Non-blocking task states
	IsDone() bool
	IsSuccess() bool
	IsFailed() bool

	// Metadata
	UUID() string
	Status() TaskStatus
	Errors() []error
}

Operation is the interface for the Prism Central asynchronous task.

type Operations added in v0.8.0

type Operations[Operation any] interface {
	// Getter is the interface for Get operations.
	Getter[Operation]

	// Lister is the interface for List operations.
	Lister[Operation]
}

Operations defines the interface for IAM Operation API.

type Ovas added in v0.6.3

type Ovas[Ova, FileDetail any] interface {
	// Getter is the interface for Get operations.
	Getter[Ova]

	// Lister is the interface for List operations.
	Lister[Ova]

	// Creator is the interface for Create operations.
	Creator[Ova]

	// GetFile downloads the OVA file for the given UUID.
	GetFile(ctx context.Context, uuid string) (*FileDetail, error)
}

Ovas defines the interface for Prism Central OVAs.

type PrismElementInfo added in v0.8.2

type PrismElementInfo struct {
	ExtId string
	Name  string
}

PrismElementInfo represents basic information about a Prism Element (cluster).

type Projects added in v0.8.2

type Projects[Project any] interface {
	// Getter is the interface for Get operations.
	Getter[Project]

	// Lister is the interface for List operations.
	Lister[Project]

	// Get default project.
	GetDefaultProject(ctx context.Context) (*Project, error)

	// GetByName resolves a project by name.
	GetByName(ctx context.Context, name string) (*Project, error)
}

type ProtectionPolicies added in v0.7.2

type ProtectionPolicies[ProtectionPolicy any] interface {
	Getter[ProtectionPolicy]
	Lister[ProtectionPolicy]
	Creator[ProtectionPolicy]
	Updater[ProtectionPolicy]
	Deleter[ProtectionPolicy]
	AsyncCreator[ProtectionPolicy]
	AsyncUpdater[ProtectionPolicy]
	AsyncDeleter[ProtectionPolicy]
}

ProtectionPolicies defines the interface for Data Policies Protection Policies API operations.

type RecoveryPlans added in v0.7.2

type RecoveryPlans[RecoveryPlan any] interface {
	Getter[RecoveryPlan]
	Lister[RecoveryPlan]
	Creator[RecoveryPlan]
	Updater[RecoveryPlan]
	Deleter[RecoveryPlan]
	AsyncCreator[RecoveryPlan]
	AsyncUpdater[RecoveryPlan]
	AsyncDeleter[RecoveryPlan]
}

RecoveryPlans defines the interface for Data Policies Recovery Plans API operations.

type ResourceGroups added in v0.8.2

type ResourceGroups[ResourceGroup any] interface {
	// Getter is the interface for Get operations.
	Getter[ResourceGroup]

	// Lister is the interface for List operations.
	Lister[ResourceGroup]

	// ListPrismElements fetches a ResourceGroup and extracts PE info from its placement targets.
	ListPrismElements(ctx context.Context, resourceGroupUUID string) ([]PrismElementInfo, error)

	// ListStorageContainers fetches a ResourceGroup and extracts storage container info from its placement targets.
	ListStorageContainers(ctx context.Context, resourceGroupUUID string) ([]StorageContainerInfo, error)
}

ResourceGroups is the interface for Resource Groups operations.

type RoleMemberships added in v0.8.2

type RoleMemberships[RoleMembership, RoleMembershipProjection any] interface {
	// Getter is the interface for Get operations.
	Getter[RoleMembership]

	// Lister is the interface for List operations.
	Lister[RoleMembershipProjection]

	// Creator is the interface for Create operations.
	Creator[RoleMembership]

	// Deleter is the interface for Delete operations.
	Deleter[RoleMembership]
}

RoleMemberships defines the interface for IAM Role Membership API operations.

type Roles added in v0.8.0

type Roles[Role any] interface {
	// Getter is the interface for Get operations.
	Getter[Role]

	// Lister is the interface for List operations.
	Lister[Role]

	// Creator is the interface for Create operations.
	Creator[Role]

	// Deleter is the interface for Delete operations.
	Deleter[Role]
}

Roles defines the interface for IAM Roles API operations.

type StorageContainerInfo added in v0.8.2

type StorageContainerInfo struct {
	ExtId        string
	Name         string
	PrismElement PrismElementInfo
}

StorageContainerInfo represents basic information about a storage container and its associated PE.

type StorageContainers

type StorageContainers[StorageContainer any] interface {
	// Getter is the interface for Get operations.
	Getter[StorageContainer]

	// Lister is the interface for List operations.
	Lister[StorageContainer]
}

StorageContainers defines the interface for managing storage containers.

type Subnets

type Subnets[Subnet, TaskReference any] interface {
	// Getter is the interface for Get operations.
	Getter[Subnet]

	// Lister is the interface for List operations.
	Lister[Subnet]

	// ReserveIpsBySubnetId reserves IP addresses on a subnet.
	// Returns a TaskReference that can be used to track the async operation.
	// spec should be of type *subnetModels.IpReserveSpec (for v4 implementation).
	ReserveIpsBySubnetId(ctx context.Context, subnetExtId string, spec any) (*TaskReference, error)

	// UnreserveIpsBySubnetId unreserves IP addresses on a subnet.
	// Returns a TaskReference that can be used to track the async operation.
	// spec should be of type *subnetModels.IpUnreserveSpec (for v4 implementation).
	UnreserveIpsBySubnetId(ctx context.Context, subnetExtId string, spec any) (*TaskReference, error)

	// ListReservedIpsBySubnetId fetches a list of reserved IP addresses on a subnet.
	ListReservedIpsBySubnetId(ctx context.Context, subnetExtId string, opts ...ODataOption) (any, error)
}

type TaskStatus

type TaskStatus string

TaskStatus is the type for the task status.

const (
	TaskStatusFailed    TaskStatus = "FAILED"
	TaskStatusQueued    TaskStatus = "QUEUED"
	TaskStatusRunning   TaskStatus = "RUNNING"
	TaskStatusSuspended TaskStatus = "SUSPENDED"
	TaskStatusSucceeded TaskStatus = "SUCCEEDED"
	TaskStatusCanceled  TaskStatus = "CANCELED"
	TaskStatusCanceling TaskStatus = "CANCELLING"
	TaskStatusUnknown   TaskStatus = "UNKNOWN"
	TaskStatusRedacted  TaskStatus = "REDACTED"
)

type Tasks

type Tasks[Task, AppMessage any] interface {
	// Getter is the interface for Get operations.
	Getter[Task]

	// Get task with the given UUID and select fields.
	GetWithSelect(ctx context.Context, uuid string, fields []string) (*Task, error)

	// Lister is the interface for List operations.
	Lister[Task]

	// Cancel task with the given UUID.
	Cancel(ctx context.Context, uuid string) (*AppMessage, error)
}

type Templates added in v0.6.3

type Templates[Template, VM, TemplateDeployParams any] interface {
	// Getter is the interface for Get operations.
	Getter[Template]

	// Lister is the interface for List operations.
	Lister[Template]

	// Creator is the interface for Create operations.
	Creator[Template]

	// DeployVmWithTemplate deploys VMs from a template version.
	DeployVmWithTemplate(ctx context.Context, templateUUID string, params *TemplateDeployParams) (Operation[VM], error)
}

Templates defines the interface for Prism Central templates.

type Updater

type Updater[T any] interface {
	// Update updates an existing entity.
	Update(ctx context.Context, uuid string, entity *T) (*T, error)
}

Updater is the interface for Update operations.

type UploadOption added in v0.8.2

type UploadOption func(*UploadOptions)

UploadOption mutates UploadOptions.

func WithExtraHeaders added in v0.8.2

func WithExtraHeaders(h http.Header) UploadOption

WithExtraHeaders adds HTTP headers to every request the Objects Lite S3 client makes during an Upload. This is intended for deployments where Prism Central sits behind a service-token gateway (e.g. Cloudflare Access) that requires extra credential headers on every request, including the S3 PutObject — which the AWS SDK would otherwise not carry.

Headers are applied by an http.RoundTripper wrapper after the AWS SDK signs the request, so they do not invalidate the AWS V4 signature. If a header is set both here and by the AWS SDK, the value supplied here wins.

If called multiple times, values are merged; duplicate keys accumulate across calls. Calling WithExtraHeaders with a nil or empty map is a no-op.

func WithUploadProjectUUID added in v0.8.2

func WithUploadProjectUUID(projectUUID string) UploadOption

WithUploadProjectUUID scopes image upload to the given Prism Central project UUID.

type UploadOptions added in v0.8.2

type UploadOptions struct {
	ProjectUUID string

	// ExtraHeaders are merged onto every HTTP request the Objects Lite
	// upload client makes. Nil or empty means no extra headers.
	ExtraHeaders http.Header
}

UploadOptions contains optional configuration for image upload.

func NewUploadOptions added in v0.8.2

func NewUploadOptions(opts ...UploadOption) UploadOptions

NewUploadOptions materializes upload options from functional options.

type Users added in v0.6.2

type Users[User any] interface {
	// Getter is the interface for Get operations.
	Getter[User]

	// Lister is the interface for List operations.
	Lister[User]

	// Creator is the interface for Create operations.
	Creator[User]

	// UpdateUserState is the interface for updating user state operations.
	UpdateUserState(ctx context.Context, uuid string, status *authn.UserStateUpdate) (*authn.UserStateUpdateResponse, error)

	// ListUserKeys is the interface for listing user keys operations.
	ListUserKeys(ctx context.Context, userExtId string, opts ...ODataOption) ([]authn.Key, error)

	// CreateUserKey is the interface for creating user keys operations.
	CreateUserKey(ctx context.Context, userExtId string, key *authn.Key) (*authn.Key, error)

	// GetUserKeyById is the interface for getting user keys operations.
	GetUserKeyById(ctx context.Context, userExtId string, keyID string) (*authn.Key, error)

	// DeleteUserKeyById is the interface for deleting user keys operations.
	DeleteUserKeyById(ctx context.Context, userExtId string, keyID string) error

	// RevokeUserKey is the interface for revoking user keys operations.
	RevokeUserKey(ctx context.Context, userExtId string, keyID string) error
}

Users defines the interface for IAM Users API operations.

type VMConsoleToken added in v0.7.1

type VMConsoleToken struct {
	Token string
	WsUri string
}

VMConsoleToken holds the VNC console access credentials returned by GenerateConsoleToken. Token is a JWT used for authentication and WsUri is the relative WebSocket path to connect to the VM's VNC console.

type VMProfiles added in v0.8.2

type VMProfiles[VMProfile, VM, DeployParams any] interface {
	// Getter is the interface for Get operations.
	Getter[VMProfile]

	// Lister is the interface for List operations.
	Lister[VMProfile]

	// DeployVmWithVmProfile deploys a VM from a VM Profile.
	DeployVmWithVmProfile(ctx context.Context, vmProfileUUID string, params *DeployParams) (Operation[VM], error)
}

type VMs

type VMs[VM, NIC, VMDisk any] interface {
	// Getter is the interface for Get operations.
	Getter[VM]

	// Lister is the interface for List operations.
	Lister[VM]

	// Creator is the interface for Create operations.
	Creator[VM]

	// Updater is the interface for Update operations.
	Updater[VM]

	// Deleter is the interface for Delete operations.
	Deleter[VM]

	// AsyncCreator is the interface for Async Create operations.
	AsyncCreator[VM]

	// AsyncUpdater is the interface for Async Update operations.
	AsyncUpdater[VM]

	// AsyncDeleter is the interface for Async Delete operations.
	AsyncDeleter[VM]

	// PowerOnVM powers on the VM with the given UUID.
	PowerOnVM(ctx context.Context, uuid string) (Operation[VM], error)

	// PowerOffVM powers off the VM with the given UUID.
	PowerOffVM(ctx context.Context, uuid string) (Operation[VM], error)

	// AddVmCustomAttributes adds custom attributes to the VM with the given UUID.
	AddVmCustomAttributes(ctx context.Context, uuid string, customAttributes []string) (*VM, error)

	// AddVmCustomAttributesAsync adds custom attributes to the VM asynchronously.
	AddVmCustomAttributesAsync(ctx context.Context, uuid string, customAttributes []string) (Operation[VM], error)

	// RemoveVmCustomAttributes removes custom attributes from the VM with the given UUID.
	RemoveVmCustomAttributes(ctx context.Context, uuid string, customAttributes []string) (*VM, error)

	// RemoveVmCustomAttributesAsync removes custom attributes from the VM asynchronously.
	RemoveVmCustomAttributesAsync(ctx context.Context, uuid string, customAttributes []string) (Operation[VM], error)

	// DeleteCdRom deletes a CD-ROM device from the VM identified by uuid
	// and waits for the asynchronous task to complete.
	DeleteCdRom(ctx context.Context, uuid string, cdRomUUID string) error

	// DeleteCdRomAsync starts an asynchronous CD-ROM deletion on the VM.
	DeleteCdRomAsync(ctx context.Context, uuid string, cdRomUUID string) (Operation[NoEntity], error)

	// GenerateConsoleToken obtains a JWT token and WebSocket URI for VNC
	// console access to the VM identified by uuid.
	GenerateConsoleToken(ctx context.Context, uuid string) (*VMConsoleToken, error)

	// GenerateConsoleTokenAsync starts the generate-console-token API call
	// asynchronously and returns an Operation to track the task.
	GenerateConsoleTokenAsync(ctx context.Context, uuid string) (Operation[NoEntity], error)

	// GetVMByBiosUUID returns the VM matching the given BIOS UUID. When multiple VMs
	// share the same BIOS UUID (e.g. due to cloning), it resolves the chain by returning
	// the leaf VM that is not referenced as a source by any other VM.
	GetVMByBiosUUID(ctx context.Context, biosUUID string) (*VM, error)

	// ListNicsByVmId lists the NICs attached to the VM with the given UUID.
	ListNicsByVmId(ctx context.Context, vmUUID string) ([]NIC, error)

	// AddDisk adds a disk to the VM and returns an async operation for the task.
	AddDisk(ctx context.Context, vmUUID string, disk *VMDisk) (Operation[NoEntity], error)

	// GrowDisk updates an existing VM disk and returns an async operation for the task.
	GrowDisk(ctx context.Context, vmUUID string, diskUUID string, disk *VMDisk) (Operation[NoEntity], error)

	// DeleteDisk deletes a disk from the VM and returns an async operation for the task.
	DeleteDisk(ctx context.Context, vmUUID string, diskUUID string) (Operation[NoEntity], error)

	// AddNIC adds a NIC to the VM and returns an async operation for the task.
	AddNIC(ctx context.Context, vmUUID string, nic *NIC) (Operation[NoEntity], error)

	// DeleteNIC deletes a NIC from the VM and returns an async operation for the task.
	DeleteNIC(ctx context.Context, vmUUID string, nicUUID string) (Operation[NoEntity], error)
}

VMs is the interface for the VMs service.

type VolumeGroups

type VolumeGroups[VolumeGroup, VmAttachment any] interface {
	// Getter is the interface for Get operations.
	Getter[VolumeGroup]

	// Lister is the interface for List operations.
	Lister[VolumeGroup]

	// AttachToVMAsync attaches a volume group to a VM asynchronously.
	AttachToVMAsync(ctx context.Context, volumeGroupUUID string, vmAttachment VmAttachment) (Operation[VolumeGroup], error)

	// AttachToVM attaches a volume group to a VM.
	AttachToVM(ctx context.Context, volumeGroupUUID string, vmAttachment VmAttachment) (*VolumeGroup, error)

	// DetachFromVMAsync detaches a volume group from a VM asynchronously.
	DetachFromVMAsync(ctx context.Context, volumeGroupUUID string, vmAttachment VmAttachment) (Operation[VolumeGroup], error)

	// DetachFromVM detaches a volume group from a VM.
	DetachFromVM(ctx context.Context, volumeGroupUUID string, vmAttachment VmAttachment) (*VolumeGroup, error)
}

Volumes is the interface for the Volumes service.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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