Documentation
¶
Index ¶
- type CreateRequest
- type DeleteRequest
- type DisableRequest
- type EnableRequest
- type ItemPCIDevice
- type ListPCIDevices
- type ListRequest
- type PCIDevice
- func (p PCIDevice) Create(ctx context.Context, req CreateRequest) (uint64, error)
- func (p PCIDevice) Delete(ctx context.Context, req DeleteRequest) (bool, error)
- func (p PCIDevice) Disable(ctx context.Context, req DisableRequest) (bool, error)
- func (p PCIDevice) Enable(ctx context.Context, req EnableRequest) (bool, error)
- func (p PCIDevice) List(ctx context.Context, req ListRequest) (*ListPCIDevices, error)
- func (p PCIDevice) 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 CreateRequest ¶
type CreateRequest struct { // StackID // Required: true StackID uint64 `url:"stackId" json:"stackId" validate:"required"` // Resource group ID // Required: true RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // Name of device // Required: true Name string `url:"name" json:"name" validate:"required"` // PCI address of the device // Must be in format 0000:1f:2b.0 // Required: true HWPath string `url:"hwPath" json:"hwPath" validate:"required,hwPath"` // Description, just for information // Required: false Description string `url:"description,omitempty" json:"description,omitempty"` }
CreateRequest struct to creating PCI device
type DeleteRequest ¶
type DeleteRequest struct { // PCI device ID // Required: true DeviceID uint64 `url:"deviceId" json:"deviceId" validate:"required"` // Force delete // Required: false Force bool `url:"force,omitempty" json:"force,omitempty"` }
DeleteRequest struct to deleting PCI device
type DisableRequest ¶
type DisableRequest struct { // PCI device ID // Required: true DeviceID uint64 `url:"deviceId" json:"deviceId" validate:"required"` // Force delete // Required: false Force bool `url:"force,omitempty" json:"force,omitempty"` }
DisableRequest struct for disabling PCI device
type EnableRequest ¶
type EnableRequest struct { // PCI device ID // Required: true DeviceID uint64 `url:"deviceId" json:"deviceId" validate:"required"` }
EnableRequest struct for enabling PCI device
type ItemPCIDevice ¶
type ItemPCIDevice struct { // CKey CKey string `json:"_ckey"` // Meta Meta []interface{} `json:"_meta"` // Compute ID ComputeID uint64 `json:"computeId"` // Description Description string `json:"description"` // GUID GUID uint64 `json:"guid"` // HwPath HwPath string `json:"hwPath"` // ID ID uint64 `json:"id"` // Name Name string `json:"name"` // Resource group ID RGID uint64 `json:"rgId"` // Stack ID StackID uint64 `json:"stackId"` // Status Status string `json:"status"` // System name SystemName string `json:"systemName"` }
Main information about PCI device
func (ItemPCIDevice) Serialize ¶
func (i ItemPCIDevice) 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 ListPCIDevices ¶
type ListPCIDevices struct { // Data Data []ItemPCIDevice `json:"data"` // Entry count EntryCount uint64 `json:"entryCount"` }
List PCI devices
func (ListPCIDevices) IDs ¶ added in v1.6.8
func (lpd ListPCIDevices) IDs() []uint64
IDs gets array of PCIDeviceIDs from ListPCIDevices struct
func (ListPCIDevices) Serialize ¶
func (l ListPCIDevices) 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 ¶ added in v1.5.0
type ListRequest struct { // Find by id // Required: false ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"` // Find by computeId // Required: false ComputeID uint64 `url:"computeId,omitempty" json:"computeId,omitempty"` // Find by name // Required: false Name string `url:"name,omitempty" json:"name,omitempty"` // Find by rgId // Required: false RGID uint64 `url:"rgId,omitempty" json:"rgId,omitempty"` // Find by status // Required: false Status string `url:"status,omitempty" json:"status,omitempty"` // Sort by one of supported fields, format +|-(field) // Required: false SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"` // 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 pci devices
type PCIDevice ¶
type PCIDevice struct {
// contains filtered or unexported fields
}
Structure for creating request to PCI device
func (PCIDevice) List ¶
func (p PCIDevice) List(ctx context.Context, req ListRequest) (*ListPCIDevices, error)
List gets list of all pci devices as a ListPCIDevices struct