parent
20fd7ab50c
commit
7c787f6fce
@ -1,247 +1,250 @@
|
|||||||
package compute
|
package compute
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
var computes = ListComputes{
|
var computes = ListComputes{
|
||||||
ItemCompute{
|
Data: []ItemCompute{
|
||||||
Disks: []InfoDisk{
|
{
|
||||||
{
|
Disks: []InfoDisk{
|
||||||
ID: 65191,
|
|
||||||
PCISlot: 6,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
InfoCompute: InfoCompute{
|
|
||||||
ACL: []interface{}{},
|
|
||||||
AccountID: 132847,
|
|
||||||
AccountName: "std_2",
|
|
||||||
AffinityLabel: "",
|
|
||||||
AffinityRules: []ItemRule{
|
|
||||||
{
|
{
|
||||||
GUID: "",
|
ID: 65191,
|
||||||
Key: "aff_key",
|
PCISlot: 6,
|
||||||
Mode: "ANY",
|
|
||||||
Policy: "RECOMMENDED",
|
|
||||||
Topology: "compute",
|
|
||||||
Value: "aff_val",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
AffinityWeight: 0,
|
InfoCompute: InfoCompute{
|
||||||
AntiAffinityRules: []ItemRule{
|
ACL: []interface{}{},
|
||||||
{
|
AccountID: 132847,
|
||||||
GUID: "",
|
AccountName: "std_2",
|
||||||
Key: "antiaff_key",
|
AffinityLabel: "",
|
||||||
Mode: "ANY",
|
AffinityRules: []ItemRule{
|
||||||
Policy: "RECOMMENDED",
|
{
|
||||||
Topology: "compute",
|
GUID: "",
|
||||||
Value: "antiaff_val",
|
Key: "aff_key",
|
||||||
|
Mode: "ANY",
|
||||||
|
Policy: "RECOMMENDED",
|
||||||
|
Topology: "compute",
|
||||||
|
Value: "aff_val",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
AffinityWeight: 0,
|
||||||
|
AntiAffinityRules: []ItemRule{
|
||||||
|
{
|
||||||
|
GUID: "",
|
||||||
|
Key: "antiaff_key",
|
||||||
|
Mode: "ANY",
|
||||||
|
Policy: "RECOMMENDED",
|
||||||
|
Topology: "compute",
|
||||||
|
Value: "antiaff_val",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Arch: "X86_64",
|
||||||
|
BootOrder: []string{
|
||||||
|
"hd", "cdrom",
|
||||||
|
},
|
||||||
|
BootDiskSize: 0,
|
||||||
|
CloneReference: 0,
|
||||||
|
Clones: []uint64{},
|
||||||
|
ComputeCIID: 0,
|
||||||
|
CPUs: 4,
|
||||||
|
CreatedBy: "timofey_tkachev_1@decs3o",
|
||||||
|
CreatedTime: 1676975175,
|
||||||
|
CustomFields: map[string]interface{}{},
|
||||||
|
DeletedBy: "",
|
||||||
|
DeletedTime: 0,
|
||||||
|
Description: "",
|
||||||
|
Devices: nil,
|
||||||
|
Driver: "KVM_X86",
|
||||||
|
GID: 212,
|
||||||
|
GUID: 48500,
|
||||||
|
ID: 48500,
|
||||||
|
ImageID: 9884,
|
||||||
|
Interfaces: ListInterfaces{},
|
||||||
|
LockStatus: "UNLOCKED",
|
||||||
|
ManagerID: 0,
|
||||||
|
ManagerType: "",
|
||||||
|
MigrationJob: 0,
|
||||||
|
Milestones: 363500,
|
||||||
|
Name: "test",
|
||||||
|
Pinned: false,
|
||||||
|
RAM: 4096,
|
||||||
|
ReferenceID: "c7cb19ac-af4a-4067-852f-c5572949207e",
|
||||||
|
Registered: true,
|
||||||
|
ResName: "compute-48500",
|
||||||
|
RGID: 79724,
|
||||||
|
RGName: "std_broker2",
|
||||||
|
SnapSets: ListSnapshots{},
|
||||||
|
StatelessSEPID: 0,
|
||||||
|
StatelessSEPType: "",
|
||||||
|
Status: "ENABLED",
|
||||||
|
Tags: map[string]interface{}{},
|
||||||
|
TechStatus: "STOPPED",
|
||||||
|
TotalDiskSize: 2,
|
||||||
|
UpdatedBy: "",
|
||||||
|
UpdatedTime: 1677058904,
|
||||||
|
UserManaged: true,
|
||||||
|
VGPUs: []uint64{},
|
||||||
|
VINSConnected: 0,
|
||||||
|
VirtualImageID: 0,
|
||||||
},
|
},
|
||||||
Arch: "X86_64",
|
|
||||||
BootOrder: []string{
|
|
||||||
"hd", "cdrom",
|
|
||||||
},
|
|
||||||
BootDiskSize: 0,
|
|
||||||
CloneReference: 0,
|
|
||||||
Clones: []uint64{},
|
|
||||||
ComputeCIID: 0,
|
|
||||||
CPUs: 4,
|
|
||||||
CreatedBy: "timofey_tkachev_1@decs3o",
|
|
||||||
CreatedTime: 1676975175,
|
|
||||||
CustomFields: map[string]interface{}{},
|
|
||||||
DeletedBy: "",
|
|
||||||
DeletedTime: 0,
|
|
||||||
Description: "",
|
|
||||||
Devices: nil,
|
|
||||||
Driver: "KVM_X86",
|
|
||||||
GID: 212,
|
|
||||||
GUID: 48500,
|
|
||||||
ID: 48500,
|
|
||||||
ImageID: 9884,
|
|
||||||
Interfaces: ListInterfaces{},
|
|
||||||
LockStatus: "UNLOCKED",
|
|
||||||
ManagerID: 0,
|
|
||||||
ManagerType: "",
|
|
||||||
MigrationJob: 0,
|
|
||||||
Milestones: 363500,
|
|
||||||
Name: "test",
|
|
||||||
Pinned: false,
|
|
||||||
RAM: 4096,
|
|
||||||
ReferenceID: "c7cb19ac-af4a-4067-852f-c5572949207e",
|
|
||||||
Registered: true,
|
|
||||||
ResName: "compute-48500",
|
|
||||||
RGID: 79724,
|
|
||||||
RGName: "std_broker2",
|
|
||||||
SnapSets: ListSnapshots{},
|
|
||||||
StatelessSEPID: 0,
|
|
||||||
StatelessSEPType: "",
|
|
||||||
Status: "ENABLED",
|
|
||||||
Tags: map[string]interface{}{},
|
|
||||||
TechStatus: "STOPPED",
|
|
||||||
TotalDiskSize: 2,
|
|
||||||
UpdatedBy: "",
|
|
||||||
UpdatedTime: 1677058904,
|
|
||||||
UserManaged: true,
|
|
||||||
VGPUs: []uint64{},
|
|
||||||
VINSConnected: 0,
|
|
||||||
VirtualImageID: 0,
|
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
ItemCompute{
|
Disks: []InfoDisk{
|
||||||
Disks: []InfoDisk{
|
{
|
||||||
{
|
ID: 65248,
|
||||||
ID: 65248,
|
PCISlot: 6,
|
||||||
PCISlot: 6,
|
},
|
||||||
},
|
},
|
||||||
},
|
InfoCompute: InfoCompute{
|
||||||
InfoCompute: InfoCompute{
|
ACL: []interface{}{},
|
||||||
ACL: []interface{}{},
|
AccountID: 132848,
|
||||||
AccountID: 132848,
|
AccountName: "std_broker",
|
||||||
AccountName: "std_broker",
|
AffinityLabel: "",
|
||||||
AffinityLabel: "",
|
AffinityRules: []ItemRule{},
|
||||||
AffinityRules: []ItemRule{},
|
AffinityWeight: 0,
|
||||||
AffinityWeight: 0,
|
AntiAffinityRules: []ItemRule{},
|
||||||
AntiAffinityRules: []ItemRule{},
|
Arch: "X86_64",
|
||||||
Arch: "X86_64",
|
BootOrder: []string{
|
||||||
BootOrder: []string{
|
"hd", "cdrom",
|
||||||
"hd", "cdrom",
|
},
|
||||||
|
BootDiskSize: 0,
|
||||||
|
CloneReference: 0,
|
||||||
|
Clones: []uint64{},
|
||||||
|
ComputeCIID: 0,
|
||||||
|
CPUs: 6,
|
||||||
|
CreatedBy: "timofey_tkachev_1@decs3o",
|
||||||
|
CreatedTime: 1677579436,
|
||||||
|
CustomFields: map[string]interface{}{},
|
||||||
|
DeletedBy: "",
|
||||||
|
DeletedTime: 0,
|
||||||
|
Description: "",
|
||||||
|
Devices: nil,
|
||||||
|
Driver: "KVM_X86",
|
||||||
|
GID: 212,
|
||||||
|
GUID: 48556,
|
||||||
|
ID: 48556,
|
||||||
|
ImageID: 9884,
|
||||||
|
Interfaces: ListInterfaces{},
|
||||||
|
LockStatus: "UNLOCKED",
|
||||||
|
ManagerID: 0,
|
||||||
|
ManagerType: "",
|
||||||
|
MigrationJob: 0,
|
||||||
|
Milestones: 363853,
|
||||||
|
Name: "compute_2",
|
||||||
|
Pinned: false,
|
||||||
|
RAM: 4096,
|
||||||
|
ReferenceID: "a542c449-5b1c-4f90-88c5-7bb5f8ae68ff",
|
||||||
|
Registered: true,
|
||||||
|
ResName: "compute-48556",
|
||||||
|
RGID: 79727,
|
||||||
|
RGName: "sdk_negative_fields_test",
|
||||||
|
SnapSets: ListSnapshots{},
|
||||||
|
StatelessSEPID: 0,
|
||||||
|
StatelessSEPType: "",
|
||||||
|
Status: "ENABLED",
|
||||||
|
Tags: map[string]interface{}{},
|
||||||
|
TechStatus: "STARTED",
|
||||||
|
TotalDiskSize: 1,
|
||||||
|
UpdatedBy: "",
|
||||||
|
UpdatedTime: 1677579436,
|
||||||
|
UserManaged: true,
|
||||||
|
VGPUs: []uint64{},
|
||||||
|
VINSConnected: 0,
|
||||||
|
VirtualImageID: 0,
|
||||||
},
|
},
|
||||||
BootDiskSize: 0,
|
|
||||||
CloneReference: 0,
|
|
||||||
Clones: []uint64{},
|
|
||||||
ComputeCIID: 0,
|
|
||||||
CPUs: 6,
|
|
||||||
CreatedBy: "timofey_tkachev_1@decs3o",
|
|
||||||
CreatedTime: 1677579436,
|
|
||||||
CustomFields: map[string]interface{}{},
|
|
||||||
DeletedBy: "",
|
|
||||||
DeletedTime: 0,
|
|
||||||
Description: "",
|
|
||||||
Devices: nil,
|
|
||||||
Driver: "KVM_X86",
|
|
||||||
GID: 212,
|
|
||||||
GUID: 48556,
|
|
||||||
ID: 48556,
|
|
||||||
ImageID: 9884,
|
|
||||||
Interfaces: ListInterfaces{},
|
|
||||||
LockStatus: "UNLOCKED",
|
|
||||||
ManagerID: 0,
|
|
||||||
ManagerType: "",
|
|
||||||
MigrationJob: 0,
|
|
||||||
Milestones: 363853,
|
|
||||||
Name: "compute_2",
|
|
||||||
Pinned: false,
|
|
||||||
RAM: 4096,
|
|
||||||
ReferenceID: "a542c449-5b1c-4f90-88c5-7bb5f8ae68ff",
|
|
||||||
Registered: true,
|
|
||||||
ResName: "compute-48556",
|
|
||||||
RGID: 79727,
|
|
||||||
RGName: "sdk_negative_fields_test",
|
|
||||||
SnapSets: ListSnapshots{},
|
|
||||||
StatelessSEPID: 0,
|
|
||||||
StatelessSEPType: "",
|
|
||||||
Status: "ENABLED",
|
|
||||||
Tags: map[string]interface{}{},
|
|
||||||
TechStatus: "STARTED",
|
|
||||||
TotalDiskSize: 1,
|
|
||||||
UpdatedBy: "",
|
|
||||||
UpdatedTime: 1677579436,
|
|
||||||
UserManaged: true,
|
|
||||||
VGPUs: []uint64{},
|
|
||||||
VINSConnected: 0,
|
|
||||||
VirtualImageID: 0,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
EntryCount: 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFilterByID(t *testing.T) {
|
func TestFilterByID(t *testing.T) {
|
||||||
actual := computes.FilterByID(48500).FindOne()
|
actual := computes.FilterByID(48500).FindOne()
|
||||||
|
|
||||||
if actual.ID != 48500 {
|
if actual.ID != 48500 {
|
||||||
t.Fatal("expected ID 48500, found: ", actual.ID)
|
t.Fatal("expected ID 48500, found: ", actual.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
actualEmpty := computes.FilterByID(0)
|
actualEmpty := computes.FilterByID(0)
|
||||||
|
|
||||||
if len(actualEmpty) != 0 {
|
if len(actualEmpty.Data) != 0 {
|
||||||
t.Fatal("expected empty, actual: ", len(actualEmpty))
|
t.Fatal("expected empty, actual: ", len(actualEmpty.Data))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFilterByName(t *testing.T) {
|
func TestFilterByName(t *testing.T) {
|
||||||
actual := computes.FilterByName("compute_2").FindOne()
|
actual := computes.FilterByName("compute_2").FindOne()
|
||||||
|
|
||||||
if actual.Name != "compute_2" {
|
if actual.Name != "compute_2" {
|
||||||
t.Fatal("expected compute with name 'test', found: ", actual.Name)
|
t.Fatal("expected compute with name 'test', found: ", actual.Name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFilterByStatus(t *testing.T) {
|
func TestFilterByStatus(t *testing.T) {
|
||||||
actual := computes.FilterByStatus("ENABLED")
|
actual := computes.FilterByStatus("ENABLED")
|
||||||
|
|
||||||
for _, item := range actual {
|
for _, item := range actual.Data {
|
||||||
if item.Status != "ENABLED" {
|
if item.Status != "ENABLED" {
|
||||||
t.Fatal("expected ENABLED status, found: ", item.Status)
|
t.Fatal("expected ENABLED status, found: ", item.Status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFilterByTechStatus(t *testing.T) {
|
func TestFilterByTechStatus(t *testing.T) {
|
||||||
actual := computes.FilterByTechStatus("STARTED").FindOne()
|
actual := computes.FilterByTechStatus("STARTED").FindOne()
|
||||||
|
|
||||||
if actual.ID != 48556 {
|
if actual.ID != 48556 {
|
||||||
t.Fatal("expected 48556 with STARTED techStatus, found: ", actual.ID)
|
t.Fatal("expected 48556 with STARTED techStatus, found: ", actual.ID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFilterByDiskID(t *testing.T) {
|
func TestFilterByDiskID(t *testing.T) {
|
||||||
actual := computes.FilterByDiskID(65248).FindOne()
|
actual := computes.FilterByDiskID(65248).FindOne()
|
||||||
|
|
||||||
if actual.ID != 48556 {
|
if actual.ID != 48556 {
|
||||||
t.Fatal("expected 48556 with DiskID 65248, found: ", actual.ID)
|
t.Fatal("expected 48556 with DiskID 65248, found: ", actual.ID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFilterFunc(t *testing.T) {
|
func TestFilterFunc(t *testing.T) {
|
||||||
actual := computes.FilterFunc(func(ic ItemCompute) bool {
|
actual := computes.FilterFunc(func(ic ItemCompute) bool {
|
||||||
return ic.Registered == true
|
return ic.Registered == true
|
||||||
})
|
})
|
||||||
|
|
||||||
if len(actual) != 2 {
|
if len(actual.Data) != 2 {
|
||||||
t.Fatal("expected 2 elements found, actual: ", len(actual))
|
t.Fatal("expected 2 elements found, actual: ", len(actual.Data))
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, item := range actual {
|
for _, item := range actual.Data {
|
||||||
if item.Registered != true {
|
if item.Registered != true {
|
||||||
t.Fatal("expected Registered to be true, actual: ", item.Registered)
|
t.Fatal("expected Registered to be true, actual: ", item.Registered)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSortingByCreatedTime(t *testing.T) {
|
func TestSortingByCreatedTime(t *testing.T) {
|
||||||
actual := computes.SortByCreatedTime(false)
|
actual := computes.SortByCreatedTime(false)
|
||||||
|
|
||||||
if actual[0].Name != "test" {
|
if actual.Data[0].Name != "test" {
|
||||||
t.Fatal("expected 'test', found: ", actual[0].Name)
|
t.Fatal("expected 'test', found: ", actual.Data[0].Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
actual = computes.SortByCreatedTime(true)
|
actual = computes.SortByCreatedTime(true)
|
||||||
if actual[0].Name != "compute_2" {
|
if actual.Data[0].Name != "compute_2" {
|
||||||
t.Fatal("expected 'compute_2', found: ", actual[0].Name)
|
t.Fatal("expected 'compute_2', found: ", actual.Data[0].Name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSortingByCPU(t *testing.T) {
|
func TestSortingByCPU(t *testing.T) {
|
||||||
actual := computes.SortByCPU(false)
|
actual := computes.SortByCPU(false)
|
||||||
|
|
||||||
if actual[0].CPUs != 4{
|
if actual.Data[0].CPUs != 4 {
|
||||||
t.Fatal("expected 4 CPU cores, found: ", actual[0].CPUs)
|
t.Fatal("expected 4 CPU cores, found: ", actual.Data[0].CPUs)
|
||||||
}
|
}
|
||||||
|
|
||||||
actual = computes.SortByCPU(true)
|
actual = computes.SortByCPU(true)
|
||||||
|
|
||||||
if actual[0].CPUs != 6 {
|
if actual.Data[0].CPUs != 6 {
|
||||||
t.Fatal("expected 6 CPU cores, found: ", actual[0].CPUs)
|
t.Fatal("expected 6 CPU cores, found: ", actual.Data[0].CPUs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,66 @@
|
|||||||
|
package compute
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Request struct for get list GPU for compute
|
||||||
|
type ListVGPURequest struct {
|
||||||
|
// ID of compute instance
|
||||||
|
// Required: true
|
||||||
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
|
// Find by GPU id
|
||||||
|
// Required: false
|
||||||
|
GPUID uint64 `url:"gpuId,omitempty" json:"gpuId,omitempty"`
|
||||||
|
|
||||||
|
// Find by type
|
||||||
|
// Required: false
|
||||||
|
Type string `url:"type,omitempty" json:"type,omitempty"`
|
||||||
|
|
||||||
|
// Find by status
|
||||||
|
// Required: false
|
||||||
|
Status string `url:"status,omitempty" json:"status,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"`
|
||||||
|
|
||||||
|
// Include deleted computes. If using field 'status', then includedeleted will be ignored
|
||||||
|
// Required: false
|
||||||
|
IncludeDeleted bool `url:"includedeleted,omitempty" json:"includedeleted,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListVGPU gets list GPU for compute
|
||||||
|
func (c Compute) ListVGPU(ctx context.Context, req ListVGPURequest) (*ListVGPUs, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
for _, validationError := range validators.GetErrors(err) {
|
||||||
|
return nil, validators.ValidationError(validationError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/compute/listVGpu"
|
||||||
|
|
||||||
|
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
list := ListVGPUs{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &list)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &list, nil
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package grid
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GetResourceConsumptionRequest struct {
|
||||||
|
// ID of the grid
|
||||||
|
// Required: true
|
||||||
|
GridID uint64 `url:"gridId" json:"gridId" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (g Grid) GetResourceConsumption(ctx context.Context, req GetResourceConsumptionRequest) (*RecordResourcesConsumption, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
for _, validationError := range validators.GetErrors(err) {
|
||||||
|
return nil, validators.ValidationError(validationError)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/grid/getResourceConsumption"
|
||||||
|
|
||||||
|
res, err := g.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
result := RecordResourcesConsumption{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &result)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &result, nil
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package grid
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (g Grid) ListResourceConsumption(ctx context.Context) (*ListResourceConsumption, error) {
|
||||||
|
url := "/cloudbroker/grid/listResourceConsumption"
|
||||||
|
|
||||||
|
res, err := g.client.DecortApiCall(ctx, http.MethodPost, url, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
result := ListResourceConsumption{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &result)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &result, nil
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue