Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b834e5d074 | ||
| e1f0d354af |
48
CHANGELOG.md
48
CHANGELOG.md
@@ -1,7 +1,6 @@
|
|||||||
## Version 1.13.7
|
## 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,44 +9,41 @@
|
|||||||
|
|
||||||
### Добавлено
|
### Добавлено
|
||||||
|
|
||||||
|
#### account
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-772 | Вычисляемое поле `UpdatedBy` в структуры ответа `RecordAccount` в cloudapi/account и `InfoAccount` в cloudbroker/account |
|
||||||
|
|
||||||
#### compute
|
#### compute
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-757 | Опциональное поле `BLKDiscard` в структуру запроса `DiskAddRequest` в cloudbroker/compute |
|
| BGOS-767 | Метод `CheckComputePlacement`, структура запроса `CheckComputePlacementRequest` и структуры ответа `CheckComputePlacementResult`, `CheckComputePlacementItem`,`CheckComputePlacementError` в cloudbroker/compute |
|
||||||
| BGOS-757 | Вычисляемое поле `BLKDiscard` в структуру ответа `ItemComputeDisk` в cloudapi/compute и в структуру ответа в `ItemDisk` в cloudbroker/compute |
|
| BGOS-771 | Вычисляемое поле `BlockSize` в структуры ответа `ItemDisk` в cloudbroker/compute и в `ItemComputeDisk` в cloudapi/compute |
|
||||||
|
|
||||||
#### disks
|
#### disks
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-756 | Опциональное поле `BLKDiscard` в структуры запроса `CreateRequest` и `UpdateRequest` в cloudbroker/disks |
|
| BGOS-770 | Опциональное поле `BlockSize` в структуру запроса `UpdateRequest` в cloudbroker/disks |
|
||||||
| BGOS-756 | Поле `BLKDiscard` в структуры ответа `RecordDisk`, `ItemDisk` и `ItemDiskUnattached` в cloudapi/disks и в структуру ответа `InfoDisk` в cloudbroker/disks |
|
| BGOS-770 | Вычисляемое поле `BlockSize` в структуры ответа `ItemDisk`, `ItemDiskUnattached` и `RecordDisk` в cloudapi/disks и в структуры ответа `InfoDisk` и `RecordDisk` в cloudbroker/disks |
|
||||||
|
|
||||||
#### kvmx86
|
#### node
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-760 | Опциональное поле `Cache` в структуру запроса `DataDisk` в cloudbroker/kvmx86 |
|
| BGOS-769 | Опциональное поле `ZoneID` в структуру запроса `ListRequest` в cloudbroker/node |
|
||||||
| BGOS-757 | Опциональное поле `BootDiskBLKDiscard` в структуры запроса `CreateBlankRequest`, `CreateRequest` и `MassCreateRequest` в cloudbroker/kvmx86 |
|
|
||||||
|
|
||||||
|
#### SDN external networks
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-694 | Опциональные поля `OperationStatus` и `HypervisorStatus` в структуру запроса `ListRequest` в sdn/external_networks |
|
||||||
|
|
||||||
|
#### SDN network object groups
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-749 | Методы `AttachL2ConnectionPorts`, `DetachL2ConnectionPorts` и структуры запросов `AttachL2ConnectionPortsRequest`, `L2PortBindings`, `DetachL2PortBindings`, `DetachL2ConnectionPortsRequest` в sdn/netobjgroups |
|
||||||
|
|
||||||
### Удалено
|
### Удалено
|
||||||
|
|
||||||
#### compute
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-755 | Опциональное поле `Cache` из структуры запроса `DiskAddRequest` в cloudapi/compute |
|
|
||||||
|
|
||||||
#### disks
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-755 | Опциональное поле `Cache` из структуры запроса `CreateRequest` в cloudapi/disks |
|
|
||||||
| BGOS-761 | Вычисляемое поле `CKey` из структуры ответа `ItemDiskUnattached` в cloudapi/disks и из структуры ответа `ItemUnattachedDisk` в cloudbroker/disks |
|
|
||||||
|
|
||||||
#### image
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-758 | Поле `CKey` из структуры ответа `RecordImage` в cloudapi/image |
|
|
||||||
|
|
||||||
#### kvmx86
|
#### kvmx86
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-755 | Опциональное поле `BootDiskCache` из структур запроса `CreateRequest` и `CreateBlankRequest` в cloudapi/kvmx86 |
|
| BGOS-773 | Опциональные поля `IS` и `IPAType` из структур запроса `CreateRequest` в cloudapi/kvmx86 и в cloudbroker/kvmx86 |
|
||||||
|
|||||||
@@ -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"`
|
||||||
|
|
||||||
|
|||||||
@@ -792,6 +792,9 @@ type ItemComputeDisk struct {
|
|||||||
// BLK Discard
|
// BLK Discard
|
||||||
BLKDiscard bool `json:"blkdiscard"`
|
BLKDiscard bool `json:"blkdiscard"`
|
||||||
|
|
||||||
|
// Block Size
|
||||||
|
BlockSize string `json:"block_size"`
|
||||||
|
|
||||||
// Boot partition
|
// Boot partition
|
||||||
BootPartition uint64 `json:"bootPartition"`
|
BootPartition uint64 `json:"bootPartition"`
|
||||||
|
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ type ItemDisk struct {
|
|||||||
// BLK Discard
|
// BLK Discard
|
||||||
BLKDiscard bool `json:"blkdiscard"`
|
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"`
|
||||||
|
|
||||||
@@ -163,6 +166,9 @@ type ItemDiskUnattached struct {
|
|||||||
// BLK Discard
|
// BLK Discard
|
||||||
BLKDiscard bool `json:"blkdiscard"`
|
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"`
|
||||||
|
|
||||||
@@ -387,6 +393,9 @@ type RecordDisk struct {
|
|||||||
// BLK Discard
|
// BLK Discard
|
||||||
BLKDiscard bool `json:"blkdiscard"`
|
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"`
|
||||||
|
|
||||||
|
|||||||
@@ -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"`
|
||||||
|
|||||||
@@ -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
|
||||||
|
}
|
||||||
@@ -65,7 +65,7 @@ type DiskAddRequest struct {
|
|||||||
|
|
||||||
// BLK Discard
|
// BLK Discard
|
||||||
// Required: false
|
// Required: false
|
||||||
BLKDiscard interface{} `url:"blkdiscard" json:"blkdiscard" validate:"omitempty,isBool"`
|
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
|
||||||
|
|||||||
@@ -394,6 +394,9 @@ type ItemDisk struct {
|
|||||||
// BLK Discard
|
// BLK Discard
|
||||||
BLKDiscard bool `json:"blkdiscard"`
|
BLKDiscard bool `json:"blkdiscard"`
|
||||||
|
|
||||||
|
// Block Size
|
||||||
|
BlockSize string `json:"block_size"`
|
||||||
|
|
||||||
// Boot partition
|
// Boot partition
|
||||||
BootPartition uint64 `json:"bootPartition"`
|
BootPartition uint64 `json:"bootPartition"`
|
||||||
|
|
||||||
@@ -1493,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
|
||||||
|
|||||||
@@ -56,6 +56,9 @@ type InfoDisk struct {
|
|||||||
// BLK Discard
|
// BLK Discard
|
||||||
BLKDiscard bool `json:"blkdiscard"`
|
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"`
|
||||||
|
|
||||||
@@ -218,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"`
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ type UpdateRequest struct {
|
|||||||
// BLK Discard
|
// BLK Discard
|
||||||
// Required: false
|
// Required: false
|
||||||
BLKDiscard interface{} `url:"blkdiscard,omitempty" json:"blkdiscard,omitempty" validate:"omitempty,isBool"`
|
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
|
||||||
|
|||||||
@@ -110,6 +110,10 @@ type DataDisk struct {
|
|||||||
// Cache mode for disk
|
// Cache mode for 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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateRequest struct to create KVM x86 VM
|
// CreateRequest struct to create KVM x86 VM
|
||||||
@@ -189,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"`
|
||||||
|
|||||||
@@ -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