Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e2edf53a5 | ||
| 8f8a81eea4 |
15
CHANGELOG.md
15
CHANGELOG.md
@@ -1,4 +1,4 @@
|
|||||||
## Version 14.9.0
|
## Version 14.11.0
|
||||||
|
|
||||||
Методы `Audits` в cloudapi/compute, cloudbroker/compute, cloudapi/account, cloudbroker/account, cloudapi/vins, cloudbroker/vins, cloudapi/rg и cloudbroker/rg стали deprecated и в следующих версиях будут удалены, вместо них необходимо использовать метод `List` в cloudapi/audit и cloudbroker/audit с соответствующими фильтрами
|
Методы `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 и в следующих версиях будут удалены
|
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и в следующих версиях будут удалены
|
||||||
@@ -7,9 +7,16 @@
|
|||||||
|
|
||||||
Все методы группы `.SDN()` находятся в альфа-версии.
|
Все методы группы `.SDN()` находятся в альфа-версии.
|
||||||
|
|
||||||
### Добавлено
|
### Изменено
|
||||||
|
|
||||||
#### vgpu
|
#### compute
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-851 | Группа методов `cloudapi/vgpu` |
|
| BGOS-874 | Поле `StoragePolicyID` с обязательного на опциональное в структуре запроса `RedeployRequest` в cloudapi/compute и cloudbroker/compute |
|
||||||
|
|
||||||
|
### Исправлено
|
||||||
|
|
||||||
|
#### vfpool
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-871 | Тип поля `Config` в структуре запроса `wrapperUpdateRequest` с `[]string` на `string` в cloudbroker/vfpool |
|
||||||
|
|||||||
@@ -152,7 +152,6 @@ go get -u repository.basistech.ru/BASIS/dynamix-golang-sdk/v14
|
|||||||
- `PCIDevice` - управление устройствами;
|
- `PCIDevice` - управление устройствами;
|
||||||
- `Prometheus` - получение статистики prometheus;
|
- `Prometheus` - получение статистики prometheus;
|
||||||
- `Resmon` - получение статистики resource monitoring;
|
- `Resmon` - получение статистики resource monitoring;
|
||||||
- `ResourceOptimizer` - управление инструментом оптимизации ресурсов (DRS);
|
|
||||||
- `RG` - управление ресурсными группами аккаунта;
|
- `RG` - управление ресурсными группами аккаунта;
|
||||||
- `Security group` – управление группами безопасности;
|
- `Security group` – управление группами безопасности;
|
||||||
- `SEP` - управление storage endpoint (sep);
|
- `SEP` - управление storage endpoint (sep);
|
||||||
@@ -361,7 +360,6 @@ func main() {
|
|||||||
- `pkg/cloudbroker/pcidevice` - для `PCIDevice`
|
- `pkg/cloudbroker/pcidevice` - для `PCIDevice`
|
||||||
- `pkg/cloudbroker/prometheus` - для `Prometheus`
|
- `pkg/cloudbroker/prometheus` - для `Prometheus`
|
||||||
- `pkg/cloudbroker/resmon` - для `Resmon`
|
- `pkg/cloudbroker/resmon` - для `Resmon`
|
||||||
- `pkg/cloudbroker/resource_optimizer` - для `ResourceOptimizer`
|
|
||||||
- `pkg/cloudbroker/rg` - для `RG`
|
- `pkg/cloudbroker/rg` - для `RG`
|
||||||
- `pkg/cloudbroker/secgroup` - для `Security group`
|
- `pkg/cloudbroker/secgroup` - для `Security group`
|
||||||
- `pkg/cloudbroker/sep` - для `SEP`
|
- `pkg/cloudbroker/sep` - для `SEP`
|
||||||
@@ -563,7 +561,6 @@ func main() {
|
|||||||
- `.PCIDevice()` - для работы с `PCIDevice`
|
- `.PCIDevice()` - для работы с `PCIDevice`
|
||||||
- `.Prometheus()` - для работы с `Prometheus`
|
- `.Prometheus()` - для работы с `Prometheus`
|
||||||
- `.Resmon()` - для работы с `Resmon`
|
- `.Resmon()` - для работы с `Resmon`
|
||||||
- `.ResourceOptimizer()` - для работы с `ResourceOptimizer`
|
|
||||||
- `.RG()` - для работы с `RG`
|
- `.RG()` - для работы с `RG`
|
||||||
- `.SecurityGroup()` - для работы с `Security Group`
|
- `.SecurityGroup()` - для работы с `Security Group`
|
||||||
- `.SEP()` - для работы с `SEP`
|
- `.SEP()` - для работы с `SEP`
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ type RedeployRequest struct {
|
|||||||
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
// Storage policy id of compute. The rules of the specified storage policy will be used.
|
// Storage policy id of compute. The rules of the specified storage policy will be used.
|
||||||
// Required: true
|
// Required: false
|
||||||
StoragePolicyID uint64 `url:"storage_policy_id,omitempty" json:"storage_policy_id,omitempty"`
|
StoragePolicyID uint64 `url:"storage_policy_id,omitempty" json:"storage_policy_id,omitempty"`
|
||||||
|
|
||||||
// ID of the new OS image, if image change is required
|
// ID of the new OS image, if image change is required
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ type RedeployRequest struct {
|
|||||||
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
|
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
|
||||||
|
|
||||||
// Storage policy id of compute. The rules of the specified storage policy will be used.
|
// Storage policy id of compute. The rules of the specified storage policy will be used.
|
||||||
// Required: true
|
// Required: false
|
||||||
StoragePolicyID uint64 `url:"storage_policy_id,omitempty" json:"storage_policy_id,omitempty"`
|
StoragePolicyID uint64 `url:"storage_policy_id,omitempty" json:"storage_policy_id,omitempty"`
|
||||||
|
|
||||||
// New size for the boot disk in GB, if boot disk size change is required
|
// New size for the boot disk in GB, if boot disk size change is required
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
package cloudbroker
|
|
||||||
|
|
||||||
import (
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/pkg/cloudbroker/resource_optimizer"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Accessing the ResourceOptimizer method group
|
|
||||||
func (cb *CloudBroker) ResourceOptimizer() *resource_optimizer.ResourceOptimizer {
|
|
||||||
return resource_optimizer.New(cb.client)
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package resource_optimizer
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"net/http"
|
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
|
||||||
)
|
|
||||||
|
|
||||||
// DRSAddNodesRequest struct to add nodes to DRS
|
|
||||||
type DRSAddNodesRequest struct {
|
|
||||||
// ID of the zone
|
|
||||||
// Required: true
|
|
||||||
ZoneID uint64 `url:"zone_id" json:"zone_id" validate:"required"`
|
|
||||||
|
|
||||||
// IDs of the nodes to add
|
|
||||||
// Required: true
|
|
||||||
NodeIDs []uint64 `url:"node_ids" json:"node_ids" validate:"required"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// DRSAddNodes adds nodes to DRS in the specified zone
|
|
||||||
func (ro ResourceOptimizer) DRSAddNodes(ctx context.Context, req DRSAddNodesRequest) (bool, error) {
|
|
||||||
err := validators.ValidateRequest(req)
|
|
||||||
if err != nil {
|
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
url := "/cloudbroker/resource_optimizer/drs_add_nodes"
|
|
||||||
|
|
||||||
res, err := ro.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
|
|
||||||
}
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
package resource_optimizer
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"net/http"
|
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
|
||||||
)
|
|
||||||
|
|
||||||
// DRSCreateRequest struct to create DRS
|
|
||||||
type DRSCreateRequest struct {
|
|
||||||
// ID of the zone
|
|
||||||
// Required: true
|
|
||||||
ZoneID uint64 `url:"zone_id" json:"zone_id" validate:"required"`
|
|
||||||
|
|
||||||
// SSO provider type
|
|
||||||
// Available values: bvs, decs3o
|
|
||||||
// Required: true
|
|
||||||
SSOType string `url:"sso_type" json:"sso_type" validate:"required,oneof=bvs decs3o"`
|
|
||||||
|
|
||||||
// Application ID
|
|
||||||
// Required: true
|
|
||||||
AppID string `url:"app_id" json:"app_id" validate:"required"`
|
|
||||||
|
|
||||||
// Application secret
|
|
||||||
// Required: true
|
|
||||||
AppSecret string `url:"app_secret" json:"app_secret" validate:"required"`
|
|
||||||
|
|
||||||
// Decort URL
|
|
||||||
// Required: true
|
|
||||||
DecortURL string `url:"decort_url" json:"decort_url" validate:"required"`
|
|
||||||
|
|
||||||
// SSO URL
|
|
||||||
// Required: true
|
|
||||||
SSOURL string `url:"sso_url" json:"sso_url" validate:"required"`
|
|
||||||
|
|
||||||
// DRS name
|
|
||||||
// Required: true
|
|
||||||
DRSName string `url:"drs_name" json:"drs_name" validate:"required"`
|
|
||||||
|
|
||||||
// Username
|
|
||||||
// Required: false
|
|
||||||
Username string `url:"username,omitempty" json:"username,omitempty"`
|
|
||||||
|
|
||||||
// Password
|
|
||||||
// Required: false
|
|
||||||
Password string `url:"password,omitempty" json:"password,omitempty"`
|
|
||||||
|
|
||||||
// Broadcast address
|
|
||||||
// Required: false
|
|
||||||
BroadcastAddr string `url:"broadcast_addr,omitempty" json:"broadcast_addr,omitempty"`
|
|
||||||
|
|
||||||
// Ping address
|
|
||||||
// Required: false
|
|
||||||
PingAddr string `url:"ping_addr,omitempty" json:"ping_addr,omitempty"`
|
|
||||||
|
|
||||||
// Skip SSL certificate verification
|
|
||||||
// Required: false
|
|
||||||
SSLSkipVerify interface{} `url:"ssl_skip_verify,omitempty" json:"ssl_skip_verify,omitempty"`
|
|
||||||
|
|
||||||
// Domain
|
|
||||||
// Required: false
|
|
||||||
Domain string `url:"domain,omitempty" json:"domain,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// DRSCreate creates a new DRS in the specified zone
|
|
||||||
func (ro ResourceOptimizer) DRSCreate(ctx context.Context, req DRSCreateRequest) (bool, error) {
|
|
||||||
err := validators.ValidateRequest(req)
|
|
||||||
if err != nil {
|
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
url := "/cloudbroker/resource_optimizer/drs_create"
|
|
||||||
|
|
||||||
res, err := ro.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
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package resource_optimizer
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"net/http"
|
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
|
||||||
)
|
|
||||||
|
|
||||||
// DRSDelNodesRequest struct to delete nodes from DRS
|
|
||||||
type DRSDelNodesRequest struct {
|
|
||||||
// ID of the zone
|
|
||||||
// Required: true
|
|
||||||
ZoneID uint64 `url:"zone_id" json:"zone_id" validate:"required"`
|
|
||||||
|
|
||||||
// IDs of the nodes to delete
|
|
||||||
// Required: true
|
|
||||||
NodeIDs []uint64 `url:"node_ids" json:"node_ids" validate:"required"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// DRSDelNodes removes nodes from DRS in the specified zone
|
|
||||||
func (ro ResourceOptimizer) DRSDelNodes(ctx context.Context, req DRSDelNodesRequest) (bool, error) {
|
|
||||||
err := validators.ValidateRequest(req)
|
|
||||||
if err != nil {
|
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
url := "/cloudbroker/resource_optimizer/drs_del_nodes"
|
|
||||||
|
|
||||||
res, err := ro.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
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
package resource_optimizer
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"net/http"
|
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
|
||||||
)
|
|
||||||
|
|
||||||
// DRSRemoveRequest struct to remove DRS
|
|
||||||
type DRSRemoveRequest struct {
|
|
||||||
// ID of the zone
|
|
||||||
// Required: true
|
|
||||||
ZoneID uint64 `url:"zone_id" json:"zone_id" validate:"required"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// DRSRemove removes DRS from the specified zone
|
|
||||||
func (ro ResourceOptimizer) DRSRemove(ctx context.Context, req DRSRemoveRequest) (bool, error) {
|
|
||||||
err := validators.ValidateRequest(req)
|
|
||||||
if err != nil {
|
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
url := "/cloudbroker/resource_optimizer/drs_remove"
|
|
||||||
|
|
||||||
res, err := ro.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
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
package resource_optimizer
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"net/http"
|
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
|
||||||
)
|
|
||||||
|
|
||||||
// DRSStartRequest struct to start DRS
|
|
||||||
type DRSStartRequest struct {
|
|
||||||
// ID of the zone
|
|
||||||
// Required: true
|
|
||||||
ZoneID uint64 `url:"zone_id" json:"zone_id" validate:"required"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// DRSStart starts DRS in the specified zone
|
|
||||||
func (ro ResourceOptimizer) DRSStart(ctx context.Context, req DRSStartRequest) (bool, error) {
|
|
||||||
err := validators.ValidateRequest(req)
|
|
||||||
if err != nil {
|
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
url := "/cloudbroker/resource_optimizer/drs_start"
|
|
||||||
|
|
||||||
res, err := ro.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
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
package resource_optimizer
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"net/http"
|
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
|
||||||
)
|
|
||||||
|
|
||||||
// DRSStopRequest struct to stop DRS
|
|
||||||
type DRSStopRequest struct {
|
|
||||||
// ID of the zone
|
|
||||||
// Required: true
|
|
||||||
ZoneID uint64 `url:"zone_id" json:"zone_id" validate:"required"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// DRSStop stops DRS in the specified zone
|
|
||||||
func (ro ResourceOptimizer) DRSStop(ctx context.Context, req DRSStopRequest) (bool, error) {
|
|
||||||
err := validators.ValidateRequest(req)
|
|
||||||
if err != nil {
|
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
url := "/cloudbroker/resource_optimizer/drs_stop"
|
|
||||||
|
|
||||||
res, err := ro.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
|
|
||||||
}
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
package resource_optimizer
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"net/http"
|
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
|
||||||
)
|
|
||||||
|
|
||||||
// DRSUpdateRequest struct to update DRS
|
|
||||||
type DRSUpdateRequest struct {
|
|
||||||
// ID of the zone
|
|
||||||
// Required: true
|
|
||||||
ZoneID uint64 `url:"zone_id" json:"zone_id" validate:"required"`
|
|
||||||
|
|
||||||
// SSO provider type
|
|
||||||
// Available values: bvs, decs3o
|
|
||||||
// Required: true
|
|
||||||
SSOType string `url:"sso_type" json:"sso_type" validate:"required,oneof=bvs decs3o"`
|
|
||||||
|
|
||||||
// Application ID
|
|
||||||
// Required: false
|
|
||||||
AppID string `url:"app_id,omitempty" json:"app_id,omitempty"`
|
|
||||||
|
|
||||||
// Application secret
|
|
||||||
// Required: false
|
|
||||||
AppSecret string `url:"app_secret,omitempty" json:"app_secret,omitempty"`
|
|
||||||
|
|
||||||
// Decort URL
|
|
||||||
// Required: false
|
|
||||||
DecortURL string `url:"decort_url,omitempty" json:"decort_url,omitempty"`
|
|
||||||
|
|
||||||
// SSO URL
|
|
||||||
// Required: false
|
|
||||||
SSOURL string `url:"sso_url,omitempty" json:"sso_url,omitempty"`
|
|
||||||
|
|
||||||
// DRS name
|
|
||||||
// Required: false
|
|
||||||
DRSName string `url:"drs_name,omitempty" json:"drs_name,omitempty"`
|
|
||||||
|
|
||||||
// Username
|
|
||||||
// Required: false
|
|
||||||
Username string `url:"username,omitempty" json:"username,omitempty"`
|
|
||||||
|
|
||||||
// Password
|
|
||||||
// Required: false
|
|
||||||
Password string `url:"password,omitempty" json:"password,omitempty"`
|
|
||||||
|
|
||||||
// Broadcast address
|
|
||||||
// Required: false
|
|
||||||
BroadcastAddr string `url:"broadcast_addr,omitempty" json:"broadcast_addr,omitempty"`
|
|
||||||
|
|
||||||
// Ping address
|
|
||||||
// Required: false
|
|
||||||
PingAddr string `url:"ping_addr,omitempty" json:"ping_addr,omitempty"`
|
|
||||||
|
|
||||||
// Skip SSL certificate verification
|
|
||||||
// Required: false
|
|
||||||
SSLSkipVerify interface{} `url:"ssl_skip_verify,omitempty" json:"ssl_skip_verify,omitempty"`
|
|
||||||
|
|
||||||
// Domain
|
|
||||||
// Required: false
|
|
||||||
Domain string `url:"domain,omitempty" json:"domain,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// DRSUpdate updates DRS configuration in the specified zone
|
|
||||||
func (ro ResourceOptimizer) DRSUpdate(ctx context.Context, req DRSUpdateRequest) (bool, error) {
|
|
||||||
err := validators.ValidateRequest(req)
|
|
||||||
if err != nil {
|
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
url := "/cloudbroker/resource_optimizer/drs_update"
|
|
||||||
|
|
||||||
res, err := ro.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
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
// API Actor API for managing resource optimizer
|
|
||||||
package resource_optimizer
|
|
||||||
|
|
||||||
import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/interfaces"
|
|
||||||
|
|
||||||
// Structure for creating request to resource_optimizer
|
|
||||||
type ResourceOptimizer struct {
|
|
||||||
client interfaces.Caller
|
|
||||||
}
|
|
||||||
|
|
||||||
// Builder for resource_optimizer endpoints
|
|
||||||
func New(client interfaces.Caller) *ResourceOptimizer {
|
|
||||||
return &ResourceOptimizer{
|
|
||||||
client: client,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -38,7 +38,7 @@ type UpdateRequest struct {
|
|||||||
|
|
||||||
type wrapperUpdateRequest struct {
|
type wrapperUpdateRequest struct {
|
||||||
UpdateRequest
|
UpdateRequest
|
||||||
Config []string `url:"config,omitempty"`
|
Config string `url:"config,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update updates vfpool device
|
// Update updates vfpool device
|
||||||
@@ -48,21 +48,15 @@ func (v VFPool) Update(ctx context.Context, req UpdateRequest) (bool, error) {
|
|||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
var config []string
|
var config string
|
||||||
|
|
||||||
if len(req.Config) != 0 {
|
if len(req.Config) != 0 {
|
||||||
config = make([]string, 0, len(req.Config))
|
b, err := json.Marshal(req.Config)
|
||||||
|
|
||||||
for c := range req.Config {
|
|
||||||
b, err := json.Marshal(req.Config[c])
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
config = append(config, string(b))
|
config = string(b)
|
||||||
}
|
|
||||||
} else {
|
|
||||||
config = []string{}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reqWrapped := wrapperUpdateRequest{
|
reqWrapped := wrapperUpdateRequest{
|
||||||
|
|||||||
Reference in New Issue
Block a user