Compare commits

...

2 Commits

Author SHA1 Message Date
d7b8f08b4d v1.15.7 2026-07-31 16:20:40 +04:00
bd2d22f456 v1.15.6 2026-07-17 16:09:24 +04:00
7 changed files with 320 additions and 103 deletions

View File

@@ -1,4 +1,4 @@
## Version 1.15.5 ## Version 1.15.7
Методы `Audits` в cloudapi/compute, cloudbroker/compute, cloudapi/account, cloudbroker/account, cloudapi/vins, cloudbroker/vins, cloudapi/rg и cloudbroker/rg стали deprecated и будут удалены в версии 1.16, вместо них необходимо использовать метод `List` в cloudapi/audit и cloudbroker/audit с соответствующими фильтрами Методы `Audits` в cloudapi/compute, cloudbroker/compute, cloudapi/account, cloudbroker/account, cloudapi/vins, cloudbroker/vins, cloudapi/rg и cloudbroker/rg стали deprecated и будут удалены в версии 1.16, вместо них необходимо использовать метод `List` в cloudapi/audit и cloudbroker/audit с соответствующими фильтрами
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и будут удалены в версии 1.16 Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и будут удалены в версии 1.16
@@ -11,69 +11,25 @@
Методы `ExecuteMaintenanceScript`, `ListEmails`, `ServicesRestart` в cloudbroker/grid стали deprecated и будут удалены в версии 1.16 Методы `ExecuteMaintenanceScript`, `ListEmails`, `ServicesRestart` в cloudbroker/grid стали deprecated и будут удалены в версии 1.16
Метод `Get` в cloudbroker/group стал deprecated и будет удален в версии 1.16 Метод `Get` в cloudbroker/group стал deprecated и будет удален в версии 1.16
### Добавлено ### Добавлено
#### compute #### compute
| Идентификатор задачи | Описание | | Идентификатор задачи | Описание |
| --- | --- | | --- | --- |
| BGOS-954 | Вычисляемое поле `ResizedOnline` в структуры ответа `RecordCompute` и `ItemCompute` в cloudapi/compute и cloudbroker/compute | | BGOS-966 | Вычисляемое поле `CPUSet` в структуру ответа `RecordMigrateStorageInfo` в cloudbroker/compute |
| BGOS-966 | Вычисляемое поля `Clock`, `CPUAlignmentProfile` и `Weight` в структуру `ShadowCompute` в cloudbroker/compute |
| BGOS-966 | Вычисляемое поле `EnableDefaultGateway` в структуру `ItemShadowComputeInterface` в cloudbroker/compute |
#### resmon #### node
| Идентификатор задачи | Описание | | Идентификатор задачи | Описание |
| --- | --- | | --- | --- |
| BGOS-947 | Вычисляемое поле `UID` в структуру ответа `GetByNodePoint` в cloudbroker/resmon | | BGOS-968 | Вычисляемое поле `OVSDPDKCores` в структуру ответа `DPDK` в cloudbroker/node |
| BGOS-947 | Вычисляемые поля `ThreadCount`, `ModelName`, `Flags` и `MaxSupportedGeneration` в структуру ответа `CPUinfoByNode` в cloudbroker/resmon |
| BGOS-947 | Вычисляемые поля `UsedGiB` и `TotalGiB` в структуру ответа `ItemStorage` в cloudbroker/resmon |
#### SDN logicalports
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-951 | Вычисляемое поле `ExcludeFirewall` в структуру ответа `LogicalPort` в sdn/logicalports |
### Изменено
#### compute
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-958 | Тип возвращаемого значения с `string` на `RecordMigrateStorageInfo` в методе `MigrateStorageInfo` в cloudbroker/compute |
#### resmon
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-947 | Тип вычисляемых полей `CPUTime` и `RAMConsumedReal` с `uint64` на `float64` в структуре ответа `ComputeUsage` в cloudbroker/resmon |
| BGOS-947 | Тип вычисляемого поля `IsUp` с `uint64` на `bool` в структуре ответа `ComputeUsage` в cloudbroker/resmon |
| BGOS-947 | Тип вычисляемого поля `SizeMax` с `float64` на `uint64` в структуре ответа `ItemDisk` в cloudbroker/resmon |
| BGOS-947 | Тип вычисляемых полей `CPUPower`, `CPUUtil`, `TotalMem`, `ReservedMem`, `UsedMem` и `FreeMem` с `uint64` на `float64` в структуре ответа `ItemTotalByGRID` в cloudbroker/resmon |
| BGOS-947 | Тип вычисляемых полей `PCPU` и `CPUUtil` с `uint64` на `float64` в структуре ответа `NodeUsage` в cloudbroker/resmon |
#### SDN hypervisors
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-956 | Тип возвращаемого значения в методе `Delete` c `bool` на `RecordVersion` в sdn/hypervisors |
#### SDN logicalports
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-951 | Тип опционального поля `LogicalPortAddresses` в структуре запроса `CreateRequest` с `[]LogicalPortAddress` на `[]LogicalPortAddressRequest` в sdn/logicalports |
| BGOS-951 | Тип обязательного поля `IP` в структуре запроса `LogicalPortAddressRequest` с `string` на `interface{}` в sdn/logicalports |
| BGOS-951 | Тип обязательного поля `IsDiscovered` в структуре запроса `UpdateAddress` и `AddAddress` с `bool` на `interface{}` в sdn/logicalports |
| BGOS-951 | Тип опционального поля `Labels` в структуре запроса `CreateRequest` с `CreateLabels` на `*CreateLabels` в sdn/logicalports |
| BGOS-951 | Тип опционального поля `Labels` в структуре запроса `UpdateRequest` с `UpdateLabels` на `*UpdateLabels` в sdn/logicalports |
#### SDN netobjgroups
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-957 | Тип вычисляемого поля `ExternalNetworkPorts` с массива на объект в sdn/netobjgroups |
### Удалено ### Удалено
#### resmon #### node
| Идентификатор задачи | Описание | | Идентификатор задачи | Описание |
| --- | --- | | --- | --- |
| BGOS-947 | Вычисляемые поля `NodesCPU`, `StorageCapacity` и `VCPUConsumed` из структуры ответа `ItemTotalByGRID` в cloudbroker/resmon | | BGOS-968 | Вычисляемое поле `PMDCPU` из структуры ответа `DPDK` в cloudbroker/node |
| BGOS-947 | Вычисляемые поля `CapacityLimit`, `Consumed`, `Type` и `UID` из структуры ответа `ItemStorage` в cloudbroker/resmon |
#### SDN netobjgroups
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-957 | Вычисляемые поля `Comment`, `Enabled`, `IPv4` и `MAC` в структуре `ExternalNetworkPorts` в структуре ответа `RecordNetObjGroup` в sdn/netobjgroups |

View File

@@ -34,7 +34,7 @@ type DecortClient struct {
mutex *sync.Mutex mutex *sync.Mutex
} }
// Сlient builder // Client builder
func New(cfg config.Config) *DecortClient { func New(cfg config.Config) *DecortClient {
if err := validators.ValidateConfig(cfg); err != nil { if err := validators.ValidateConfig(cfg); err != nil {
panic(validators.ValidationErrors(validators.GetErrors(err))) panic(validators.ValidationErrors(validators.GetErrors(err)))

View File

@@ -482,9 +482,6 @@ type RecordCompute struct {
// Natable VINS network name // Natable VINS network name
NatableVINSNetworkName string `json:"natableVinsNetworkName"` NatableVINSNetworkName string `json:"natableVinsNetworkName"`
// Node ID
NodeID uint64 `json:"node_id"`
// Name of OS // Name of OS
OSVersion string `json:"os_version"` OSVersion string `json:"os_version"`
@@ -722,6 +719,9 @@ type SnapRecordCompute struct {
// Network interface naming // Network interface naming
NetworkInterfaceNaming string `json:"networkInterfaceNaming"` NetworkInterfaceNaming string `json:"networkInterfaceNaming"`
// Node ID
NodeID uint64 `json:"node_id"`
// Numa Affinity // Numa Affinity
NumaAffinity string `json:"numaAffinity"` NumaAffinity string `json:"numaAffinity"`
@@ -785,9 +785,6 @@ type SnapRecordCompute struct {
// Resource group name // Resource group name
RGName string `json:"rgName"` RGName string `json:"rgName"`
// List snapsets
SnapSets ListSnapSets `json:"snapSets"`
// Stateless SepID // Stateless SepID
StatelessSepID int64 `json:"statelessSepId"` StatelessSepID int64 `json:"statelessSepId"`

View File

@@ -68,7 +68,7 @@ type ListACL []ItemACL
// Main information about snapshot // Main information about snapshot
type ItemSnapshot struct { type ItemSnapshot struct {
// Compute info // Compute info
Compute RecordCompute `json:"compute"` Compute SnapRecordCompute `json:"compute"`
// List of disk IDs // List of disk IDs
Disks []uint64 `json:"disks"` Disks []uint64 `json:"disks"`
@@ -1239,6 +1239,270 @@ type RecordCompute struct {
_ uint64 `json:"nodeId"` _ uint64 `json:"nodeId"`
} }
// SnapRecordCompute is RecordCompute but without the SnapSets field
type SnapRecordCompute struct {
// Account ID
AccountID uint64 `json:"accountId"`
// Account name
AccountName string `json:"accountName"`
// Access Control List
ACL []interface{} `json:"acl"`
// Affinity label
AffinityLabel string `json:"affinityLabel"`
// Affinity rules
AffinityRules ListRules `json:"affinityRules"`
// Affinity weight
AffinityWeight uint64 `json:"affinityWeight"`
// Anti affinity rules
AntiAffinityRules ListRules `json:"antiAffinityRules"`
// Auto start when node restarted
AutoStart bool `json:"autoStart"`
// Architecture
Arch 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"`
// Clock
Clock string `json:"clock"`
// List clone IDs
Clones []uint64 `json:"clones"`
// Compute CI ID
ComputeCIID uint64 `json:"computeciId"`
// CPU Pin
CPUPin bool `json:"cpupin"`
// Number of CPU
CPUs uint64 `json:"cpus"`
// Created by
CreatedBy string `json:"createdBy"`
// Created time
CreatedTime uint64 `json:"createdTime"`
// Custom fields
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
Disks ListDisks `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"`
// 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"`
// Need reboot
NeedReboot bool `json:"needReboot"`
// network interface naming
NetworkInterfaceNaming string `json:"networkInterfaceNaming"`
// NumaAffinity
NumaAffinity string `json:"numaAffinity"`
//NumaNodeId
NumaNodeId int64 `json:"numaNodeId"`
// List OS users
OSUsers ListOSUsers `json:"osUsers"`
// Name of OS
OSVersion string `json:"os_version"`
// 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
Registered bool `json:"registered"`
// Whether a compute has been resized online
ResizedOnline bool `json:"resizedOnline"`
// 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"`
// Node ID
NodeID uint64 `json:"node_id"`
// Node name
NodeName string `json:"nodeName"`
// Stateless SEP ID
StatelessSEPID int64 `json:"statelessSepId"`
// Stateless SEP Type
StatelessSEPType string `json:"statelessSepType"`
// Status
Status string `json:"status"`
// Tags
Tags map[string]interface{} `json:"tags"`
// Tech status
TechStatus string `json:"techStatus"`
// Total disk size
TotalDiskSize uint64 `json:"totalDisksSize"`
// Updated by
UpdatedBy string `json:"updatedBy"`
// Updated time
UpdatedTime uint64 `json:"updatedTime"`
// User managed
UserManaged bool `json:"userManaged"`
// Userdata
Userdata interface{} `json:"userdata"`
// List VGPU
VGPUs []VGPUItem `json:"vgpus"`
// VNC password
VNCPassword string `json:"vncPasswd"`
// Weight
Weight uint64 `json:"weight"`
// Zone ID
ZoneID uint64 `json:"zoneId"`
}
type LoaderMetaIso struct { type LoaderMetaIso struct {
// Name // Name
DeviceName string `json:"devicename"` DeviceName string `json:"devicename"`
@@ -1531,6 +1795,9 @@ type RecordMigrateStorageInfo struct {
// Migration completion status // Migration completion status
Completed bool `json:"completed"` Completed bool `json:"completed"`
// CPU set
CPUSet string `json:"cpu_set"`
// Daemon address // Daemon address
DaemonAddr string `json:"daemonAddr"` DaemonAddr string `json:"daemonAddr"`
@@ -1642,6 +1909,9 @@ type ShadowCompute struct {
// Chipset // Chipset
Chipset string `json:"chipset"` Chipset string `json:"chipset"`
// Clock
Clock string `json:"clock"`
// Clone reference // Clone reference
CloneReference uint64 `json:"cloneReference"` CloneReference uint64 `json:"cloneReference"`
@@ -1651,6 +1921,9 @@ type ShadowCompute struct {
// Compute CI ID // Compute CI ID
ComputeCIID uint64 `json:"computeciId"` ComputeCIID uint64 `json:"computeciId"`
// CPU alignment profile
CPUAlignmentProfile CPUAlignmentProfile `json:"cpu_alignment_profile"`
// CPU pin // CPU pin
CPUPin bool `json:"cpupin"` CPUPin bool `json:"cpupin"`
@@ -1795,6 +2068,9 @@ type ShadowCompute struct {
// VNC password // VNC password
VNCPassword string `json:"vncPasswd"` VNCPassword string `json:"vncPasswd"`
// Weight
Weight uint64 `json:"weight"`
// Zone ID // Zone ID
ZoneID uint64 `json:"zoneId"` ZoneID uint64 `json:"zoneId"`
} }
@@ -1909,6 +2185,9 @@ type ItemShadowComputeInterface struct {
// Enabled // Enabled
Enabled bool `json:"enabled"` Enabled bool `json:"enabled"`
// Enable default gateway
EnableDefaultGateway bool `json:"enable_default_gateway"`
// Node ID // Node ID
NodeID uint64 `json:"nodeId"` NodeID uint64 `json:"nodeId"`

View File

@@ -477,11 +477,11 @@ type DPDK struct {
// Bridges // Bridges
Bridges Bridges `json:"bridges"` Bridges Bridges `json:"bridges"`
// ovs dpdk cores
OVSDPDKCores []uint64 `json:"ovs_dpdk_cores"`
// hp memory // hp memory
HPMemory map[string]uint64 `json:"hp_memory"` HPMemory map[string]uint64 `json:"hp_memory"`
// pmd cpu
PMDCPU []uint64 `json:"pmd_cpu"`
} }
// Bridges // Bridges

View File

@@ -2,8 +2,8 @@ package sep
import ( import (
"context" "context"
"encoding/json"
"net/http" "net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators" "repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
) )
@@ -20,23 +20,24 @@ type AddConsumerNodesRequest struct {
} }
// AddConsumerNodes adds consumer nodes to SEP parameters // AddConsumerNodes adds consumer nodes to SEP parameters
func (s SEP) AddConsumerNodes(ctx context.Context, req AddConsumerNodesRequest) (uint64, error) { func (s SEP) AddConsumerNodes(ctx context.Context, req AddConsumerNodesRequest) ([]uint64, error) {
err := validators.ValidateRequest(req) err := validators.ValidateRequest(req)
list := []uint64{}
if err != nil { if err != nil {
return 0, validators.ValidationErrors(validators.GetErrors(err)) return list, validators.ValidationErrors(validators.GetErrors(err))
} }
url := "/cloudbroker/sep/addConsumerNodes" url := "/cloudbroker/sep/addConsumerNodes"
res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req) res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil { if err != nil {
return 0, err return list, err
} }
result, err := strconv.ParseUint(string(res), 10, 64) err = json.Unmarshal(res, &list)
if err != nil { if err != nil {
return 0, err return nil, err
} }
return result, nil return list, nil
} }

View File

@@ -181,55 +181,39 @@ type L2ExternalNetwork struct {
VLANTag *int `json:"vlan_tag"` VLANTag *int `json:"vlan_tag"`
} }
type ExternalNetworkPorts []ExternalNetworkPort
// Info about an external network port // Info about an external network port
type ExternalNetworkPorts struct { type ExternalNetworkPort struct {
// Access group ID // Access group ID
AccessGroupID string `json:"access_group_id"` AccessGroupID string `json:"access_group_id"`
// Access group name // Access group name
AccessGroupName string `json:"access_group_name"` AccessGroupName string `json:"access_group_name"`
// Bridge network name // Comment
BridgeNetworkName string `json:"bridge_network_name"` Comment string `json:"comment"`
// Default gateway for IPv4 // The name displayed
DefaultGatewayIPv4 string `json:"default_gateway_ipv4"` DisplayName string `json:"display_name"`
// Default gateway for IPv6 // Whether the port is enabled
DefaultGatewayIPv6 string `json:"default_gateway_ipv6"` Enabled bool `json:"enabled"`
// Description // The ID of the external network
Description string `json:"description"` ExternalNetworkID string `json:"external_network_id"`
// Details of external network ports
ExternalNetworkPorts ExternalNetworkPortsField `json:"external_network_ports"`
// Hypervisors
Hypervisors []string `json:"hypervisors"`
// ID of an external network port // ID of an external network port
ID string `json:"id"` ID string `json:"id"`
// Status // IP of version 4
Status Status `json:"status"` IPv4 string `json:"ipv4"`
// Version ID // Version ID
VersionID uint64 `json:"version_id"` VersionID uint64 `json:"version_id"`
// Subnet for V4 // MAC
SubnetV4 string `json:"subnet_v4"` MAC string `json:"mac"`
// Subnet for V6
SubnetV6 string `json:"subnet_v6"`
// Created at
CreatedAt string `json:"created_at"`
// Updated at
UpdatedAt string `json:"updated_at"`
// VLAN Tag
VLANTag int `json:"vlan_tag"`
} }
// Info about a logical port // Info about a logical port