main v1.12.6
dayterr 2 weeks ago
parent 84a090f9e8
commit 095a18f27a

@ -1,34 +1,32 @@
## Version 1.12.5
## Version 1.12.6
Методы `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-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 |
| BGOS-638 | Добавлена поддержка версий 4.1.0 и 4.2.0 в функцию check |
#### disks
#### image
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-627 | Методы `Migrate`, `MigrateAbort` и `GetMigrateStatus`, структуры запросов `MigrateRequest`, `CloneMigrateRequest` и `GetMigrateStatusRequest` и структура ответа `MigrateStatus` в cloudbroker/disks |
| BGOS-481 | Метод `AsyncCreateCDROMImage` в cloudbroker/image |
### Исправлено
#### compute
#### node
| Идентификатор<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 |
### Удалено
| BGOS-634 | Метод `UpdateDescription` и структура запроса `UpdateDescriptionRequest` в cloudbroker/node |
#### compute
#### stpolicy
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-629 | Методы `CreateTemplateAsync` в cloudapi/compute и в cloudbroker/compute |
| BGOS-636 | Вычисляемое поле `StoragePolicyID` в структуры ответа `InfoStoragePolicy` и `ItemStoragePolicy` в `cloudapi/stpolicy` и в cloudbroker/stpolicy |
#### vins
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-637 | Вычисляемое поле `LiveMigrationJobID` в структуры ответа `RecordVNFDev` в cloudapi/vins и в `VNFDev` cloudbroker/vins |

@ -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 {

@ -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": "-",
}

@ -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
}

@ -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

@ -848,23 +848,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{},

Loading…
Cancel
Save