v15.2.0
v15.2.0
This commit is contained in:
@@ -3,9 +3,8 @@ package account
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// SetCPUAllocationParameterRequest struct for setting CPU allocation parameter
|
||||
|
||||
@@ -16,7 +16,7 @@ type SetCPUAllocationRatioRequest struct {
|
||||
|
||||
// CPU allocation ratio, i.e. one pCPU = ratio*vCPU
|
||||
// Required: true
|
||||
Ratio float64 `url:"ratio" json:"ratio" validate:"required"`
|
||||
Ratio uint64 `url:"ratio" json:"ratio" validate:"required"`
|
||||
}
|
||||
|
||||
// SetCPUAllocationRatio sets CPU allocation ratio
|
||||
|
||||
@@ -3,9 +3,8 @@ package disks
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// DepresentRequest struct to depresent disk from node
|
||||
|
||||
@@ -3,9 +3,8 @@ package disks
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// PresentRequest struct to present disk to node
|
||||
|
||||
@@ -3,9 +3,8 @@ package grid
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// SetCPUAllocationParameterRequest for setting CPU allocation parameter
|
||||
|
||||
@@ -3,9 +3,8 @@ package grid
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// SetCPUAllocationRatioForVMRequest for setting CPU allocation ratio for computes
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/constants"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
||||
)
|
||||
|
||||
@@ -102,6 +103,6 @@ func (i Image) ListRaw(ctx context.Context, req ListRequest) ([]byte, error) {
|
||||
|
||||
url := "/cloudbroker/image/list"
|
||||
|
||||
res, err := i.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
res, err := i.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
||||
return res, err
|
||||
}
|
||||
|
||||
@@ -161,8 +161,11 @@ type CpuInfo struct {
|
||||
// Flags
|
||||
Flags []string `json:"flags"`
|
||||
|
||||
// Mddel name
|
||||
// Model name
|
||||
ModelName string `json:"model_name"`
|
||||
|
||||
// Max supported generation
|
||||
MaxSupportedGeneration string `json:"max_supported_generation"`
|
||||
}
|
||||
|
||||
// Main information about node
|
||||
|
||||
@@ -3,9 +3,8 @@ package pcidevice
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// DeleteRequest struct to deleting PCI device
|
||||
|
||||
@@ -3,9 +3,8 @@ package pcidevice
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// DisableRequest struct for disabling PCI device
|
||||
|
||||
@@ -3,9 +3,8 @@ package pcidevice
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// EnableRequest struct for enabling PCI device
|
||||
|
||||
@@ -2,7 +2,6 @@ package pcidevice
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/serialization"
|
||||
)
|
||||
|
||||
|
||||
@@ -3,9 +3,8 @@ package rg
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// SetCPUAllocationParameterRequest struct for setting CPU allocation parameter
|
||||
|
||||
@@ -3,9 +3,8 @@ package rg
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// SetCPUAllocationRatioRequest struct for setting CPU allocation ratio
|
||||
|
||||
@@ -11,12 +11,12 @@ import (
|
||||
// ConsumptionRequest struct to get consumption info
|
||||
type ConsumptionRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
|
||||
// Required: false
|
||||
SEPID uint64 `url:"sep_id,omitempty" json:"sep_id,omitempty"`
|
||||
}
|
||||
|
||||
// Consumption gets SEP consumption info
|
||||
func (s SEP) Consumption(ctx context.Context, req ConsumptionRequest) (*RecordConsumption, error) {
|
||||
func (s SEP) Consumption(ctx context.Context, req ConsumptionRequest) (*ListConsumption, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
@@ -29,7 +29,7 @@ func (s SEP) Consumption(ctx context.Context, req ConsumptionRequest) (*RecordCo
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := RecordConsumption{}
|
||||
info := ListConsumption{}
|
||||
|
||||
err = json.Unmarshal(res, &info)
|
||||
if err != nil {
|
||||
|
||||
@@ -47,8 +47,22 @@ type ByPool struct {
|
||||
UsageLimit uint64 `json:"usage_limit"`
|
||||
}
|
||||
|
||||
// List of Resource groups
|
||||
type ListConsumption struct {
|
||||
// Data
|
||||
Data []RecordConsumption `json:"data"`
|
||||
|
||||
// Enrtry count
|
||||
EntryCount uint64 `json:"entryCount"`
|
||||
}
|
||||
|
||||
// Main information about consumption
|
||||
type RecordConsumption struct {
|
||||
// ID
|
||||
ID uint64 `json:"id"`
|
||||
|
||||
// Name
|
||||
Name string `json:"name"`
|
||||
// By pool
|
||||
ByPool map[string]ByPool `json:"byPool"`
|
||||
|
||||
@@ -57,6 +71,9 @@ type RecordConsumption struct {
|
||||
|
||||
// Type
|
||||
Type string `json:"type"`
|
||||
|
||||
// Consumed by
|
||||
ConsumedBy []uint64 `json:"consumedBy"`
|
||||
}
|
||||
|
||||
// Main information about URI
|
||||
|
||||
@@ -3,9 +3,8 @@ package vgpu
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// AllocateRequest struct for allocating VGPU
|
||||
|
||||
@@ -3,9 +3,8 @@ package vgpu
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// CreateRequest struct for creating VGPU
|
||||
|
||||
@@ -3,9 +3,8 @@ package vgpu
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// DeallocateRequest struct for deallocating VGPU
|
||||
|
||||
@@ -3,9 +3,8 @@ package vgpu
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// DestroyRequest struct for destroying VGPU
|
||||
|
||||
Reference in New Issue
Block a user