Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74c12914c9 |
45
CHANGELOG.md
45
CHANGELOG.md
@@ -1,49 +1,50 @@
|
||||
## Version 1.14.0
|
||||
## Version 1.13.5
|
||||
|
||||
Методы `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 и в следующих версиях будут удалены
|
||||
Методы `ComputeCISet`, `ComputeCIUnset`, `GetAudits` в cloudbroker/compute и `GetAudits` в cloudapi/compute стали deprecated и будут удалены в следующих версиях
|
||||
Методы `ComputeCISet`, `ComputeCIUnset`, `GetAudits` в cloudbroker/computeGetAudits и `GetAudits` в cloudbroker/compute стали deprecated и будут удалены в следующих версиях
|
||||
Методы `ComputeCISet`, `ComputeCIUnset` в cloudbroker/image стали deprecated и будут удалены в следующих версиях
|
||||
|
||||
Все методы группы `.SDN()` находятся в альфа-версии.
|
||||
|
||||
### Добавлено
|
||||
|
||||
#### account
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-772 | Вычисляемое поле `UpdatedBy` в структуры ответа `RecordAccount` в cloudapi/account и `InfoAccount` в cloudbroker/account |
|
||||
|
||||
#### compute
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-767 | Метод `CheckComputePlacement`, структура запроса `CheckComputePlacementRequest` и структуры ответа `CheckComputePlacementResult`, `CheckComputePlacementItem`,`CheckComputePlacementError` в cloudbroker/compute |
|
||||
| BGOS-771 | Вычисляемое поле `BlockSize` в структуры ответа `ItemDisk` в cloudbroker/compute и в `ItemComputeDisk` в cloudapi/compute |
|
||||
|
||||
#### disks
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-770 | Опциональное поле `BlockSize` в структуру запроса `UpdateRequest` в cloudbroker/disks |
|
||||
| BGOS-770 | Вычисляемое поле `BlockSize` в структуры ответа `ItemDisk`, `ItemDiskUnattached` и `RecordDisk` в cloudapi/disks и в структуры ответа `InfoDisk` и `RecordDisk` в cloudbroker/disks |
|
||||
| BGOS-735 | Вычисляемое поле `Cache` в структуры ответа `ItemDiskUnattached` в cloudapi/disks и в cloudbroker/disks |
|
||||
|
||||
#### node
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-769 | Опциональное поле `ZoneID` в структуру запроса `ListRequest` в cloudbroker/node |
|
||||
| BGOS-738 | Структура запроса `AutoStartRequest`, метод `AutoStart` в cloudbroker/node |
|
||||
| BGOS-738 | Опциональное поле `AutoStart` в структуру запроса `MaintenanceRequest` в cloudbroker/node |
|
||||
| BGOS-738 | Вычисляемые поля `AutoStart`, `AutoStartCount` в структуры ответов `ItemNode` и `RecordNode` в cloudbroker/node |
|
||||
| BGOS-743 | Структура запроса `NodeAutoStartRequest`, метод `NodeAutoStart` в cloudbroker/zone |
|
||||
|
||||
#### SDN external networks
|
||||
#### zone
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-694 | Опциональные поля `OperationStatus` и `HypervisorStatus` в структуру запроса `ListRequest` в sdn/external_networks |
|
||||
| BGOS-737 | Опциональное поле `AutoStart` в структуру запроса `UpdateRequest` в cloudbroker/zone |
|
||||
| BGOS-737 | Вычисляемое поле `AutoStart` в структуры ответа `RecordZone` в cloudapi/zone и в cloudbroker/zone |
|
||||
|
||||
#### SDN network object groups
|
||||
### Изменено
|
||||
|
||||
#### sep
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-749 | Методы `AttachL2ConnectionPorts`, `DetachL2ConnectionPorts` и структуры запросов `AttachL2ConnectionPortsRequest`, `L2PortBindings`, `DetachL2PortBindings`, `DetachL2ConnectionPortsRequest` в sdn/netobjgroups |
|
||||
| BGOS-740 | Тип поля `Force` с обязательного на опциональный в структуре запроса `DelConsumerNodesRequest` в cloudbroker/sep |
|
||||
|
||||
### Удалено
|
||||
|
||||
#### kvmx86
|
||||
#### bservice
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-773 | Опциональные поля `IS` и `IPAType` из структур запроса `CreateRequest` в cloudapi/kvmx86 и в cloudbroker/kvmx86 |
|
||||
| BGOS-739 | Обязательное поле `Driver` в структурах запроса `GroupAddRequest` в cloudapi/bservice и в cloudbroker/bservice |
|
||||
|
||||
#### flipgroup
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-742 | Опциональное поле `RGID` из структуры запроса `ListRequest` в cloudapi/flipgroup и в cloudbroker/flipgroup |
|
||||
| BGOS-742 | Вычисляемые поля `RGName` и `RGID` из структуры ответа `RecordFLIPGroup` в cloudapi/flipgroup и в cloudbroker/flipgroup |
|
||||
|
||||
@@ -18,7 +18,6 @@ Decort SDK - это библиотека, написанная на языке G
|
||||
- Версия 1.11.х Decort-SDK соответствует 4.3.0 версии платформы
|
||||
- Версия 1.12.х Decort-SDK соответствует 4.4.0 версии платформы
|
||||
- Версия 1.13.х Decort-SDK соответствует 4.5.0 версии платформы
|
||||
- Версия 1.14.х Decort-SDK соответствует 4.6.0 версии платформы
|
||||
|
||||
## Оглавление
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ var FileName = map[string]string{
|
||||
var K8sValues = []string{"labels", "taints", "annotations, additionalSANs"}
|
||||
|
||||
var VersionMap = map[string]string{
|
||||
"4.6.0": "-",
|
||||
"4.5.0": "-",
|
||||
"4.4.0": "-",
|
||||
"4.3.0": "-",
|
||||
|
||||
@@ -299,9 +299,6 @@ type RecordAccount struct {
|
||||
// UniqPools
|
||||
UniqPools []interface{} `json:"uniqPools"`
|
||||
|
||||
// Updated By
|
||||
UpdatedBy string `json:"updatedBy"`
|
||||
|
||||
// Updated time
|
||||
UpdatedTime uint64 `json:"updatedTime"`
|
||||
|
||||
|
||||
@@ -58,6 +58,10 @@ type DiskAddRequest struct {
|
||||
// Desired bus number (hex string, e.g. "0x03")
|
||||
// Required: false
|
||||
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
|
||||
|
||||
@@ -789,12 +789,6 @@ type ItemComputeDisk struct {
|
||||
// Account ID
|
||||
AccountID uint64 `json:"accountId"`
|
||||
|
||||
// BLK Discard
|
||||
BLKDiscard bool `json:"blkdiscard"`
|
||||
|
||||
// Block Size
|
||||
BlockSize string `json:"block_size"`
|
||||
|
||||
// Boot partition
|
||||
BootPartition uint64 `json:"bootPartition"`
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ type NetAttachRequest struct {
|
||||
// 'VFNIC' for connect to vfpool
|
||||
// 'DPDK' for connect to DPDK
|
||||
// `EMPTY` for connect empty network
|
||||
// `SDN` for connect to SDN
|
||||
// `SDT` for connect to SDN
|
||||
// `TRUNK` for connect to TRUNK
|
||||
// Required: true
|
||||
NetType string `url:"netType" json:"netType" validate:"computex86NetType"`
|
||||
@@ -50,22 +50,6 @@ type NetAttachRequest struct {
|
||||
// Required: false
|
||||
NetMask uint64 `url:"netMask,omitempty" json:"netMask,omitempty"`
|
||||
|
||||
// SDN Segment ID
|
||||
// Required: false
|
||||
SDNSegmentID string `url:"sdn_segment_id,omitempty" json:"sdn_segment_id,omitempty"`
|
||||
|
||||
// SDN Object Group ID
|
||||
// Required: false
|
||||
SDNObjectGroupID string `url:"sdn_object_group_id,omitempty" json:"sdn_object_group_id,omitempty"`
|
||||
|
||||
// SDN Logical Port Display Name
|
||||
// Required: false
|
||||
SDNLogicalPortDisplayName string `url:"sdn_logical_port_display_name,omitempty" json:"sdn_logical_port_display_name,omitempty"`
|
||||
|
||||
// SDN Logical Port Description
|
||||
// Required: false
|
||||
SDNLogicalPortDescription string `url:"sdn_logical_port_description,omitempty" json:"sdn_logical_port_description,omitempty"`
|
||||
|
||||
// Unique identifier of logical port on SDN side
|
||||
// Required: false
|
||||
SDNInterfaceID string `url:"sdn_interface_id,omitempty" json:"sdn_interface_id,omitempty" validate:"omitempty"`
|
||||
|
||||
@@ -37,6 +37,10 @@ type CreateRequest struct {
|
||||
// Pool name to create disk
|
||||
// Required: false
|
||||
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
|
||||
|
||||
@@ -360,6 +360,7 @@ func TestListSearchDisks_SortByCreatedTime(t *testing.T) {
|
||||
var unattachedDisks = ListDisksUnattached{
|
||||
Data: []ItemDiskUnattached{
|
||||
{
|
||||
CKey: "",
|
||||
Meta: []interface{}{
|
||||
"cloudbroker",
|
||||
"disk",
|
||||
@@ -411,6 +412,7 @@ var unattachedDisks = ListDisksUnattached{
|
||||
VMID: 0,
|
||||
},
|
||||
{
|
||||
CKey: "",
|
||||
Meta: []interface{}{
|
||||
"cloudbroker",
|
||||
"disk",
|
||||
|
||||
@@ -11,12 +11,6 @@ type ItemDisk struct {
|
||||
// Account name
|
||||
AccountName string `json:"accountName"`
|
||||
|
||||
// BLK Discard
|
||||
BLKDiscard bool `json:"blkdiscard"`
|
||||
|
||||
// Block size of disk
|
||||
BlockSize string `json:"block_size"`
|
||||
|
||||
// Computes
|
||||
Computes map[string]string `json:"computes"`
|
||||
|
||||
@@ -151,6 +145,9 @@ type ItemDisk struct {
|
||||
}
|
||||
|
||||
type ItemDiskUnattached struct {
|
||||
// CKey
|
||||
CKey string `json:"_ckey"`
|
||||
|
||||
// Meta
|
||||
Meta []interface{} `json:"_meta"`
|
||||
|
||||
@@ -163,12 +160,6 @@ type ItemDiskUnattached struct {
|
||||
// Access Control List
|
||||
ACL map[string]interface{} `json:"acl"`
|
||||
|
||||
// BLK Discard
|
||||
BLKDiscard bool `json:"blkdiscard"`
|
||||
|
||||
// Block size of disk
|
||||
BlockSize string `json:"block_size"`
|
||||
|
||||
// Boot Partition
|
||||
BootPartition uint64 `json:"bootPartition"`
|
||||
|
||||
@@ -390,12 +381,6 @@ type RecordDisk struct {
|
||||
// Account name
|
||||
AccountName string `json:"accountName"`
|
||||
|
||||
// BLK Discard
|
||||
BLKDiscard bool `json:"blkdiscard"`
|
||||
|
||||
// Block size of disk
|
||||
BlockSize string `json:"block_size"`
|
||||
|
||||
// Computes
|
||||
Computes map[string]string `json:"computes"`
|
||||
|
||||
|
||||
@@ -92,6 +92,9 @@ type RecordImage struct {
|
||||
// UNCPathj
|
||||
UNCPath string `json:"UNCPath"`
|
||||
|
||||
// CKey
|
||||
CKey string `json:"_ckey"`
|
||||
|
||||
// Account ID
|
||||
AccountID uint64 `json:"accountId"`
|
||||
|
||||
|
||||
@@ -44,22 +44,6 @@ type Interface struct {
|
||||
// Required: false
|
||||
MAC string `url:"mac,omitempty" json:"mac,omitempty" validate:"omitempty"`
|
||||
|
||||
// SDN Segment ID
|
||||
// Required: false
|
||||
SDNSegmentID string `url:"sdn_segment_id,omitempty" json:"sdn_segment_id,omitempty"`
|
||||
|
||||
// SDN Object Group ID
|
||||
// Required: false
|
||||
SDNObjectGroupID string `url:"sdn_object_group_id,omitempty" json:"sdn_object_group_id,omitempty"`
|
||||
|
||||
// SDN Logical Port Display Name
|
||||
// Required: false
|
||||
SDNLogicalPortDisplayName string `url:"sdn_logical_port_display_name,omitempty" json:"sdn_logical_port_display_name,omitempty"`
|
||||
|
||||
// SDN Logical Port Description
|
||||
// Required: false
|
||||
SDNLogicalPortDescription string `url:"sdn_logical_port_description,omitempty" json:"sdn_logical_port_description,omitempty"`
|
||||
|
||||
// SDN interface id
|
||||
// Required: false
|
||||
SDNInterfaceID string `url:"sdn_interface_id,omitempty" json:"sdn_interface_id,omitempty"`
|
||||
@@ -183,6 +167,14 @@ type CreateRequest struct {
|
||||
// Required: false
|
||||
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
|
||||
// Required: false
|
||||
CustomFields string `url:"customFields,omitempty" json:"customFields,omitempty"`
|
||||
@@ -217,6 +209,10 @@ type CreateRequest struct {
|
||||
// Zone ID
|
||||
// Required: false
|
||||
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
|
||||
|
||||
@@ -115,6 +115,10 @@ type CreateBlankRequest struct {
|
||||
// The OS version that will be installed on the virtual machine
|
||||
// Required: false
|
||||
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
|
||||
|
||||
@@ -215,9 +215,6 @@ type InfoAccount struct {
|
||||
// UniqPools
|
||||
UniqPools []string `json:"uniqPools"`
|
||||
|
||||
// Updated By
|
||||
UpdatedBy string `json:"updatedBy"`
|
||||
|
||||
// UpdatedTime
|
||||
UpdatedTime uint64 `json:"updatedTime"`
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
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,10 +62,6 @@ type DiskAddRequest struct {
|
||||
// Disk cache mode
|
||||
// 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"`
|
||||
}
|
||||
|
||||
// DiskAdd creates new disk and attach to compute
|
||||
|
||||
@@ -391,12 +391,6 @@ type ItemDisk struct {
|
||||
// Access Control List
|
||||
ACL ItemACL `json:"acl"`
|
||||
|
||||
// BLK Discard
|
||||
BLKDiscard bool `json:"blkdiscard"`
|
||||
|
||||
// Block Size
|
||||
BlockSize string `json:"block_size"`
|
||||
|
||||
// Boot partition
|
||||
BootPartition uint64 `json:"bootPartition"`
|
||||
|
||||
@@ -1496,20 +1490,3 @@ type CloneStatus struct {
|
||||
// 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
|
||||
|
||||
@@ -20,7 +20,7 @@ type NetAttachRequest struct {
|
||||
// 'VFNIC' for connect to vfpool
|
||||
// 'DPDK' for connect to DPDK
|
||||
// `EMPTY` for connect empty network
|
||||
// `SDN` for connect to SDN
|
||||
// `SDT` for connect to SDN
|
||||
// `TRUNK` for connect to TRUNK
|
||||
// Required: true
|
||||
NetType string `url:"netType" json:"netType" validate:"computex86NetType"`
|
||||
@@ -50,22 +50,6 @@ type NetAttachRequest struct {
|
||||
// Required: false
|
||||
NetMask uint64 `url:"netMask,omitempty" json:"netMask,omitempty"`
|
||||
|
||||
// SDN Segment ID
|
||||
// Required: false
|
||||
SDNSegmentID string `url:"sdn_segment_id,omitempty" json:"sdn_segment_id,omitempty"`
|
||||
|
||||
// SDN Object Group ID
|
||||
// Required: false
|
||||
SDNObjectGroupID string `url:"sdn_object_group_id,omitempty" json:"sdn_object_group_id,omitempty"`
|
||||
|
||||
// SDN Logical Port Display Name
|
||||
// Required: false
|
||||
SDNLogicalPortDisplayName string `url:"sdn_logical_port_display_name,omitempty" json:"sdn_logical_port_display_name,omitempty"`
|
||||
|
||||
// SDN Logical Port Description
|
||||
// Required: false
|
||||
SDNLogicalPortDescription string `url:"sdn_logical_port_description,omitempty" json:"sdn_logical_port_description,omitempty"`
|
||||
|
||||
// Unique identifier of logical port on SDN side
|
||||
// Required: false
|
||||
SDNInterfaceID string `url:"sdn_interface_id,omitempty" json:"sdn_interface_id,omitempty" validate:"omitempty"`
|
||||
|
||||
@@ -41,10 +41,6 @@ type CreateRequest struct {
|
||||
// Cache mode of 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"`
|
||||
}
|
||||
|
||||
// Create creates a disk
|
||||
|
||||
@@ -53,12 +53,6 @@ type InfoDisk struct {
|
||||
// Access Control Control
|
||||
ACL map[string]interface{} `json:"acl"`
|
||||
|
||||
// BLK Discard
|
||||
BLKDiscard bool `json:"blkdiscard"`
|
||||
|
||||
// Block size of disk
|
||||
BlockSize string `json:"block_size"`
|
||||
|
||||
// Boot partition
|
||||
BootPartition uint64 `json:"bootPartition"`
|
||||
|
||||
@@ -221,9 +215,6 @@ type ItemReplication struct {
|
||||
// Detailed indormation about disk
|
||||
type RecordDisk struct {
|
||||
|
||||
// Block size of disk
|
||||
BlockSize string `json:"block_size"`
|
||||
|
||||
//Created by
|
||||
CreatedBy string `json:"createdBy"`
|
||||
|
||||
@@ -273,6 +264,9 @@ type SearchListDisks []ItemDisk
|
||||
|
||||
// Main information about unattached disk
|
||||
type ItemUnattachedDisk struct {
|
||||
// CKey
|
||||
CKey string `json:"_ckey"`
|
||||
|
||||
// Meta
|
||||
Meta []interface{} `json:"_meta"`
|
||||
|
||||
|
||||
@@ -17,14 +17,6 @@ type UpdateRequest struct {
|
||||
// Cache mode of 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"`
|
||||
|
||||
// Block size of disk
|
||||
// Required: false
|
||||
BlockSize string `url:"block_size,omitempty" json:"block_size,omitempty"`
|
||||
}
|
||||
|
||||
// Update updates disk
|
||||
|
||||
@@ -57,22 +57,6 @@ type Interface struct {
|
||||
// Flag indicating whether this interface is enabled (only for VINS, EXTNET, DPDK, SDN, TRUNK)
|
||||
// Required: false
|
||||
Enabled interface{} `url:"enabled,omitempty" json:"enabled,omitempty" validate:"omitempty,isBool"`
|
||||
|
||||
// SDN Segment ID
|
||||
// Required: false
|
||||
SDNSegmentID string `url:"sdn_segment_id,omitempty" json:"sdn_segment_id,omitempty"`
|
||||
|
||||
// SDN Object Group ID
|
||||
// Required: false
|
||||
SDNObjectGroupID string `url:"sdn_object_group_id,omitempty" json:"sdn_object_group_id,omitempty"`
|
||||
|
||||
// SDN Logical Port Display Name
|
||||
// Required: false
|
||||
SDNLogicalPortDisplayName string `url:"sdn_logical_port_display_name,omitempty" json:"sdn_logical_port_display_name,omitempty"`
|
||||
|
||||
// SDN Logical Port Description
|
||||
// Required: false
|
||||
SDNLogicalPortDescription string `url:"sdn_logical_port_description,omitempty" json:"sdn_logical_port_description,omitempty"`
|
||||
}
|
||||
|
||||
// DataDisk detailed struct for DataDisks field in CreateRequest, CreateBlankRequest and MassCreateRequest
|
||||
@@ -106,14 +90,6 @@ type DataDisk struct {
|
||||
// Specify image id for create disk from template
|
||||
// Required: false
|
||||
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
|
||||
@@ -193,6 +169,14 @@ type CreateRequest struct {
|
||||
// Required: false
|
||||
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
|
||||
// Required: false
|
||||
CustomField string `url:"customFields,omitempty" json:"customFields,omitempty"`
|
||||
@@ -231,10 +215,6 @@ type CreateRequest struct {
|
||||
// Cache mode for boot disk
|
||||
// Required: false
|
||||
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
|
||||
|
||||
@@ -119,10 +119,6 @@ type CreateBlankRequest struct {
|
||||
// Cache mode for boot disk
|
||||
// Required: false
|
||||
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
|
||||
|
||||
@@ -14,13 +14,9 @@ type InterfaceMassCreate struct {
|
||||
// - VINS
|
||||
// - EXTNET
|
||||
// - TRUNK
|
||||
// - SDN
|
||||
// For SDN, one of the fields sdn_interface_id or sdn_segment_id is specified, but not both at the same time
|
||||
// Required: false
|
||||
NetType string `url:"netType" json:"netType" validate:"required,massCreateNetType"`
|
||||
|
||||
// Network ID for connect
|
||||
// Required: false
|
||||
NetID uint64 `url:"netId" json:"netId" validate:"required"`
|
||||
|
||||
// IP address to assign to this VM when connecting to the specified network
|
||||
@@ -51,22 +47,6 @@ type InterfaceMassCreate struct {
|
||||
// Flag indicating whether this interface is enabled (only for VINS, EXTNET, DPDK, SDN, TRUNK)
|
||||
// Required: false
|
||||
Enabled interface{} `url:"enabled,omitempty" json:"enabled,omitempty" validate:"omitempty,isBool"`
|
||||
|
||||
// SDN Segment ID
|
||||
// Required: false
|
||||
SDNSegmentID string `url:"sdn_segment_id,omitempty" json:"sdn_segment_id,omitempty"`
|
||||
|
||||
// SDN Object Group ID
|
||||
// Required: false
|
||||
SDNObjectGroupID string `url:"sdn_object_group_id,omitempty" json:"sdn_object_group_id,omitempty"`
|
||||
|
||||
// SDN Logical Port Display Name
|
||||
// Required: false
|
||||
SDNLogicalPortDisplayName string `url:"sdn_logical_port_display_name,omitempty" json:"sdn_logical_port_display_name,omitempty"`
|
||||
|
||||
// SDN Logical Port Description
|
||||
// Required: false
|
||||
SDNLogicalPortDescription string `url:"sdn_logical_port_description,omitempty" json:"sdn_logical_port_description,omitempty"`
|
||||
}
|
||||
|
||||
// MassCreateRequest struct to mass create KVM x86
|
||||
@@ -156,10 +136,6 @@ type MassCreateRequest struct {
|
||||
// Cache mode for boot disk
|
||||
// Required: false
|
||||
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 {
|
||||
|
||||
@@ -49,10 +49,6 @@ type ListRequest struct {
|
||||
// Page size
|
||||
// Required: false
|
||||
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
|
||||
|
||||
@@ -26,9 +26,6 @@ type RecordNode struct {
|
||||
// Isolated Cpus
|
||||
IsolatedCpus []interface{} `json:"isolatedCpus"`
|
||||
|
||||
// MemAllocationRatio
|
||||
MemAllocationRatio float64 `json:"mem_allocation_ratio"`
|
||||
|
||||
// Name
|
||||
Name string `json:"name"`
|
||||
|
||||
|
||||
@@ -17,10 +17,6 @@ type CreateRequest struct {
|
||||
// Description
|
||||
// Required: false
|
||||
Description string `url:"description,omitempty" json:"description,omitempty"`
|
||||
|
||||
// If true, all nodes belonging to the given zone will be marked for autostart
|
||||
// Required: false
|
||||
AutoStart interface{} `url:"autostart,omitempty" json:"autostart,omitempty" validate:"omitempty,isBool"`
|
||||
}
|
||||
|
||||
// Create creates zone object
|
||||
|
||||
@@ -62,18 +62,10 @@ type ListRequest struct {
|
||||
// Required: false
|
||||
CreatedFrom string `url:"created_from,omitempty" json:"created_from,omitempty"`
|
||||
|
||||
// Filter by create date to
|
||||
// Filter lby create date to
|
||||
// Required: false
|
||||
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
|
||||
// Required: false
|
||||
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
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
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
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
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
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,7 +570,6 @@ func getRequestsMapCloudbroker() map[string]interface{} {
|
||||
"/restmachine/cloudbroker/compute/cdInsert": compute_cb.CDInsertRequest{},
|
||||
"/restmachine/cloudbroker/compute/changeLinkState": compute_cb.ChangeLinkStateRequest{},
|
||||
"/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/clone": compute_cb.CloneRequest{},
|
||||
"/restmachine/cloudbroker/compute/clone_abort": compute_cb.CloneAbortRequest{},
|
||||
@@ -1166,8 +1165,6 @@ func getRequestsMapSDN() map[string]interface{} {
|
||||
"/restmachine/sdn/network_object_group/get": netobjgroups.GetRequest{},
|
||||
"/restmachine/sdn/network_object_group/list": netobjgroups.ListRequest{},
|
||||
"/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
|
||||
"/restmachine/sdn/segment/create": segments.CreateRequest{},
|
||||
|
||||
Reference in New Issue
Block a user