Documentation
¶
Index ¶
- type AllocateRequest
- type CreateRequest
- type DeallocateRequest
- type DestroyRequest
- type ItemVGPU
- type ListRequest
- type ListVGPU
- type VGPU
- func (v VGPU) Allocate(ctx context.Context, req AllocateRequest) (bool, error)
- func (v VGPU) Create(ctx context.Context, req CreateRequest) (uint64, error)
- func (v VGPU) Deallocate(ctx context.Context, req DeallocateRequest) (bool, error)
- func (v VGPU) Destroy(ctx context.Context, req DestroyRequest) (bool, error)
- func (v VGPU) List(ctx context.Context, req ListRequest) (*ListVGPU, error)
- func (v VGPU) ListRaw(ctx context.Context, req ListRequest) ([]byte, error)
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) 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 (VGPU) Deallocate ¶
Deallocate releases GPU resources