vgpu

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllocateRequest

type AllocateRequest struct {
	// Virtual GPU ID
	// Required: true
	VGPUID uint64 `url:"vgpuId" json:"vgpuId" validate:"required"`
}

AllocateRequest struct for allocating VGPU

type CreateRequest

type CreateRequest struct {
	// ID of pGPU
	// Required: true
	PGPUID uint64 `url:"pgpuId" json:"pgpuId" validate:"required"`

	// ID of the target resource group.
	// Required: true
	RGID uint64 `url:"rgId" json:"rgId" validate:"required"`

	// Virtual profile id
	// Required: false
	ProfileID uint64 `url:"profileId,omitempty" json:"profileId,omitempty"`

	// Allocate vgpu after creation
	// Required: false
	Allocate bool `url:"allocate,omitempty" json:"allocate,omitempty"`
}

CreateRequest struct for creating VGPU

type DeallocateRequest

type DeallocateRequest struct {
	// Virtual GPU ID
	// Required: true
	VGPUID uint64 `url:"vgpuId" json:"vgpuId" validate:"required"`

	// Force delete (detach from compute)
	// Required: false
	Force bool `url:"force,omitempty" json:"force,omitempty"`
}

DeallocateRequest struct for deallocating VGPU

type DestroyRequest

type DestroyRequest struct {
	// Virtual GPU ID
	// Required: true
	VGPUID uint64 `url:"vgpuId" json:"vgpuId" validate:"required"`

	// Force delete (deallocate and detach from compute)
	// Required: false
	Force bool `url:"force,omitempty" json:"force,omitempty"`
}

DestroyRequest struct for destroying VGPU

type ItemVGPU

type ItemVGPU struct {
	// CKey
	CKey string `json:"_ckey"`

	// Meta
	Meta []interface{} `json:"_meta"`

	// Account ID
	AccountID uint64 `json:"accountId"`

	// Created time
	CreatedTime uint64 `json:"createdTime"`

	// Deleted time
	DeletedTime uint64 `json:"deletedTime"`

	//Grid ID
	GID uint64 `json:"gid"`

	// GUID
	GUID uint64 `json:"guid"`

	// VGPU ID
	ID uint64 `json:"id"`

	// Last claimed by
	LastClaimedBy uint64 `json:"lastClaimedBy"`

	// Last update time
	LastUpdateTime uint64 `json:"lastUpdateTime"`

	// Mode
	Mode string `json:"mode"`

	// PCI Slot
	PCISlot interface{} `json:"pciSlot"`

	// PGPUID
	PGPUID uint64 `json:"pgpuid"`

	// Profile ID
	ProfileID interface{} `json:"profileId"`

	// RAM
	RAM uint64 `json:"ram"`

	// Reference ID
	ReferenceID interface{} `json:"referenceId"`

	// RGID
	RGID uint64 `json:"rgId"`

	// Status
	Status string `json:"status"`

	// Type
	Type string `json:"type"`

	// VMID
	VMID uint64 `json:"vmid"`
}

func (ItemVGPU) Serialize

func (i ItemVGPU) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

type ListRequest

type ListRequest struct {
	// Find by id
	// Required: false
	ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`

	// Find by vgpu status
	// Required: false
	Status string `url:"status,omitempty" json:"status,omitempty"`

	// Find by vgpu type
	// Required: false
	Type string `url:"type,omitempty" json:"type,omitempty"`

	// Find by vgpu mode
	// Required: false
	Mode string `url:"mode,omitempty" json:"mode,omitempty"`

	// Find by id resgroup
	// Required: false
	RGID uint64 `url:"rgId,omitempty" json:"rgId,omitempty"`

	// Find by account id
	// Required: false
	AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`

	// Find by compute id
	// Required: false
	ComputeID uint64 `url:"computeId,omitempty" json:"computeId,omitempty"`

	// Find by pgpu id
	// Required: false
	PGPUID uint64 `url:"pgpuId,omitempty" json:"pgpuId,omitempty"`

	// Page number
	// Required: false
	Page uint64 `url:"page,omitempty" json:"page,omitempty"`

	// Page size
	// Required: false
	Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}

ListRequest struct to get list of VGPU

type ListVGPU

type ListVGPU struct {
	// Data
	Data []ItemVGPU `json:"data"`

	// Entry count
	EntryCount uint64 `json:"entryCount"`
}

List of VGPU

func (ListVGPU) IDs added in v1.6.8

func (lvg ListVGPU) IDs() []uint64

IDs gets array of VGPUIDs from ListVGPU struct

func (ListVGPU) Serialize

func (l ListVGPU) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

type VGPU

type VGPU struct {
	// contains filtered or unexported fields
}

Structure for creating request to VGPU

func New

func New(client interfaces.Caller) *VGPU

Builder for VGPU endpoints

func (VGPU) Allocate

func (v VGPU) Allocate(ctx context.Context, req AllocateRequest) (bool, error)

Allocate allocates GPU

func (VGPU) Create

func (v VGPU) Create(ctx context.Context, req CreateRequest) (uint64, error)

Create creates VGPU

func (VGPU) Deallocate

func (v VGPU) Deallocate(ctx context.Context, req DeallocateRequest) (bool, error)

Deallocate releases GPU resources

func (VGPU) Destroy

func (v VGPU) Destroy(ctx context.Context, req DestroyRequest) (bool, error)

Destroy destroys VGPU

func (VGPU) List

func (v VGPU) List(ctx context.Context, req ListRequest) (*ListVGPU, error)

List gets list of all VGPU as a ListVGPU struct

func (VGPU) ListRaw added in v1.6.6

func (v VGPU) ListRaw(ctx context.Context, req ListRequest) ([]byte, error)

ListRaw gets list of all VGPU as an array of bytes

Jump to

Keyboard shortcuts

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