Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b834e5d074 | ||
| e1f0d354af | |||
|
|
d149ba19fd |
43
CHANGELOG.md
43
CHANGELOG.md
@@ -1,7 +1,6 @@
|
|||||||
## Version 1.13.6
|
## Version 1.14.0
|
||||||
|
|
||||||
Методы `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 с соответствующими фильтрами
|
||||||
Метод `ListNodes` в cloudbroker/image стал deprecated и в следующих версиях будет удалён
|
|
||||||
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и в следующих версиях будут удалены
|
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и в следующих версиях будут удалены
|
||||||
Методы `ComputeCISet`, `ComputeCIUnset`, `GetAudits` в cloudbroker/compute и `GetAudits` в cloudapi/compute стали deprecated и будут удалены в следующих версиях
|
Методы `ComputeCISet`, `ComputeCIUnset`, `GetAudits` в cloudbroker/compute и `GetAudits` в cloudapi/compute стали deprecated и будут удалены в следующих версиях
|
||||||
Методы `ComputeCISet`, `ComputeCIUnset` в cloudbroker/image стали deprecated и будут удалены в следующих версиях
|
Методы `ComputeCISet`, `ComputeCIUnset` в cloudbroker/image стали deprecated и будут удалены в следующих версиях
|
||||||
@@ -10,49 +9,41 @@
|
|||||||
|
|
||||||
### Добавлено
|
### Добавлено
|
||||||
|
|
||||||
|
#### account
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-772 | Вычисляемое поле `UpdatedBy` в структуры ответа `RecordAccount` в cloudapi/account и `InfoAccount` в cloudbroker/account |
|
||||||
|
|
||||||
#### compute
|
#### compute
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-751 | Опциональные поля `SDNSegmentID`, `SDNObjectGroupID`, `SDNLogicalPortDisplayName`, `SDNLogicalPortDescription` в структуры запроса в `Interface` в cloudapi/compute и в `Interface`, `InterfaceMassCreate` в cloudbroker/compute |
|
| BGOS-767 | Метод `CheckComputePlacement`, структура запроса `CheckComputePlacementRequest` и структуры ответа `CheckComputePlacementResult`, `CheckComputePlacementItem`,`CheckComputePlacementError` в cloudbroker/compute |
|
||||||
| BGOS-752 | Опциональные поля `SDNSegmentID`, `SDNObjectGroupID`, `SDNLogicalPortDisplayName`, `SDNLogicalPortDescription` в структуру запроса `NetAttachRequest` в cloudapi/compute и в cloudbroker/compute |
|
| BGOS-771 | Вычисляемое поле `BlockSize` в структуры ответа `ItemDisk` в cloudbroker/compute и в `ItemComputeDisk` в cloudapi/compute |
|
||||||
|
|
||||||
#### disks
|
#### disks
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-735 | Вычисляемое поле `Cache` в структуры ответа `ItemDiskUnattached` в cloudapi/disks и в cloudbroker/disks |
|
| BGOS-770 | Опциональное поле `BlockSize` в структуру запроса `UpdateRequest` в cloudbroker/disks |
|
||||||
|
| BGOS-770 | Вычисляемое поле `BlockSize` в структуры ответа `ItemDisk`, `ItemDiskUnattached` и `RecordDisk` в cloudapi/disks и в структуры ответа `InfoDisk` и `RecordDisk` в cloudbroker/disks |
|
||||||
|
|
||||||
#### node
|
#### node
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-738 | Структура запроса `AutoStartRequest`, метод `AutoStart` в cloudbroker/node |
|
| BGOS-769 | Опциональное поле `ZoneID` в структуру запроса `ListRequest` в cloudbroker/node |
|
||||||
| BGOS-738 | Опциональное поле `AutoStart` в структуру запроса `MaintenanceRequest` в cloudbroker/node |
|
|
||||||
| BGOS-738 | Вычисляемые поля `AutoStart`, `AutoStartCount` в структуры ответов `ItemNode` и `RecordNode` в cloudbroker/node |
|
|
||||||
| BGOS-746 | Вычисляемое поле `MemAllocationRatio` в структуру ответа `RecordNode` в cloudbroker/node |
|
|
||||||
|
|
||||||
#### zone
|
#### SDN external networks
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-737 | Опциональное поле `AutoStart` в структуру запроса `UpdateRequest` в cloudbroker/zone |
|
| BGOS-694 | Опциональные поля `OperationStatus` и `HypervisorStatus` в структуру запроса `ListRequest` в sdn/external_networks |
|
||||||
| BGOS-737 | Вычисляемое поле `AutoStart` в структуры ответа `RecordZone` в cloudapi/zone и в cloudbroker/zone |
|
|
||||||
| BGOS-748 | Опциональное поле `AutoStart` в структуру запроса `CreateRequest` в cloudbroker/zone |
|
|
||||||
| BGOS-743 | Структура запроса `NodeAutoStartRequest`, метод `NodeAutoStart` в cloudbroker/zone |
|
|
||||||
|
|
||||||
### Изменено
|
#### SDN network object groups
|
||||||
|
|
||||||
#### sep
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-740 | Тип поля `Force` с обязательного на опциональный в структуре запроса `DelConsumerNodesRequest` в cloudbroker/sep |
|
| BGOS-749 | Методы `AttachL2ConnectionPorts`, `DetachL2ConnectionPorts` и структуры запросов `AttachL2ConnectionPortsRequest`, `L2PortBindings`, `DetachL2PortBindings`, `DetachL2ConnectionPortsRequest` в sdn/netobjgroups |
|
||||||
|
|
||||||
### Удалено
|
### Удалено
|
||||||
|
|
||||||
#### bservice
|
#### kvmx86
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-739 | Обязательное поле `Driver` в структурах запроса `GroupAddRequest` в cloudapi/bservice и в cloudbroker/bservice |
|
| BGOS-773 | Опциональные поля `IS` и `IPAType` из структур запроса `CreateRequest` в cloudapi/kvmx86 и в cloudbroker/kvmx86 |
|
||||||
|
|
||||||
#### flipgroup
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-742 | Опциональное поле `RGID` из структуры запроса `ListRequest` в cloudapi/flipgroup и в cloudbroker/flipgroup |
|
|
||||||
| BGOS-742 | Вычисляемые поля `RGName` и `RGID` из структуры ответа `RecordFLIPGroup` в cloudapi/flipgroup и в cloudbroker/flipgroup |
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ Decort SDK - это библиотека, написанная на языке G
|
|||||||
- Версия 1.11.х Decort-SDK соответствует 4.3.0 версии платформы
|
- Версия 1.11.х Decort-SDK соответствует 4.3.0 версии платформы
|
||||||
- Версия 1.12.х Decort-SDK соответствует 4.4.0 версии платформы
|
- Версия 1.12.х Decort-SDK соответствует 4.4.0 версии платформы
|
||||||
- Версия 1.13.х Decort-SDK соответствует 4.5.0 версии платформы
|
- Версия 1.13.х Decort-SDK соответствует 4.5.0 версии платформы
|
||||||
|
- Версия 1.14.х Decort-SDK соответствует 4.6.0 версии платформы
|
||||||
|
|
||||||
## Оглавление
|
## Оглавление
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ var FileName = map[string]string{
|
|||||||
var K8sValues = []string{"labels", "taints", "annotations, additionalSANs"}
|
var K8sValues = []string{"labels", "taints", "annotations, additionalSANs"}
|
||||||
|
|
||||||
var VersionMap = map[string]string{
|
var VersionMap = map[string]string{
|
||||||
|
"4.6.0": "-",
|
||||||
"4.5.0": "-",
|
"4.5.0": "-",
|
||||||
"4.4.0": "-",
|
"4.4.0": "-",
|
||||||
"4.3.0": "-",
|
"4.3.0": "-",
|
||||||
|
|||||||
@@ -299,6 +299,9 @@ type RecordAccount struct {
|
|||||||
// UniqPools
|
// UniqPools
|
||||||
UniqPools []interface{} `json:"uniqPools"`
|
UniqPools []interface{} `json:"uniqPools"`
|
||||||
|
|
||||||
|
// Updated By
|
||||||
|
UpdatedBy string `json:"updatedBy"`
|
||||||
|
|
||||||
// Updated time
|
// Updated time
|
||||||
UpdatedTime uint64 `json:"updatedTime"`
|
UpdatedTime uint64 `json:"updatedTime"`
|
||||||
|
|
||||||
|
|||||||
@@ -58,10 +58,6 @@ type DiskAddRequest struct {
|
|||||||
// Desired bus number (hex string, e.g. "0x03")
|
// Desired bus number (hex string, e.g. "0x03")
|
||||||
// Required: false
|
// Required: false
|
||||||
BusNumber string `url:"bus_number,omitempty" json:"bus_number,omitempty"`
|
BusNumber string `url:"bus_number,omitempty" json:"bus_number,omitempty"`
|
||||||
|
|
||||||
// Disk cache mode
|
|
||||||
// Required: false
|
|
||||||
Cache string `url:"cache,omitempty" json:"cache,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// DiskAdd creates new disk and attach to compute
|
// DiskAdd creates new disk and attach to compute
|
||||||
|
|||||||
@@ -789,6 +789,12 @@ type ItemComputeDisk struct {
|
|||||||
// Account ID
|
// Account ID
|
||||||
AccountID uint64 `json:"accountId"`
|
AccountID uint64 `json:"accountId"`
|
||||||
|
|
||||||
|
// BLK Discard
|
||||||
|
BLKDiscard bool `json:"blkdiscard"`
|
||||||
|
|
||||||
|
// Block Size
|
||||||
|
BlockSize string `json:"block_size"`
|
||||||
|
|
||||||
// Boot partition
|
// Boot partition
|
||||||
BootPartition uint64 `json:"bootPartition"`
|
BootPartition uint64 `json:"bootPartition"`
|
||||||
|
|
||||||
|
|||||||
@@ -37,10 +37,6 @@ type CreateRequest struct {
|
|||||||
// Pool name to create disk
|
// Pool name to create disk
|
||||||
// Required: false
|
// Required: false
|
||||||
Pool string `url:"pool,omitempty" json:"pool,omitempty"`
|
Pool string `url:"pool,omitempty" json:"pool,omitempty"`
|
||||||
|
|
||||||
// Cache mode of disk
|
|
||||||
// Required: false
|
|
||||||
Cache string `url:"cache,omitempty" json:"cache,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create creates a disk
|
// Create creates a disk
|
||||||
|
|||||||
@@ -360,7 +360,6 @@ func TestListSearchDisks_SortByCreatedTime(t *testing.T) {
|
|||||||
var unattachedDisks = ListDisksUnattached{
|
var unattachedDisks = ListDisksUnattached{
|
||||||
Data: []ItemDiskUnattached{
|
Data: []ItemDiskUnattached{
|
||||||
{
|
{
|
||||||
CKey: "",
|
|
||||||
Meta: []interface{}{
|
Meta: []interface{}{
|
||||||
"cloudbroker",
|
"cloudbroker",
|
||||||
"disk",
|
"disk",
|
||||||
@@ -412,7 +411,6 @@ var unattachedDisks = ListDisksUnattached{
|
|||||||
VMID: 0,
|
VMID: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
CKey: "",
|
|
||||||
Meta: []interface{}{
|
Meta: []interface{}{
|
||||||
"cloudbroker",
|
"cloudbroker",
|
||||||
"disk",
|
"disk",
|
||||||
|
|||||||
@@ -11,6 +11,12 @@ type ItemDisk struct {
|
|||||||
// Account name
|
// Account name
|
||||||
AccountName string `json:"accountName"`
|
AccountName string `json:"accountName"`
|
||||||
|
|
||||||
|
// BLK Discard
|
||||||
|
BLKDiscard bool `json:"blkdiscard"`
|
||||||
|
|
||||||
|
// Block size of disk
|
||||||
|
BlockSize string `json:"block_size"`
|
||||||
|
|
||||||
// Computes
|
// Computes
|
||||||
Computes map[string]string `json:"computes"`
|
Computes map[string]string `json:"computes"`
|
||||||
|
|
||||||
@@ -145,9 +151,6 @@ type ItemDisk struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ItemDiskUnattached struct {
|
type ItemDiskUnattached struct {
|
||||||
// CKey
|
|
||||||
CKey string `json:"_ckey"`
|
|
||||||
|
|
||||||
// Meta
|
// Meta
|
||||||
Meta []interface{} `json:"_meta"`
|
Meta []interface{} `json:"_meta"`
|
||||||
|
|
||||||
@@ -160,6 +163,12 @@ type ItemDiskUnattached struct {
|
|||||||
// Access Control List
|
// Access Control List
|
||||||
ACL map[string]interface{} `json:"acl"`
|
ACL map[string]interface{} `json:"acl"`
|
||||||
|
|
||||||
|
// BLK Discard
|
||||||
|
BLKDiscard bool `json:"blkdiscard"`
|
||||||
|
|
||||||
|
// Block size of disk
|
||||||
|
BlockSize string `json:"block_size"`
|
||||||
|
|
||||||
// Boot Partition
|
// Boot Partition
|
||||||
BootPartition uint64 `json:"bootPartition"`
|
BootPartition uint64 `json:"bootPartition"`
|
||||||
|
|
||||||
@@ -381,6 +390,12 @@ type RecordDisk struct {
|
|||||||
// Account name
|
// Account name
|
||||||
AccountName string `json:"accountName"`
|
AccountName string `json:"accountName"`
|
||||||
|
|
||||||
|
// BLK Discard
|
||||||
|
BLKDiscard bool `json:"blkdiscard"`
|
||||||
|
|
||||||
|
// Block size of disk
|
||||||
|
BlockSize string `json:"block_size"`
|
||||||
|
|
||||||
// Computes
|
// Computes
|
||||||
Computes map[string]string `json:"computes"`
|
Computes map[string]string `json:"computes"`
|
||||||
|
|
||||||
|
|||||||
@@ -92,9 +92,6 @@ type RecordImage struct {
|
|||||||
// UNCPathj
|
// UNCPathj
|
||||||
UNCPath string `json:"UNCPath"`
|
UNCPath string `json:"UNCPath"`
|
||||||
|
|
||||||
// CKey
|
|
||||||
CKey string `json:"_ckey"`
|
|
||||||
|
|
||||||
// Account ID
|
// Account ID
|
||||||
AccountID uint64 `json:"accountId"`
|
AccountID uint64 `json:"accountId"`
|
||||||
|
|
||||||
|
|||||||
@@ -183,14 +183,6 @@ type CreateRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
Start bool `url:"start" json:"start"`
|
Start bool `url:"start" json:"start"`
|
||||||
|
|
||||||
// System name
|
|
||||||
// Required: false
|
|
||||||
IS string `url:"IS,omitempty" json:"IS,omitempty"`
|
|
||||||
|
|
||||||
// Compute purpose
|
|
||||||
// Required: false
|
|
||||||
IPAType string `url:"ipaType,omitempty" json:"ipaType,omitempty"`
|
|
||||||
|
|
||||||
// Custom fields for compute. Must be a dict
|
// Custom fields for compute. Must be a dict
|
||||||
// Required: false
|
// Required: false
|
||||||
CustomFields string `url:"customFields,omitempty" json:"customFields,omitempty"`
|
CustomFields string `url:"customFields,omitempty" json:"customFields,omitempty"`
|
||||||
@@ -225,10 +217,6 @@ type CreateRequest struct {
|
|||||||
// Zone ID
|
// Zone ID
|
||||||
// Required: false
|
// Required: false
|
||||||
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
|
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
|
||||||
|
|
||||||
// Cache mode for boot disk
|
|
||||||
// Required: false
|
|
||||||
BootDiskCache string `url:"boot_disk_cache,omitempty" json:"boot_disk_cache,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRAM returns RAM field values
|
// GetRAM returns RAM field values
|
||||||
|
|||||||
@@ -115,10 +115,6 @@ type CreateBlankRequest struct {
|
|||||||
// The OS version that will be installed on the virtual machine
|
// The OS version that will be installed on the virtual machine
|
||||||
// Required: false
|
// Required: false
|
||||||
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
|
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
|
||||||
|
|
||||||
// Cache mode for boot disk
|
|
||||||
// Required: false
|
|
||||||
BootDiskCache string `url:"boot_disk_cache,omitempty" json:"boot_disk_cache,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRAM returns RAM field values
|
// GetRAM returns RAM field values
|
||||||
|
|||||||
@@ -215,6 +215,9 @@ type InfoAccount struct {
|
|||||||
// UniqPools
|
// UniqPools
|
||||||
UniqPools []string `json:"uniqPools"`
|
UniqPools []string `json:"uniqPools"`
|
||||||
|
|
||||||
|
// Updated By
|
||||||
|
UpdatedBy string `json:"updatedBy"`
|
||||||
|
|
||||||
// UpdatedTime
|
// UpdatedTime
|
||||||
UpdatedTime uint64 `json:"updatedTime"`
|
UpdatedTime uint64 `json:"updatedTime"`
|
||||||
|
|
||||||
|
|||||||
47
pkg/cloudbroker/compute/check_compute_placement.go
Normal file
47
pkg/cloudbroker/compute/check_compute_placement.go
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
package compute
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// CheckComputePlacementRequest struct for check compute placement
|
||||||
|
type CheckComputePlacementRequest struct {
|
||||||
|
// IDs of compute instances to check
|
||||||
|
// Required: true
|
||||||
|
ComputeIDs []uint64 `url:"compute_ids" json:"compute_ids" validate:"required"`
|
||||||
|
|
||||||
|
// Filter by CPU and RAM when checking placement
|
||||||
|
// Required: false
|
||||||
|
// Default: true
|
||||||
|
FilterByCPURAM interface{} `url:"filter_by_cpu_ram,omitempty" json:"filter_by_cpu_ram,omitempty" validate:"omitempty,isBool"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// CheckComputePlacement checks compute placement and returns structured result
|
||||||
|
func (c Compute) CheckComputePlacement(ctx context.Context, req CheckComputePlacementRequest) (CheckComputePlacementResult, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/compute/check_compute_placement"
|
||||||
|
|
||||||
|
if req.FilterByCPURAM == nil {
|
||||||
|
req.FilterByCPURAM = true
|
||||||
|
}
|
||||||
|
|
||||||
|
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
result := make(CheckComputePlacementResult)
|
||||||
|
if err := json.Unmarshal(res, &result); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return result, nil
|
||||||
|
}
|
||||||
@@ -62,6 +62,10 @@ type DiskAddRequest struct {
|
|||||||
// Disk cache mode
|
// Disk cache mode
|
||||||
// Required: false
|
// Required: false
|
||||||
Cache string `url:"cache,omitempty" json:"cache,omitempty"`
|
Cache string `url:"cache,omitempty" json:"cache,omitempty"`
|
||||||
|
|
||||||
|
// BLK Discard
|
||||||
|
// Required: false
|
||||||
|
BLKDiscard interface{} `url:"blkdiscard,omitempty" json:"blkdiscard,omitempty" validate:"omitempty,isBool"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DiskAdd creates new disk and attach to compute
|
// DiskAdd creates new disk and attach to compute
|
||||||
|
|||||||
@@ -391,6 +391,12 @@ type ItemDisk struct {
|
|||||||
// Access Control List
|
// Access Control List
|
||||||
ACL ItemACL `json:"acl"`
|
ACL ItemACL `json:"acl"`
|
||||||
|
|
||||||
|
// BLK Discard
|
||||||
|
BLKDiscard bool `json:"blkdiscard"`
|
||||||
|
|
||||||
|
// Block Size
|
||||||
|
BlockSize string `json:"block_size"`
|
||||||
|
|
||||||
// Boot partition
|
// Boot partition
|
||||||
BootPartition uint64 `json:"bootPartition"`
|
BootPartition uint64 `json:"bootPartition"`
|
||||||
|
|
||||||
@@ -1490,3 +1496,20 @@ type CloneStatus struct {
|
|||||||
// Progress percent
|
// Progress percent
|
||||||
ProgressPercent int `json:"progress_percent"`
|
ProgressPercent int `json:"progress_percent"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type CheckComputePlacementError struct {
|
||||||
|
// Code
|
||||||
|
Code int64 `json:"code"`
|
||||||
|
|
||||||
|
// Message
|
||||||
|
Message string `json:"message"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CheckComputePlacementItem struct {
|
||||||
|
// Nide IDs
|
||||||
|
NodeIDs []uint64 `json:"node_ids"`
|
||||||
|
// error
|
||||||
|
Error CheckComputePlacementError `json:"error,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CheckComputePlacementResult map[string]CheckComputePlacementItem
|
||||||
|
|||||||
@@ -41,6 +41,10 @@ type CreateRequest struct {
|
|||||||
// Cache mode of disk
|
// Cache mode of disk
|
||||||
// Required: false
|
// Required: false
|
||||||
Cache string `url:"cache,omitempty" json:"cache,omitempty"`
|
Cache string `url:"cache,omitempty" json:"cache,omitempty"`
|
||||||
|
|
||||||
|
// BLK Discard
|
||||||
|
// Required: false
|
||||||
|
BLKDiscard interface{} `url:"blkdiscard,omitempty" json:"blkdiscard,omitempty" validate:"omitempty,isBool"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create creates a disk
|
// Create creates a disk
|
||||||
|
|||||||
@@ -53,6 +53,12 @@ type InfoDisk struct {
|
|||||||
// Access Control Control
|
// Access Control Control
|
||||||
ACL map[string]interface{} `json:"acl"`
|
ACL map[string]interface{} `json:"acl"`
|
||||||
|
|
||||||
|
// BLK Discard
|
||||||
|
BLKDiscard bool `json:"blkdiscard"`
|
||||||
|
|
||||||
|
// Block size of disk
|
||||||
|
BlockSize string `json:"block_size"`
|
||||||
|
|
||||||
// Boot partition
|
// Boot partition
|
||||||
BootPartition uint64 `json:"bootPartition"`
|
BootPartition uint64 `json:"bootPartition"`
|
||||||
|
|
||||||
@@ -215,6 +221,9 @@ type ItemReplication struct {
|
|||||||
// Detailed indormation about disk
|
// Detailed indormation about disk
|
||||||
type RecordDisk struct {
|
type RecordDisk struct {
|
||||||
|
|
||||||
|
// Block size of disk
|
||||||
|
BlockSize string `json:"block_size"`
|
||||||
|
|
||||||
//Created by
|
//Created by
|
||||||
CreatedBy string `json:"createdBy"`
|
CreatedBy string `json:"createdBy"`
|
||||||
|
|
||||||
@@ -264,9 +273,6 @@ type SearchListDisks []ItemDisk
|
|||||||
|
|
||||||
// Main information about unattached disk
|
// Main information about unattached disk
|
||||||
type ItemUnattachedDisk struct {
|
type ItemUnattachedDisk struct {
|
||||||
// CKey
|
|
||||||
CKey string `json:"_ckey"`
|
|
||||||
|
|
||||||
// Meta
|
// Meta
|
||||||
Meta []interface{} `json:"_meta"`
|
Meta []interface{} `json:"_meta"`
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,14 @@ type UpdateRequest struct {
|
|||||||
// Cache mode of disk
|
// Cache mode of disk
|
||||||
// Required: false
|
// Required: false
|
||||||
Cache string `url:"cache,omitempty" json:"cache,omitempty"`
|
Cache string `url:"cache,omitempty" json:"cache,omitempty"`
|
||||||
|
|
||||||
|
// BLK Discard
|
||||||
|
// Required: false
|
||||||
|
BLKDiscard interface{} `url:"blkdiscard,omitempty" json:"blkdiscard,omitempty" validate:"omitempty,isBool"`
|
||||||
|
|
||||||
|
// Block size of disk
|
||||||
|
// Required: false
|
||||||
|
BlockSize string `url:"block_size,omitempty" json:"block_size,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update updates disk
|
// Update updates disk
|
||||||
|
|||||||
@@ -106,6 +106,14 @@ type DataDisk struct {
|
|||||||
// Specify image id for create disk from template
|
// Specify image id for create disk from template
|
||||||
// Required: false
|
// Required: false
|
||||||
ImageID uint64 `url:"imageId,omitempty" json:"imageId,omitempty"`
|
ImageID uint64 `url:"imageId,omitempty" json:"imageId,omitempty"`
|
||||||
|
|
||||||
|
// Cache mode for disk
|
||||||
|
// Required: false
|
||||||
|
Cache string `url:"cache,omitempty" json:"cache,omitempty"`
|
||||||
|
|
||||||
|
// BLK Discard
|
||||||
|
// Required: false
|
||||||
|
BLKDiscard interface{} `url:"blkdiscard,omitempty" json:"blkdiscard,omitempty" validate:"omitempty,isBool"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateRequest struct to create KVM x86 VM
|
// CreateRequest struct to create KVM x86 VM
|
||||||
@@ -185,14 +193,6 @@ type CreateRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
NodeID uint64 `url:"node_id,omitempty" json:"node_id,omitempty"`
|
NodeID uint64 `url:"node_id,omitempty" json:"node_id,omitempty"`
|
||||||
|
|
||||||
// System name
|
|
||||||
// Required: false
|
|
||||||
IS string `url:"IS,omitempty" json:"IS,omitempty"`
|
|
||||||
|
|
||||||
// Compute purpose
|
|
||||||
// Required: false
|
|
||||||
IPAType string `url:"ipaType,omitempty" json:"ipaType,omitempty"`
|
|
||||||
|
|
||||||
// Custom fields for Compute. Must be dict
|
// Custom fields for Compute. Must be dict
|
||||||
// Required: false
|
// Required: false
|
||||||
CustomField string `url:"customFields,omitempty" json:"customFields,omitempty"`
|
CustomField string `url:"customFields,omitempty" json:"customFields,omitempty"`
|
||||||
@@ -231,6 +231,10 @@ type CreateRequest struct {
|
|||||||
// Cache mode for boot disk
|
// Cache mode for boot disk
|
||||||
// Required: false
|
// Required: false
|
||||||
BootDiskCache string `url:"boot_disk_cache,omitempty" json:"boot_disk_cache,omitempty"`
|
BootDiskCache string `url:"boot_disk_cache,omitempty" json:"boot_disk_cache,omitempty"`
|
||||||
|
|
||||||
|
// Boot Disk BLK Discard
|
||||||
|
// Required: false
|
||||||
|
BootDiskBLKDiscard interface{} `url:"boot_disk_blkdiscard,omitempty" json:"boot_disk_blkdiscard,omitempty" validate:"omitempty,isBool"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRAM returns RAM field values
|
// GetRAM returns RAM field values
|
||||||
|
|||||||
@@ -119,6 +119,10 @@ type CreateBlankRequest struct {
|
|||||||
// Cache mode for boot disk
|
// Cache mode for boot disk
|
||||||
// Required: false
|
// Required: false
|
||||||
BootDiskCache string `url:"boot_disk_cache,omitempty" json:"boot_disk_cache,omitempty"`
|
BootDiskCache string `url:"boot_disk_cache,omitempty" json:"boot_disk_cache,omitempty"`
|
||||||
|
|
||||||
|
// Boot Disk BLK Discard
|
||||||
|
// Required: false
|
||||||
|
BootDiskBLKDiscard interface{} `url:"boot_disk_blkdiscard" json:"boot_disk_blkdiscard" validate:"omitempty,isBool"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRAM returns RAM field values
|
// GetRAM returns RAM field values
|
||||||
|
|||||||
@@ -156,6 +156,10 @@ type MassCreateRequest struct {
|
|||||||
// Cache mode for boot disk
|
// Cache mode for boot disk
|
||||||
// Required: false
|
// Required: false
|
||||||
BootDiskCache string `url:"boot_disk_cache,omitempty" json:"boot_disk_cache,omitempty"`
|
BootDiskCache string `url:"boot_disk_cache,omitempty" json:"boot_disk_cache,omitempty"`
|
||||||
|
|
||||||
|
// Boot Disk BLK Discard
|
||||||
|
// Required: false
|
||||||
|
BootDiskBLKDiscard interface{} `url:"boot_disk_blkdiscard" json:"boot_disk_blkdiscard" validate:"omitempty,isBool"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type asyncWrapperMassCreateRequest struct {
|
type asyncWrapperMassCreateRequest struct {
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ type ListRequest struct {
|
|||||||
// Page size
|
// Page size
|
||||||
// Required: false
|
// Required: false
|
||||||
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
|
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
|
||||||
|
|
||||||
|
// Find by zone ID
|
||||||
|
// Required: false
|
||||||
|
ZoneID uint64 `url:"zone_id,omitempty" json:"zone_id,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List gets list of all nodes as a ListNodes struct
|
// List gets list of all nodes as a ListNodes struct
|
||||||
|
|||||||
@@ -62,10 +62,18 @@ type ListRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
CreatedFrom string `url:"created_from,omitempty" json:"created_from,omitempty"`
|
CreatedFrom string `url:"created_from,omitempty" json:"created_from,omitempty"`
|
||||||
|
|
||||||
// Filter lby create date to
|
// Filter by create date to
|
||||||
// Required: false
|
// Required: false
|
||||||
CreatedTo string `url:"created_to,omitempty" json:"created_to,omitempty"`
|
CreatedTo string `url:"created_to,omitempty" json:"created_to,omitempty"`
|
||||||
|
|
||||||
|
// Filter by operation status
|
||||||
|
// Required: false
|
||||||
|
OperationStatus string `url:"operation_status,omitempty" json:"operation_status,omitempty"`
|
||||||
|
|
||||||
|
// Filter by hypervisor status
|
||||||
|
// Required: false
|
||||||
|
HypervisorStatus string `url:"hypervisor_status,omitempty" json:"hypervisor_status,omitempty"`
|
||||||
|
|
||||||
// Page number for pagination
|
// Page number for pagination
|
||||||
// Required: false
|
// Required: false
|
||||||
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
||||||
|
|||||||
62
pkg/sdn/netobjgroups/attach_l2_connection_ports.go
Normal file
62
pkg/sdn/netobjgroups/attach_l2_connection_ports.go
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
package netobjgroups
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/constants"
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AttachL2ConnectionPortsRequest struct to attach l2 ports to a network object group
|
||||||
|
type AttachL2ConnectionPortsRequest struct {
|
||||||
|
// ID of a network object group
|
||||||
|
// Required: true
|
||||||
|
ObjectGroupID string `url:"object_group_id" json:"object_group_id" validate:"required"`
|
||||||
|
|
||||||
|
// ID of an access group
|
||||||
|
// Required: true
|
||||||
|
AccessGroupID string `url:"access_group_id" json:"access_group_id" validate:"required"`
|
||||||
|
|
||||||
|
// Version ID
|
||||||
|
// Required: true
|
||||||
|
VersionID uint64 `url:"version_id" json:"version_id" validate:"required"`
|
||||||
|
|
||||||
|
// Port Bindings
|
||||||
|
// Required: true
|
||||||
|
PortBindings []L2PortBindings `url:"port_bindings" json:"port_bindings" validate:"required,dive"`
|
||||||
|
}
|
||||||
|
type L2PortBindings struct {
|
||||||
|
// ID of a logical port
|
||||||
|
// Required: true
|
||||||
|
PortID string `url:"port_id" json:"port_id" validate:"required"`
|
||||||
|
|
||||||
|
// Version of a logical port
|
||||||
|
// Required: true
|
||||||
|
PortVersion int64 `url:"port_version" json:"port_version" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// AttachLogicalPorts attaches l2 ports to a network object group
|
||||||
|
func (nog NetworkObjectGroups) AttachL2ConnectionPorts(ctx context.Context, req AttachL2ConnectionPortsRequest) (*RecordVersion, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/sdn/network_object_group/attach_l2_connection_ports"
|
||||||
|
|
||||||
|
res, err := nog.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := RecordVersion{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
62
pkg/sdn/netobjgroups/detach_l2_connection_ports.go
Normal file
62
pkg/sdn/netobjgroups/detach_l2_connection_ports.go
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
package netobjgroups
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/constants"
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DetachL2ConnectionPortsRequest struct to detach an l2 port from a network object group
|
||||||
|
type DetachL2ConnectionPortsRequest struct {
|
||||||
|
// ID of a network object group
|
||||||
|
// Required: true
|
||||||
|
ObjectGroupID string `url:"object_group_id" json:"object_group_id" validate:"required"`
|
||||||
|
|
||||||
|
// ID of an access group
|
||||||
|
// Required: true
|
||||||
|
AccessGroupID string `url:"access_group_id" json:"access_group_id" validate:"required"`
|
||||||
|
|
||||||
|
// Version ID
|
||||||
|
// Required: true
|
||||||
|
VersionID uint64 `url:"version_id" json:"version_id" validate:"required"`
|
||||||
|
|
||||||
|
// Port Bindings
|
||||||
|
// Required: true
|
||||||
|
PortBindings []DetachL2PortBindings `url:"port_bindings" json:"port_bindings" validate:"required,dive"`
|
||||||
|
}
|
||||||
|
type DetachL2PortBindings struct {
|
||||||
|
// ID of a logical port
|
||||||
|
// Required: true
|
||||||
|
PortID string `url:"port_id" json:"port_id" validate:"required"`
|
||||||
|
|
||||||
|
// Version of a logical port
|
||||||
|
// Required: true
|
||||||
|
PortVersion int64 `url:"port_version" json:"port_version" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// DetachL2ConnectionPorts detaches logical ports from a network object group
|
||||||
|
func (nog NetworkObjectGroups) DetachL2ConnectionPorts(ctx context.Context, req DetachL2ConnectionPortsRequest) (*RecordVersion, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/sdn/network_object_group/detach_l2_connection_ports"
|
||||||
|
|
||||||
|
res, err := nog.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := RecordVersion{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
7
tests/platform_upgrade/platform_tests_start.sh
Normal file
7
tests/platform_upgrade/platform_tests_start.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
go test -v -run TestGetListCloudAPI > TestGetListCloudAPI.txt
|
||||||
|
go test -v -run TestGetListCloudbroker > TestGetListCloudbroker.txt
|
||||||
|
go test -v -run TestGetListSDNAPI > TestGetListSDNAPI.txt
|
||||||
|
go test -v -run TestRequestsCloudAPI > TestRequestsCloudAPI.txt
|
||||||
|
go test -v -run TestRequestsCloudbroker > TestRequestsCloudbroker.txt
|
||||||
|
go test -v -run TestRequestsSDN > TestRequestsSDN.txt
|
||||||
|
go test -v -run TestGetAllPaths > TestGetAllPaths.txt
|
||||||
@@ -570,6 +570,7 @@ func getRequestsMapCloudbroker() map[string]interface{} {
|
|||||||
"/restmachine/cloudbroker/compute/cdInsert": compute_cb.CDInsertRequest{},
|
"/restmachine/cloudbroker/compute/cdInsert": compute_cb.CDInsertRequest{},
|
||||||
"/restmachine/cloudbroker/compute/changeLinkState": compute_cb.ChangeLinkStateRequest{},
|
"/restmachine/cloudbroker/compute/changeLinkState": compute_cb.ChangeLinkStateRequest{},
|
||||||
"/restmachine/cloudbroker/compute/change_mtu": compute_cb.ChangeMTURequest{},
|
"/restmachine/cloudbroker/compute/change_mtu": compute_cb.ChangeMTURequest{},
|
||||||
|
"/restmachine/cloudbroker/compute/check_compute_placement": compute_cb.CheckComputePlacementRequest{},
|
||||||
"/restmachine/cloudbroker/compute/change_security_groups": compute_cb.ChangeSecGroupsRequest{},
|
"/restmachine/cloudbroker/compute/change_security_groups": compute_cb.ChangeSecGroupsRequest{},
|
||||||
"/restmachine/cloudbroker/compute/clone": compute_cb.CloneRequest{},
|
"/restmachine/cloudbroker/compute/clone": compute_cb.CloneRequest{},
|
||||||
"/restmachine/cloudbroker/compute/clone_abort": compute_cb.CloneAbortRequest{},
|
"/restmachine/cloudbroker/compute/clone_abort": compute_cb.CloneAbortRequest{},
|
||||||
@@ -1165,6 +1166,8 @@ func getRequestsMapSDN() map[string]interface{} {
|
|||||||
"/restmachine/sdn/network_object_group/get": netobjgroups.GetRequest{},
|
"/restmachine/sdn/network_object_group/get": netobjgroups.GetRequest{},
|
||||||
"/restmachine/sdn/network_object_group/list": netobjgroups.ListRequest{},
|
"/restmachine/sdn/network_object_group/list": netobjgroups.ListRequest{},
|
||||||
"/restmachine/sdn/network_object_group/update": netobjgroups.UpdateRequest{},
|
"/restmachine/sdn/network_object_group/update": netobjgroups.UpdateRequest{},
|
||||||
|
"/restmachine/sdn/network_object_group/attach_l2_connection_ports": netobjgroups.AttachL2ConnectionPortsRequest{},
|
||||||
|
"/restmachine/sdn/network_object_group/detach_l2_connection_ports": netobjgroups.DetachL2ConnectionPortsRequest{},
|
||||||
|
|
||||||
// segments
|
// segments
|
||||||
"/restmachine/sdn/segment/create": segments.CreateRequest{},
|
"/restmachine/sdn/segment/create": segments.CreateRequest{},
|
||||||
|
|||||||
Reference in New Issue
Block a user