Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74c12914c9 |
57
CHANGELOG.md
57
CHANGELOG.md
@@ -1,53 +1,50 @@
|
||||
## Version 1.13.4
|
||||
## 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/computeGetAudits и `GetAudits` в cloudbroker/compute стали deprecated и будут удалены в следующих версиях
|
||||
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и в следующих версиях будут удалены
|
||||
Методы `ComputeCISet`, `ComputeCIUnset`, `GetAudits` в cloudbroker/computeGetAudits и `GetAudits` в cloudbroker/compute стали deprecated и будут удалены в следующих версиях
|
||||
Методы `ComputeCISet`, `ComputeCIUnset` в cloudbroker/image стали deprecated и будут удалены в следующих версиях
|
||||
|
||||
Все методы группы `.SDN()` находятся в альфа-версии.
|
||||
|
||||
### Добавлено
|
||||
|
||||
#### compute
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-732 | Опциональное поле `NetMask` в структуру запроса `NetAttachRequest` в cloudapi/compute |
|
||||
| BGOS-727 | Опциональное поле `Cache` в структуру запроса `DiskAddRequest` в cloudapi/compute и в cloudbroker/compute |
|
||||
| BGOS-727 | Поле `Cache` в структуры ответа `ItemComputeDisk` в cloudapi/compute и в `ItemDisk` в cloudbroker/compute |
|
||||
|
||||
#### disks
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-725 | Структура запроса `UpdateRequest`, метод `Update` в cloudbroker/disks |
|
||||
| BGOS-725 | Опциональное поле `Cache` в структуру запроса `CreateRequest` в cloudapi/disks и в cloudbroker/disks |
|
||||
| BGOS-725 | Поле `Cache` в структуру ответа `InfoDisk` в cloudbroker/disks |
|
||||
| BGOS-725 | Поле `Cache` в структуры ответа `RecordDisk`,`ItemDisk` в cloudapi/disks |
|
||||
| BGOS-735 | Вычисляемое поле `Cache` в структуры ответа `ItemDiskUnattached` в cloudapi/disks и в cloudbroker/disks |
|
||||
|
||||
#### kvmx86
|
||||
#### node
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-727 | Опциональное поле `BootDiskCache` в структуры запроса `CreateRequest`, `CreateBlankRequest` в cloudapi/kvmx86 и в cloudbroker/kvmx86 |
|
||||
| BGOS-727 | Опциональное поле `BootDiskCache` в структуру запроса `MassCreateRequest` в cloudbroker/kvmx86 |
|
||||
| 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 |
|
||||
|
||||
#### zone
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-737 | Опциональное поле `AutoStart` в структуру запроса `UpdateRequest` в cloudbroker/zone |
|
||||
| BGOS-737 | Вычисляемое поле `AutoStart` в структуры ответа `RecordZone` в cloudapi/zone и в cloudbroker/zone |
|
||||
|
||||
### Изменено
|
||||
|
||||
#### sep
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-740 | Тип поля `Force` с обязательного на опциональный в структуре запроса `DelConsumerNodesRequest` в cloudbroker/sep |
|
||||
|
||||
### Удалено
|
||||
|
||||
#### bservice
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-728 | Тип полей `Chipset` и `Mode` с обязательного на опциональный в структуре запроса `GroupResizeRequest` в cloudapi/bservice и в cloudbroker/bservice |
|
||||
| BGOS-739 | Обязательное поле `Driver` в структурах запроса `GroupAddRequest` в cloudapi/bservice и в cloudbroker/bservice |
|
||||
|
||||
#### lb
|
||||
#### flipgroup
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-733 | Тип поля `Start` с обязательного на опциональный в структуре запроса `CreateRequest`в cloudapi/lb и в cloudbroker/lb |
|
||||
|
||||
#### trunk
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-730 | Тип полей `Name` и `TrunkTags` с обязательного на опциональный в структуре запроса `UpdateRequest` в cloudbroker/trunk |
|
||||
|
||||
#### user
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-729 | Тип поля `Limit` с обязательного на опциональный в структуре запроса `GetMatchingUsernamesRequest` в cloudbroker/user |
|
||||
| BGOS-742 | Опциональное поле `RGID` из структуры запроса `ListRequest` в cloudapi/flipgroup и в cloudbroker/flipgroup |
|
||||
| BGOS-742 | Вычисляемые поля `RGName` и `RGID` из структуры ответа `RecordFLIPGroup` в cloudapi/flipgroup и в cloudbroker/flipgroup |
|
||||
|
||||
@@ -38,10 +38,6 @@ type GroupAddRequest struct {
|
||||
// Required: true
|
||||
ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`
|
||||
|
||||
// Compute driver like a KVM_X86, etc.
|
||||
// Required: true
|
||||
Driver string `url:"driver" json:"driver" validate:"required"`
|
||||
|
||||
// Storage endpoint provider ID
|
||||
// Required: false
|
||||
SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`
|
||||
|
||||
@@ -163,6 +163,9 @@ type ItemDiskUnattached struct {
|
||||
// Boot Partition
|
||||
BootPartition uint64 `json:"bootPartition"`
|
||||
|
||||
// Cache
|
||||
Cache string `json:"cache"`
|
||||
|
||||
// Created time
|
||||
CreatedTime uint64 `json:"createdTime"`
|
||||
|
||||
|
||||
@@ -34,10 +34,6 @@ type ListRequest struct {
|
||||
// Required: false
|
||||
AccountId uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
|
||||
|
||||
// Find by resource group ID
|
||||
// Required: false
|
||||
RGID uint64 `url:"rgId,omitempty" json:"rgId,omitempty"`
|
||||
|
||||
// Find by id
|
||||
// Required: false
|
||||
ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`
|
||||
|
||||
@@ -85,12 +85,6 @@ type RecordFLIPGroup struct {
|
||||
// Network
|
||||
Network string `json:"network"`
|
||||
|
||||
// Resource group ID
|
||||
RGID uint64 `json:"rgId"`
|
||||
|
||||
// Resource group name
|
||||
RGName string `json:"rgName"`
|
||||
|
||||
// Status
|
||||
Status string `json:"status"`
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@ type ListZones struct {
|
||||
|
||||
// Detailed information about the zone record
|
||||
type RecordZone struct {
|
||||
// If true, all nodes belonging to the given zone will be marked for autostart
|
||||
AutoStart bool `json:"autostart"`
|
||||
|
||||
// ID
|
||||
ID uint64 `json:"id"`
|
||||
|
||||
|
||||
@@ -38,10 +38,6 @@ type GroupAddRequest struct {
|
||||
// Required: true
|
||||
ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`
|
||||
|
||||
// Compute driver like a KVM_X86, etc.
|
||||
// Required: true
|
||||
Driver string `url:"driver" json:"driver" validate:"required"`
|
||||
|
||||
// Storage endpoint provider ID
|
||||
// Required: false
|
||||
SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`
|
||||
|
||||
@@ -34,10 +34,6 @@ type ListRequest struct {
|
||||
// Required: false
|
||||
AccountId uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
|
||||
|
||||
// Find by resource group ID
|
||||
// Required: false
|
||||
RGID uint64 `url:"rgId,omitempty" json:"rgId,omitempty"`
|
||||
|
||||
// Find by id
|
||||
// Required: false
|
||||
ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`
|
||||
|
||||
@@ -11,7 +11,7 @@ type RecordFLIPGroupCreated struct {
|
||||
// IP
|
||||
IP string `json:"ip"`
|
||||
|
||||
// Name
|
||||
// Name
|
||||
Name string `json:"name"`
|
||||
|
||||
// Network mask
|
||||
@@ -85,12 +85,6 @@ type RecordFLIPGroup struct {
|
||||
// Network
|
||||
Network string `json:"network"`
|
||||
|
||||
// Resource group ID
|
||||
RGID uint64 `json:"rgId"`
|
||||
|
||||
// Resource group name
|
||||
RGName string `json:"rgName"`
|
||||
|
||||
// Status
|
||||
Status string `json:"status"`
|
||||
|
||||
|
||||
42
pkg/cloudbroker/node/autostart.go
Normal file
42
pkg/cloudbroker/node/autostart.go
Normal file
@@ -0,0 +1,42 @@
|
||||
package node
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// AutoStartRequest struct to set node autostart
|
||||
type AutoStartRequest struct {
|
||||
// Node ID
|
||||
// Required: true
|
||||
NodeID uint64 `url:"node_id" json:"node_id" validate:"required"`
|
||||
|
||||
// Auto start
|
||||
// Required: true
|
||||
AutoStart bool `url:"autostart" json:"autostart" validate:"required"`
|
||||
}
|
||||
|
||||
// AutoStart sets node autostart
|
||||
func (n Node) AutoStart(ctx context.Context, req AutoStartRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/node/autostart"
|
||||
|
||||
res, err := n.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
result, err := strconv.ParseBool(string(res))
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
@@ -26,6 +26,11 @@ type MaintenanceRequest struct {
|
||||
// Reason
|
||||
// Required: false
|
||||
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
|
||||
|
||||
// Allow node auto-enable
|
||||
// Default: false
|
||||
// Required: false
|
||||
AutoStart bool `url:"autostart" json:"autostart"`
|
||||
}
|
||||
|
||||
// Maintenance places node in maintenance state
|
||||
|
||||
@@ -85,6 +85,12 @@ type RecordNode struct {
|
||||
|
||||
// CPU used by the node
|
||||
UsableCPUs []string `json:"usable_cpus"`
|
||||
|
||||
// AutoStart
|
||||
AutoStart bool `json:"autostart"`
|
||||
|
||||
// AutoStart Count
|
||||
AutoStartCount uint64 `json:"autostart_count"`
|
||||
}
|
||||
|
||||
// Resource consumption of the node
|
||||
@@ -301,6 +307,12 @@ type ItemNode struct {
|
||||
|
||||
// CPU used by the node
|
||||
UsableCPUs []string `json:"usable_cpus"`
|
||||
|
||||
// AutoStart
|
||||
AutoStart bool `json:"autostart"`
|
||||
|
||||
// AutoStart Count
|
||||
AutoStartCount uint64 `json:"autostart_count"`
|
||||
}
|
||||
|
||||
type PackageInfo struct {
|
||||
|
||||
@@ -20,8 +20,8 @@ type DelConsumerNodesRequest struct {
|
||||
|
||||
// The force flag must be set to true only if the node will never come back online
|
||||
// Default: false
|
||||
// Required: true
|
||||
Force bool `url:"force" json:"force" validate:"required"`
|
||||
// Required: false
|
||||
Force bool `url:"force" json:"force"`
|
||||
}
|
||||
|
||||
// DelConsumerNodes excludes consumer nodes from SEP parameters
|
||||
|
||||
@@ -10,6 +10,9 @@ type ListZones struct {
|
||||
|
||||
// Detailed information about the zone record
|
||||
type RecordZone struct {
|
||||
// If true, all nodes belonging to the given zone will be marked for autostart
|
||||
AutoStart bool `json:"autostart"`
|
||||
|
||||
// ID
|
||||
ID uint64 `json:"id"`
|
||||
|
||||
|
||||
43
pkg/cloudbroker/zone/node_autostart.go
Normal file
43
pkg/cloudbroker/zone/node_autostart.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package zone
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// NodeAutoStartRequest struct to set node autostart in zone
|
||||
type NodeAutoStartRequest struct {
|
||||
// ID of zone
|
||||
// Required: true
|
||||
ZoneID uint64 `url:"zone_id" json:"zone_id" validate:"required"`
|
||||
|
||||
// AutoStart nodes in zone
|
||||
// Required: true
|
||||
AutoStart bool `url:"autostart" json:"autostart" validate:"required"`
|
||||
}
|
||||
|
||||
// NodeAutoStart sets node autostart in zone
|
||||
func (e Zone) NodeAutoStart(ctx context.Context, req NodeAutoStartRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/zone/node_autostart"
|
||||
|
||||
res, err := e.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
result, err := strconv.ParseBool(string(res))
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
@@ -21,6 +21,10 @@ type UpdateRequest 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"`
|
||||
}
|
||||
|
||||
// Update updates zone object
|
||||
|
||||
@@ -894,6 +894,7 @@ func getRequestsMapCloudbroker() map[string]interface{} {
|
||||
"/restmachine/cloudbroker/node/get_logical_cores_count": node_cb.GetLogicalCoresCountRequest{},
|
||||
"/restmachine/cloudbroker/node/set_cpu_allocation_ratio": node_cb.SetCpuAllocationRatioRequest{},
|
||||
"/restmachine/cloudbroker/node/set_mem_allocation_ratio": node_cb.SetMemAllocationRatioRequest{},
|
||||
"/restmachine/cloudbroker/node/autostart": node_cb.AutoStartRequest{},
|
||||
|
||||
// pcidevice
|
||||
"/restmachine/cloudbroker/pcidevice/create": pcidevice_cb.CreateRequest{},
|
||||
@@ -1092,13 +1093,14 @@ func getRequestsMapCloudbroker() map[string]interface{} {
|
||||
"/restmachine/cloudbroker/vins/migrateToZone": vins_cb.MigrateToZoneRequest{},
|
||||
|
||||
// zone
|
||||
"/restmachine/cloudbroker/zone/get": zone_cb.GetRequest{},
|
||||
"/restmachine/cloudbroker/zone/list": zone_cb.ListRequest{},
|
||||
"/restmachine/cloudbroker/zone/create": zone_cb.CreateRequest{},
|
||||
"/restmachine/cloudbroker/zone/delete": zone_cb.DeleteRequest{},
|
||||
"/restmachine/cloudbroker/zone/update": zone_cb.UpdateRequest{},
|
||||
"/restmachine/cloudbroker/zone/addNode": zone_cb.AddNodeRequest{},
|
||||
"/restmachine/cloudbroker/zone/delNode": zone_cb.DelNodeRequest{},
|
||||
"/restmachine/cloudbroker/zone/get": zone_cb.GetRequest{},
|
||||
"/restmachine/cloudbroker/zone/list": zone_cb.ListRequest{},
|
||||
"/restmachine/cloudbroker/zone/create": zone_cb.CreateRequest{},
|
||||
"/restmachine/cloudbroker/zone/delete": zone_cb.DeleteRequest{},
|
||||
"/restmachine/cloudbroker/zone/update": zone_cb.UpdateRequest{},
|
||||
"/restmachine/cloudbroker/zone/addNode": zone_cb.AddNodeRequest{},
|
||||
"/restmachine/cloudbroker/zone/delNode": zone_cb.DelNodeRequest{},
|
||||
"/restmachine/cloudbroker/zone/node_autostart": zone_cb.NodeAutoStartRequest{},
|
||||
|
||||
// security policy
|
||||
"/sdn/security_policy/create": secpolicies.CreateRequest{},
|
||||
|
||||
Reference in New Issue
Block a user