v1.5.0-delta
This commit is contained in:
@@ -8,6 +8,38 @@ import (
|
||||
|
||||
// Request struct for getting list of VGPU
|
||||
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"`
|
||||
@@ -18,7 +50,7 @@ type ListRequest struct {
|
||||
}
|
||||
|
||||
// List gets list all VGPU
|
||||
func (v VGPU) List(ctx context.Context, req ListRequest) (ListVGPU, error) {
|
||||
func (v VGPU) List(ctx context.Context, req ListRequest) (*ListVGPU, error) {
|
||||
url := "/cloudbroker/vgpu/list"
|
||||
|
||||
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
@@ -33,5 +65,5 @@ func (v VGPU) List(ctx context.Context, req ListRequest) (ListVGPU, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return list, nil
|
||||
return &list, nil
|
||||
}
|
||||
|
||||
@@ -63,4 +63,10 @@ type ItemVGPU struct {
|
||||
}
|
||||
|
||||
// List of VGPU
|
||||
type ListVGPU []ItemVGPU
|
||||
type ListVGPU struct {
|
||||
// Data
|
||||
Data []ItemVGPU `json:"data"`
|
||||
|
||||
// Entry count
|
||||
EntryCount uint64 `json:"entryCount"`
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package vgpu
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/serialization"
|
||||
)
|
||||
|
||||
@@ -11,7 +12,7 @@ import (
|
||||
// - First argument -> prefix
|
||||
// - Second argument -> indent
|
||||
func (l ListVGPU) Serialize(params ...string) (serialization.Serialized, error) {
|
||||
if len(l) == 0 {
|
||||
if len(l.Data) == 0 {
|
||||
return []byte{}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user