Compare commits

..

2 Commits

Author SHA1 Message Date
cf8dae6f4b git test 2026-06-19 17:42:24 +03:00
3fe358fd9e git test 2026-06-19 17:40:28 +03:00
42 changed files with 152 additions and 629 deletions

View File

@@ -1,64 +1,41 @@
## Version 15.3.0
## Version 15.2.0
Методы `Audits` в cloudapi/compute, cloudbroker/compute, cloudapi/account, cloudbroker/account, cloudapi/vins, cloudbroker/vins, cloudapi/rg и cloudbroker/rg стали deprecated и будут удалены в версии 16.0, вместо них необходимо использовать метод `List` в cloudapi/audit и cloudbroker/audit с соответствующими фильтрами
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и будут удалены в версии 16.0
Методы `ComputeCISet`, `ComputeCIUnset`, `GetAudits` в cloudbroker/compute и `GetAudits` в cloudapi/compute стали deprecated и будут удалены в версии 16.0
Методы `ComputeCISet`, `ComputeCIUnset` в cloudbroker/image стали deprecated и будут удалены в версии 16.0
Методы `Delete`, `Disable`, `Enable`, `GetConsumedCloudUnitsByType`, `GetReservedAccountUnits` в cloudapi/account стали deprecated и будут удалены в версии 16.0
Методы `Disable`, `Enable` в cloudbroker/account стали deprecated и будут удалены в версии 16.0
Метод `IsValidInviteUserToken` в cloudapi/user стал deprecated и будет удален в версии 16.0
Метод `GetLog` в cloudbroker/compute стал deprecated и будет удален в версии 16.0
Методы `ExecuteMaintenanceScript`, `ListEmails`, `ServicesRestart` в cloudbroker/grid стали deprecated и будут удалены в версии 16.0
Метод `Get` в cloudbroker/group стал deprecated и будет удален в версии 16.0
Методы `Audits` в cloudapi/compute, cloudbroker/compute, cloudapi/account, cloudbroker/account, cloudapi/vins, cloudbroker/vins, cloudapi/rg и cloudbroker/rg стали deprecated и в следующих версиях будут удалены, вместо них необходимо использовать метод `List` в cloudapi/audit и cloudbroker/audit с соответствующими фильтрами
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и в следующих версиях будут удалены
Методы `ComputeCISet`, `ComputeCIUnset`, `GetAudits` в cloudbroker/compute и `GetAudits` в cloudapi/compute стали deprecated и будут удалены в следующих версиях
Методы `ComputeCISet`, `ComputeCIUnset` в cloudbroker/image стали deprecated и будут удалены в следующих версиях
Все методы группы `.SDN()` находятся в альфа-версии.
### Добавлено
#### compute
#### image
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-922 | Опциональное поле `EnableDefaultGateway` в структуру запроса `NetAttachRequest` в cloudapi/compute и cloudbroker/compute |
| BGOS-922 | Вычисляемое поле `EnableDefaultGateway` в структуру ответа `RecordNetAttach` в cloudapi/compute и cloudbroker/compute |
| BGOS-922 | Вычисляемое поле `EnableDefaultGateway` в структуру ответа `ItemInterface` в cloudbroker/compute |
| BGOS-922 | Вычисляемое поле `EnableDefaultGateway` в структуру ответа `ItemVNFInterface` в cloudapi/compute |
| BGOS-931 | Структура ответа `SnapRecordCompute` в cloudapi/compute |
| BGOS-936 | Вычисляемое поле `NodeID` в структуры ответа `RecordCompute` и `ItemCompute` в cloudapi/compute |
#### disks
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-924 | Вычисляемое поле `Ready` в структуру ответа `MigrateStatus` в cloudbroker/disks |
#### grid
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-926 | Метод `SetResourcesLimit` и структура запроса `SetResourcesLimitRequest` в cloudbroker/grid |
#### kvmx86
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-937 | Опциональное поле `EnableDefaultGateway` в структуру `Interface` в cloudapi/kvmx86 и cloudbroker/kvmx86 |
| BGOS-937 | Опциональное поле `EnableDefaultGateway` в структуру `InterfaceMassCreate` в cloudbroker/kvmx86 |
| BGOS-916 | Вычисляемые поля `Compute` и `MemoryDumpImage` в структуру ответа `ItemSnapSet` в cloudapi/image |
#### node
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-927 | Вычисляемые поля `ReservedCPU` и `ReservedRAM` в структуры ответа `ItemNode` и `RecordNode` в cloudbroker/node |
| BGOS-928 | Метод `SetResourcesLimit` и структура запроса `SetResourcesLimitRequest` в cloudbroker/node |
#### vins
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-923 | Опциональное поле `EnableDefaultGateway` в структуры запросов `CreateInAccountRequest` и `CreateInRGRequest` в cloudapi/vins и cloudbroker/vins |
| BGOS-923 | Опциональное поле `EnableDefaultGateway` в структуру запроса `UpdateRequest` в cloudbroker/vins |
| BGOS-923 | Вычисляемое поле `EnableDefaultGateway` в структуру ответа `RecordVINS` в cloudapi/vins и cloudbroker/vins |
| BGOS-923 | Вычисляемое поле `EnableDefaultGateway` в структуру ответа `ItemVINS` в cloudbroker/vins |
| BGOS-919 | Вычисляемое поле `MaxSupportedGeneration` в структуру ответа `CpuInfo` в cloudbroker/node |
#### zone
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-929 | Вычисляемые поля `ReservedCPU` и `ReservedRAM` в структуры ответа `RecordZone` и `ItemZone` в cloudapi/zone и в cloudbroker/zone |
| BGOS-930 | Метод `SetResourcesLimit` и структура запроса `SetResourcesLimitRequest` в cloudbroker/zone |
| BGOS-930 | Метод `UpdateCPUAlignmentProfile` и структура запроса `UpdateCPUAlignmentProfileRequest` в cloudbroker/zone |
| BGOS-914 | Вычисляемые поля `ID`, `Name` и `ConsumedBy` в структуру ответа `RecordConsumption` в cloudbroker/sep |
| BGOS-914 | Структура ответа `ListConsumption` в cloudbroker/sep |
### Изменено
#### account
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-918 | Тип обязательного поля `Ratio` с `float64` на `uint64` в структуре запроса `SetCPUAllocationRatioRequest` в cloudbroker/account |
#### SEP
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-914 | Тип поля `SEPID` с обязательного на опциональный в структуре запроса `ConsumptionRequest` в cloudbroker/sep |
| BGOS-914 | Тип ответа метода `Consumption` с `RecordConsumption` на `ListConsumption` в cloudbroker/sep |

View File

@@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
)

View File

@@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
)

View File

@@ -182,9 +182,6 @@ type RecordNetAttach struct {
// Enabled
Enabled bool `json:"enabled"`
// Enable default gateway
EnableDefaultGateway bool `json:"enable_default_gateway"`
// Enable security groups
EnableSecGroups bool `json:"enable_secgroups"`
@@ -482,9 +479,6 @@ type RecordCompute struct {
// Natable VINS network name
NatableVINSNetworkName string `json:"natableVinsNetworkName"`
// Node ID
NodeID uint64 `json:"node_id"`
// Name of OS
OSVersion string `json:"os_version"`
@@ -571,261 +565,6 @@ type RecordCompute struct {
ZoneID uint64 `json:"zoneId"`
}
type SnapRecordCompute struct {
// Access Control List
ACL ListACL `json:"acl"`
// Account ID
AccountID uint64 `json:"accountId"`
// Account name
AccountName string `json:"accountName"`
// Affinity label
AffinityLabel string `json:"affinityLabel"`
// List affinity rules
AffinityRules ListRules `json:"affinityRules"`
// Affinity weight
AffinityWeight uint64 `json:"affinityWeight"`
// List anti affinity rules
AntiAffinityRules ListRules `json:"antiAffinityRules"`
// Auto start when node restarted
AutoStart bool `json:"autoStart"`
// Architecture
Architecture string `json:"arch"`
// Boot image ID
BootImageID uint64 `json:"boot_image_id"`
// Boot order
BootOrder []string `json:"bootOrder"`
// Boot type
BootType string `json:"bootType"`
// Boot disk size
BootDiskSize uint64 `json:"bootdiskSize"`
// CD Image Id
CdImageId uint64 `json:"cdImageId"`
// Chipset
Chipset string `json:"chipset"`
// Clone reference
CloneReference uint64 `json:"cloneReference"`
// List clone IDs
Clones []uint64 `json:"clones"`
// Clock
Clock string `json:"clock"`
// Compute CI ID
ComputeCIID uint64 `json:"computeciId"`
// CPU Pin
CPUPin bool `json:"cpupin"`
// Number of cores
CPU uint64 `json:"cpus"`
// Created by
CreatedBy string `json:"createdBy"`
// Created time
CreatedTime uint64 `json:"createdTime"`
// Custom fields items
CustomFields map[string]interface{} `json:"customFields"`
// Deleted by
DeletedBy string `json:"deletedBy"`
// Deleted time
DeletedTime uint64 `json:"deletedTime"`
// Description
Description string `json:"desc"`
// Devices
Devices interface{} `json:"devices"`
// List disks in compute
Disks ListComputeDisks `json:"disks"`
// Driver
Driver string `json:"driver"`
// Grid ID
GID uint64 `json:"gid"`
// GUID
GUID uint64 `json:"guid"`
// HPBacked
HPBacked bool `json:"hpBacked"`
// Hot resize
HotResize bool `json:"hotResize"`
// ID
ID uint64 `json:"id"`
// Image ID
ImageID uint64 `json:"imageId"`
// Image name
ImageName string `json:"imageName"`
// List interfaces
Interfaces ListInterfaces `json:"interfaces"`
// Loader meta iso information
LoaderMetaIso LoaderMetaIso `json:"loaderMetaIso"`
// Live migration job ID
LiveMigrationJobID uint64 `json:"live_migration_job_id"`
// Loader type
LoaderType string `json:"loaderType"`
// Lock status
LockStatus string `json:"lockStatus"`
// Manager ID
ManagerID uint64 `json:"managerId"`
// Manager type
ManagerType string `json:"managerType"`
// Migration job
MigrationJob uint64 `json:"migrationjob"`
// Milestones
Milestones uint64 `json:"milestones"`
// Name
Name string `json:"name"`
// NeedReboot
NeedReboot bool `json:"needReboot"`
// Network interface naming
NetworkInterfaceNaming string `json:"networkInterfaceNaming"`
// Numa Affinity
NumaAffinity string `json:"numaAffinity"`
//NumaNodeId
NumaNodeId int64 `json:"numaNodeId"`
// Natable VINS ID
NatableVINSID uint64 `json:"natableVinsId"`
// Natable VINS IP
NatableVINSIP string `json:"natableVinsIp"`
// Natable VINS Name
NatableVINSName string `json:"natableVinsName"`
// Natable VINS network
NatableVINSNetwork string `json:"natableVinsNetwork"`
// Natable VINS network name
NatableVINSNetworkName string `json:"natableVinsNetworkName"`
// Name of OS
OSVersion string `json:"os_version"`
// List OS Users
OSUsers ListOSUser `json:"osUsers"`
// Pinned to node
PinnedToNode int64 `json:"pinnedToNode"`
// PreferredCPU
PreferredCPU []int64 `json:"preferredCpu"`
// CPU alignment profile
CPUAlignmentProfile CPUAlignmentProfile `json:"cpu_alignment_profile"`
// Qemu_quest
QemuQuest QemuQuest `json:"qemu_guest"`
// ReadOnly indicates read-only mode state
ReadOnly bool `json:"read_only"`
// Number of RAM
RAM uint64 `json:"ram"`
// Reference ID
ReferenceID string `json:"referenceId"`
// Registered or not
Registered bool `json:"registered"`
// Resource name
ResName string `json:"resName"`
// Reserved Node Cpus
ReservedNodeCpus []uint64 `json:"reservedNodeCpus"`
// Resource group ID
RGID uint64 `json:"rgId"`
// Resource group name
RGName string `json:"rgName"`
// List snapsets
SnapSets ListSnapSets `json:"snapSets"`
// Stateless SepID
StatelessSepID int64 `json:"statelessSepId"`
// Stateless SepType
StatelessSepType string `json:"statelessSepType"`
// Status
Status string `json:"status"`
// Tags
Tags map[string]string `json:"tags"`
// Tech status
TechStatus string `json:"techStatus"`
// Updated by
UpdatedBy string `json:"updatedBy"`
// Updated time
UpdatedTime uint64 `json:"updatedTime"`
// User Managed or not
UserManaged bool `json:"userManaged"`
// Userdata
Userdata interface{} `json:"userdata"`
// vGPUs list
VGPUs []VGPUItem `json:"vgpus"`
// VNC password
VNCPassword string `json:"vncPasswd"`
// Weight
Weight uint64 `json:"weight"`
// Zone ID
// Required: false
ZoneID uint64 `json:"zoneId"`
}
type LoaderMetaIso struct {
// Name
DeviceName string `json:"devicename"`
@@ -952,7 +691,7 @@ type ListOSUser []ItemOSUser
// Main information about snapsets
type ItemSnapSet struct {
// Compute info
Compute SnapRecordCompute `json:"compute"`
Compute RecordCompute `json:"compute"`
// List disk ID
Disks []uint64 `json:"disks"`
@@ -990,9 +729,6 @@ type ItemVNFInterface struct {
// Enabled
Enabled bool `json:"enabled"`
// Enable default gateway
EnableDefaultGateway bool `json:"enable_default_gateway"`
// Enable security groups
EnableSecGroups bool `json:"enable_secgroups"`
@@ -1455,9 +1191,6 @@ type ItemCompute struct {
// Name
Name string `json:"name"`
// Node ID
NodeID uint64 `json:"node_id"`
// NeedReboot
NeedReboot bool `json:"needReboot"`

View File

@@ -81,11 +81,6 @@ type NetAttachRequest struct {
// Flag indicating whether this interface is enabled (only for VINS, EXTNET, DPDK, SDN, TRUNK)
// Required: false
Enabled interface{} `url:"enabled,omitempty" json:"enabled,omitempty" validate:"omitempty,isBool"`
// Flag indicating whether default gateway is enabled for this interface
// Required: false
// Default: true
EnableDefaultGateway interface{} `url:"enable_default_gateway,omitempty" json:"enable_default_gateway,omitempty" validate:"omitempty,isBool"`
}
type wrapperNetAttachRequest struct {

View File

@@ -76,11 +76,6 @@ type Interface struct {
// Flag indicating whether this interface is enabled (only for VINS, EXTNET, DPDK, SDN, TRUNK)
// Required: false
Enabled interface{} `url:"enabled,omitempty" json:"enabled,omitempty" validate:"omitempty,isBool"`
// Flag indicating whether default gateway are enabled for this interface, not applicable to netType EXTNET, VFNIC, TRUNK, or SDN
// Default: true
// Required: false
EnableDefaultGateway interface{} `url:"enable_default_gateway,omitempty" json:"enable_default_gateway,omitempty" validate:"omitempty,isBool"`
}
// DataDisk detailed struct for DataDisks field in CreateRequest and CreateBlankRequest

View File

@@ -2,7 +2,6 @@ package pcidevice
import (
"encoding/json"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/serialization"
)

View File

@@ -2,10 +2,10 @@ package vins
import (
"context"
"encoding/json"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
)
@@ -62,11 +62,11 @@ type CreateInAccountRequest struct {
// Required: false
// Default: false
EnableSecGroups interface{} `url:"enable_secgroups,omitempty" json:"enable_secgroups,omitempty" validate:"omitempty,isBool"`
}
// Flag indicating whether default gateway is enabled for this VINS
// Required: false
// Default: true
EnableDefaultGateway interface{} `url:"enable_default_gateway,omitempty" json:"enable_default_gateway,omitempty" validate:"omitempty,isBool"`
type wrapperCreateRequestInAcc struct {
CreateInAccountRequest
Routes []string `url:"routes,omitempty"`
}
// CreateInAccount creates VINS in account level
@@ -76,9 +76,31 @@ func (v VINS) CreateInAccount(ctx context.Context, req CreateInAccountRequest) (
return 0, validators.ValidationErrors(validators.GetErrors(err))
}
var routes []string
if len(req.Routes) != 0 {
routes = make([]string, 0, len(req.Routes))
for r := range req.Routes {
b, err := json.Marshal(req.Routes[r])
if err != nil {
return 0, err
}
routes = append(routes, string(b))
}
} else {
routes = []string{}
}
reqWrapped := wrapperCreateRequestInAcc{
CreateInAccountRequest: req,
Routes: routes,
}
url := "/cloudapi/vins/createInAccount"
res, err := v.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped)
if err != nil {
return 0, err
}

View File

@@ -2,10 +2,10 @@ package vins
import (
"context"
"encoding/json"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
)
@@ -56,11 +56,11 @@ type CreateInRGRequest struct {
// Required: false
// Default: false
EnableSecGroups interface{} `url:"enable_secgroups,omitempty" json:"enable_secgroups,omitempty" validate:"omitempty,isBool"`
}
// Flag indicating whether default gateway is enabled for this VINS
// Required: false
// Default: true
EnableDefaultGateway interface{} `url:"enable_default_gateway,omitempty" json:"enable_default_gateway,omitempty" validate:"omitempty,isBool"`
type wrapperCreateRequestInRG struct {
CreateInRGRequest
Routes []string `url:"routes,omitempty"`
}
// CreateInRG creates VINS in resource group level
@@ -70,9 +70,31 @@ func (v VINS) CreateInRG(ctx context.Context, req CreateInRGRequest) (uint64, er
return 0, validators.ValidationErrors(validators.GetErrors(err))
}
var routes []string
if len(req.Routes) != 0 {
routes = make([]string, 0, len(req.Routes))
for r := range req.Routes {
b, err := json.Marshal(req.Routes[r])
if err != nil {
return 0, err
}
routes = append(routes, string(b))
}
} else {
routes = []string{}
}
reqWrapped := wrapperCreateRequestInRG{
CreateInRGRequest: req,
Routes: routes,
}
url := "/cloudapi/vins/createInRG"
res, err := v.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped)
if err != nil {
return 0, err
}

View File

@@ -694,9 +694,6 @@ type RecordVINS struct {
// Description
Description string `json:"desc"`
// Enable Default Gateway
EnableDefaultGateway bool `json:"enable_default_gateway"`
// Enable Security Groups
EnableSecGroups bool `json:"enable_secgroups"`

View File

@@ -111,12 +111,6 @@ type RecordZone struct {
// CPU alignment profiles
CpuAlignmentProfiles []CpuAlignmentProfile `json:"cpu_alignment_profiles"`
// Reserved CPU
ReservedCPU uint64 `json:"reserved_cpu"`
// Reserved RAM
ReservedRAM uint64 `json:"reserved_ram"`
}
// A zone item from a list
@@ -189,10 +183,4 @@ type ItemZone struct {
// CPU alignment profiles
CpuAlignmentProfiles []CpuAlignmentProfile `json:"cpu_alignment_profiles"`
// Reserved CPU
ReservedCPU uint64 `json:"reserved_cpu"`
// Reserved RAM
ReservedRAM uint64 `json:"reserved_ram"`
}

View File

@@ -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

View File

@@ -148,9 +148,6 @@ type RecordNetAttach struct {
// Enabled
Enabled bool `json:"enabled"`
// Enable default gateway
EnableDefaultGateway bool `json:"enable_default_gateway"`
// Enable security groups
EnableSecGroups bool `json:"enable_secgroups"`
@@ -600,9 +597,6 @@ type ItemInterface struct {
// Enabled
Enabled bool `json:"enabled"`
// Enable default gateway
EnableDefaultGateway bool `json:"enable_default_gateway"`
// Enable security groups
EnableSecGroups bool `json:"enable_secgroups"`

View File

@@ -81,11 +81,6 @@ type NetAttachRequest struct {
// Flag indicating whether this interface is enabled (only for VINS, EXTNET, DPDK, SDN, TRUNK)
// Required: false
Enabled interface{} `url:"enabled,omitempty" json:"enabled,omitempty" validate:"omitempty,isBool"`
// Flag indicating whether default gateway is enabled for this interface
// Required: false
// Default: true
EnableDefaultGateway interface{} `url:"enable_default_gateway,omitempty" json:"enable_default_gateway,omitempty" validate:"omitempty,isBool"`
}
type wrapperNetAttachRequest struct {

View File

@@ -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

View File

@@ -343,7 +343,4 @@ type MigrateStatus struct {
// Progress percent
ProgressPercent int `json:"progress_percent"`
// Operation status
Ready bool `json:"ready"`
}

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -1,44 +0,0 @@
package grid
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
)
// SetResourcesLimitRequest struct to set resources limit
type SetResourcesLimitRequest struct {
// ID of the grid
// Required: true
GID uint64 `url:"grid_id" json:"grid_id" validate:"required"`
// Number of CPU cores reserved
// Default: 0
// Required: true
ReservedCPU uint64 `url:"reserved_cpu" json:"reserved_cpu"`
// Amount of RAM in MB reserved
// Default: 0
// Required: true
ReservedRAM uint64 `url:"reserved_ram" json:"reserved_ram"`
}
// SetResourcesLimit sets reserved CPU and RAM limits for the grid
func (g Grid) SetResourcesLimit(ctx context.Context, req SetResourcesLimitRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/grid/set_resources_limit"
res, err := g.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil {
return false, err
}
return strconv.ParseBool(string(res))
}

View File

@@ -59,11 +59,6 @@ type Interface struct {
// Required: false
Enabled interface{} `url:"enabled,omitempty" json:"enabled,omitempty" validate:"omitempty,isBool"`
// Flag indicating whether default gateway are enabled for this interface, not applicable to netType EXTNET, VFNIC, TRUNK, or SDN
// Default: true
// Required: false
EnableDefaultGateway interface{} `url:"enable_default_gateway,omitempty" json:"enable_default_gateway,omitempty" validate:"omitempty,isBool"`
// SDN Segment ID
// Required: false
SDNSegmentID string `url:"sdn_segment_id,omitempty" json:"sdn_segment_id,omitempty"`

View File

@@ -56,11 +56,6 @@ type InterfaceMassCreate struct {
// Required: false
Enabled interface{} `url:"enabled,omitempty" json:"enabled,omitempty" validate:"omitempty,isBool"`
// Flag indicating whether default gateway are enabled for this interface, not applicable to netType EXTNET, VFNIC, TRUNK, or SDN
// Default: true
// Required: false
EnableDefaultGateway interface{} `url:"enable_default_gateway,omitempty" json:"enable_default_gateway,omitempty" validate:"omitempty,isBool"`
// SDN Segment ID
// Required: false
SDNSegmentID string `url:"sdn_segment_id,omitempty" json:"sdn_segment_id,omitempty"`

View File

@@ -50,12 +50,6 @@ type RecordNode struct {
// ReservedCPUs
ReservedCPUs []interface{} `json:"reservedCpus"`
// Reserved CPU
ReservedCPU uint64 `json:"reserved_cpu"`
// Reserved RAM
ReservedRAM uint64 `json:"reserved_ram"`
// Roles
Roles []string `json:"roles"`
@@ -266,12 +260,6 @@ type ItemNode struct {
// ReservedCPUs
ReservedCPUs []interface{} `json:"reservedCpus"`
// Reserved CPU
ReservedCPU uint64 `json:"reserved_cpu"`
// Reserved RAM
ReservedRAM uint64 `json:"reserved_ram"`
// Roles
Roles []string `json:"roles"`

View File

@@ -1,42 +0,0 @@
package node
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
)
// SetResourcesLimitRequest struct to set resources limit for node
type SetResourcesLimitRequest struct {
// Node ID
// Required: true
NodeID uint64 `url:"node_id" json:"node_id" validate:"required"`
// Number of CPU cores reserved
// Required: true
ReservedCPU uint64 `url:"reserved_cpu" json:"reserved_cpu"`
// Amount of RAM in MB reserved
// Required: true
ReservedRAM uint64 `url:"reserved_ram" json:"reserved_ram"`
}
// SetResourcesLimit sets reserved CPU and RAM limits for the node
func (n Node) SetResourcesLimit(ctx context.Context, req SetResourcesLimitRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/node/set_resources_limit"
res, err := n.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil {
return false, err
}
return strconv.ParseBool(string(res))
}

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -2,7 +2,6 @@ package pcidevice
import (
"encoding/json"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/serialization"
)

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -2,10 +2,10 @@ package vins
import (
"context"
"encoding/json"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
)
@@ -62,11 +62,11 @@ type CreateInAccountRequest struct {
// Required: false
// Default: false
EnableSecGroups interface{} `url:"enable_secgroups,omitempty" json:"enable_secgroups,omitempty" validate:"omitempty,isBool"`
}
// Flag indicating whether default gateway is enabled for this VINS
// Required: false
// Default: true
EnableDefaultGateway interface{} `url:"enable_default_gateway,omitempty" json:"enable_default_gateway,omitempty" validate:"omitempty,isBool"`
type wrapperCreateRequestInAcc struct {
CreateInAccountRequest
Routes []string `url:"routes,omitempty"`
}
// CreateInAccount creates VINS in account level
@@ -76,9 +76,31 @@ func (v VINS) CreateInAccount(ctx context.Context, req CreateInAccountRequest) (
return 0, validators.ValidationErrors(validators.GetErrors(err))
}
var routes []string
if len(req.Routes) != 0 {
routes = make([]string, 0, len(req.Routes))
for r := range req.Routes {
b, err := json.Marshal(req.Routes[r])
if err != nil {
return 0, err
}
routes = append(routes, string(b))
}
} else {
routes = []string{"[]"}
}
reqWrapped := wrapperCreateRequestInAcc{
CreateInAccountRequest: req,
Routes: routes,
}
url := "/cloudbroker/vins/createInAccount"
res, err := v.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped)
if err != nil {
return 0, err
}

View File

@@ -2,10 +2,10 @@ package vins
import (
"context"
"encoding/json"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
)
@@ -56,11 +56,11 @@ type CreateInRGRequest struct {
// Required: false
// Default: false
EnableSecGroups interface{} `url:"enable_secgroups,omitempty" json:"enable_secgroups,omitempty" validate:"omitempty,isBool"`
}
// Flag indicating whether default gateway is enabled for this VINS
// Required: false
// Default: true
EnableDefaultGateway interface{} `url:"enable_default_gateway,omitempty" json:"enable_default_gateway,omitempty" validate:"omitempty,isBool"`
type wrapperCreateRequestInRG struct {
CreateInRGRequest
Routes []string `url:"routes,omitempty"`
}
// CreateInRG creates VINS in resource group level
@@ -69,10 +69,31 @@ func (v VINS) CreateInRG(ctx context.Context, req CreateInRGRequest) (uint64, er
if err != nil {
return 0, validators.ValidationErrors(validators.GetErrors(err))
}
var routes []string
if len(req.Routes) != 0 {
routes = make([]string, 0, len(req.Routes))
for r := range req.Routes {
b, err := json.Marshal(req.Routes[r])
if err != nil {
return 0, err
}
routes = append(routes, string(b))
}
} else {
routes = []string{"[]"}
}
reqWrapped := wrapperCreateRequestInRG{
CreateInRGRequest: req,
Routes: routes,
}
url := "/cloudbroker/vins/createInRG"
res, err := v.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped)
if err != nil {
return 0, err
}

View File

@@ -523,9 +523,6 @@ type RecordVINS struct {
// Description
Description string `json:"desc"`
// Enable Default Gateway
EnableDefaultGateway bool `json:"enable_default_gateway"`
// Enable Security Groups
EnableSecGroups bool `json:"enable_secgroups"`
@@ -739,9 +736,6 @@ type ItemVINS struct {
// Description
Description string `json:"desc"`
// Enable Default Gateway
EnableDefaultGateway bool `json:"enable_default_gateway"`
// Enable Security Groups
EnableSecGroups bool `json:"enable_secgroups"`

View File

@@ -25,10 +25,6 @@ type UpdateRequest struct {
// Flag indicating whether security groups are enabled for this network
// Required: false
EnableSecGroups interface{} `url:"enable_secgroups,omitempty" json:"enable_secgroups,omitempty" validate:"omitempty,isBool"`
// Flag indicating whether default gateway is enabled for this VINS
// Required: false
EnableDefaultGateway interface{} `url:"enable_default_gateway,omitempty" json:"enable_default_gateway,omitempty" validate:"omitempty,isBool"`
}
// Update updates a vins parameters

View File

@@ -177,12 +177,6 @@ type RecordZone struct {
// CPU alignment profiles
CpuAlignmentProfiles []CpuAlignmentProfile `json:"cpu_alignment_profiles"`
// Reserved CPU
ReservedCPU uint64 `json:"reserved_cpu"`
// Reserved RAM
ReservedRAM uint64 `json:"reserved_ram"`
}
// A zone item from a list
@@ -255,10 +249,4 @@ type ItemZone struct {
// CPU alignment profiles
CpuAlignmentProfiles []CpuAlignmentProfile `json:"cpu_alignment_profiles"`
// Reserved CPU
ReservedCPU uint64 `json:"reserved_cpu"`
// Reserved RAM
ReservedRAM uint64 `json:"reserved_ram"`
}

View File

@@ -1,42 +0,0 @@
package zone
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
)
// SetResourcesLimitRequest struct to set resources limit
type SetResourcesLimitRequest struct {
// ID of the zone
// Required: true
ZoneID uint64 `url:"zone_id" json:"zone_id" validate:"required"`
// Number of CPU cores reserved
// Required: true
ReservedCPU uint64 `url:"reserved_cpu" json:"reserved_cpu"`
// Amount of RAM in MB reserved
// Required: true
ReservedRAM uint64 `url:"reserved_ram" json:"reserved_ram"`
}
// SetResourcesLimit sets reserved CPU and RAM limits for the zone
func (e Zone) SetResourcesLimit(ctx context.Context, req SetResourcesLimitRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/zone/set_resources_limit"
res, err := e.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil {
return false, err
}
return strconv.ParseBool(string(res))
}

View File

@@ -1,46 +0,0 @@
package zone
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
)
// UpdateCPUAlignmentProfileRequest struct to update CPU alignment profile of zone
type UpdateCPUAlignmentProfileRequest struct {
// ID of zone
// Required: true
ZoneID uint64 `url:"zone_id" json:"zone_id" validate:"required"`
// Minimum percentage of hypervisors that must support the selected CPU model for the balanced profile
// Default: 70
// Required: false
HypervisorSimilarityInPercentage uint64 `url:"hypervisor_similarity_in_percentage,omitempty" json:"hypervisor_similarity_in_percentage,omitempty" validate:"omitempty,max=100"`
}
// UpdateCPUAlignmentProfile updates CPU alignment profile of zone
func (e Zone) UpdateCPUAlignmentProfile(ctx context.Context, req UpdateCPUAlignmentProfileRequest) ([]CpuAlignmentProfile, error) {
err := validators.ValidateRequest(req)
if err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/zone/update_cpu_alignment_profile"
res, err := e.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil {
return nil, err
}
var profiles []CpuAlignmentProfile
err = json.Unmarshal(res, &profiles)
if err != nil {
return nil, err
}
return profiles, nil
}

View File

@@ -30,6 +30,7 @@ func (m *migrator) Migrate(ctxOrigin context.Context, dxVMID, nodeID uint64) (bo
req := compute.MigrateRequest{
ComputeID: dxVMID,
TargetNodeID: nodeID,
Force: false,
}
ctx, cancel := context.WithTimeout(ctxOrigin, m.cfg.QueryTimeout)
ok, err := m.client.CloudBroker().Compute().Migrate(ctx, req)