Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
562b6019d0 | ||
| bf5c01b40b | |||
|
|
095a18f27a |
34
CHANGELOG.md
34
CHANGELOG.md
@@ -1,34 +1,12 @@
|
||||
## Version 1.12.5
|
||||
## Version 1.12.8
|
||||
|
||||
Методы `Audits` в cloudapi/compute, cloudbroker/compute, cloudapi/account, cloudbroker/account, cloudapi/vins, cloudbroker/vins, cloudapi/rg и cloudbroker/rg стали deprecated и в следующих версиях будут удалены, вместо них необходимо использовать метод `List` в cloudapi/audit и cloudbroker/audit с соответствующими фильтрами
|
||||
|
||||
### Добавлено
|
||||
|
||||
#### compute
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-625 | Обязательное поле `StoragePolicyID` и опциональные поля `PoolName` и `SEPID` в структуру запроса `CloneRequest` в cloudapi/compute и cloudbroker/compute |
|
||||
| BGOS-626 | Методы `CloneAbort` и `GetCloneStatus` и структуры запросов `CloneAbortRequest` и `GetCloneStatusRequest` в cloudbroker/compute |
|
||||
| BGOS-630 | Поле `BootImageID` в структуры ответа `ItemCompute` и `RecordCompute` в cloudapi/compute и в структуры ответа `RecordCompute` и `InfoCompute` в cloudbroker/compute |
|
||||
|
||||
#### disks
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-627 | Методы `Migrate`, `MigrateAbort` и `GetMigrateStatus`, структуры запросов `MigrateRequest`, `CloneMigrateRequest` и `GetMigrateStatusRequest` и структура ответа `MigrateStatus` в cloudbroker/disks |
|
||||
Методы `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 и в следующих версиях будет удалён
|
||||
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и в следующих версиях будут удалены
|
||||
|
||||
### Исправлено
|
||||
|
||||
#### compute
|
||||
#### Общие изменения
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-623 | Тип поля `EnableSecGroups` с `bool` на `interface{}` в структуре запроса `ChangeSecGroupsRequest` в cloudapi/compute и в cloudbroker/compute |
|
||||
| BGOS-625 | Возвращаемое значение в функции `Clone` с `uint64` на `string` в cloudapi/compute и cloudbroker/compute |
|
||||
| BGOS-629 | Возвращаемое значение метода `CreateTemplate` изменено с `uint64` на `string` в cloudapi/compute и в cloudbroker/compute |
|
||||
|
||||
### Удалено
|
||||
|
||||
#### compute
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-629 | Методы `CreateTemplateAsync` в cloudapi/compute и в cloudbroker/compute |
|
||||
|
||||
| BGOS-644, BGOS-645, BGOS-646 | Исправлены уязвимости, обновлена версия go до v1.24.0 |
|
||||
24
check.go
24
check.go
@@ -28,7 +28,13 @@ func (de DecortClient) Check() (*CheckInfo, error) {
|
||||
|
||||
err = json.Unmarshal([]byte(strings.Replace(strings.Trim(string(res), `"`), "\\", "", -1)), &info)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
var v string
|
||||
json.Unmarshal([]byte(res), &v)
|
||||
if _, exists := constants.VersionMap[v]; exists {
|
||||
info.Version = v
|
||||
} else {
|
||||
return nil, fmt.Errorf("platform version isn't supported")
|
||||
}
|
||||
}
|
||||
|
||||
if v, ok := constants.VersionMap[info.Version]; ok {
|
||||
@@ -51,7 +57,13 @@ func (bvs BVSDecortClient) Check() (*CheckInfo, error) {
|
||||
|
||||
err = json.Unmarshal([]byte(strings.Replace(strings.Trim(string(res), `"`), "\\", "", -1)), &info)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
var v string
|
||||
json.Unmarshal([]byte(res), &v)
|
||||
if _, exists := constants.VersionMap[v]; exists {
|
||||
info.Version = v
|
||||
} else {
|
||||
return nil, fmt.Errorf("platform version isn't supported")
|
||||
}
|
||||
}
|
||||
|
||||
if v, ok := constants.VersionMap[info.Version]; ok {
|
||||
@@ -74,7 +86,13 @@ func (ldc LegacyDecortClient) Check() (*CheckInfo, error) {
|
||||
|
||||
err = json.Unmarshal([]byte(strings.Replace(strings.Trim(string(res), `"`), "\\", "", -1)), &info)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
var v string
|
||||
json.Unmarshal([]byte(res), &v)
|
||||
if _, exists := constants.VersionMap[v]; exists {
|
||||
info.Version = v
|
||||
} else {
|
||||
return nil, fmt.Errorf("platform version isn't supported")
|
||||
}
|
||||
}
|
||||
|
||||
if v, ok := constants.VersionMap[info.Version]; ok {
|
||||
|
||||
14
go.mod
14
go.mod
@@ -1,21 +1,21 @@
|
||||
module repository.basistech.ru/BASIS/decort-golang-sdk
|
||||
|
||||
go 1.20
|
||||
go 1.24.0
|
||||
|
||||
require (
|
||||
github.com/go-playground/validator/v10 v10.11.2
|
||||
github.com/go-playground/validator/v10 v10.28.0
|
||||
github.com/google/go-querystring v1.1.0
|
||||
github.com/joho/godotenv v1.5.1
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/gabriel-vasile/mimetype v1.4.10 // indirect
|
||||
github.com/go-playground/locales v0.14.1 // indirect
|
||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||
github.com/google/go-cmp v0.5.9 // indirect
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/leodido/go-urn v1.2.1 // indirect
|
||||
golang.org/x/crypto v0.15.0 // indirect
|
||||
golang.org/x/sys v0.14.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
github.com/leodido/go-urn v1.4.0 // indirect
|
||||
golang.org/x/crypto v0.42.0 // indirect
|
||||
golang.org/x/sys v0.36.0 // indirect
|
||||
golang.org/x/text v0.29.0 // indirect
|
||||
)
|
||||
|
||||
16
go.sum
16
go.sum
@@ -1,6 +1,8 @@
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=
|
||||
github.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
|
||||
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
|
||||
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
|
||||
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
||||
@@ -8,6 +10,9 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn
|
||||
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
||||
github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU=
|
||||
github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s=
|
||||
github.com/go-playground/validator/v10 v10.27.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo=
|
||||
github.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=
|
||||
github.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=
|
||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
@@ -20,6 +25,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=
|
||||
github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
|
||||
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
|
||||
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
|
||||
@@ -28,10 +35,19 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
|
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
|
||||
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
|
||||
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
|
||||
golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI=
|
||||
golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8=
|
||||
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
|
||||
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
|
||||
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
|
||||
golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk=
|
||||
golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
|
||||
@@ -28,5 +28,9 @@ var FileName = map[string]string{
|
||||
var K8sValues = []string{"labels", "taints", "annotations, additionalSANs"}
|
||||
|
||||
var VersionMap = map[string]string{
|
||||
"4.4.0": "-",
|
||||
"4.3.0": "-",
|
||||
"4.2.0": "-",
|
||||
"4.1.1": "-",
|
||||
"4.1.0": "-",
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
@@ -30,6 +30,9 @@ type ItemStoragePolicy struct {
|
||||
// Max IOPS for the sotrage policy
|
||||
LimitIOPS uint64 `json:"limit_iops"`
|
||||
|
||||
// Storage policy ID
|
||||
StoragePolicyID uint64 `json:"storage_policy_id"`
|
||||
|
||||
// Which accounts and resource groups use the storage policy
|
||||
Usage Usage `json:"usage"`
|
||||
}
|
||||
@@ -56,6 +59,9 @@ type InfoStoragePolicy struct {
|
||||
// Max IOPS for the sotrage policy
|
||||
LimitIOPS uint64 `json:"limit_iops"`
|
||||
|
||||
// ID of the storage policy
|
||||
StoragePolicyID uint64 `json:"storage_policy_id"`
|
||||
|
||||
// Which accounts and resource groups use the storage policy
|
||||
Usage Usage `json:"usage"`
|
||||
}
|
||||
|
||||
@@ -214,6 +214,9 @@ type RecordVNFDev struct {
|
||||
|
||||
// Zone ID
|
||||
ZoneID uint64 `json:"zoneId"`
|
||||
|
||||
// Live migration job ID
|
||||
LiveMigrationJobID uint64 `json:"live_migration_job_id"`
|
||||
}
|
||||
|
||||
// VNF config
|
||||
|
||||
@@ -2,6 +2,7 @@ package image
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
@@ -43,6 +44,11 @@ type CreateCDROMImageRequest struct {
|
||||
PasswordDl string `url:"passwordDL,omitempty" json:"passwordDL,omitempty"`
|
||||
}
|
||||
|
||||
type asyncWrapperCreateCDROMImageRequest struct {
|
||||
CreateCDROMImageRequest
|
||||
AsyncMode bool `url:"asyncMode"`
|
||||
}
|
||||
|
||||
// CreateCDROMImage creates CD-ROM image from an ISO identified by URL
|
||||
func (i Image) CreateCDROMImage(ctx context.Context, req CreateCDROMImageRequest) (uint64, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
@@ -52,7 +58,9 @@ func (i Image) CreateCDROMImage(ctx context.Context, req CreateCDROMImageRequest
|
||||
|
||||
url := "/cloudbroker/image/createCDROMImage"
|
||||
|
||||
res, err := i.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
syncReq := asyncWrapperCreateCDROMImageRequest{CreateCDROMImageRequest: req, AsyncMode: false}
|
||||
|
||||
res, err := i.client.DecortApiCall(ctx, http.MethodPost, url, syncReq)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -64,3 +72,29 @@ func (i Image) CreateCDROMImage(ctx context.Context, req CreateCDROMImageRequest
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// AsyncCreateCDROMImage creates CD-ROM image from an ISO identified by URL in async mode
|
||||
func (i Image) AsyncCreateCDROMImage(ctx context.Context, req CreateCDROMImageRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/createCDROMImage"
|
||||
|
||||
asyncReq := asyncWrapperCreateCDROMImageRequest{CreateCDROMImageRequest: req, AsyncMode: true}
|
||||
|
||||
res, err := i.client.DecortApiCall(ctx, http.MethodPost, url, asyncReq)
|
||||
if err != nil {
|
||||
return " ", err
|
||||
}
|
||||
|
||||
var taskID string
|
||||
|
||||
err = json.Unmarshal(res, &taskID)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return taskID, nil
|
||||
}
|
||||
|
||||
42
pkg/cloudbroker/node/update_description.go
Normal file
42
pkg/cloudbroker/node/update_description.go
Normal file
@@ -0,0 +1,42 @@
|
||||
package node
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// UpdateDescriptionRequest struct to update description of the node
|
||||
type UpdateDescriptionRequest struct {
|
||||
// Node ID
|
||||
// Required: true
|
||||
NID uint64 `url:"nid" json:"nid" validate:"required"`
|
||||
|
||||
// New description for the node
|
||||
// Required: true
|
||||
Description string `url:"description" json:"description" validate:"required"`
|
||||
}
|
||||
|
||||
// UpdateDescription updates description of the node
|
||||
func (n Node) UpdateDescription(ctx context.Context, req UpdateDescriptionRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/node/update_description"
|
||||
|
||||
res, err := n.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
|
||||
}
|
||||
@@ -56,6 +56,9 @@ type ItemStoragePolicy struct {
|
||||
// Max IOPS for the sotrage policy
|
||||
LimitIOPS uint64 `json:"limit_iops"`
|
||||
|
||||
// Storage policy ID
|
||||
StoragePolicyID uint64 `json:"storage_policy_id"`
|
||||
|
||||
// Which accounts and resource groups use the storage policy
|
||||
Usage Usage `json:"usage"`
|
||||
}
|
||||
@@ -82,6 +85,9 @@ type InfoStoragePolicy struct {
|
||||
// Max IOPS for the storage policy
|
||||
LimitIOPS uint64 `json:"limit_iops"`
|
||||
|
||||
// Storage policy ID
|
||||
StoragePolicyID uint64 `json:"storage_policy_id"`
|
||||
|
||||
// Which accounts and resource groups use the storage policy
|
||||
Usage Usage `json:"usage"`
|
||||
}
|
||||
|
||||
@@ -250,6 +250,9 @@ type VNFDev struct {
|
||||
|
||||
// Zone ID
|
||||
ZoneID uint64 `json:"zoneId"`
|
||||
|
||||
// Live migration job ID
|
||||
LiveMigrationJobID uint64 `json:"live_migration_job_id"`
|
||||
}
|
||||
|
||||
// Main information about reservation
|
||||
|
||||
@@ -385,6 +385,8 @@ func getRequestsMapCloudAPI() map[string]interface{} {
|
||||
"/restmachine/cloudapi/rg/update": rg.UpdateRequest{},
|
||||
"/restmachine/cloudapi/rg/usage": rg.UsageRequest{},
|
||||
"/restmachine/cloudapi/rg/removeDefNet": rg.RemoveDefNetRequest{},
|
||||
"/restmachine/cloudapi/rg/add_storage_policy": rg.AddStoragePolicyRequest{},
|
||||
"/restmachine/cloudapi/rg/del_storage_policy": rg.DelStoragePolicyRequest{},
|
||||
|
||||
// security_group
|
||||
"/restmachine/cloudapi/security_group/create": secgroup.CreateRequest{},
|
||||
@@ -848,23 +850,24 @@ func getRequestsMapCloudbroker() map[string]interface{} {
|
||||
"/restmachine/cloudbroker/lb/updateSysctlParams": lb_cb.UpdateSysctParamsRequest{},
|
||||
|
||||
// node
|
||||
"/restmachine/cloudbroker/node/add_ssh_identity": node_cb.AddSSHIdentityRequest{},
|
||||
"/restmachine/cloudbroker/node/applyIpmiAction": node_cb.ApplyIpmiActionRequest{},
|
||||
"/restmachine/cloudbroker/node/consumption": node_cb.ConsumptionRequest{},
|
||||
"/restmachine/cloudbroker/node/decommission": node_cb.DecommissionRequest{},
|
||||
"/restmachine/cloudbroker/node/enable": node_cb.EnableRequest{},
|
||||
"/restmachine/cloudbroker/node/enableNodes": node_cb.EnableNodesRequest{},
|
||||
"/restmachine/cloudbroker/node/get": node_cb.GetRequest{},
|
||||
"/restmachine/cloudbroker/node/get_ssh_identity": node_cb.GetSSHIdentityRequest{},
|
||||
"/restmachine/cloudbroker/node/list": node_cb.ListRequest{},
|
||||
"/restmachine/cloudbroker/node/maintenance": node_cb.MaintenanceRequest{},
|
||||
"/restmachine/cloudbroker/node/restrict": node_cb.RestrictRequest{},
|
||||
"/restmachine/cloudbroker/node/setCoreIsolation": node_cb.SetCoreIsolationRequest{},
|
||||
"/restmachine/cloudbroker/node/setHugePages": node_cb.SetHugePagesRequest{},
|
||||
"/restmachine/cloudbroker/node/setsriovstatus": node_cb.SetSRIOVStatusRequest{},
|
||||
"/restmachine/cloudbroker/node/setVFsNumber": node_cb.SetVFsNumberRequest{},
|
||||
"/restmachine/cloudbroker/node/update": node_cb.UpdateRequest{},
|
||||
"/restmachine/cloudbroker/node/setVFsParams": node_cb.VFParam{},
|
||||
"/restmachine/cloudbroker/node/add_ssh_identity": node_cb.AddSSHIdentityRequest{},
|
||||
"/restmachine/cloudbroker/node/applyIpmiAction": node_cb.ApplyIpmiActionRequest{},
|
||||
"/restmachine/cloudbroker/node/consumption": node_cb.ConsumptionRequest{},
|
||||
"/restmachine/cloudbroker/node/decommission": node_cb.DecommissionRequest{},
|
||||
"/restmachine/cloudbroker/node/enable": node_cb.EnableRequest{},
|
||||
"/restmachine/cloudbroker/node/enableNodes": node_cb.EnableNodesRequest{},
|
||||
"/restmachine/cloudbroker/node/get": node_cb.GetRequest{},
|
||||
"/restmachine/cloudbroker/node/get_ssh_identity": node_cb.GetSSHIdentityRequest{},
|
||||
"/restmachine/cloudbroker/node/list": node_cb.ListRequest{},
|
||||
"/restmachine/cloudbroker/node/maintenance": node_cb.MaintenanceRequest{},
|
||||
"/restmachine/cloudbroker/node/restrict": node_cb.RestrictRequest{},
|
||||
"/restmachine/cloudbroker/node/setCoreIsolation": node_cb.SetCoreIsolationRequest{},
|
||||
"/restmachine/cloudbroker/node/setHugePages": node_cb.SetHugePagesRequest{},
|
||||
"/restmachine/cloudbroker/node/setsriovstatus": node_cb.SetSRIOVStatusRequest{},
|
||||
"/restmachine/cloudbroker/node/setVFsNumber": node_cb.SetVFsNumberRequest{},
|
||||
"/restmachine/cloudbroker/node/update": node_cb.UpdateRequest{},
|
||||
"/restmachine/cloudbroker/node/update_description": node_cb.UpdateDescriptionRequest{},
|
||||
"/restmachine/cloudbroker/node/setVFsParams": node_cb.VFParam{},
|
||||
|
||||
// pcidevice
|
||||
"/restmachine/cloudbroker/pcidevice/create": pcidevice_cb.CreateRequest{},
|
||||
|
||||
Reference in New Issue
Block a user