Compare commits

...

1 Commits

Author SHA1 Message Date
dayterr
444a33dc7e v1.14.4
v1.14.4
2026-03-20 17:14:16 +03:00
11 changed files with 202 additions and 46 deletions

View File

@@ -1,4 +1,4 @@
## Version 1.14.3
## Version 1.14.4
Методы `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 и в следующих версиях будут удалены
@@ -9,62 +9,27 @@
### Добавлено
#### compute
#### image
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-805 | Вычисляемое поле `Provision` в структуру ответа `ItemComputeDisk` в cloudapi/compute и в структуру ответа `ItemDisk` в cloudbroker/compute |
#### disks
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-806 | Вычисляемое поле `Provision` в структуры ответа `ItemDisk`, `ItemDiskUnattached` и `RecordDisk` в cloudapi/disks и в структуру ответа `InfoDisk` в cloudbroker/disks |
| BGOS-812 | Методы `CreateMultiImage`, `MultiImageAddLinks`, `MultiImageDelLinks` и `MultiImageExport` в cloudbroker/image |
| BGOS-812 | Структуры запросов `CreateMultiImageRequest`, `MultiImageAddLinksRequest`, `MultiImageDelLinksRequest` и `MultiImageExportRequest` в cloudbroker/image |
| BGOS-813 | Вычисляемое поле `LinksTo` в структуры ответа `RecordImage` и `ItemImage` в cloudbroker/image и в структуру ответа `RecordImage` в cloudapi/image |
### node
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-802 | Опциональное поле `Target` в структуру запроса `GetLogicalCoresCountRequest` в cloudbroker/node |
| BGOS-811 | Вычисляемое поле `ThreadCount` в структуру ответа `CpuInfo` в cloudbroker/node |
#### rg
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-803 | Опциональное поле `CPUAllocationParameter` в структуру запроса `UpdateRequest` в cloudbroker/rg |
#### SDN Logical Ports
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-695 | Опциональное поле `Labels` в структуры запроса `CreateRequest` и `UpdateRequest` в sdn/logical_ports |
| BGOS-695 | Вычисляемое поле `Labels` в структуру ответа `LogicalPort` в sdn/logical_ports |
| BGOS-695 | Опциональные поля `OperationStatus` и `HypervisorStatus` в структуру запроса `ListRequest` в sdn/logical_ports |
| BGOS-695 | Вычисляемые поля `OperationStatus` и `HypervisorStatus` в структуре `Status` в структуру ответа `LogicalPort` в sdn/logical_ports |
### Изменено
#### compute
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-794 | Тип возвращаемого значения метода `AbortSharedSnapshotMerge` с `bool` на `string` в cloudapi/compute и в cloudbroker/compute |
| BGOS-814 | Тип возвращаемого значения метода `CheckComputePlacement` с `map[string]CheckComputePlacementItem` на `map[uint64]CheckComputePlacementItem` в cloudbroker/compute |
#### kvmx86
#### rg
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-808 | Минимальное значение поля `MTU` в структуре `Interface` в cloudapi/kvmx86 и cloudbroker/kvmx86 и в структуре `InterfaceMassCreate` в cloudbroker/kvmx86 с 1 на 1500 |
#### zone
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-807 | JSON-тег у вычисляемого поля `LBIDs` в структуре ответа `RecordZone` с `lbIds` на `lbsIds` в cloudapi/zone |
#### SDN Logical Ports
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-695 | Имя вычисляемого поля со `Status` на `OperationStatus` в sdn/logical_ports |
### Удалено
#### SDN Logical Ports
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-695 | Обязательное поле `IsExcludedFromFirewall` в структурах запроса `CreateRequest` и `UpdateRequest` в sdn/logical_ports |
| BGOS-695 | Вычисляемое поле `IsExcludedFromFirewall` в структуре `Bindings` в структуре ответа `LogicalPort` в sdn/logical_ports |
| BGOS-695 | Вычисляемое поле `Common` в структуре `Status` в структуре ответа `LogicalPort` в sdn/logical_ports |
| BGOS-695 | Структуры запроса `ExcludeFirewallRequest`, `UnexcludeFirewallRequest`, `CreateBatchRequest` и `DeleteBatchRequest` и методы `ExcludeFirewall`, `UnexcludeFirewall`, `CreateBatch` и `DeleteBatch` в sdn/logical_ports |
| BGOS-815 | JSON-тэг у поля `RGID` в структуре ответа `ItemResourceConsumption` с `rgid` на `id` в cloudbroker/rg |

View File

@@ -149,6 +149,9 @@ type RecordImage struct {
// Link to
LinkTo uint64 `json:"linkTo"`
// Links to
LinksTo []uint64 `json:"linksTo"`
// Milestones
Milestones uint64 `json:"milestones"`

View File

@@ -1535,4 +1535,4 @@ type CheckComputePlacementItem struct {
Error CheckComputePlacementError `json:"error,omitempty"`
}
type CheckComputePlacementResult map[string]CheckComputePlacementItem
type CheckComputePlacementResult map[uint64]CheckComputePlacementItem

View File

@@ -0,0 +1,47 @@
package image
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/constants"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// CreateMultiImageRequest struct to create multi image
type CreateMultiImageRequest struct {
// Name of the multi image
// Required: true
Name string `url:"name" json:"name" validate:"required"`
// IDs of real images
// Required: true
TargetIDs []uint64 `url:"target_ids" json:"target_ids" validate:"required"`
// Account ID
// Required: false
AccountID uint64 `url:"account_id,omitempty" json:"account_id,omitempty"`
}
// CreateMultiImage creates multi image
func (i Image) CreateMultiImage(ctx context.Context, req CreateMultiImageRequest) (uint64, error) {
err := validators.ValidateRequest(req)
if err != nil {
return 0, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/image/create_multi_image"
res, err := i.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil {
return 0, err
}
result, err := strconv.ParseUint(string(res), 10, 64)
if err != nil {
return 0, err
}
return result, nil
}

View File

@@ -62,6 +62,9 @@ type RecordImage struct {
// Link to
LinkTo uint64 `json:"linkTo"`
// Links to
LinksTo []uint64 `json:"linksTo"`
// Milestones
Milestones uint64 `json:"milestones"`
@@ -197,6 +200,9 @@ type ItemImage struct {
// Link to
LinkTo uint64 `json:"linkTo"`
// Links to
LinksTo []uint64 `json:"linksTo"`
// Milestones
Milestones uint64 `json:"milestones"`

View File

@@ -0,0 +1,43 @@
package image
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/constants"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// MultiImageAddLinksRequest struct to add links to multi image
type MultiImageAddLinksRequest struct {
// ID of the multi image
// Required: true
ImageID uint64 `url:"image_id" json:"image_id" validate:"required"`
// IDs of real images
// Required: true
TargetIDs []uint64 `url:"target_ids" json:"target_ids" validate:"required"`
}
// MultiImageAddLinks adds image links to multi image
func (i Image) MultiImageAddLinks(ctx context.Context, req MultiImageAddLinksRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/image/multi_image_add_links"
res, err := i.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}

View File

@@ -0,0 +1,43 @@
package image
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/constants"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// MultiImageDelLinksRequest struct to delete links from multi image
type MultiImageDelLinksRequest struct {
// ID of the multi image
// Required: true
ImageID uint64 `url:"image_id" json:"image_id" validate:"required"`
// IDs of real images
// Required: true
TargetIDs []uint64 `url:"target_ids" json:"target_ids" validate:"required"`
}
// MultiImageDelLinks removes image links from multi image
func (i Image) MultiImageDelLinks(ctx context.Context, req MultiImageDelLinksRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/image/multi_image_del_links"
res, err := i.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}

View File

@@ -0,0 +1,42 @@
package image
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// MultiImageExportRequest struct to export multi image to a pool
type MultiImageExportRequest struct {
// ID of the multi image
// Required: true
MultiImageID uint64 `url:"multi_image_id" json:"multi_image_id" validate:"required"`
// Name of the target pool
// Required: true
PoolName string `url:"pool_name" json:"pool_name" validate:"required"`
}
// MultiImageExport copies a physical image from multi image to the specified pool
func (i Image) MultiImageExport(ctx context.Context, req MultiImageExportRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/image/multi_image_export"
res, err := i.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
}

View File

@@ -155,6 +155,9 @@ type CpuInfo struct {
// PhysCount
PhysCount uint64 `json:"physCount"`
// Thread count
ThreadCount uint64 `json:"threadCount"`
// Flags
Flags []string `json:"flags"`

View File

@@ -66,7 +66,7 @@ type ItemResourceConsumption struct {
ResourceLimits ResourceLimits `json:"resourceLimits"`
// Resource group ID
RGID uint64 `json:"rgid"`
RGID uint64 `json:"id"`
}
type ListResourceConsumption struct {

View File

@@ -795,6 +795,10 @@ func getRequestsMapCloudbroker() map[string]interface{} {
"/restmachine/cloudbroker/image/rename": image_cb.RenameRequest{},
"/restmachine/cloudbroker/image/revokeAccess": image_cb.RevokeAccessRequest{},
"/restmachine/cloudbroker/image/share": image_cb.ShareRequest{},
"/restmachine/cloudbroker/image/create_multi_image": image_cb.CreateMultiImageRequest{},
"/restmachine/cloudbroker/image/multi_image_add_links": image_cb.MultiImageAddLinksRequest{},
"/restmachine/cloudbroker/image/multi_image_del_links": image_cb.MultiImageDelLinksRequest{},
"/restmachine/cloudbroker/image/multi_image_export": image_cb.MultiImageExportRequest{},
// k8ci
"/restmachine/cloudbroker/k8ci/accessAdd": k8ci_cb.AccessAddRequest{},