v1.16.9
This commit is contained in:
dayterr
2026-10-23 16:06:09 +03:00
parent 84164a72a4
commit 54a86e5361
21 changed files with 351 additions and 71 deletions

View File

@@ -1,4 +1,4 @@
## Version 1.16.8
## Version 1.16.9
### Deprecated
@@ -33,70 +33,74 @@
### Добавлено
#### apiaccess
#### Общее
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1123 | Вычисляемое поле `BasisMPM` в структуру ответа `CloudBrokerEndpoints` в cloudbroker/apiaccess |
| BGOS-1146 | Значение `aerodisk` в валидаторе `sepTypeValues` |
| BGOS-1146 | Значение `AERODISK` в валидаторе `sepTypesValues` |
#### basismpm
#### audit
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1123 | Структура запроса `StartRequest` и метод `Start` в cloudbroker/basismpm |
| BGOS-1123 | Структура запроса `StatusRequest` и метод `Status` в cloudbroker/basismpm |
| BGOS-1123 | Структура запроса `StopRequest` и метод `Stop` в cloudbroker/basismpm |
| BGOS-1123 | Структура запроса `UpdateRequest` и метод `Update` в cloudbroker/basismpm |
| BGOS-1123 | Структуры ответа `MemInfo` и `RecordBasisMPM` в cloudbroker/basismpm |
| BGOS-1147 | Вычисляемое поле `VMFolderID` в структуру ответа `ItemAudit` в cloudapi/audit |
| BGOS-1147 | Вычисляемое поле `VMFolderID` в структуры ответа `ItemAudit` и `RecordAudit` в cloudbroker/audit |
#### compute
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1138 | Метод `MassPinToNode` и структура запроса `MassPinToNodeRequest` в cloudbroker/compute |
#### grid
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1148 | Вычисляемые поля `SDNWeb` и `BVPWeb` в структуры ответа `RecordGrid` и `ItemGridList` в cloudbroker/grid |
| BGOS-1148 | Структуры ответа `SDNWeb` и `BVPWeb` в cloudbroker/grid |
#### image
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1124 | Структура запроса `CreateFromDiskRequest` и методы `CreateFromDisk` и `CreateFromDiskAsync` в cloudapi/image |
| BGOS-1124 | Структура запроса `CreateFromDiskRequest` и методы `CreateFromDisk` и `CreateFromDiskAsync` в cloudbroker/image |
| BGOS-1140 | Опциональные поля `AccountID` и `SEPType` в структуру запроса `ListRequest` в cloudapi/image |
| BGOS-1140 | Опциональные поля `AccountID` и `SEPType` в структуру запроса `ListRequest` в cloudbroker/image |
| BGOS-1143 | Вычисляемое поле `RealSize` в структуру ответа `RecordImage` в cloudapi/image |
| BGOS-1143 | Вычисляемое поле `LinksTo` в структуру ответа `ItemImage` в cloudapi/image |
| BGOS-1143 | Вычисляемое поле `RealSize` в структуру ответа `RecordImage` в cloudbroker/image |
| BGOS-1143 | Вычисляемые поля `RealSize`, `CKey` и `Meta` в структуру ответа `ItemImage` в cloudbroker/image |
#### compute
#### locations
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1126 | Вычисляемые поля `PreviousReservesComputeResources` и `TakeOverResources` в структуру ответа `Resolution` в cloudbroker/compute |
| BGOS-1126 | Опциональное поле `TakeOverResources` в структуру запроса `MigrateV2ResolveRequest` в cloudbroker/compute |
| BGOS-1126 | Вычисляемое поле `Message` в структуру ответа `MigrateV2ResolveRecord` в cloudbroker/compute |
| BGOS-1126 | Вычисляемые поля `DisksCompleted`, `CompletedDisks`, `DisksTotal` и `CurrentDisk` в структуру ответа `ProgressDisks` в cloudbroker/compute |
| BGOS-1126 | Структуры ответа `CompletedDisk` и `CurrentDisk` в cloudbroker/compute |
| BGOS-1139 | Вычисляемые поля `SDNWeb` и `BVPWeb` в структуру ответа `ItemLocation` в cloudapi/locations |
#### zone
#### rg
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1127 | Вычисляемое поле `DRSPortSeed` в структуры ответа `ItemZone` и `RecordZone` в cloudbroker/zone |
| BGOS-1141 | Вычисляемое поле `Policies` в структуру ответа `Reservation` в cloudbroker/rg |
| BGOS-1141 | Структуры ответа `PolicyUsage` и `ResourceConsumptionLimits` в cloudbroker/rg |
| BGOS-1141 | Вычисляемое поле `Policies` в структуры ответа `Resource`, `RecordResourceUsage` в cloudapi/rg |
| BGOS-1141 | Структуры ответа `PolicyUsage` и `ResourceConsumptionLimits` в cloudapi/rg |
#### vins
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1142 | Вычисляемое поле `AutoAssignable` в структуру ответа `ItemReservation` в cloudapi/vins |
### Изменено
#### compute
#### basismpm
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1126 | Тип вычисляемого поля `UpdatedAt` с `uint64` на `float64` в структуре ответа `Observation` в cloudbroker/compute |
| BGOS-1126 | Тип вычисляемых полей `SampledAt`, `Percent` и `BytesPerSecond` с `uint64` на `float64` в структуре ответа `Memory` в cloudbroker/compute |
| BGOS-1126 | Тип вычисляемых полей `SampledAt`, `Percent` и `BytesPerSecond` с `uint64` на `float64` в структуре ответа `ProgressDisks` в cloudbroker/compute |
| BGOS-1126 | Тип вычисляемых полей `SampledAt`, `Percent` и `BytesPerSecond` с `uint64` на `float64` в структуре ответа `SystemDisk` в cloudbroker/compute |
| BGOS-1126 | Тип опционального поля `Storage` со `Storage` на `*Storage` в структуре запроса `MigrateV2Request` в cloudbroker/compute |
| BGOS-1126 | Тип поля `Targets` с опционального на обязательный в структуре запроса `Storage` в cloudbroker/compute |
| BGOS-1126 | Тэги `url` и `json` поля `Targets` с `targets` на `targets` в структуре запроса `Storage` в cloudbroker/compute |
| BGOS-1144 | Тип опциональных полей `PressureThreshold`, `DeflateThreshold`, `BufferPCT`, `GuaranteedPCT`, `ShrinkThresholdPCT`, `BalloonMaxShrinkPCT` и `BalloonMaxGrowPCT` с `uint64` на `float64` в структурах запроса `StartRequest` и `UpdateRequest` в cloudbroker/basismpm |
#### disks
#### rg
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1128 | Тэги `url` и `json` поля `KeepCurrentIOTune` с `keep_current_iot` на `keep_current_iotune` в структуре запроса `ChangeDiskStoragePolicyRequest` в cloudbroker/disks |
| BGOS-1128 | Тэги `url` и `json` поля `KeepCurrentIOTune` с `keep_current_iot` на `keep_current_iotune` в структуре запроса `ChangeDiskStoragePolicyRequest` в cloudapi/disks |
#### client sdk
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1134 | При получении от сервера ответа с HTTP-кодом ошибки клиенты `DecortClient`, `LegacyDecortClient` и `BVSDecortClient` теперь возвращают ошибку типа `HTTPError` с полями `StatusCode` и `Body`. Для проверки статусов добавлены функции `IsNotFound` и `HasStatusCode` |
| BGOS-1141 | Тип вычисляемого поля `ResourceLimits` с `ResourceLimits` на `ResourceConsumptionLimits` в структуре ответа `ItemResourceConsumption` в cloudbroker/rg |
| BGOS-1141 | Тип вычисляемого поля `ResourceLimits` с `ResourceLimits` на `ResourceConsumptionLimits` в структуре ответа `ItemResourceConsumption` в cloudapi/rg |
### Исправлено
#### client sdk
#### rg
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1135 | Исправлена ошибка в сообщении об ошибке при отсутствии времени истечения токена в клиенте |
| BGOS-1141 | JSON-тэг поля `RGID` с `rgid` на `id` в структуре ответа `ItemResourceConsumption` в cloudapi/rg |

View File

@@ -508,24 +508,24 @@ func migrateV2ModeValidator(fe validator.FieldLevel) bool {
// pressureThresholdValidator checks if PressureThreshold is in range from 5 to 50
func pressureThresholdValidator(fe validator.FieldLevel) bool {
fieldValue := fe.Field().Uint()
return fieldValue >= uint64(pressureThresholdMin) && fieldValue <= uint64(pressureThresholdMax)
fieldValue := fe.Field().Float()
return fieldValue >= float64(pressureThresholdMin) && fieldValue <= float64(pressureThresholdMax)
}
// deflateThresholdValidator checks if DeflateThreshold is in range from 10 to 70
func deflateThresholdValidator(fe validator.FieldLevel) bool {
fieldValue := fe.Field().Uint()
return fieldValue >= uint64(deflateThresholdMin) && fieldValue <= uint64(deflateThresholdMax)
fieldValue := fe.Field().Float()
return fieldValue >= float64(deflateThresholdMin) && fieldValue <= float64(deflateThresholdMax)
}
func bufferPCTValidator(fe validator.FieldLevel) bool {
fieldValue := fe.Field().Uint()
return fieldValue >= uint64(bufferPCTMin) && fieldValue <= uint64(bufferPCTMax)
fieldValue := fe.Field().Float()
return fieldValue >= float64(bufferPCTMin) && fieldValue <= float64(bufferPCTMax)
}
func guaranteedPCTValidator(fe validator.FieldLevel) bool {
fieldValue := fe.Field().Uint()
return fieldValue >= uint64(guaranteedPCTMin) && fieldValue <= uint64(guaranteedPCTMax)
fieldValue := fe.Field().Float()
return fieldValue >= float64(guaranteedPCTMin) && fieldValue <= float64(guaranteedPCTMax)
}
func guaranteedABSMinValidator(fe validator.FieldLevel) bool {
@@ -534,18 +534,18 @@ func guaranteedABSMinValidator(fe validator.FieldLevel) bool {
}
func shrinkThresholdPCTValidator(fe validator.FieldLevel) bool {
fieldValue := fe.Field().Uint()
return fieldValue >= uint64(shrinkThresholdPCTMin) && fieldValue <= uint64(shrinkThresholdPCTMax)
fieldValue := fe.Field().Float()
return fieldValue >= float64(shrinkThresholdPCTMin) && fieldValue <= float64(shrinkThresholdPCTMax)
}
func balloonMaxShrinkPCTValidator(fe validator.FieldLevel) bool {
fieldValue := fe.Field().Uint()
return fieldValue >= uint64(balloonMaxShrinkPCTMin) && fieldValue <= uint64(balloonMaxShrinkPCTMax)
fieldValue := fe.Field().Float()
return fieldValue >= float64(balloonMaxShrinkPCTMin) && fieldValue <= float64(balloonMaxShrinkPCTMax)
}
func balloonMaxGrowPCTValidator(fe validator.FieldLevel) bool {
fieldValue := fe.Field().Uint()
return fieldValue >= uint64(balloonMaxGrowPCTMin) && fieldValue <= uint64(balloonMaxGrowPCTMax)
fieldValue := fe.Field().Float()
return fieldValue >= float64(balloonMaxGrowPCTMin) && fieldValue <= float64(balloonMaxGrowPCTMax)
}
func vmChangeCooldownValidator(fe validator.FieldLevel) bool {
@@ -567,3 +567,8 @@ func logLevelValidator(fe validator.FieldLevel) bool {
fieldValue := fe.Field().String()
return IsInSlice(fieldValue, logLevelValues)
}
func sepTypesValidator(fe validator.FieldLevel) bool {
fieldValue := fe.Field().String()
return IsInSlice(fieldValue, sepTypesValues)
}

View File

@@ -367,6 +367,12 @@ func errorMessage(fe validator.FieldError) string {
prefix,
fe.Field(),
joinValues(sepTechStatusValues))
case "sepTypes":
return fmt.Sprintf("%s %s must be one of the following: %s",
prefix,
fe.Field(),
joinValues(sepTypesValues))
}
return fe.Error()

View File

@@ -398,5 +398,10 @@ func registerAllValidators(validate *validator.Validate) error {
return err
}
err = validate.RegisterValidation("sepTypes", sepTypesValidator)
if err != nil {
return err
}
return nil
}

View File

@@ -63,7 +63,7 @@ var (
loaderTypeValues = []string{"linux", "windows", "unknown"}
sepTypeValues = []string{"hitachi", "dorado", "tatlin", "shared", "local", "des", "ustor"}
sepTypeValues = []string{"hitachi", "dorado", "tatlin", "shared", "local", "des", "ustor", "aerodisk"}
languageValues = []string{"ru", "en"}
@@ -88,6 +88,8 @@ var (
migrateV2ModeValues = []string{"compute", "disks", "compute_and_disks"}
logLevelValues = []string{"DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"}
sepTypesValues = []string{"DES", "DORADO", "HITACHI", "LOCAL", "SHARED", "TATLIN", "USTOR", "AERODISK"}
)
const (

View File

@@ -122,6 +122,9 @@ type ItemAudit struct {
// Persistent disk IDs associated with the operation
DiskIDs []uint64 `json:"disk_ids"`
// VM folder ID
VMFolderID uint64 `json:"vmfolder_id"`
// API task ID for asynchronous calls
APITask string `json:"apitask"`
}

View File

@@ -59,6 +59,14 @@ type ListRequest struct {
// Required: false
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
// Sort by account ID
// Required: false
AccountID uint64 `url:"account_id,omitempty" json:"account_id,omitempty"`
// Sort by sep type
// Required: false
SEPType string `url:"sep_type,omitempty" json:"sep_type,omitempty" validate:"omitempty,sepTypes"`
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`

View File

@@ -32,6 +32,9 @@ type ItemImage struct {
// Link to
LinkTo uint64 `json:"linkTo"`
// Links to
LinksTo []uint64 `json:"linksTo"`
// Name
Name string `json:"name"`
@@ -214,4 +217,7 @@ type RecordImage struct {
// Version
Version string `json:"version"`
// Real size of the image
RealSize uint64 `json:"real_size"`
}

View File

@@ -46,6 +46,12 @@ type ItemLocation struct {
// Are VM Folders enabled
VMFoldersEnabled bool `json:"vm_folders_enabled"`
// SDN Web config
SDNWeb SDNWeb `json:"sdn_web"`
// BVP Web config
BVPWeb BVPWeb `json:"bvp_web"`
}
// List of locations
@@ -56,3 +62,27 @@ type ListLocations struct {
// Entry count
EntryCount uint64 `json:"entryCount"`
}
// SDN Web config
type SDNWeb struct {
// Whether the config is enabled
Enabled bool `json:"enabled"`
// URL
URL string `json:"url"`
// Number of the port
Port uint64 `json:"port"`
}
// BVP Web config
type BVPWeb struct {
// Whether the config is enabled
Enabled bool `json:"enabled"`
// URL
URL string `json:"url"`
// Number of ther port
Port uint64 `json:"port"`
}

View File

@@ -22,6 +22,9 @@ type Resource struct {
// SEPs
SEPs map[string]map[string]DiskUsage `json:"seps"`
// Policies
Policies map[string]PolicyUsage `json:"policies"`
}
// Disk usage
@@ -33,6 +36,21 @@ type DiskUsage struct {
DiskSizeMax float64 `json:"disksizemax"`
}
// Policy usage
type PolicyUsage struct {
// Disk size
DiskSize float64 `json:"disksize"`
// Max disk size
DiskSizeMax float64 `json:"disksizemax"`
// Limit
Limit float64 `json:"limit"`
// SEPs
SEPs map[string]map[string]DiskUsage `json:"seps"`
}
// Information about resources
type Resources struct {
// Current information about resources
@@ -51,10 +69,31 @@ type ItemResourceConsumption struct {
Reserved Resource `json:"reserved"`
// Resource limits
ResourceLimits ResourceLimits `json:"resourceLimits"`
ResourceLimits ResourceConsumptionLimits `json:"resourceLimits"`
// Resource group ID
RGID uint64 `json:"rgid"`
RGID uint64 `json:"id"`
}
// Resource limits of resource consumption
type ResourceConsumptionLimits struct {
// CUC
CUC float64 `json:"CU_C"`
// CUD
CUD float64 `json:"CU_D"`
// CUDM
CUDM float64 `json:"CU_DM"`
// CUI
CUI float64 `json:"CU_I"`
// CUM
CUM float64 `json:"CU_M"`
// GPU units
GPUUnits float64 `json:"gpu_units"`
}
type ListResourceConsumption struct {
@@ -892,4 +931,7 @@ type RecordResourceUsage struct {
// SEPs
SEPs map[string]map[string]DiskUsage `json:"seps"`
// Policies
Policies map[string]PolicyUsage `json:"policies"`
}

View File

@@ -844,6 +844,9 @@ type ItemReservation struct {
// Account ID
AccountID uint64 `json:"account_id"`
// Whether reservation is auto assignable
AutoAssignable bool `json:"auto_assignable"`
// IP
IP string `json:"ip"`

View File

@@ -77,6 +77,9 @@ type ItemAudit struct {
// Persistent disk IDs associated with the operation
DiskIDs []uint64 `json:"disk_ids"`
// VM folder ID
VMFolderID uint64 `json:"vmfolder_id"`
// API task ID for asynchronous calls
APITask string `json:"apitask"`
}
@@ -146,6 +149,9 @@ type RecordAudit struct {
// Compute ID
ComputeID uint64 `json:"compute_id"`
// VM folder ID
VMFolderID uint64 `json:"vmfolder_id"`
}
// List of Linked Jobs

View File

@@ -18,12 +18,12 @@ type StartRequest struct {
// Memory pressure threshold (%)
// Required: false
// Default: 20
PressureThreshold uint64 `url:"pressure_threshold,omitempty" json:"pressure_threshold,omitempty" validate:"omitempty,pressureThreshold"`
PressureThreshold float64 `url:"pressure_threshold,omitempty" json:"pressure_threshold,omitempty" validate:"omitempty,pressureThreshold"`
// Deflate threshold (%)
// Required: false
// Default: 30
DeflateThreshold uint64 `url:"deflate_threshold,omitempty" json:"deflate_threshold,omitempty" validate:"omitempty,deflateThreshold"`
DeflateThreshold float64 `url:"deflate_threshold,omitempty" json:"deflate_threshold,omitempty" validate:"omitempty,deflateThreshold"`
// Host reserved memory
// Required: false
@@ -33,12 +33,12 @@ type StartRequest struct {
// Buffer percentage (%)
// Required: false
// Default: 20
BufferPCT uint64 `url:"buffer_pct,omitempty" json:"buffer_pct,omitempty" validate:"omitempty,bufferPCT"`
BufferPCT float64 `url:"buffer_pct,omitempty" json:"buffer_pct,omitempty" validate:"omitempty,bufferPCT"`
// Guaranteed memory percentage (%)
// Required: false
// Default: 25
GuaranteedPCT uint64 `url:"guaranteed_pct,omitempty" json:"guaranteed_pct,omitempty" validate:"omitempty,guaranteedPCT"`
GuaranteedPCT float64 `url:"guaranteed_pct,omitempty" json:"guaranteed_pct,omitempty" validate:"omitempty,guaranteedPCT"`
// Absolute minimum guaranteed memory (MB)
// Required: false
@@ -48,17 +48,17 @@ type StartRequest struct {
// Shrink threshold percentage (%)
// Required: false
// Default: 50
ShrinkThresholdPCT uint64 `url:"shrink_threshold_pct,omitempty" json:"shrink_threshold_pct,omitempty" validate:"omitempty,shrinkThresholdPCT"`
ShrinkThresholdPCT float64 `url:"shrink_threshold_pct,omitempty" json:"shrink_threshold_pct,omitempty" validate:"omitempty,shrinkThresholdPCT"`
// Max shrink percentage per cycle (%)
// Required: false
// Default: 10
BalloonMaxShrinkPCT uint64 `url:"balloon_max_shrink_pct,omitempty" json:"balloon_max_shrink_pct,omitempty" validate:"omitempty,balloonMaxShrinkPCT"`
BalloonMaxShrinkPCT float64 `url:"balloon_max_shrink_pct,omitempty" json:"balloon_max_shrink_pct,omitempty" validate:"omitempty,balloonMaxShrinkPCT"`
// Max grow percentage per cycle (%)
// Required: false
// Default: 10
BalloonMaxGrowPCT uint64 `url:"balloon_max_grow_pct,omitempty" json:"balloon_max_grow_pct,omitempty" validate:"omitempty,balloonMaxGrowPCT"`
BalloonMaxGrowPCT float64 `url:"balloon_max_grow_pct,omitempty" json:"balloon_max_grow_pct,omitempty" validate:"omitempty,balloonMaxGrowPCT"`
// VM change cooldown (seconds)
// Required: false

View File

@@ -18,12 +18,12 @@ type UpdateRequest struct {
// Memory pressure threshold (%)
// Required: false
// Default: 20
PressureThreshold uint64 `url:"pressure_threshold,omitempty" json:"pressure_threshold,omitempty" validate:"omitempty,pressureThreshold"`
PressureThreshold float64 `url:"pressure_threshold,omitempty" json:"pressure_threshold,omitempty" validate:"omitempty,pressureThreshold"`
// Deflate threshold (%)
// Required: false
// Default: 30
DeflateThreshold uint64 `url:"deflate_threshold,omitempty" json:"deflate_threshold,omitempty" validate:"omitempty,deflateThreshold"`
DeflateThreshold float64 `url:"deflate_threshold,omitempty" json:"deflate_threshold,omitempty" validate:"omitempty,deflateThreshold"`
// Host reserved memory
// Required: false
@@ -33,12 +33,12 @@ type UpdateRequest struct {
// Buffer percentage (%)
// Required: false
// Default: 20
BufferPCT uint64 `url:"buffer_pct,omitempty" json:"buffer_pct,omitempty" validate:"omitempty,bufferPCT"`
BufferPCT float64 `url:"buffer_pct,omitempty" json:"buffer_pct,omitempty" validate:"omitempty,bufferPCT"`
// Guaranteed memory percentage (%)
// Required: false
// Default: 25
GuaranteedPCT uint64 `url:"guaranteed_pct,omitempty" json:"guaranteed_pct,omitempty" validate:"omitempty,guaranteedPCT"`
GuaranteedPCT float64 `url:"guaranteed_pct,omitempty" json:"guaranteed_pct,omitempty" validate:"omitempty,guaranteedPCT"`
// Absolute minimum guaranteed memory (MB)
// Required: false
@@ -48,17 +48,17 @@ type UpdateRequest struct {
// Shrink threshold percentage (%)
// Required: false
// Default: 50
ShrinkThresholdPCT uint64 `url:"shrink_threshold_pct,omitempty" json:"shrink_threshold_pct,omitempty" validate:"omitempty,shrinkThresholdPCT"`
ShrinkThresholdPCT float64 `url:"shrink_threshold_pct,omitempty" json:"shrink_threshold_pct,omitempty" validate:"omitempty,shrinkThresholdPCT"`
// Max shrink percentage per cycle (%)
// Required: false
// Default: 10
BalloonMaxShrinkPCT uint64 `url:"balloon_max_shrink_pct,omitempty" json:"balloon_max_shrink_pct,omitempty" validate:"omitempty,balloonMaxShrinkPCT"`
BalloonMaxShrinkPCT float64 `url:"balloon_max_shrink_pct,omitempty" json:"balloon_max_shrink_pct,omitempty" validate:"omitempty,balloonMaxShrinkPCT"`
// Max grow percentage per cycle (%)
// Required: false
// Default: 10
BalloonMaxGrowPCT uint64 `url:"balloon_max_grow_pct,omitempty" json:"balloon_max_grow_pct,omitempty" validate:"omitempty,balloonMaxGrowPCT"`
BalloonMaxGrowPCT float64 `url:"balloon_max_grow_pct,omitempty" json:"balloon_max_grow_pct,omitempty" validate:"omitempty,balloonMaxGrowPCT"`
// VM change cooldown (seconds)
// Required: false

View File

@@ -0,0 +1,64 @@
package compute
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/constants"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
type Pin struct {
// ID of the compute instance
// Required: true
ComputeID uint64 `url:"compute_id" json:"compute_id" validate:"required"`
// Target node ID. Required for stopped computes.
// For started computes it is optional;
// if it differs from the current node, allow_migration must be true,
// otherwise the compute is reported with migration_not_allowed error.
// Required: false
NodeID uint64 `url:"node_id,omitempty" json:"node_id,omitempty"`
}
// MassPinToNodeRequest to pin multiple computes to nodes in a single call
type MassPinToNodeRequest struct {
// Computes to pin, at most 200 items per request
// Required: true
Pins []Pin `url:"pins" json:"pins" validate:"required,min=1,max=200,dive"`
// Allow live migration of started computes to the requested node_id
// Default: false
// Required: false
AllowMigration interface{} `url:"allow_migration,omitempty" json:"allow_migration,omitempty" validate:"omitempty,isBool"`
// Start compute after node exits from MAINTENANCE state
// Default: false
// Required: false
AutoStart interface{} `url:"auto_start,omitempty" json:"auto_start,omitempty" validate:"omitempty,isBool"`
}
// MassPinToNode pins multiple computes to nodes in a single call
func (c Compute) MassPinToNode(ctx context.Context, req MassPinToNodeRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/compute/mass_pin_to_node"
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil {
return "", err
}
var resp string
err = json.Unmarshal(res, &resp)
if err != nil {
return "", err
}
return resp, nil
}

View File

@@ -120,6 +120,12 @@ type RecordGrid struct {
// Whether VM folders are enabled
VMFoldersEnabled bool `json:"vm_folders_enabled"`
// SDN Web config
SDNWeb SDNWeb `json:"sdn_web"`
// BVP Web config
BVPWeb BVPWeb `json:"bvp_web"`
}
// Information about grid
@@ -171,6 +177,36 @@ type ItemGridList struct {
// Whether VM folders are enabled
VMFoldersEnabled bool `json:"vm_folders_enabled"`
// SDN Web config
SDNWeb SDNWeb `json:"sdn_web"`
// BVP Web config
BVPWeb BVPWeb `json:"bvp_web"`
}
// SDN Web config
type SDNWeb struct {
// Whether the config is enabled
Enabled bool `json:"enabled"`
// URL
URL string `json:"url"`
// Number of the port
Port uint64 `json:"port"`
}
// BVP Web config
type BVPWeb struct {
// Whether the config is enabled
Enabled bool `json:"enabled"`
// URL
URL string `json:"url"`
// Number of the port
Port uint64 `json:"port"`
}
// List Grids

View File

@@ -59,6 +59,14 @@ type ListRequest struct {
// Required: false
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
// Sort by account ID
// Required: false
AccountID uint64 `url:"account_id,omitempty" json:"account_id,omitempty"`
// Sort by sep type
// Required: false
SEPType string `url:"sep_type,omitempty" json:"sep_type,omitempty" validate:"omitempty,sepTypes"`
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`

View File

@@ -89,6 +89,9 @@ type RecordImage struct {
// Purge attempts
PurgeAttempts uint64 `json:"purgeAttempts"`
// Real size if the image
RealSize uint64 `json:"real_size"`
// Reference ID
ReferenceID string `json:"referenceId"`
@@ -277,6 +280,15 @@ type ItemImage struct {
// Virtual
Virtual bool `json:"virtual"`
// Real size of the image
RealSize uint64 `json:"real_size"`
// CKey
CKey string `json:"_ckey"`
// Meta info
Meta interface{} `json:"_meta"`
}
// List images

View File

@@ -43,6 +43,9 @@ type Reservation struct {
// SEPs
SEPs map[string]map[string]DiskUsage `json:"seps"`
// Policies
Policies map[string]PolicyUsage `json:"policies"`
}
// Disk usage
@@ -54,6 +57,21 @@ type DiskUsage struct {
DiskSizeMax float64 `json:"disksizemax"`
}
// Policy usage
type PolicyUsage struct {
// Disk size
DiskSize float64 `json:"disksize"`
// Max disk size
DiskSizeMax float64 `json:"disksizemax"`
// Limit
Limit float64 `json:"limit"`
// SEPs
SEPs map[string]map[string]DiskUsage `json:"seps"`
}
// Resources usage information
type ItemResourceConsumption struct {
// Current information
@@ -63,12 +81,33 @@ type ItemResourceConsumption struct {
Reserved Reservation `json:"Reserved"`
// Resource limits
ResourceLimits ResourceLimits `json:"resourceLimits"`
ResourceLimits ResourceConsumptionLimits `json:"resourceLimits"`
// Resource group ID
RGID uint64 `json:"id"`
}
// Resource limits of resource consumption
type ResourceConsumptionLimits struct {
// CUC
CUC float64 `json:"CU_C"`
// CUD
CuD float64 `json:"CU_D"`
// CUDM
CUDM float64 `json:"CU_DM"`
// CUI
CUI float64 `json:"CU_I"`
// CUM
CUM float64 `json:"CU_M"`
// GPU units
GPUUnits float64 `json:"gpu_units"`
}
type ListResourceConsumption struct {
// Data
Data []ItemResourceConsumption `json:"data"`

View File

@@ -16,7 +16,7 @@ type AddPoolRequest struct {
SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
// Pool structure which contains fields such as "name", "usage_limit", "types", "system", "accessAccountIds", "accessResGroupIds". Added fields for other pool types: Des, Ovs - "uris" list of "ip, port".
// Dorado, Tatlin - "vdisk_discard". Hitachi - "id", "snapshotable", "snapshot_pool_id", "minLdevId", "maxLdevId", "clone_technology", "vdisk_discard". Shared - "description", "wwns", "allocate_type", "stripes", "metadata_size", "metadatatalun", "vdisk_discard" Local - "description", "node_consumer", "block_disk".
// Dorado, Tatlin - "vdisk_discard". Hitachi - "id", "snapshotable", "snapshot_pool_id", "minLdevId", "maxLdevId", "clone_technology", "vdisk_discard". Shared - "description", "wwns", "allocate_type", "stripes", "metadata_size", "metadatatalun", "vdisk_discard" Local - "description", "node_consumer", "block_disk", Aerodisk – "provision", "clone_technology", "disk_block_size", "read_only"..
// Required: true
Pool string `url:"pool" json:"pool" validate:"required"`
}

View File

@@ -713,6 +713,7 @@ func getRequestsMapCloudbroker() map[string]interface{} {
"/restmachine/cloudbroker/compute/migrate_v2_abort": compute_cb.MigrateV2AbortRequest{},
"/restmachine/cloudbroker/compute/migrate_v2_cleanup": compute_cb.MigrateV2CleanupRequest{},
"/restmachine/cloudbroker/compute/migrate_v2": compute_cb.MigrateV2Request{},
"/restmachine/cloudbroker/compute/mass_pin_to_node": compute_cb.MassPinToNodeRequest{},
// disks
"/restmachine/cloudbroker/disks/change_disk_storage_policy": disks_cb.ChangeDiskStoragePolicyRequest{},