diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a42802..56f0af7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## Version 15.1.0 +## Version 15.2.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 и в следующих версиях будут удалены @@ -7,52 +7,35 @@ Все методы группы `.SDN()` находятся в альфа-версии. + ### Добавлено -#### Общее +#### image | Идентификатор задачи | Описание | | --- | --- | -| BGOS-899 | Добавлена валидация полей `ssoUrl` и `decortUrl` в конфигах `Config`, `BVSConfig` и `LegacyConfig`, а также поля `domain` в конфиге `BVSConfig` при вызове конструкторов `New`, `NewBVS`, `NewLegacy` | - -#### kvmx86 -| Идентификатор задачи | Описание | -| --- | --- | -| BGOS-903 | Структура ответа `MassCreateError` в cloudbroker/kvmx86 | +| BGOS-916 | Вычисляемые поля `Compute` и `MemoryDumpImage` в структуру ответа `ItemSnapSet` в cloudapi/image | #### node | Идентификатор задачи | Описание | | --- | --- | -| BGOS-906 | Метод `Install` и структура запроса `InstallRequest` в cloudbroker/node | +| BGOS-919 | Вычисляемое поле `MaxSupportedGeneration` в структуру ответа `CpuInfo` в cloudbroker/node | #### zone | Идентификатор задачи | Описание | | --- | --- | -| BGOS-902 | Вычисляемое поле `SupportedCpuModels` в структуру ответа `TestCPUAlignmentProfileResult` в cloudbroker/zone | -| BGOS-902 | Структура ответа `SupportedCpuModel` в cloudbroker/zone | +| BGOS-914 | Вычисляемые поля `ID`, `Name` и `ConsumedBy` в структуру ответа `RecordConsumption` в cloudbroker/sep | +| BGOS-914 | Структура ответа `ListConsumption` в cloudbroker/sep | + ### Изменено -#### compute +#### account | Идентификатор задачи | Описание | | --- | --- | -| BGOS-905 | Тип полей `Login` и `Password` с опциональных на обязательные в структуре `OSUser` в cloudbroker/compute | +| BGOS-918 | Тип обязательного поля `Ratio` с `float64` на `uint64` в структуре запроса `SetCPUAllocationRatioRequest` в cloudbroker/account | -#### zone -| Идентификатор
задачи | Описание | -| --- | --- | -| BGOS-902 | Тип поля `Percentage` с `uint64` на `float64` в структуре ответа `CpuAlignmentProfileCandidate` в cloudbroker/zone | - -#### SDN logicalports +#### SEP | Идентификатор задачи | Описание | | --- | --- | -| BGOS-907 | Тип поля `MAC` с опционального на обязательное в структуре `AddAddress` в sdn/logicalports | - - -### Удалено - -#### compute -| Идентификатор задачи | Описание | -| --- | --- | -| BGOS-904 | Опциональное поле `Force` из структуры запроса `MigrateRequest` в cloudbroker/compute | - - +| BGOS-914 | Тип поля `SEPID` с обязательного на опциональный в структуре запроса `ConsumptionRequest` в cloudbroker/sep | +| BGOS-914 | Тип ответа метода `Consumption` с `RecordConsumption` на `ListConsumption` в cloudbroker/sep | diff --git a/pkg/cloudapi/compute/boot_order_get.go b/pkg/cloudapi/compute/boot_order_get.go index d7d060c..6bfb9a7 100644 --- a/pkg/cloudapi/compute/boot_order_get.go +++ b/pkg/cloudapi/compute/boot_order_get.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators" ) diff --git a/pkg/cloudapi/compute/boot_order_set.go b/pkg/cloudapi/compute/boot_order_set.go index 38fd93b..bae4bba 100644 --- a/pkg/cloudapi/compute/boot_order_set.go +++ b/pkg/cloudapi/compute/boot_order_set.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators" ) diff --git a/pkg/cloudapi/compute/models.go b/pkg/cloudapi/compute/models.go index 4bd21b9..656e137 100644 --- a/pkg/cloudapi/compute/models.go +++ b/pkg/cloudapi/compute/models.go @@ -86,7 +86,7 @@ type ItemSnapshot struct { // Compute info Compute RecordCompute `json:"compute"` - // List disk ID + // List of disk IDs Disks []uint64 `json:"disks"` // GUID @@ -690,7 +690,10 @@ type ListOSUser []ItemOSUser // Main information about snapsets type ItemSnapSet struct { - // List disk IDs + // Compute info + Compute RecordCompute `json:"compute"` + + // List disk ID Disks []uint64 `json:"disks"` // GUID @@ -699,6 +702,9 @@ type ItemSnapSet struct { // Label Label string `json:"label"` + // Memory dump image ID + MemoryDumpImage uint64 `json:"memory_dump_image"` + // Timestamp Timestamp uint64 `json:"timestamp"` } diff --git a/pkg/cloudapi/image/list.go b/pkg/cloudapi/image/list.go index e154d70..af20d2b 100644 --- a/pkg/cloudapi/image/list.go +++ b/pkg/cloudapi/image/list.go @@ -5,6 +5,7 @@ import ( "encoding/json" "net/http" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/constants" "repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators" ) @@ -102,6 +103,6 @@ func (i Image) ListRaw(ctx context.Context, req ListRequest) ([]byte, error) { url := "/cloudapi/image/list" - res, err := i.client.DecortApiCall(ctx, http.MethodPost, url, req) + res, err := i.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req) return res, err } diff --git a/pkg/cloudapi/pcidevice/serialize.go b/pkg/cloudapi/pcidevice/serialize.go index 062bd2e..46fcb09 100644 --- a/pkg/cloudapi/pcidevice/serialize.go +++ b/pkg/cloudapi/pcidevice/serialize.go @@ -2,7 +2,6 @@ package pcidevice import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/serialization" ) diff --git a/pkg/cloudbroker/account/set_cpu_allocation_parameter.go b/pkg/cloudbroker/account/set_cpu_allocation_parameter.go index f22efb9..b9bf90d 100644 --- a/pkg/cloudbroker/account/set_cpu_allocation_parameter.go +++ b/pkg/cloudbroker/account/set_cpu_allocation_parameter.go @@ -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 diff --git a/pkg/cloudbroker/account/set_cpu_allocation_ratio.go b/pkg/cloudbroker/account/set_cpu_allocation_ratio.go index d82187e..58cb3da 100644 --- a/pkg/cloudbroker/account/set_cpu_allocation_ratio.go +++ b/pkg/cloudbroker/account/set_cpu_allocation_ratio.go @@ -16,7 +16,7 @@ type SetCPUAllocationRatioRequest struct { // CPU allocation ratio, i.e. one pCPU = ratio*vCPU // Required: true - Ratio float64 `url:"ratio" json:"ratio" validate:"required"` + Ratio uint64 `url:"ratio" json:"ratio" validate:"required"` } // SetCPUAllocationRatio sets CPU allocation ratio diff --git a/pkg/cloudbroker/disks/depresent.go b/pkg/cloudbroker/disks/depresent.go index feb04d2..511d595 100644 --- a/pkg/cloudbroker/disks/depresent.go +++ b/pkg/cloudbroker/disks/depresent.go @@ -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 diff --git a/pkg/cloudbroker/disks/present.go b/pkg/cloudbroker/disks/present.go index d9cd2ea..fe2149e 100644 --- a/pkg/cloudbroker/disks/present.go +++ b/pkg/cloudbroker/disks/present.go @@ -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 diff --git a/pkg/cloudbroker/grid/set_cpu_allocation_parameter.go b/pkg/cloudbroker/grid/set_cpu_allocation_parameter.go index 45e478f..d035608 100644 --- a/pkg/cloudbroker/grid/set_cpu_allocation_parameter.go +++ b/pkg/cloudbroker/grid/set_cpu_allocation_parameter.go @@ -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 diff --git a/pkg/cloudbroker/grid/set_cpu_allocation_ratio_for_vm.go b/pkg/cloudbroker/grid/set_cpu_allocation_ratio_for_vm.go index 1fbf369..9196f22 100644 --- a/pkg/cloudbroker/grid/set_cpu_allocation_ratio_for_vm.go +++ b/pkg/cloudbroker/grid/set_cpu_allocation_ratio_for_vm.go @@ -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 diff --git a/pkg/cloudbroker/image/list.go b/pkg/cloudbroker/image/list.go index 08f3974..4aeb13c 100644 --- a/pkg/cloudbroker/image/list.go +++ b/pkg/cloudbroker/image/list.go @@ -5,6 +5,7 @@ import ( "encoding/json" "net/http" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/constants" "repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators" ) @@ -102,6 +103,6 @@ func (i Image) ListRaw(ctx context.Context, req ListRequest) ([]byte, error) { url := "/cloudbroker/image/list" - res, err := i.client.DecortApiCall(ctx, http.MethodPost, url, req) + res, err := i.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req) return res, err } diff --git a/pkg/cloudbroker/node/models.go b/pkg/cloudbroker/node/models.go index e35e502..51901d6 100644 --- a/pkg/cloudbroker/node/models.go +++ b/pkg/cloudbroker/node/models.go @@ -161,8 +161,11 @@ type CpuInfo struct { // Flags Flags []string `json:"flags"` - // Mddel name + // Model name ModelName string `json:"model_name"` + + // Max supported generation + MaxSupportedGeneration string `json:"max_supported_generation"` } // Main information about node diff --git a/pkg/cloudbroker/pcidevice/delete.go b/pkg/cloudbroker/pcidevice/delete.go index 941f204..e2bb29e 100644 --- a/pkg/cloudbroker/pcidevice/delete.go +++ b/pkg/cloudbroker/pcidevice/delete.go @@ -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 diff --git a/pkg/cloudbroker/pcidevice/disable.go b/pkg/cloudbroker/pcidevice/disable.go index a806a85..ecaa75a 100644 --- a/pkg/cloudbroker/pcidevice/disable.go +++ b/pkg/cloudbroker/pcidevice/disable.go @@ -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 diff --git a/pkg/cloudbroker/pcidevice/enable.go b/pkg/cloudbroker/pcidevice/enable.go index 7a8bbf3..705ad37 100644 --- a/pkg/cloudbroker/pcidevice/enable.go +++ b/pkg/cloudbroker/pcidevice/enable.go @@ -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 diff --git a/pkg/cloudbroker/pcidevice/serialize.go b/pkg/cloudbroker/pcidevice/serialize.go index 062bd2e..46fcb09 100644 --- a/pkg/cloudbroker/pcidevice/serialize.go +++ b/pkg/cloudbroker/pcidevice/serialize.go @@ -2,7 +2,6 @@ package pcidevice import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/serialization" ) diff --git a/pkg/cloudbroker/rg/set_cpu_allocation_parameter.go b/pkg/cloudbroker/rg/set_cpu_allocation_parameter.go index f44395e..9676240 100644 --- a/pkg/cloudbroker/rg/set_cpu_allocation_parameter.go +++ b/pkg/cloudbroker/rg/set_cpu_allocation_parameter.go @@ -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 diff --git a/pkg/cloudbroker/rg/set_cpu_allocation_ratio.go b/pkg/cloudbroker/rg/set_cpu_allocation_ratio.go index cd102a1..09dc8f9 100644 --- a/pkg/cloudbroker/rg/set_cpu_allocation_ratio.go +++ b/pkg/cloudbroker/rg/set_cpu_allocation_ratio.go @@ -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 diff --git a/pkg/cloudbroker/sep/consumption.go b/pkg/cloudbroker/sep/consumption.go index 539f1fb..a218ccb 100644 --- a/pkg/cloudbroker/sep/consumption.go +++ b/pkg/cloudbroker/sep/consumption.go @@ -11,12 +11,12 @@ import ( // ConsumptionRequest struct to get consumption info type ConsumptionRequest struct { // Storage endpoint provider ID - // Required: true - SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"` + // Required: false + SEPID uint64 `url:"sep_id,omitempty" json:"sep_id,omitempty"` } // Consumption gets SEP consumption info -func (s SEP) Consumption(ctx context.Context, req ConsumptionRequest) (*RecordConsumption, error) { +func (s SEP) Consumption(ctx context.Context, req ConsumptionRequest) (*ListConsumption, error) { err := validators.ValidateRequest(req) if err != nil { return nil, validators.ValidationErrors(validators.GetErrors(err)) @@ -29,7 +29,7 @@ func (s SEP) Consumption(ctx context.Context, req ConsumptionRequest) (*RecordCo return nil, err } - info := RecordConsumption{} + info := ListConsumption{} err = json.Unmarshal(res, &info) if err != nil { diff --git a/pkg/cloudbroker/sep/models.go b/pkg/cloudbroker/sep/models.go index 936f7c0..4127214 100644 --- a/pkg/cloudbroker/sep/models.go +++ b/pkg/cloudbroker/sep/models.go @@ -47,8 +47,22 @@ type ByPool struct { UsageLimit uint64 `json:"usage_limit"` } +// List of Resource groups +type ListConsumption struct { + // Data + Data []RecordConsumption `json:"data"` + + // Enrtry count + EntryCount uint64 `json:"entryCount"` +} + // Main information about consumption type RecordConsumption struct { + // ID + ID uint64 `json:"id"` + + // Name + Name string `json:"name"` // By pool ByPool map[string]ByPool `json:"byPool"` @@ -57,6 +71,9 @@ type RecordConsumption struct { // Type Type string `json:"type"` + + // Consumed by + ConsumedBy []uint64 `json:"consumedBy"` } // Main information about URI diff --git a/pkg/cloudbroker/vgpu/allocate.go b/pkg/cloudbroker/vgpu/allocate.go index 751b5cc..621231b 100644 --- a/pkg/cloudbroker/vgpu/allocate.go +++ b/pkg/cloudbroker/vgpu/allocate.go @@ -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 diff --git a/pkg/cloudbroker/vgpu/create.go b/pkg/cloudbroker/vgpu/create.go index a33c989..d1d3e0b 100644 --- a/pkg/cloudbroker/vgpu/create.go +++ b/pkg/cloudbroker/vgpu/create.go @@ -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 diff --git a/pkg/cloudbroker/vgpu/deallocate.go b/pkg/cloudbroker/vgpu/deallocate.go index 1c917b5..8ba9c25 100644 --- a/pkg/cloudbroker/vgpu/deallocate.go +++ b/pkg/cloudbroker/vgpu/deallocate.go @@ -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 diff --git a/pkg/cloudbroker/vgpu/destroy.go b/pkg/cloudbroker/vgpu/destroy.go index e3a972a..50bd40f 100644 --- a/pkg/cloudbroker/vgpu/destroy.go +++ b/pkg/cloudbroker/vgpu/destroy.go @@ -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