diff --git a/CHANGELOG.md b/CHANGELOG.md
index fe24df3..993d48f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,64 +1,40 @@
-## Version 1.10.0
+## Version 1.10.1
### Добавлено
#### compute
| Идентификатор
задачи | Описание |
| --- | --- |
-| BGOS-204 | Вычисляемое поле `VNCPassword` в моделях `RecordCompute` в cloudapi/compute и cloudbroker/compute |
-| BGOS-204 | Опциональное поле `CDImageID` в структуре `ListRequest` в cloudbroker/compute |
-| BGOS-211 | Вычисляемое поле `AutoStart` в моделях `RecordCompute, ItemCompute, InfoCompute` в cloudapi/compute и cloudbroker/compute |
-| BGOS-211 | Опциональное поле `AutoStart` в структурах `PinToStackRequest, UpdateRequest` в cloudapi/compute и cloudbroker/compute |
+| BGOS-268 | Вычисляемое поле `PreferredCPU` в моделях `RecordCompute, ItemCompute, InfoCompute` в cloudapi/compute и cloudbroker/compute |
+| BGOS-268 | Опциональное поле `PreferredCPU` в структурах `ResizeRequest, UpdateRequest` в cloudapi/compute и cloudbroker/compute |
-#### extnet
+#### kvmx86
| Идентификатор
задачи | Описание |
| --- | --- |
-| BGOS-204 | Вычисляемое поле `AccountID` в модели `ItemReservation` в cloudapi/extnet и cloudbroker/extnet |
-| BGOS-205 | Методы API `cloudbroker/extnet/addReservedIp, cloudbroker/extnet/getReservedIp, cloudapi/extnet/getReservedIp, cloudbroker/extnet/delReservedIp` в cloudapi/extnet и cloudbroker/extnet |
-
-#### image
-| Идентификатор
задачи | Описание |
-| --- | --- |
-| BGOS-214 | Вычисляемое поле `SnapshotID` в модели `RecordImage, ItemImage` в cloudbroker/image |
+| BGOS-268 | Опциональное поле `PreferredCPU` в структурах `CreateRequest, CreateBlankRequest` в cloudapi/kvmx86 и cloudbroker/kvmx86 |
#### node
| Идентификатор
задачи | Описание |
| --- | --- |
-| BGOS-204 | Обязательное поле `Spoofchk` в структуре `SetVFsNumberRequest` в cloudbroker/node |
-| BGOS-213 | Вычисляемое поле `NetAddr` в модели `RecordNode` в cloudbroker/node |
+| BGOS-270 | Вычисляемые поля `DPDK, UEFIFirmwareFile` в модели `ItemNode` в cloudbroker/node |
+| BGOS-271 | Вычисляемые поля `DPDK, NetworkMode, ToActive, ToInstalling, ToMaintenance, ToRestricted` в моделях `RecordNode` в cloudbroker/node |
-#### vgpu
+#### sep
| Идентификатор
задачи | Описание |
| --- | --- |
-| BGOS-204 | Опциональное поле `NID` в структуре `ListRequest` в cloudbroker/vgpu |
+| BGOS-273 | Вычисляемое поле `MultipathNum` в модели `RecordSEP` cloudbroker/sep |
#### vins
| Идентификатор
задачи | Описание |
| --- | --- |
-| BGOS-204 | Вычисляемое поле `VNCPassword` в модели `RecordVNFDev` в cloudapi/vins и cloudbroker/vins |
-| BGOS-204 | Вычисляемое поле `AccoundID` в модели `ItemReservation` в cloudapi/vins |
+| BGOS-265 | Вычисляемое поле `AccoundID` в модели `ItemReservation` в cloudbroker/vins |
### Удалено
-#### disks
-| Идентификатор
задачи | Описание |
-| --- | --- |
-| BGOS-206 | Метод `Resize` в cloudapi/disks и cloudbroker/disks |
-
#### sep
| Идентификатор
задачи | Описание |
| --- | --- |
-| BGOS-206 | Метод `UpdateCapacityLimit` cloudbroker/sep |
+| BGOS-272 | Вычисляемые поля `_ckey,_meta` в модели `RecordSEP` в cloudbroker/sep |
-#### vins
-| Идентификатор
задачи | Описание |
-| --- | --- |
-| BGOS-204 | Вычисляемые поля `ClientType,Description,DomainName,Hostname` в модели `ItemReservation` в cloudapi/vins и cloudbroker/vins |
-| BGOS-204 | Вычисляемое поле `СomputeIds` в структуре `StaticRouteAddRequest` в cloudapi/vins и cloudbroker/vins |
-### Исправлено
-#### compute
-| Идентификатор
задачи | Описание |
-| --- | --- |
-| BATF-215 | Изменены возвращаемые параметры метода `PinToStack` на `bool,error` в cloudapi/compute |
\ No newline at end of file
diff --git a/internal/validators/custom.go b/internal/validators/custom.go
index fd3187c..56d190f 100644
--- a/internal/validators/custom.go
+++ b/internal/validators/custom.go
@@ -378,6 +378,21 @@ func chipsetValidator(fe validator.FieldLevel) bool {
return IsInSlice(fieldValue, chipsetValues)
}
+func preferredCPUValidator(fe validator.FieldLevel) bool {
+ fieldSlice, ok := fe.Field().Interface().([]int64)
+ if !ok {
+ return false
+ }
+
+ for _, value := range fieldSlice {
+ if value < -1 {
+ return false
+ }
+ }
+
+ return true
+}
+
// ValidateRAM checks if request contains RAM value that is positive integer divisible by divisibility passed.
// It is recommended to pass constants.RAM_DIVISIBILITY as divisility arguement
func ValidateRAM(r interfaces.RequestWithRAM, divisibility uint64) error {
diff --git a/internal/validators/messages.go b/internal/validators/messages.go
index 72b4100..3ec169b 100644
--- a/internal/validators/messages.go
+++ b/internal/validators/messages.go
@@ -94,6 +94,9 @@ func errorMessage(fe validator.FieldError) string {
case "mtu":
return fmt.Sprint(prefix, fe.Field(), "must be ", mtuMin, "-", mtuMax)
+ case "preferredCPU":
+ return fmt.Sprint(prefix, fe.Field(), "must be equal to or greater than", -1)
+
case "computex86NetType":
return fmt.Sprintf("%s %s must be one of the following: %s",
prefix,
diff --git a/internal/validators/validator.go b/internal/validators/validator.go
index 829eb95..49f295a 100644
--- a/internal/validators/validator.go
+++ b/internal/validators/validator.go
@@ -261,5 +261,10 @@ func registerAllValidators(validate *validator.Validate) error {
return err
}
+ err = validate.RegisterValidation("preferredCPU", preferredCPUValidator)
+ if err != nil {
+ return err
+ }
+
return nil
}
diff --git a/pkg/cloudapi/compute/models.go b/pkg/cloudapi/compute/models.go
index a4dad63..0037ae7 100644
--- a/pkg/cloudapi/compute/models.go
+++ b/pkg/cloudapi/compute/models.go
@@ -428,6 +428,9 @@ type RecordCompute struct {
// Pinned or not
Pinned bool `json:"pinned"`
+ // PreferredCPU
+ PreferredCPU []int64 `json:"preferredCpu"`
+
// Number of RAM
RAM uint64 `json:"ram"`
@@ -980,6 +983,9 @@ type ItemCompute struct {
// Pinned or not
Pinned bool `json:"pinned"`
+ // PreferredCPU
+ PreferredCPU []int64 `json:"preferredCpu"`
+
// Number of RAM
RAM uint64 `json:"ram"`
diff --git a/pkg/cloudapi/compute/resize.go b/pkg/cloudapi/compute/resize.go
index 81cddda..3626838 100644
--- a/pkg/cloudapi/compute/resize.go
+++ b/pkg/cloudapi/compute/resize.go
@@ -27,6 +27,10 @@ type ResizeRequest struct {
// Force compute resize
// Required: false
Force bool `url:"force,omitempty" json:"force,omitempty"`
+
+ // Recommended isolated CPUs. Field is ignored if compute.cpupin=False or compute.pinned=False
+ // Required: false
+ PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"`
}
// GetRAM returns RAM field values
diff --git a/pkg/cloudapi/compute/update.go b/pkg/cloudapi/compute/update.go
index 6f50f1c..4b7d464 100644
--- a/pkg/cloudapi/compute/update.go
+++ b/pkg/cloudapi/compute/update.go
@@ -48,6 +48,10 @@ type UpdateRequest struct {
// Required: false
// Default: false
AutoStart bool `url:"autoStart" json:"autoStart"`
+
+ // Recommended isolated CPUs. Field is ignored if compute.cpupin=False or compute.pinned=False
+ // Required: false
+ PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"`
}
// Update updates some properties of the compute
diff --git a/pkg/cloudapi/kvmx86/create.go b/pkg/cloudapi/kvmx86/create.go
index 2aa948c..90ac936 100644
--- a/pkg/cloudapi/kvmx86/create.go
+++ b/pkg/cloudapi/kvmx86/create.go
@@ -164,6 +164,10 @@ type CreateRequest struct {
// Required: false
// Default: false
HPBacked bool `url:"hpBacked" json:"hpBacked"`
+
+ // Recommended isolated CPUs. Field is ignored if compute.cpupin=False or compute.pinned=False
+ // Required: false
+ PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"`
}
// GetRAM returns RAM field values
diff --git a/pkg/cloudapi/kvmx86/create_blank.go b/pkg/cloudapi/kvmx86/create_blank.go
index b02c69d..892df50 100644
--- a/pkg/cloudapi/kvmx86/create_blank.go
+++ b/pkg/cloudapi/kvmx86/create_blank.go
@@ -68,6 +68,10 @@ type CreateBlankRequest struct {
// Text description of this VM
// Required: false
Description string `url:"desc,omitempty" json:"desc,omitempty"`
+
+ // Recommended isolated CPUs. Field is ignored if compute.cpupin=False or compute.pinned=False
+ // Required: false
+ PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"`
}
// GetRAM returns RAM field values
diff --git a/pkg/cloudbroker/audit/export_audits_to_file.go b/pkg/cloudbroker/audit/export_audits_to_file.go
index e0dc5fb..de9f2fa 100644
--- a/pkg/cloudbroker/audit/export_audits_to_file.go
+++ b/pkg/cloudbroker/audit/export_audits_to_file.go
@@ -9,7 +9,7 @@ import (
func (a Audit) ExportAuditsToFile(ctx context.Context) ([]byte, error) {
url := "/cloudbroker/audit/exportAuditsToFile"
- res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, nil)
+ res, err := a.client.DecortApiCall(ctx, http.MethodGet, url, nil)
if err != nil {
return nil, err
}
diff --git a/pkg/cloudbroker/compute/models.go b/pkg/cloudbroker/compute/models.go
index a59627b..a5f73cc 100644
--- a/pkg/cloudbroker/compute/models.go
+++ b/pkg/cloudbroker/compute/models.go
@@ -732,6 +732,9 @@ type InfoCompute struct {
// Pinned
Pinned bool `json:"pinned"`
+ // PreferredCPU
+ PreferredCPU []int64 `json:"preferredCpu"`
+
// Number of RAM
RAM uint64 `json:"ram"`
@@ -981,6 +984,9 @@ type RecordCompute struct {
// Pinned
Pinned bool `json:"pinned"`
+ // PreferredCPU
+ PreferredCPU []int64 `json:"preferredCpu"`
+
// Number of RAM
RAM uint64 `json:"ram"`
diff --git a/pkg/cloudbroker/compute/resize.go b/pkg/cloudbroker/compute/resize.go
index 2d2e50a..a50268c 100644
--- a/pkg/cloudbroker/compute/resize.go
+++ b/pkg/cloudbroker/compute/resize.go
@@ -27,6 +27,10 @@ type ResizeRequest struct {
// Force compute resize
// Required: false
Force bool `url:"force,omitempty" json:"force,omitempty"`
+
+ // Recommended isolated CPUs. Field is ignored if compute.cpupin=False or compute.pinned=False
+ // Required: false
+ PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"`
}
// GetRAM returns RAM field values
diff --git a/pkg/cloudbroker/compute/update.go b/pkg/cloudbroker/compute/update.go
index 88cbf3a..860ad58 100644
--- a/pkg/cloudbroker/compute/update.go
+++ b/pkg/cloudbroker/compute/update.go
@@ -48,6 +48,10 @@ type UpdateRequest struct {
// Required: false
// Default: false
AutoStart bool `url:"autoStart" json:"autoStart"`
+
+ // Recommended isolated CPUs. Field is ignored if compute.cpupin=False or compute.pinned=False
+ // Required: false
+ PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"`
}
// Update updates some properties of the compute
diff --git a/pkg/cloudbroker/kvmx86/create.go b/pkg/cloudbroker/kvmx86/create.go
index 77590f6..687610d 100644
--- a/pkg/cloudbroker/kvmx86/create.go
+++ b/pkg/cloudbroker/kvmx86/create.go
@@ -168,6 +168,10 @@ type CreateRequest struct {
// Required: false
// Default: false
HPBacked bool `url:"hpBacked" json:"hpBacked"`
+
+ // Recommended isolated CPUs. Field is ignored if compute.cpupin=False or compute.pinned=False
+ // Required: false
+ PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"`
}
// GetRAM returns RAM field values
diff --git a/pkg/cloudbroker/kvmx86/create_blank.go b/pkg/cloudbroker/kvmx86/create_blank.go
index 648443a..084a197 100644
--- a/pkg/cloudbroker/kvmx86/create_blank.go
+++ b/pkg/cloudbroker/kvmx86/create_blank.go
@@ -68,6 +68,10 @@ type CreateBlankRequest struct {
// Type of the emulated system, Q35 or i440fx
// Required: false
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
+
+ // Recommended isolated CPUs. Field is ignored if compute.cpupin=False or compute.pinned=False
+ // Required: false
+ PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"`
}
// GetRAM returns RAM field values
diff --git a/pkg/cloudbroker/node/models.go b/pkg/cloudbroker/node/models.go
index d599e85..9835010 100644
--- a/pkg/cloudbroker/node/models.go
+++ b/pkg/cloudbroker/node/models.go
@@ -11,6 +11,9 @@ type RecordNode struct {
// CPU Allocation Ratio
CPUAllocationRatio float64 `json:"cpu_allocation_ratio"`
+ // DPDK info
+ DPDK DPDK `json:"dpdk"`
+
// GID
GID uint64 `json:"gid"`
@@ -32,6 +35,9 @@ type RecordNode struct {
// Netaddr
NetAddr NetAddr `json:"netaddr"`
+ // Network mode
+ NetworkMode string `json:"networkmode"`
+
// Nic Info
NicInfo ListNicInfo `json:"nicInfo"`
@@ -53,6 +59,18 @@ type RecordNode struct {
// Status
Status string `json:"status"`
+ // To active
+ ToActive Role `json:"to_active"`
+
+ // To installing
+ ToInstalling Role `json:"to_installing"`
+
+ // To maintenance
+ ToMaintenance Role `json:"to_maintenance"`
+
+ // To restricted
+ ToRestricted Role `json:"to_restricted"`
+
// Version
Version string `json:"version"`
}
@@ -125,6 +143,9 @@ type ItemNode struct {
// Description
Description string `json:"description"`
+ // DPDK
+ DPDK DPDK `json:"dpdk"`
+
// GID
GID uint64 `json:"gid"`
@@ -227,6 +248,9 @@ type ItemNode struct {
// Type
Type string `json:"type"`
+ //UEFI Firmware File
+ UEFIFirmwareFile string `json:"uefiFirmwareFile"`
+
// Version
Version string `json:"version"`
}
@@ -326,3 +350,33 @@ type NetAddr struct {
// IP list backplane1 node
IP []string `json:"ip"`
}
+
+// DPDK info
+type DPDK struct {
+ // Bridges
+ Bridges Bridges `json:"bridges"`
+
+ // hp memory
+ HPMemory map[string]uint64 `json:"hp_memory"`
+
+ // pmd cpu
+ PMDCPU []uint64 `json:"pmd_cpu"`
+}
+
+// Bridges
+type Bridges struct {
+ Backplane1 Backplane1 `json:"backplane1"`
+}
+
+// Backplane1
+type Backplane1 struct {
+ Interfaces []string `json:"interfaces"`
+ NumaNode uint64 `json:"numa_node"`
+}
+
+// Role
+type Role struct {
+ Actor string `json:"actor"`
+ Reason string `json:"reason"`
+ Time uint64 `json:"time"`
+}
diff --git a/pkg/cloudbroker/sep/models.go b/pkg/cloudbroker/sep/models.go
index 39bfb5d..f22c31a 100644
--- a/pkg/cloudbroker/sep/models.go
+++ b/pkg/cloudbroker/sep/models.go
@@ -25,7 +25,7 @@ type Total struct {
}
type ByPool struct {
-
+
// Disk count
DiskCount uint64 `json:"disk_count"`
@@ -101,12 +101,6 @@ type SEPConfig map[string]interface{}
// Detailed information about SEP
type RecordSEP struct {
- // CKey
- CKey string `json:"_ckey"`
-
- // Meta
- Meta []interface{} `json:"_meta"`
-
// Config
Config SEPConfig `json:"config"`
@@ -128,6 +122,9 @@ type RecordSEP struct {
// Milestones
Milestones uint64 `json:"milestones"`
+ // MultipathNum
+ MultipathNum uint64 `json:"multipathNum"`
+
// Name
Name string `json:"name"`
diff --git a/pkg/cloudbroker/vins/models.go b/pkg/cloudbroker/vins/models.go
index 5675c3f..3e3a2be 100644
--- a/pkg/cloudbroker/vins/models.go
+++ b/pkg/cloudbroker/vins/models.go
@@ -242,6 +242,9 @@ type VNFDev struct {
// Main information about reservation
type ItemReservation struct {
+ // Account ID
+ AccountID uint64 `json:"account_id"`
+
// IP
IP string `json:"ip"`