Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bf5c01b40b |
34
CHANGELOG.md
34
CHANGELOG.md
@@ -1,32 +1,12 @@
|
|||||||
## Version 1.12.6
|
## Version 1.12.7
|
||||||
|
|
||||||
Методы `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 с соответствующими фильтрами
|
||||||
Метод `ListStacks` в cloudbroker/image стал deprecated и в следующих версиях будет удалён
|
Метод `ListStacks` в cloudbroker/image стал deprecated и в следующих версиях будет удалён
|
||||||
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и в следующих версиях будут удалены
|
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и в следующих версиях будут удалены
|
||||||
|
|
||||||
### Добавлено
|
### Добавлено
|
||||||
|
|
||||||
#### общее
|
#### rg
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
|-------------------------|--------------------------------------------------------|
|
||||||
| BGOS-638 | Добавлена поддержка версий 4.1.0 и 4.2.0 в функцию check |
|
| BGOS-641 | Методы `AddStoragePolicy` и `DelStoragePolicy` и структуры запроса `AddStoragePolicyRequest` и `DelStoragePolicyRequest` в cloudapi/rg |
|
||||||
|
|
||||||
#### image
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-481 | Метод `AsyncCreateCDROMImage` в cloudbroker/image |
|
|
||||||
|
|
||||||
#### node
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-634 | Метод `UpdateDescription` и структура запроса `UpdateDescriptionRequest` в cloudbroker/node |
|
|
||||||
|
|
||||||
#### stpolicy
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-636 | Вычисляемое поле `StoragePolicyID` в структуры ответа `InfoStoragePolicy` и `ItemStoragePolicy` в `cloudapi/stpolicy` и в cloudbroker/stpolicy |
|
|
||||||
|
|
||||||
#### vins
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-637 | Вычисляемое поле `LiveMigrationJobID` в структуры ответа `RecordVNFDev` в cloudapi/vins и в `VNFDev` cloudbroker/vins |
|
|
||||||
|
|||||||
46
pkg/cloudapi/rg/add_storage_policy.go
Normal file
46
pkg/cloudapi/rg/add_storage_policy.go
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
package rg
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AddStoragePolicyRequest struct for adding storage policy to the resource group
|
||||||
|
type AddStoragePolicyRequest struct {
|
||||||
|
// ID of resource group to add to
|
||||||
|
// Required: true
|
||||||
|
RGID uint64 `url:"resgroup_id" json:"resgroup_id" validate:"required"`
|
||||||
|
|
||||||
|
// ID of the storage policy to which to connect resource group
|
||||||
|
// Required: true
|
||||||
|
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
|
||||||
|
|
||||||
|
// Limit storage resources GB. Or -1 unlimit
|
||||||
|
// Required: false
|
||||||
|
Limit int `url:"limit,omitempty" json:"limit,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// AddStoragePolicy add storage policy to the account.
|
||||||
|
func (r RG) AddStoragePolicy(ctx context.Context, req AddStoragePolicyRequest) (bool, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudapi/rg/add_storage_policy"
|
||||||
|
|
||||||
|
res, err := r.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
|
||||||
|
}
|
||||||
42
pkg/cloudapi/rg/del_storage_policy.go
Normal file
42
pkg/cloudapi/rg/del_storage_policy.go
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
package rg
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DelStoragePolicyRequest struct for deleting storage policy to the resource group
|
||||||
|
type DelStoragePolicyRequest struct {
|
||||||
|
// ID of resource group
|
||||||
|
// Required: true
|
||||||
|
RGID uint64 `url:"resgroup_id" json:"resgroup_id" validate:"required"`
|
||||||
|
|
||||||
|
// ID of the storage policy to which to disconnect account
|
||||||
|
// Required: true
|
||||||
|
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// DelStoragePolicy delete storage policy to the account.
|
||||||
|
func (r RG) DelStoragePolicy(ctx context.Context, req DelStoragePolicyRequest) (bool, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudapi/rg/del_storage_policy"
|
||||||
|
|
||||||
|
res, err := r.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
|
||||||
|
}
|
||||||
@@ -385,6 +385,8 @@ func getRequestsMapCloudAPI() map[string]interface{} {
|
|||||||
"/restmachine/cloudapi/rg/update": rg.UpdateRequest{},
|
"/restmachine/cloudapi/rg/update": rg.UpdateRequest{},
|
||||||
"/restmachine/cloudapi/rg/usage": rg.UsageRequest{},
|
"/restmachine/cloudapi/rg/usage": rg.UsageRequest{},
|
||||||
"/restmachine/cloudapi/rg/removeDefNet": rg.RemoveDefNetRequest{},
|
"/restmachine/cloudapi/rg/removeDefNet": rg.RemoveDefNetRequest{},
|
||||||
|
"/restmachine/cloudapi/rg/add_storage_policy": rg.AddStoragePolicyRequest{},
|
||||||
|
"/restmachine/cloudapi/rg/del_storage_policy": rg.DelStoragePolicyRequest{},
|
||||||
|
|
||||||
// security_group
|
// security_group
|
||||||
"/restmachine/cloudapi/security_group/create": secgroup.CreateRequest{},
|
"/restmachine/cloudapi/security_group/create": secgroup.CreateRequest{},
|
||||||
|
|||||||
Reference in New Issue
Block a user