diff --git a/CHANGELOG.md b/CHANGELOG.md
index c8f7486..a63a3ea 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,4 @@
-## Version 1.14.5
+## Version 1.14.6
Методы `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 и в следующих версиях будут удалены
@@ -9,41 +9,69 @@
### Добавлено
-#### compute
+#### extnet
| Идентификатор
задачи | Описание |
| --- | --- |
-| BGOS-360 | Валидация поля `Label` в структуре запроса `SnapshotCreateRequest` в cloudapi/compute и cloudbroker/compute |
+| BGOS-825 | Опциональное поле `EnableSecGroups` в структуру запроса `CreateRequest` в cloudbroker/extnet |
-#### image
+#### grid
| Идентификатор
задачи | Описание |
| --- | --- |
-| BGOS-820 | Обязательное поле `SEPID` в структуру запроса `MultiImageExportRequest` в cloudbroker/image |
+| BGOS-828 | Вычисляемое поле `ZeroAccessEnabled` в структуру ответа `ItemLocation` в cloudbroker/grid |
-#### locations
+#### dpdknet
| Идентификатор
задачи | Описание |
| --- | --- |
-| BGOS-823 | Вычисляемое поле `ZeroAccessEnabled` в структуру ответа `ItemLocation` в cloudapi/locations |
+| BGOS-825 | Опциональное поле `EnableSecGroups` в структуру запроса `CreateRequest` в cloudbroker/dpdknet |
-#### resource_optimizer
+### sep
| Идентификатор
задачи | Описание |
| --- | --- |
-| BGOS-818 | Группа методов `cloudbroker/resource_optimizer` для управления инструментом оптимизации ресурсов (DRS) |
+| BGOS-832 | Метод `AddPoolAsync` в cloudbroker/sep |
-### zone
+#### vins
| Идентификатор
задачи | Описание |
| --- | --- |
-| BGOS-819 | Вычисляемые поля `DRS`, `DRSUID`, `AppID`, `DecortURL`, `DRSName` и `SSOURL` в структуру ответа `RecordZone` в cloudapi/zone и в cloudbroker/zone |
-| BGOS-819 | Структура ответа `ItemZone` в cloudapi/zone и в cloudbroker/zone |
-| BGOS-819 | Опциональное поле `DRS` в структуру запроса `CreateRequest` в cloudbroker/zone |
+| BGOS-825 | Опциональное поле `EnableSecGroups` в структуру запроса `CreateInAccountRequest` в cloudbroker/vins и cloudapi/vins |
+| BGOS-825 | Опциональное поле `EnableSecGroups` в структуру запроса `CreateInRGRequest` в cloudbroker/vins и cloudapi/vins |
+
### Изменено
-#### image
+#### compute
| Идентификатор
задачи | Описание |
| --- | --- |
-| BGOS-822 | Тип полей `HotResize` и `Bootable` в структуре запроса `EditRequest` с bool на interface в cloudbroker/image |
+| BGOS-827 | Описание поля `EnableSecGroups` в структуре запроса `NetAttachRequest` в cloudapi/compute и в cloudbroker/compute |
-#### node
+#### kvmx86
| Идентификатор
задачи | Описание |
| --- | --- |
-| BGOS-821 | Тип вычисляемого поля `VCPU` с `uint64` на `float64` в структуре ответа `FreeResourcesInfo` в cloudbroker/node |
\ No newline at end of file
+| BGOS-827 | Описание поля `EnableSecGroups` в структуре `Interface` в структуре запроса `CreateRequest` и `CreateBlankRequest` в cloudapi/kvmx86 и в cloudbroker/kvmx86 |
+| BGOS-827 | Описание поля `EnableSecGroups` в структуре `InterfaceMassCreate` в структурах запроса `MassCreateRequest` в cloudbroker/kvmx86 |
+
+#### lb
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BGOS-830 | Тип ответа метода `HighlyAvailable` в cloudapi/lb с uint64 на bool |
+
+#### sep
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BGOS-834 | Тип ответа метода `DelConsumerNodes` с bool на interface в cloudbroker/sep |
+
+#### sep
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BGOS-833 | Тип ответа метода `ConfigFieldEdit` с bool на структуру `RecordConfigFieldEdit` в cloudbroker/sep |
+
+### Удалено
+
+#### grid
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BGOS-826 | Структура запроса `AddRequest` и метод `Add` в cloudbroker/grid |
+
+#### sep
+| Идентификатор
задачи | Описание |
+| --- | --- |
+| BGOS-832 | Опциональное поле `Sync` из структуры запроса `AddPoolRequest` в cloudbroker/sep |
\ No newline at end of file
diff --git a/pkg/cloudapi/compute/net_attach.go b/pkg/cloudapi/compute/net_attach.go
index 8782fc8..3ddd062 100644
--- a/pkg/cloudapi/compute/net_attach.go
+++ b/pkg/cloudapi/compute/net_attach.go
@@ -74,6 +74,7 @@ type NetAttachRequest struct {
SecGroups []uint64 `url:"security_groups,omitempty" json:"security_groups,omitempty"`
// Flag indicating whether security groups are enabled for this interface
+ // Not applicable to netType VFNIC, TRUNK, or SDN
// Required: false
EnableSecGroups bool `url:"enable_secgroups,omitempty" json:"enable_secgroups,omitempty"`
diff --git a/pkg/cloudapi/kvmx86/create.go b/pkg/cloudapi/kvmx86/create.go
index 901c2a0..cc12c10 100644
--- a/pkg/cloudapi/kvmx86/create.go
+++ b/pkg/cloudapi/kvmx86/create.go
@@ -69,6 +69,7 @@ type Interface struct {
SecGroups []uint64 `url:"security_groups,omitempty" json:"security_groups,omitempty"`
// Flag indicating whether security groups are enabled for this interface
+ // Not applicable to netType VFNIC, TRUNK, or SDN
// Required: false
EnableSecGroups bool `url:"enable_secgroups,omitempty" json:"enable_secgroups,omitempty"`
diff --git a/pkg/cloudapi/lb/make_highly_available.go b/pkg/cloudapi/lb/make_highly_available.go
index 378224a..e7a6740 100644
--- a/pkg/cloudapi/lb/make_highly_available.go
+++ b/pkg/cloudapi/lb/make_highly_available.go
@@ -16,22 +16,22 @@ type HighlyAvailableRequest struct {
}
// HighlyAvailable makes load balancer highly available
-func (l LB) HighlyAvailable(ctx context.Context, req HighlyAvailableRequest) (uint64, error) {
+func (l LB) HighlyAvailable(ctx context.Context, req HighlyAvailableRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
- return 0, validators.ValidationErrors(validators.GetErrors(err))
+ return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/lb/makeHighlyAvailable"
res, err := l.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
- return 0, err
+ return false, err
}
- result, err := strconv.ParseUint(string(res), 10, 64)
+ result, err := strconv.ParseBool(string(res))
if err != nil {
- return 0, err
+ return false, err
}
return result, nil
diff --git a/pkg/cloudapi/vins/create_in_account.go b/pkg/cloudapi/vins/create_in_account.go
index b4f9f49..1166300 100644
--- a/pkg/cloudapi/vins/create_in_account.go
+++ b/pkg/cloudapi/vins/create_in_account.go
@@ -57,6 +57,11 @@ type CreateInAccountRequest struct {
// Zone ID
// Required: false
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
+
+ // Enable security groups for VINS
+ // Required: false
+ // Default: false
+ EnableSecGroups interface{} `url:"enable_secgroups,omitempty" json:"enable_secgroups,omitempty" validate:"omitempty,isBool"`
}
type wrapperCreateRequestInAcc struct {
diff --git a/pkg/cloudapi/vins/create_in_rg.go b/pkg/cloudapi/vins/create_in_rg.go
index 351bf84..3889154 100644
--- a/pkg/cloudapi/vins/create_in_rg.go
+++ b/pkg/cloudapi/vins/create_in_rg.go
@@ -51,6 +51,11 @@ type CreateInRGRequest struct {
// Zone ID
// Required: false
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
+
+ // Enable security groups for VINS
+ // Required: false
+ // Default: false
+ EnableSecGroups interface{} `url:"enable_secgroups,omitempty" json:"enable_secgroups,omitempty" validate:"omitempty,isBool"`
}
type wrapperCreateRequestInRG struct {
diff --git a/pkg/cloudbroker/compute/net_attach.go b/pkg/cloudbroker/compute/net_attach.go
index 3909b58..dd66d4b 100644
--- a/pkg/cloudbroker/compute/net_attach.go
+++ b/pkg/cloudbroker/compute/net_attach.go
@@ -74,6 +74,7 @@ type NetAttachRequest struct {
SecGroups []uint64 `url:"security_groups,omitempty" json:"security_groups,omitempty"`
// Flag indicating whether security groups are enabled for this interface
+ // Not applicable to netType VFNIC, TRUNK, or SDN
// Required: false
EnableSecGroups bool `url:"enable_secgroups,omitempty" json:"enable_secgroups,omitempty"`
diff --git a/pkg/cloudbroker/dpdknet/create.go b/pkg/cloudbroker/dpdknet/create.go
index f91c2dc..d44a531 100644
--- a/pkg/cloudbroker/dpdknet/create.go
+++ b/pkg/cloudbroker/dpdknet/create.go
@@ -37,6 +37,11 @@ type CreateRequest struct {
// List of resource groups IDs to which DPDK network will be available. Empty field means all resource groups in the system.
// Required: false
RGAccess []uint64 `url:"rgAccess,omitempty" json:"rgAccess,omitempty"`
+
+ // Enable security groups for DPDK network
+ // Required: false
+ // Default: false
+ EnableSecGroups interface{} `url:"enable_secgroups,omitempty" json:"enable_secgroups,omitempty" validate:"omitempty,isBool"`
}
// Create creates a DPDK networks
diff --git a/pkg/cloudbroker/extnet/create.go b/pkg/cloudbroker/extnet/create.go
index 0cfa90f..f55f34f 100644
--- a/pkg/cloudbroker/extnet/create.go
+++ b/pkg/cloudbroker/extnet/create.go
@@ -104,6 +104,11 @@ type CreateRequest struct {
// Required: false
// Default: false
HAMode bool `url:"highlyAvailable,omitempty" json:"highlyAvailable,omitempty"`
+
+ // Enable security groups for external network
+ // Required: false
+ // Default: false
+ EnableSecGroups interface{} `url:"enable_secgroups,omitempty" json:"enable_secgroups,omitempty" validate:"omitempty,isBool"`
}
type wrapperCreateRequest struct {
diff --git a/pkg/cloudbroker/grid/add.go b/pkg/cloudbroker/grid/add.go
deleted file mode 100644
index 30c7aa2..0000000
--- a/pkg/cloudbroker/grid/add.go
+++ /dev/null
@@ -1,46 +0,0 @@
-package grid
-
-import (
- "context"
- "net/http"
- "strconv"
-
- "repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
-)
-
-// AddRequest struct for location code
-type AddRequest struct {
- // Grid (platform) ID
- // Required: true
- GID uint64 `url:"gid" json:"gid" validate:"required"`
-
- // Name of the location
- // Required: true
- Name string `url:"name" json:"name" validate:"required"`
-
- // Location code typicly used in dns names
- // Required: true
- LocationCode string `url:"locationcode" json:"locationcode" validate:"required"`
-}
-
-// Add location code (e.g. DNS name of this grid)
-func (g Grid) Add(ctx context.Context, req AddRequest) (bool, error) {
- err := validators.ValidateRequest(req)
- if err != nil {
- return false, validators.ValidationErrors(validators.GetErrors(err))
- }
-
- url := "/cloudbroker/grid/add"
-
- res, err := g.client.DecortApiCall(ctx, http.MethodPost, url, req)
- if err != nil {
- return false, err
- }
-
- result, err := strconv.ParseBool(string(res))
- if err != nil {
- return false, err
- }
-
- return result, nil
-}
diff --git a/pkg/cloudbroker/grid/models.go b/pkg/cloudbroker/grid/models.go
index c72102a..5ce88bb 100644
--- a/pkg/cloudbroker/grid/models.go
+++ b/pkg/cloudbroker/grid/models.go
@@ -129,6 +129,9 @@ type ItemGridList struct {
// SDN support
SDNSupport bool `json:"sdn_support"`
+
+ // Is Zero Access enabled
+ ZeroAccessEnabled bool `json:"zeroaccess_enabled"`
}
// List Grids
diff --git a/pkg/cloudbroker/kvmx86/create.go b/pkg/cloudbroker/kvmx86/create.go
index c3fe873..837e8a1 100644
--- a/pkg/cloudbroker/kvmx86/create.go
+++ b/pkg/cloudbroker/kvmx86/create.go
@@ -51,6 +51,7 @@ type Interface struct {
SecGroups []uint64 `url:"security_groups,omitempty" json:"security_groups,omitempty"`
// Flag indicating whether security groups are enabled for this interface
+ // Not applicable to netType VFNIC, TRUNK, or SDN
// Required: false
EnableSecGroups bool `url:"enable_secgroups,omitempty" json:"enable_secgroups,omitempty"`
diff --git a/pkg/cloudbroker/kvmx86/mass_create.go b/pkg/cloudbroker/kvmx86/mass_create.go
index 5ad8bdc..a8f04b3 100644
--- a/pkg/cloudbroker/kvmx86/mass_create.go
+++ b/pkg/cloudbroker/kvmx86/mass_create.go
@@ -45,6 +45,7 @@ type InterfaceMassCreate struct {
SecGroups []uint64 `url:"security_groups,omitempty" json:"security_groups,omitempty"`
// Flag indicating whether security groups are enabled for this interface
+ // Not applicable to netType VFNIC, TRUNK, or SDN
// Required: false
EnableSecGroups bool `url:"enable_secgroups,omitempty" json:"enable_secgroups,omitempty"`
diff --git a/pkg/cloudbroker/sep/add_pool.go b/pkg/cloudbroker/sep/add_pool.go
index 84a15f9..78d69c9 100644
--- a/pkg/cloudbroker/sep/add_pool.go
+++ b/pkg/cloudbroker/sep/add_pool.go
@@ -3,6 +3,8 @@ package sep
import (
"context"
"net/http"
+ "strconv"
+ "strings"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
@@ -13,32 +15,66 @@ type AddPoolRequest struct {
// Required: true
SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
- // Method Async/Sync
- // Default: true
- // Required: false
- Sync bool `url:"sync" json:"sync"`
-
// 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 no additional fields required. Hitachi - "id", "snapshotable", "snapshot_pool_id", "minLdevId", "maxLdevId", "clone_technology". Shared - "description", "wwns", "allocate_type", "stripes", "metadata_size", "metadatatalun". Local - "description", "node_consumer", "block_disk".
// Required: true
Pool string `url:"pool" json:"pool" validate:"required"`
}
-// AddPool adds pool to SEP
-func (s SEP) AddPool(ctx context.Context, req AddPoolRequest) (string, error) {
+type wrapperAddPoolRequest struct {
+ AddPoolRequest
+ AsyncMode bool `url:"asyncMode"`
+}
+
+// AddPool adds pool to SEP in sync mode.
+// It returns result of operation and error.
+func (s SEP) AddPool(ctx context.Context, req AddPoolRequest) (bool, error) {
+ err := validators.ValidateRequest(req)
+ if err != nil {
+ return false, validators.ValidationErrors(validators.GetErrors(err))
+ }
+
+ reqWrapped := wrapperAddPoolRequest{
+ AddPoolRequest: req,
+ AsyncMode: false,
+ }
+
+ url := "/cloudbroker/sep/addPool"
+
+ res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped)
+ if err != nil {
+ return false, err
+ }
+
+ result, err := strconv.ParseBool(string(res))
+ if err != nil {
+ return false, err
+ }
+
+ return result, nil
+}
+
+// AddPoolAsync adds pool to SEP in async mode.
+// It returns guid of task and error.
+func (s SEP) AddPoolAsync(ctx context.Context, req AddPoolRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
+ reqWrapped := wrapperAddPoolRequest{
+ AddPoolRequest: req,
+ AsyncMode: true,
+ }
+
url := "/cloudbroker/sep/addPool"
- res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
+ res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped)
if err != nil {
return "", err
}
- result := string(res)
+ result := strings.ReplaceAll(string(res), "\"", "")
return result, nil
}
diff --git a/pkg/cloudbroker/sep/config_field_edit.go b/pkg/cloudbroker/sep/config_field_edit.go
index 6aa8d28..3465ee9 100644
--- a/pkg/cloudbroker/sep/config_field_edit.go
+++ b/pkg/cloudbroker/sep/config_field_edit.go
@@ -2,8 +2,8 @@ package sep
import (
"context"
+ "encoding/json"
"net/http"
- "strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
@@ -34,23 +34,25 @@ type ConfigFieldEditRequest struct {
}
// ConfigFieldEdit edits SEP config field value
-func (s SEP) ConfigFieldEdit(ctx context.Context, req ConfigFieldEditRequest) (bool, error) {
+func (s SEP) ConfigFieldEdit(ctx context.Context, req ConfigFieldEditRequest) (*RecordConfigFieldEdit, error) {
err := validators.ValidateRequest(req)
if err != nil {
- return false, validators.ValidationErrors(validators.GetErrors(err))
+ return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/sep/configFieldEdit"
res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
- return false, err
+ return nil, err
}
- result, err := strconv.ParseBool(string(res))
+ info := RecordConfigFieldEdit{}
+
+ err = json.Unmarshal(res, &info)
if err != nil {
- return false, err
+ return nil, err
}
- return result, nil
+ return &info, nil
}
diff --git a/pkg/cloudbroker/sep/del_consumer_nodes.go b/pkg/cloudbroker/sep/del_consumer_nodes.go
index 0703916..8afdbdc 100644
--- a/pkg/cloudbroker/sep/del_consumer_nodes.go
+++ b/pkg/cloudbroker/sep/del_consumer_nodes.go
@@ -2,8 +2,8 @@ package sep
import (
"context"
+ "encoding/json"
"net/http"
- "strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
@@ -25,22 +25,24 @@ type DelConsumerNodesRequest struct {
}
// DelConsumerNodes excludes consumer nodes from SEP parameters
-func (s SEP) DelConsumerNodes(ctx context.Context, req DelConsumerNodesRequest) (bool, error) {
+func (s SEP) DelConsumerNodes(ctx context.Context, req DelConsumerNodesRequest) (interface{}, error) {
err := validators.ValidateRequest(req)
if err != nil {
- return false, validators.ValidationErrors(validators.GetErrors(err))
+ return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/sep/delConsumerNodes"
res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
- return false, err
+ return nil, err
}
- result, err := strconv.ParseBool(string(res))
+ var result interface{}
+
+ err = json.Unmarshal(res, &result)
if err != nil {
- return false, err
+ return nil, err
}
return result, nil
diff --git a/pkg/cloudbroker/sep/models.go b/pkg/cloudbroker/sep/models.go
index 401b151..936f7c0 100644
--- a/pkg/cloudbroker/sep/models.go
+++ b/pkg/cloudbroker/sep/models.go
@@ -1,5 +1,7 @@
package sep
+import "encoding/json"
+
// Total resource information
type Total struct {
// Capacity limit
@@ -185,3 +187,93 @@ type ListAvailableSEP struct {
// Data
Data []SEPData `json:"data"`
}
+
+// Disk clean settings
+type DiskCleanSettings struct {
+ // Block size
+ BlockSize string `json:"blocksize"`
+
+ // Write bytes per second
+ WBPS uint64 `json:"wbps"`
+
+ // Write I/O operations per second
+ WIOPS uint64 `json:"wiops"`
+}
+
+// Pool configuration
+type PoolConfig struct {
+ // Disk clean
+ DiskClean *string `json:"disk_clean"`
+
+ // Disk clean settings
+ DiskCleanSettings DiskCleanSettings `json:"disk_clean_settings"`
+
+ // Pool name
+ Name string `json:"name"`
+
+ // Usage limit
+ UsageLimit uint64 `json:"usage_limit"`
+
+ // Additional properties
+ AdditionalProperties map[string]interface{} `json:"-"`
+}
+
+func (p *PoolConfig) UnmarshalJSON(data []byte) error {
+ type tmpAlias PoolConfig
+ if err := json.Unmarshal(data, (*tmpAlias)(p)); err != nil {
+ return err
+ }
+
+ all := make(map[string]interface{})
+ if err := json.Unmarshal(data, &all); err != nil {
+ return err
+ }
+
+ delete(all, "disk_clean")
+ delete(all, "disk_clean_settings")
+ delete(all, "name")
+ delete(all, "usage_limit")
+
+ if len(all) > 0 {
+ p.AdditionalProperties = all
+ }
+
+ return nil
+}
+
+// Sep configuration information
+type RecordConfigFieldEdit struct {
+ // Format
+ Format string `json:"format"`
+
+ // Pools
+ Pools []PoolConfig `json:"pools"`
+
+ // Protocol
+ Protocol string `json:"protocol"`
+
+ // Additional properties
+ AdditionalProperties map[string]interface{} `json:"-"`
+}
+
+func (r *RecordConfigFieldEdit) UnmarshalJSON(data []byte) error {
+ type tmpAlias RecordConfigFieldEdit
+ if err := json.Unmarshal(data, (*tmpAlias)(r)); err != nil {
+ return err
+ }
+
+ all := make(map[string]interface{})
+ if err := json.Unmarshal(data, &all); err != nil {
+ return err
+ }
+
+ delete(all, "format")
+ delete(all, "pools")
+ delete(all, "protocol")
+
+ if len(all) > 0 {
+ r.AdditionalProperties = all
+ }
+
+ return nil
+}
diff --git a/pkg/cloudbroker/vins/create_in_account.go b/pkg/cloudbroker/vins/create_in_account.go
index b1e6e44..a0e79ad 100644
--- a/pkg/cloudbroker/vins/create_in_account.go
+++ b/pkg/cloudbroker/vins/create_in_account.go
@@ -57,6 +57,11 @@ type CreateInAccountRequest struct {
// Zone ID
// Required: false
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
+
+ // Enable security groups for VINS
+ // Required: false
+ // Default: false
+ EnableSecGroups interface{} `url:"enable_secgroups,omitempty" json:"enable_secgroups,omitempty" validate:"omitempty,isBool"`
}
type wrapperCreateRequestInAcc struct {
diff --git a/pkg/cloudbroker/vins/create_in_rg.go b/pkg/cloudbroker/vins/create_in_rg.go
index f6f3c62..ca73638 100644
--- a/pkg/cloudbroker/vins/create_in_rg.go
+++ b/pkg/cloudbroker/vins/create_in_rg.go
@@ -51,6 +51,11 @@ type CreateInRGRequest struct {
// Zone ID
// Required: false
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
+
+ // Enable security groups for VINS
+ // Required: false
+ // Default: false
+ EnableSecGroups interface{} `url:"enable_secgroups,omitempty" json:"enable_secgroups,omitempty" validate:"omitempty,isBool"`
}
type wrapperCreateRequestInRG struct {
diff --git a/samples/client/client.go b/samples/client/client.go
index 2a9e401..4e1a0b2 100644
--- a/samples/client/client.go
+++ b/samples/client/client.go
@@ -26,17 +26,17 @@ func NewMigrator(cfg *Config, c decortsdk.ClientInterface) Migrator {
}
}
-func (m *migrator) Migrate(ctxOrigin context.Context, dxVMID, stackID uint64) (bool, error) {
+func (m *migrator) Migrate(ctxOrigin context.Context, dxVMID, nodeID uint64) (bool, error) {
req := compute.MigrateRequest{
- ComputeID: dxVMID,
- TargetStackID: stackID,
- Force: false,
+ ComputeID: dxVMID,
+ TargetNodeID: nodeID,
+ Force: false,
}
ctx, cancel := context.WithTimeout(ctxOrigin, m.cfg.QueryTimeout)
ok, err := m.client.CloudBroker().Compute().Migrate(ctx, req)
cancel()
if err != nil {
- return false, errors.Join(err, fmt.Errorf("Migrate VM %d to Node %d", dxVMID, stackID))
+ return false, errors.Join(err, fmt.Errorf("Migrate VM %d to Node %d", dxVMID, nodeID))
}
return ok, nil
}
diff --git a/samples/client/client_test.go b/samples/client/client_test.go
index b474e0c..dc67fb5 100644
--- a/samples/client/client_test.go
+++ b/samples/client/client_test.go
@@ -60,17 +60,17 @@ func TestMigrator(t *testing.T) {
assert.NoError(t, err)
dxVMID := uint64(100500)
- stackID := uint64(100501)
+ nodeID := uint64(100501)
// Записываем поведение клиента
mockCaller.EXPECT().DecortApiCall(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Eq(compute.AsyncWrapperMigrateRequest{
MigrateRequest: compute.MigrateRequest{
- ComputeID: dxVMID,
- TargetStackID: stackID,
+ ComputeID: dxVMID,
+ TargetNodeID: nodeID,
},
SyncMode: true})).Return(b, nil).AnyTimes()
- ok, err := migrator.Migrate(context.Background(), dxVMID, stackID)
+ ok, err := migrator.Migrate(context.Background(), dxVMID, nodeID)
assert.NoError(t, err)
assert.True(t, ok)
}
diff --git a/tests/platform_upgrade/request_map.go b/tests/platform_upgrade/request_map.go
index 853c3bb..897eb45 100644
--- a/tests/platform_upgrade/request_map.go
+++ b/tests/platform_upgrade/request_map.go
@@ -749,7 +749,6 @@ func getRequestsMapCloudbroker() map[string]interface{} {
"/restmachine/cloudbroker/flipgroup/list": flipgroup_cb.ListRequest{},
// grid
- "/restmachine/cloudbroker/grid/add": grid_cb.AddRequest{},
"/restmachine/cloudbroker/grid/addCustomBackupPath": grid_cb.AddCustomBackupPathRequest{},
"/restmachine/cloudbroker/grid/changeSettings": grid_cb.ChangeSettingsRequest{},
"/restmachine/cloudbroker/grid/executeMaintenanceScript": grid_cb.ExecuteMaintenanceScriptRequest{},