Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9adcfec1c | ||
| f6bc14c7be |
15
CHANGELOG.md
15
CHANGELOG.md
@@ -1,4 +1,4 @@
|
||||
## Version 1.14.9
|
||||
## Version 1.14.11
|
||||
|
||||
Методы `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,9 +7,16 @@
|
||||
|
||||
Все методы группы `.SDN()` находятся в альфа-версии.
|
||||
|
||||
### Добавлено
|
||||
### Изменено
|
||||
|
||||
#### vgpu
|
||||
#### compute
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-851 | Группа методов `cloudapi/vgpu` |
|
||||
| BGOS-874 | Поле `StoragePolicyID` с обязательного на опциональное в структуре запроса `RedeployRequest` в cloudapi/compute и cloudbroker/compute |
|
||||
|
||||
### Исправлено
|
||||
|
||||
#### vfpool
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-871 | Тип поля `Config` в структуре запроса `wrapperUpdateRequest` с `[]string` на `string` в cloudbroker/vfpool |
|
||||
|
||||
@@ -161,7 +161,6 @@ go get -u repository.basistech.ru/BASIS/decort-golang-sdk
|
||||
- `PCIDevice` - управление устройствами;
|
||||
- `Prometheus` - получение статистики prometheus;
|
||||
- `Resmon` - получение статистики resource monitoring;
|
||||
- `ResourceOptimizer` - управление инструментом оптимизации ресурсов (DRS);
|
||||
- `RG` - управление ресурсными группами аккаунта;
|
||||
- `Security group` – управление группами безопасности;
|
||||
- `SEP` - управление storage endpoint (sep);
|
||||
@@ -370,7 +369,6 @@ func main() {
|
||||
- `pkg/cloudbroker/pcidevice` - для `PCIDevice`
|
||||
- `pkg/cloudbroker/prometheus` - для `Prometheus`
|
||||
- `pkg/cloudbroker/resmon` - для `Resmon`
|
||||
- `pkg/cloudbroker/resource_optimizer` - для `ResourceOptimizer`
|
||||
- `pkg/cloudbroker/rg` - для `RG`
|
||||
- `pkg/cloudbroker/secgroup` - для `Security group`
|
||||
- `pkg/cloudbroker/sep` - для `SEP`
|
||||
|
||||
@@ -15,7 +15,7 @@ type RedeployRequest struct {
|
||||
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||
|
||||
// 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"`
|
||||
|
||||
// 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"`
|
||||
|
||||
// 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"`
|
||||
|
||||
// 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/decort-golang-sdk/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/decort-golang-sdk/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/decort-golang-sdk/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/decort-golang-sdk/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/decort-golang-sdk/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/decort-golang-sdk/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/decort-golang-sdk/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/decort-golang-sdk/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/decort-golang-sdk/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 {
|
||||
UpdateRequest
|
||||
Config []string `url:"config,omitempty"`
|
||||
Config string `url:"config,omitempty"`
|
||||
}
|
||||
|
||||
// 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))
|
||||
}
|
||||
|
||||
var config []string
|
||||
var config string
|
||||
|
||||
if len(req.Config) != 0 {
|
||||
config = make([]string, 0, len(req.Config))
|
||||
|
||||
for c := range req.Config {
|
||||
b, err := json.Marshal(req.Config[c])
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
config = append(config, string(b))
|
||||
b, err := json.Marshal(req.Config)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
} else {
|
||||
config = []string{}
|
||||
|
||||
config = string(b)
|
||||
}
|
||||
|
||||
reqWrapped := wrapperUpdateRequest{
|
||||
|
||||
@@ -58,7 +58,6 @@ import (
|
||||
node_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/node"
|
||||
pcidevice_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/pcidevice"
|
||||
prometheus_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/prometheus"
|
||||
resource_optimizer_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/resource_optimizer"
|
||||
rg_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/rg"
|
||||
secgroup_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/secgroup"
|
||||
sep_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/sep"
|
||||
@@ -928,15 +927,6 @@ func getRequestsMapCloudbroker() map[string]interface{} {
|
||||
"/restmachine/cloudbroker/prometheus/computeMemoryUsage": prometheus_cb.ComputeMemoryUsageRequest{},
|
||||
"/restmachine/cloudbroker/prometheus/computeMemoryUnused": prometheus_cb.ComputeMemoryUnusedRequest{},
|
||||
|
||||
// resource_optimizer
|
||||
"/restmachine/cloudbroker/resource_optimizer/drs_add_nodes": resource_optimizer_cb.DRSAddNodesRequest{},
|
||||
"/restmachine/cloudbroker/resource_optimizer/drs_create": resource_optimizer_cb.DRSCreateRequest{},
|
||||
"/restmachine/cloudbroker/resource_optimizer/drs_del_nodes": resource_optimizer_cb.DRSDelNodesRequest{},
|
||||
"/restmachine/cloudbroker/resource_optimizer/drs_remove": resource_optimizer_cb.DRSRemoveRequest{},
|
||||
"/restmachine/cloudbroker/resource_optimizer/drs_start": resource_optimizer_cb.DRSStartRequest{},
|
||||
"/restmachine/cloudbroker/resource_optimizer/drs_stop": resource_optimizer_cb.DRSStopRequest{},
|
||||
"/restmachine/cloudbroker/resource_optimizer/drs_update": resource_optimizer_cb.DRSUpdateRequest{},
|
||||
|
||||
// rg
|
||||
"/restmachine/cloudbroker/rg/accessGrant": rg_cb.AccessGrantRequest{},
|
||||
"/restmachine/cloudbroker/rg/accessRevoke": rg_cb.AccessRevokeRequest{},
|
||||
|
||||
@@ -22,6 +22,7 @@ var DEPRECATED_GROUPS = []string{
|
||||
"/cloudapi/compute/affinityGroupCheckStart",
|
||||
"/cloudapi/vins/staticRouteAccessGrant",
|
||||
"/cloudapi/vins/staticRouteAccessRevoke",
|
||||
"/cloudbroker/resource_optimizer",
|
||||
|
||||
"/cloudbroker/account/listVMs",
|
||||
"/cloudbroker/account/listCS",
|
||||
|
||||
Reference in New Issue
Block a user