Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
403574496b | ||
|
|
25fa57f583 | ||
| 3588755461 | |||
|
|
a59feae2f2 |
59
CHANGELOG.md
59
CHANGELOG.md
@@ -1,71 +1,50 @@
|
|||||||
## Version 13.1.0
|
## Version 13.5.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 и в следующих версиях будет удалён
|
Метод `ListNodes` в cloudbroker/image стал deprecated и в следующих версиях будет удалён
|
||||||
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и в следующих версиях будут удалены
|
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и в следующих версиях будут удалены
|
||||||
Методы `ComputeCISet`, `ComputeCIUnset`, `GetAudits` в cloudbroker/computeGetAudits и `GetAudits` в cloudbroker/compute стали deprecated и будут удалены в следующих версиях |
|
Методы `ComputeCISet`, `ComputeCIUnset`, `GetAudits` в cloudbroker/computeGetAudits и `GetAudits` в cloudbroker/compute стали deprecated и будут удалены в следующих версиях
|
||||||
|
Методы `ComputeCISet`, `ComputeCIUnset` в cloudbroker/image стали deprecated и будут удалены в следующих версиях
|
||||||
|
|
||||||
Все методы группы `.SDN()` находятся в альфа-версии.
|
Все методы группы `.SDN()` находятся в альфа-версии.
|
||||||
|
|
||||||
### Добавлено
|
### Добавлено
|
||||||
|
|
||||||
#### account
|
#### disks
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-686 | Поле `Policies` в структуры ответа `LimitsRG` в cloudapi/account и `Limits` в cloudbroker/account |
|
| BGOS-735 | Вычисляемое поле `Cache` в структуры ответа `ItemDiskUnattached` в cloudapi/disks и в cloudbroker/disks |
|
||||||
|
|
||||||
#### access groups
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-693 | Поле `OwnerDisplayName` в структуру запроса `ListGroupsRequest` и поле `Comment` в структуру ответа `AccessGroupItem` |
|
|
||||||
|
|
||||||
#### backup
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-688 | Опциональное поле `NodeID` в структуры запросов `RestoreDiskFromBackupRequest` и `RestoreDisksFromBackupRequest` в cloudbroker/backup |
|
|
||||||
|
|
||||||
#### node
|
#### node
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-691 | Поле `UsableCPUs` в структурах ответа `RecordNode` и `ItemNode` в 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 |
|
||||||
|
|
||||||
#### storage policy
|
#### zone
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-690 | Поле `SepTechStatus` в структуру `AccessSEPPool` в структуре ответа `ItemStoragePolicy` в cloudapi/stpolicy и в cloudbroker/stpolicy |
|
| BGOS-737 | Опциональное поле `AutoStart` в структуру запроса `UpdateRequest` в cloudbroker/zone |
|
||||||
|
| BGOS-737 | Вычисляемое поле `AutoStart` в структуры ответа `RecordZone` в cloudapi/zone и в cloudbroker/zone |
|
||||||
#### user
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | ---|
|
|
||||||
| BGOS-692 | Поле `SortBy` в структуру запроса `GetAuditRequest` в cloudbroker/user |
|
|
||||||
|
|
||||||
### Изменено
|
### Изменено
|
||||||
|
|
||||||
#### user
|
#### sep
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-700 | Изменен тип поля `EmailAddress` с `[]string` на `string` в структуре запроса `CreateRequest` в cloudbroker/user |
|
| BGOS-740 | Тип поля `Force` с обязательного на опциональный в структуре запроса `DelConsumerNodesRequest` в cloudbroker/sep |
|
||||||
| BGOS-700 | Изменен тип возвращаемого значения метода `Create` с `bool` на `string` в cloudbroker/user |
|
|
||||||
|
|
||||||
### Удалено
|
### Удалено
|
||||||
|
|
||||||
#### account
|
#### bservice
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-686 | Поле `CUNP` из структуры ответа `ResourceLimits` в cloudapi/account и cloudbroker/account |
|
| BGOS-739 | Обязательное поле `Driver` в структурах запроса `GroupAddRequest` в cloudapi/bservice и в cloudbroker/bservice |
|
||||||
| BGOS-686 | Поле `ExtTraffic` из структур ответа `Resource` и `LimitsRG` в cloudapi/account и `Resource` и `Limits` в cloudbroker/account |
|
|
||||||
|
|
||||||
#### grid
|
#### flipgroup
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-686 | Поле `ExtTraffic` из структуры ответа `RecordResource` в cloudbroker/grid |
|
| BGOS-742 | Опциональное поле `RGID` из структуры запроса `ListRequest` в cloudapi/flipgroup и в cloudbroker/flipgroup |
|
||||||
|
| BGOS-742 | Вычисляемые поля `RGName` и `RGID` из структуры ответа `RecordFLIPGroup` в cloudapi/flipgroup и в cloudbroker/flipgroup |
|
||||||
#### rg
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | ---|
|
|
||||||
| BGOS-686 | Поле `ExtTraffic` из структур ответа `Resource` и `RecordResourceUsage` в cloudapi/rg и `Reservation` в cloudbroker/rg |
|
|
||||||
|
|
||||||
#### user
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-686 | Поле `ExtTraffic` из структуры ответа `Resources` в cloudapi/user |
|
|
||||||
|
|||||||
@@ -471,3 +471,10 @@ func addressPoolNetTypeValidator(fe validator.FieldLevel) bool {
|
|||||||
|
|
||||||
return IsInSlice(fieldValue, addressPoolNetTypeValues)
|
return IsInSlice(fieldValue, addressPoolNetTypeValues)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sepTechStatusValidator is used to validate SepTechStatus fields
|
||||||
|
func sepTechStatusValidator(fe validator.FieldLevel) bool {
|
||||||
|
fieldValue := fe.Field().String()
|
||||||
|
|
||||||
|
return IsInSlice(fieldValue, sepTechStatusValues)
|
||||||
|
}
|
||||||
|
|||||||
@@ -366,6 +366,12 @@ func errorMessage(fe validator.FieldError) string {
|
|||||||
prefix,
|
prefix,
|
||||||
fe.Field(),
|
fe.Field(),
|
||||||
joinValues(ipTypeValues))
|
joinValues(ipTypeValues))
|
||||||
|
|
||||||
|
case "sepTechStatus":
|
||||||
|
return fmt.Sprintf("%s %s must be one of the following: %s",
|
||||||
|
prefix,
|
||||||
|
fe.Field(),
|
||||||
|
joinValues(sepTechStatusValues))
|
||||||
}
|
}
|
||||||
|
|
||||||
return fe.Error()
|
return fe.Error()
|
||||||
|
|||||||
@@ -311,5 +311,10 @@ func registerAllValidators(validate *validator.Validate) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = validate.RegisterValidation("sepTechStatus", sepTechStatusValidator)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ var (
|
|||||||
|
|
||||||
loaderTypeValues = []string{"linux", "windows", "unknown"}
|
loaderTypeValues = []string{"linux", "windows", "unknown"}
|
||||||
|
|
||||||
sepTypeValues = []string{"hitachi", "dorado", "tatlin", "shared", "local", "des"}
|
sepTypeValues = []string{"hitachi", "dorado", "tatlin", "shared", "local", "des", "ustor"}
|
||||||
|
|
||||||
languageValues = []string{"ru", "en"}
|
languageValues = []string{"ru", "en"}
|
||||||
|
|
||||||
@@ -81,6 +81,8 @@ var (
|
|||||||
addressPoolNetTypeValues = []string{"IPv4", "IPv6", "MAC"}
|
addressPoolNetTypeValues = []string{"IPv4", "IPv6", "MAC"}
|
||||||
|
|
||||||
ipTypeValues = []string{"v4, v6"}
|
ipTypeValues = []string{"v4, v6"}
|
||||||
|
|
||||||
|
sepTechStatusValues = []string{"ENABLED", "DISABLED"}
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -38,10 +38,6 @@ type GroupAddRequest struct {
|
|||||||
// Required: true
|
// Required: true
|
||||||
ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`
|
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
|
// Storage endpoint provider ID
|
||||||
// Required: false
|
// Required: false
|
||||||
SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`
|
SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`
|
||||||
|
|||||||
@@ -25,15 +25,15 @@ type GroupResizeRequest struct {
|
|||||||
// Chipset for new computes, either i440fx or Q35 (i440fx by default)
|
// Chipset for new computes, either i440fx or Q35 (i440fx by default)
|
||||||
// Available values : i440fx, Q35
|
// Available values : i440fx, Q35
|
||||||
// Default value : Q35
|
// Default value : Q35
|
||||||
// Required: true
|
// Required: false
|
||||||
Chipset string `url:"chipset" json:"chipset" validate:"required,chipset"`
|
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
||||||
|
|
||||||
// Either delta or absolute value of computes
|
// Either delta or absolute value of computes
|
||||||
// Should be one of:
|
// Should be one of:
|
||||||
// - ABSOLUTE
|
// - ABSOLUTE
|
||||||
// - RELATIVE
|
// - RELATIVE
|
||||||
// Required: true
|
// Required: false
|
||||||
Mode string `url:"mode" json:"mode" validate:"bserviceMode"`
|
Mode string `url:"mode,omitempty" json:"mode,omitempty" validate:"omitempty,bserviceMode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GroupResize resize the group by changing the number of computes
|
// GroupResize resize the group by changing the number of computes
|
||||||
|
|||||||
@@ -38,9 +38,8 @@ type AffinityRuleAddRequest struct {
|
|||||||
Key string `url:"key" json:"key" validate:"required"`
|
Key string `url:"key" json:"key" validate:"required"`
|
||||||
|
|
||||||
// Value that must match the key to be taken into account when analyzing this rule
|
// Value that must match the key to be taken into account when analyzing this rule
|
||||||
// Required: false
|
// Required: true
|
||||||
// Not required on purpose: despite required tag on platform, empty string is allowed
|
Value string `url:"value" json:"value" validate:"required"`
|
||||||
Value string `url:"value" json:"value"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AffinityRuleAdd add affinity rule
|
// AffinityRuleAdd add affinity rule
|
||||||
|
|||||||
@@ -38,9 +38,8 @@ type AffinityRuleRemoveRequest struct {
|
|||||||
Key string `url:"key" json:"key" validate:"required"`
|
Key string `url:"key" json:"key" validate:"required"`
|
||||||
|
|
||||||
// Value that must match the key to be taken into account when analyzing this rule
|
// Value that must match the key to be taken into account when analyzing this rule
|
||||||
// Required: false
|
// Required: true
|
||||||
// Not required on purpose: despite required tag on platform, empty string is allowed
|
Value string `url:"value" json:"value" validate:"required"`
|
||||||
Value string `url:"value" json:"value"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AffinityRuleRemove remove affinity rule
|
// AffinityRuleRemove remove affinity rule
|
||||||
|
|||||||
@@ -38,9 +38,8 @@ type AntiAffinityRuleAddRequest struct {
|
|||||||
Key string `url:"key" json:"key" validate:"required"`
|
Key string `url:"key" json:"key" validate:"required"`
|
||||||
|
|
||||||
// Value that must match the key to be taken into account when analyzing this rule
|
// Value that must match the key to be taken into account when analyzing this rule
|
||||||
// Required: false
|
// Required: true
|
||||||
// Not required on purpose: despite required tag on platform, empty string is allowed
|
Value string `url:"value" json:"value" validate:"required"`
|
||||||
Value string `url:"value" json:"value"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AntiAffinityRuleAdd add anti affinity rule
|
// AntiAffinityRuleAdd add anti affinity rule
|
||||||
|
|||||||
@@ -38,9 +38,8 @@ type AntiAffinityRuleRemoveRequest struct {
|
|||||||
Key string `url:"key" json:"key" validate:"required"`
|
Key string `url:"key" json:"key" validate:"required"`
|
||||||
|
|
||||||
// Value that must match the key to be taken into account when analyzing this rule
|
// Value that must match the key to be taken into account when analyzing this rule
|
||||||
// Required: false
|
// Required: true
|
||||||
// Not required on purpose: despite required tag on platform, empty string is allowed
|
Value string `url:"value" json:"value" validate:"required"`
|
||||||
Value string `url:"value" json:"value"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AntiAffinityRuleRemove remove anti affinity rule
|
// AntiAffinityRuleRemove remove anti affinity rule
|
||||||
|
|||||||
@@ -58,6 +58,10 @@ 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
|
||||||
|
|||||||
@@ -795,6 +795,9 @@ type ItemComputeDisk struct {
|
|||||||
// Bus number
|
// Bus number
|
||||||
BusNumber uint64 `json:"bus_number"`
|
BusNumber uint64 `json:"bus_number"`
|
||||||
|
|
||||||
|
// Chache
|
||||||
|
Cache string `json:"cache"`
|
||||||
|
|
||||||
// Created by
|
// Created by
|
||||||
CreatedBy string `json:"createdBy"`
|
CreatedBy string `json:"createdBy"`
|
||||||
|
|
||||||
@@ -1237,6 +1240,9 @@ type ListInfoDisks []InfoDisk
|
|||||||
type InfoDisk struct {
|
type InfoDisk struct {
|
||||||
// ID
|
// ID
|
||||||
ID uint64 `json:"id"`
|
ID uint64 `json:"id"`
|
||||||
|
|
||||||
|
// SEP ID
|
||||||
|
SepID int64 `json:"sepId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List information about computes
|
// List information about computes
|
||||||
|
|||||||
@@ -45,6 +45,11 @@ type NetAttachRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty" validate:"omitempty,mtu"`
|
MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty" validate:"omitempty,mtu"`
|
||||||
|
|
||||||
|
// Net mask
|
||||||
|
// Used only to DPDK or VFNIC net type
|
||||||
|
// Required: false
|
||||||
|
NetMask uint64 `url:"netMask,omitempty" json:"netMask,omitempty"`
|
||||||
|
|
||||||
// Unique identifier of logical port on SDN side
|
// Unique identifier of logical port on SDN side
|
||||||
// Required: false
|
// Required: false
|
||||||
SDNInterfaceID string `url:"sdn_interface_id,omitempty" json:"sdn_interface_id,omitempty" validate:"omitempty"`
|
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
|
// 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
|
||||||
|
|||||||
@@ -139,6 +139,9 @@ type ItemDisk struct {
|
|||||||
|
|
||||||
// Updated by
|
// Updated by
|
||||||
UpdatedBy string `json:"updatedBy"`
|
UpdatedBy string `json:"updatedBy"`
|
||||||
|
|
||||||
|
// Cache mode of disk
|
||||||
|
Cache string `json:"cache"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ItemDiskUnattached struct {
|
type ItemDiskUnattached struct {
|
||||||
@@ -160,6 +163,9 @@ type ItemDiskUnattached struct {
|
|||||||
// Boot Partition
|
// Boot Partition
|
||||||
BootPartition uint64 `json:"bootPartition"`
|
BootPartition uint64 `json:"bootPartition"`
|
||||||
|
|
||||||
|
// Cache
|
||||||
|
Cache string `json:"cache"`
|
||||||
|
|
||||||
// Created time
|
// Created time
|
||||||
CreatedTime uint64 `json:"createdTime"`
|
CreatedTime uint64 `json:"createdTime"`
|
||||||
|
|
||||||
@@ -503,6 +509,9 @@ type RecordDisk struct {
|
|||||||
|
|
||||||
// Updated by
|
// Updated by
|
||||||
UpdatedBy string `json:"updatedBy"`
|
UpdatedBy string `json:"updatedBy"`
|
||||||
|
|
||||||
|
// Cache mode of disk
|
||||||
|
Cache string `json:"cache"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ItemReplication struct {
|
type ItemReplication struct {
|
||||||
|
|||||||
@@ -34,10 +34,6 @@ type ListRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
AccountId uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
|
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
|
// Find by id
|
||||||
// Required: false
|
// Required: false
|
||||||
ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`
|
ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`
|
||||||
|
|||||||
@@ -85,12 +85,6 @@ type RecordFLIPGroup struct {
|
|||||||
// Network
|
// Network
|
||||||
Network string `json:"network"`
|
Network string `json:"network"`
|
||||||
|
|
||||||
// Resource group ID
|
|
||||||
RGID uint64 `json:"rgId"`
|
|
||||||
|
|
||||||
// Resource group name
|
|
||||||
RGName string `json:"rgName"`
|
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,11 @@ type Interface struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty" validate:"omitempty,mtu"`
|
MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty" validate:"omitempty,mtu"`
|
||||||
|
|
||||||
|
// Net mask
|
||||||
|
// Used only to DPDK or VFNIC net type
|
||||||
|
// Required: false
|
||||||
|
NetMask uint64 `url:"netMask,omitempty" json:"netMask,omitempty"`
|
||||||
|
|
||||||
// MAC address to assign to this VM when connecting to the specified network
|
// MAC address to assign to this VM when connecting to the specified network
|
||||||
// Required: false
|
// Required: false
|
||||||
MAC string `url:"mac,omitempty" json:"mac,omitempty" validate:"omitempty"`
|
MAC string `url:"mac,omitempty" json:"mac,omitempty" validate:"omitempty"`
|
||||||
@@ -204,6 +209,10 @@ 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,6 +115,10 @@ 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
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ type CreateRequest struct {
|
|||||||
HighlyAvailable bool `url:"highlyAvailable,omitempty" json:"highlyAvailable,omitempty"`
|
HighlyAvailable bool `url:"highlyAvailable,omitempty" json:"highlyAvailable,omitempty"`
|
||||||
|
|
||||||
// Start now Load balancer
|
// Start now Load balancer
|
||||||
// Required: true
|
// Required: false
|
||||||
Start bool `url:"start" json:"start" validate:"required"`
|
Start interface{} `url:"start,omitempty" json:"start,omitempty" validate:"omitempty,isBool"`
|
||||||
|
|
||||||
// Text description of this load balancer
|
// Text description of this load balancer
|
||||||
// Required: false
|
// Required: false
|
||||||
|
|||||||
@@ -56,6 +56,10 @@ type ListRequest struct {
|
|||||||
// Search by pool name
|
// Search by pool name
|
||||||
// Required: false
|
// Required: false
|
||||||
PoolName string `url:"pool_name,omitempty" json:"pool_name,omitempty"`
|
PoolName string `url:"pool_name,omitempty" json:"pool_name,omitempty"`
|
||||||
|
|
||||||
|
// Filter SEP's by tech status (ENABLED, DISABLED)
|
||||||
|
// Required: false
|
||||||
|
SepTechStatus string `url:"sep_tech_status,omitempty" json:"sep_tech_status,omitempty" validate:"omitempty,sepTechStatus"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List gets list of storage policies as a ListStoragePolicies struct
|
// List gets list of storage policies as a ListStoragePolicies struct
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ type ItemTrunk struct {
|
|||||||
// MAC
|
// MAC
|
||||||
MAC string `json:"mac"`
|
MAC string `json:"mac"`
|
||||||
|
|
||||||
|
// MTU
|
||||||
|
MTU uint64 `json:"mtu"`
|
||||||
|
|
||||||
// Name of a trunk
|
// Name of a trunk
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ type ListZones struct {
|
|||||||
|
|
||||||
// Detailed information about the zone record
|
// Detailed information about the zone record
|
||||||
type RecordZone struct {
|
type RecordZone struct {
|
||||||
|
// If true, all nodes belonging to the given zone will be marked for autostart
|
||||||
|
AutoStart bool `json:"autostart"`
|
||||||
|
|
||||||
// ID
|
// ID
|
||||||
ID uint64 `json:"id"`
|
ID uint64 `json:"id"`
|
||||||
|
|
||||||
|
|||||||
@@ -95,6 +95,15 @@ type RecordAudit struct {
|
|||||||
|
|
||||||
// TTL
|
// TTL
|
||||||
TTL string `json:"_ttl"`
|
TTL string `json:"_ttl"`
|
||||||
|
|
||||||
|
// Resgroup ID
|
||||||
|
ResgroupID uint64 `json:"resgroup_id"`
|
||||||
|
|
||||||
|
// Account ID
|
||||||
|
AccountID uint64 `json:"account_id"`
|
||||||
|
|
||||||
|
// Compute ID
|
||||||
|
ComputeID uint64 `json:"compute_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of Linked Jobs
|
// List of Linked Jobs
|
||||||
|
|||||||
@@ -38,10 +38,6 @@ type GroupAddRequest struct {
|
|||||||
// Required: true
|
// Required: true
|
||||||
ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`
|
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
|
// Storage endpoint provider ID
|
||||||
// Required: false
|
// Required: false
|
||||||
SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`
|
SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`
|
||||||
|
|||||||
@@ -25,15 +25,15 @@ type GroupResizeRequest struct {
|
|||||||
// Chipset for new computes, either i440fx or Q35 (i440fx by default)
|
// Chipset for new computes, either i440fx or Q35 (i440fx by default)
|
||||||
// Available values : i440fx, Q35
|
// Available values : i440fx, Q35
|
||||||
// Default value : Q35
|
// Default value : Q35
|
||||||
//Required: true
|
// Required: false
|
||||||
Chipset string `url:"chipset" json:"chipset" validate:"required,chipset"`
|
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
||||||
|
|
||||||
// Either delta or absolute value of computes
|
// Either delta or absolute value of computes
|
||||||
// Should be one of:
|
// Should be one of:
|
||||||
// - ABSOLUTE
|
// - ABSOLUTE
|
||||||
// - RELATIVE
|
// - RELATIVE
|
||||||
// Required: true
|
// Required: false
|
||||||
Mode string `url:"mode" json:"mode" validate:"bserviceMode"`
|
Mode string `url:"mode,omitempty" json:"mode,omitempty" validate:"omitempty,bserviceMode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GroupResize resize the group by changing the number of computes
|
// GroupResize resize the group by changing the number of computes
|
||||||
|
|||||||
@@ -40,9 +40,8 @@ type AffinityRuleAddRequest struct {
|
|||||||
Key string `url:"key" json:"key" validate:"required"`
|
Key string `url:"key" json:"key" validate:"required"`
|
||||||
|
|
||||||
// Value that must match the key to be taken into account when analyzing this rule
|
// Value that must match the key to be taken into account when analyzing this rule
|
||||||
// Required: false
|
// Required: true
|
||||||
// Not required on purpose: despite required tag on platform, empty string is allowed
|
Value string `url:"value" json:"value" validate:"required"`
|
||||||
Value string `url:"value" json:"value"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AffinityRuleAdd adds affinity rule
|
// AffinityRuleAdd adds affinity rule
|
||||||
|
|||||||
@@ -38,9 +38,8 @@ type AffinityRuleRemoveRequest struct {
|
|||||||
Key string `url:"key" json:"key" validate:"required"`
|
Key string `url:"key" json:"key" validate:"required"`
|
||||||
|
|
||||||
// Value that must match the key to be taken into account when analyzing this rule
|
// Value that must match the key to be taken into account when analyzing this rule
|
||||||
// Required: false
|
// Required: true
|
||||||
// Not required on purpose: despite required tag on platform, empty string is allowed
|
Value string `url:"value" json:"value" validate:"required"`
|
||||||
Value string `url:"value" json:"value"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AffinityRuleRemove remove affinity rule
|
// AffinityRuleRemove remove affinity rule
|
||||||
|
|||||||
@@ -38,9 +38,8 @@ type AntiAffinityRuleAddRequest struct {
|
|||||||
Key string `url:"key" json:"key" validate:"required"`
|
Key string `url:"key" json:"key" validate:"required"`
|
||||||
|
|
||||||
// Value that must match the key to be taken into account when analyzing this rule
|
// Value that must match the key to be taken into account when analyzing this rule
|
||||||
// Required: false
|
// Required: true
|
||||||
// Not required on purpose: despite required tag on platform, empty string is allowed
|
Value string `url:"value" json:"value" validate:"required"`
|
||||||
Value string `url:"value" json:"value"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AntiAffinityRuleAdd adds anti affinity rule
|
// AntiAffinityRuleAdd adds anti affinity rule
|
||||||
|
|||||||
@@ -38,9 +38,8 @@ type AntiAffinityRuleRemoveRequest struct {
|
|||||||
Key string `url:"key" json:"key" validate:"required"`
|
Key string `url:"key" json:"key" validate:"required"`
|
||||||
|
|
||||||
// Value that must match the key to be taken into account when analyzing this rule
|
// Value that must match the key to be taken into account when analyzing this rule
|
||||||
// Required: false
|
// Required: true
|
||||||
// Not required on purpose: despite required tag on platform, empty string is allowed
|
Value string `url:"value" json:"value" validate:"required"`
|
||||||
Value string `url:"value" json:"value"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AntiAffinityRuleRemove removes anti affinity rule
|
// AntiAffinityRuleRemove removes anti affinity rule
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
type GetCloneStatusRequest struct {
|
type GetCloneStatusRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"compute_id" json:"compute_id" validate:"required"`
|
ComputeID string `url:"compute_id" json:"compute_id" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetCloneStatus gets information about compute clone status as a RecordCloneStatus struct
|
// GetCloneStatus gets information about compute clone status as a RecordCloneStatus struct
|
||||||
|
|||||||
@@ -58,6 +58,10 @@ 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
|
||||||
|
|||||||
@@ -397,6 +397,9 @@ type ItemDisk struct {
|
|||||||
// Bus number
|
// Bus number
|
||||||
BusNumber uint64 `json:"bus_number"`
|
BusNumber uint64 `json:"bus_number"`
|
||||||
|
|
||||||
|
// Chache
|
||||||
|
Cache string `json:"cache"`
|
||||||
|
|
||||||
// Created by
|
// Created by
|
||||||
CreatedBy string `json:"createdBy"`
|
CreatedBy string `json:"createdBy"`
|
||||||
|
|
||||||
@@ -841,7 +844,7 @@ type InfoCompute struct {
|
|||||||
SnapSets ListSnapshots `json:"snapSets"`
|
SnapSets ListSnapshots `json:"snapSets"`
|
||||||
|
|
||||||
// Node ID
|
// Node ID
|
||||||
NodeID uint64 `json:"nodeId"`
|
NodeID uint64 `json:"node_id"`
|
||||||
|
|
||||||
// Node name
|
// Node name
|
||||||
NodeName string `json:"nodeName"`
|
NodeName string `json:"nodeName"`
|
||||||
@@ -1171,6 +1174,9 @@ type RecordCompute struct {
|
|||||||
|
|
||||||
// Zone ID
|
// Zone ID
|
||||||
ZoneID uint64 `json:"zoneId"`
|
ZoneID uint64 `json:"zoneId"`
|
||||||
|
|
||||||
|
//todo
|
||||||
|
_ uint64 `json:"nodeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type LoaderMetaIso struct {
|
type LoaderMetaIso struct {
|
||||||
@@ -1280,6 +1286,9 @@ type ItemDeletedCompute struct {
|
|||||||
type InfoDisk struct {
|
type InfoDisk struct {
|
||||||
// ID
|
// ID
|
||||||
ID uint64 `json:"id"`
|
ID uint64 `json:"id"`
|
||||||
|
|
||||||
|
// SEP ID
|
||||||
|
SepID int64 `json:"sepId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List computes
|
// List computes
|
||||||
|
|||||||
@@ -45,6 +45,11 @@ type NetAttachRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty" validate:"omitempty,mtu"`
|
MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty" validate:"omitempty,mtu"`
|
||||||
|
|
||||||
|
// Net mask
|
||||||
|
// Used only to DPDK or VFNIC net type
|
||||||
|
// Required: false
|
||||||
|
NetMask uint64 `url:"netMask,omitempty" json:"netMask,omitempty"`
|
||||||
|
|
||||||
// Unique identifier of logical port on SDN side
|
// Unique identifier of logical port on SDN side
|
||||||
// Required: false
|
// Required: false
|
||||||
SDNInterfaceID string `url:"sdn_interface_id,omitempty" json:"sdn_interface_id,omitempty" validate:"omitempty"`
|
SDNInterfaceID string `url:"sdn_interface_id,omitempty" json:"sdn_interface_id,omitempty" validate:"omitempty"`
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ type StartRequest struct {
|
|||||||
|
|
||||||
// ID of node to start compute
|
// ID of node to start compute
|
||||||
// Required: false
|
// Required: false
|
||||||
NodeID uint64 `url:"nodeId,omitempty" json:"nodeId,omitempty"`
|
NodeID uint64 `url:"node_id,omitempty" json:"node_id,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start starts compute
|
// Start starts compute
|
||||||
|
|||||||
@@ -33,7 +33,11 @@ type StartMigrationOutRequest struct {
|
|||||||
|
|
||||||
// Mapping of guest disk target names to absolute paths on the destination host.
|
// Mapping of guest disk target names to absolute paths on the destination host.
|
||||||
// Required: false
|
// Required: false
|
||||||
Diskmap map[string]string `url:"diskmap,omitempty" json:"diskmap,omitempty"`
|
DiskMap map[string]string `url:"diskmap,omitempty" json:"diskmap,omitempty"`
|
||||||
|
|
||||||
|
// Mapping of network interfaces
|
||||||
|
// Required: false
|
||||||
|
NetMap map[string]string `url:"netmap,omitempty" json:"netmap,omitempty"`
|
||||||
|
|
||||||
// Mapping for CD/DVD devices or their source paths to new ISO/device paths on the destination
|
// Mapping for CD/DVD devices or their source paths to new ISO/device paths on the destination
|
||||||
// Required: false
|
// Required: false
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ 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
|
||||||
|
|||||||
@@ -187,6 +187,9 @@ type InfoDisk struct {
|
|||||||
|
|
||||||
// Updated by
|
// Updated by
|
||||||
UpdatedBy string `json:"updatedBy"`
|
UpdatedBy string `json:"updatedBy"`
|
||||||
|
|
||||||
|
// Cache mode of disk
|
||||||
|
Cache string `json:"cache"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ItemReplication struct {
|
type ItemReplication struct {
|
||||||
|
|||||||
42
pkg/cloudbroker/disks/update.go
Normal file
42
pkg/cloudbroker/disks/update.go
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
package disks
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// UpdateRequest struct to update disk
|
||||||
|
type UpdateRequest struct {
|
||||||
|
// ID of the disk to update
|
||||||
|
// Required: true
|
||||||
|
DiskID uint64 `url:"disk_id" json:"disk_id" validate:"required"`
|
||||||
|
|
||||||
|
// Cache mode of disk
|
||||||
|
// Required: false
|
||||||
|
Cache string `url:"cache,omitempty" json:"cache,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update updates disk
|
||||||
|
func (d Disks) Update(ctx context.Context, req UpdateRequest) (bool, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/disks/update"
|
||||||
|
|
||||||
|
res, err := d.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
|
||||||
|
}
|
||||||
@@ -34,10 +34,6 @@ type ListRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
AccountId uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
|
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
|
// Find by id
|
||||||
// Required: false
|
// Required: false
|
||||||
ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`
|
ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`
|
||||||
|
|||||||
@@ -85,12 +85,6 @@ type RecordFLIPGroup struct {
|
|||||||
// Network
|
// Network
|
||||||
Network string `json:"network"`
|
Network string `json:"network"`
|
||||||
|
|
||||||
// Resource group ID
|
|
||||||
RGID uint64 `json:"rgId"`
|
|
||||||
|
|
||||||
// Resource group name
|
|
||||||
RGName string `json:"rgName"`
|
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ type PurgeLogsRequest struct {
|
|||||||
GID uint64 `url:"gid" json:"gid" validate:"required"`
|
GID uint64 `url:"gid" json:"gid" validate:"required"`
|
||||||
|
|
||||||
// Age of the records to remove, e.g. -1h for records older than 1 hour, -1w - one week, etc
|
// Age of the records to remove, e.g. -1h for records older than 1 hour, -1w - one week, etc
|
||||||
// Required: true
|
// Required: false
|
||||||
Age string `url:"age" json:"age" validate:"required"`
|
Age string `url:"age,omitempty" json:"age,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PurgeLogs clear Log and ECO records that are older than the specified age.
|
// PurgeLogs clear Log and ECO records that are older than the specified age.
|
||||||
|
|||||||
@@ -37,6 +37,11 @@ type Interface struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
MAC string `url:"mac,omitempty" json:"mac,omitempty" validate:"omitempty"`
|
MAC string `url:"mac,omitempty" json:"mac,omitempty" validate:"omitempty"`
|
||||||
|
|
||||||
|
// Net mask
|
||||||
|
// Used only to DPDK or VFNIC net type
|
||||||
|
// Required: false
|
||||||
|
NetMask uint64 `url:"netMask,omitempty" json:"netMask,omitempty"`
|
||||||
|
|
||||||
// SDN interface id
|
// SDN interface id
|
||||||
// Required: false
|
// Required: false
|
||||||
SDNInterfaceID string `url:"sdn_interface_id,omitempty" json:"sdn_interface_id,omitempty"`
|
SDNInterfaceID string `url:"sdn_interface_id,omitempty" json:"sdn_interface_id,omitempty"`
|
||||||
@@ -206,6 +211,10 @@ 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,6 +115,10 @@ 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
|
||||||
|
|||||||
@@ -132,6 +132,10 @@ type MassCreateRequest 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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type asyncWrapperMassCreateRequest struct {
|
type asyncWrapperMassCreateRequest struct {
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ type CreateRequest struct {
|
|||||||
VINSID uint64 `url:"vinsId" json:"vinsId"`
|
VINSID uint64 `url:"vinsId" json:"vinsId"`
|
||||||
|
|
||||||
// Start now Load balancer
|
// Start now Load balancer
|
||||||
// Required: true
|
// Required: false
|
||||||
Start bool `url:"start" json:"start" validate:"required"`
|
Start interface{} `url:"start,omitempty" json:"start,omitempty" validate:"omitempty,isBool"`
|
||||||
|
|
||||||
// Custom sysctl values for Load Balancer instance. Applied on boot
|
// Custom sysctl values for Load Balancer instance. Applied on boot
|
||||||
// Required: false
|
// Required: false
|
||||||
|
|||||||
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/dynamix-golang-sdk/v13/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
|
// Reason
|
||||||
// Required: false
|
// Required: false
|
||||||
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
|
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
|
// Maintenance places node in maintenance state
|
||||||
|
|||||||
@@ -85,6 +85,12 @@ type RecordNode struct {
|
|||||||
|
|
||||||
// CPU used by the node
|
// CPU used by the node
|
||||||
UsableCPUs []string `json:"usable_cpus"`
|
UsableCPUs []string `json:"usable_cpus"`
|
||||||
|
|
||||||
|
// AutoStart
|
||||||
|
AutoStart bool `json:"autostart"`
|
||||||
|
|
||||||
|
// AutoStart Count
|
||||||
|
AutoStartCount uint64 `json:"autostart_count"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resource consumption of the node
|
// Resource consumption of the node
|
||||||
@@ -301,6 +307,12 @@ type ItemNode struct {
|
|||||||
|
|
||||||
// CPU used by the node
|
// CPU used by the node
|
||||||
UsableCPUs []string `json:"usable_cpus"`
|
UsableCPUs []string `json:"usable_cpus"`
|
||||||
|
|
||||||
|
// AutoStart
|
||||||
|
AutoStart bool `json:"autostart"`
|
||||||
|
|
||||||
|
// AutoStart Count
|
||||||
|
AutoStartCount uint64 `json:"autostart_count"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type PackageInfo struct {
|
type PackageInfo struct {
|
||||||
|
|||||||
@@ -5,13 +5,14 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/constants"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
type VFParam struct {
|
type VFParam struct {
|
||||||
// Number of VF to assign
|
// ID of the FN
|
||||||
// Required: true
|
// Required: true
|
||||||
VFNum uint64 `url:"vfNum" json:"vfNum" validate:"required"`
|
FNID uint64 `url:"fnId" json:"fnId" validate:"required"`
|
||||||
|
|
||||||
// Trust
|
// Trust
|
||||||
// Required: true
|
// Required: true
|
||||||
@@ -46,7 +47,7 @@ func (n Node) SetVFsParams(ctx context.Context, req SetVFsParamsRequest) (bool,
|
|||||||
|
|
||||||
url := "/cloudbroker/node/setVFsParams"
|
url := "/cloudbroker/node/setVFsParams"
|
||||||
|
|
||||||
res, err := n.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := n.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
|
|||||||
@@ -20,22 +20,22 @@ type AddConsumerNodesRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AddConsumerNodes adds consumer nodes to SEP parameters
|
// AddConsumerNodes adds consumer nodes to SEP parameters
|
||||||
func (s SEP) AddConsumerNodes(ctx context.Context, req AddConsumerNodesRequest) (bool, error) {
|
func (s SEP) AddConsumerNodes(ctx context.Context, req AddConsumerNodesRequest) (uint64, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/sep/addConsumerNodes"
|
url := "/cloudbroker/sep/addConsumerNodes"
|
||||||
|
|
||||||
res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := strconv.ParseBool(string(res))
|
result, err := strconv.ParseUint(string(res), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
|
|||||||
@@ -20,22 +20,22 @@ type AddProviderNodesRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AddProviderNodes adds provider nodes to SEP parameters
|
// AddProviderNodes adds provider nodes to SEP parameters
|
||||||
func (s SEP) AddProviderNodes(ctx context.Context, req AddProviderNodesRequest) (bool, error) {
|
func (s SEP) AddProviderNodes(ctx context.Context, req AddProviderNodesRequest) (uint64, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/sep/addProviderNodes"
|
url := "/cloudbroker/sep/addProviderNodes"
|
||||||
|
|
||||||
res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := strconv.ParseBool(string(res))
|
result, err := strconv.ParseUint(string(res), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ type CreateRequest struct {
|
|||||||
|
|
||||||
// Type of storage
|
// Type of storage
|
||||||
// Required: true
|
// Required: true
|
||||||
SEPType string `url:"sep_type" json:"sep_type" validate:"required"`
|
SEPType string `url:"sep_type" json:"sep_type" validate:"required,sepType"`
|
||||||
|
|
||||||
// SEP config
|
// SEP config
|
||||||
// Required: true
|
// Required: true
|
||||||
@@ -30,14 +30,6 @@ type CreateRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
Description string `url:"description,omitempty" json:"description,omitempty"`
|
Description string `url:"description,omitempty" json:"description,omitempty"`
|
||||||
|
|
||||||
// List of provider node IDs
|
|
||||||
// Required: false
|
|
||||||
ProviderNIDs []uint64 `url:"provider_nids,omitempty" json:"provider_nids,omitempty"`
|
|
||||||
|
|
||||||
// List of consumer node IDs
|
|
||||||
// Required: false
|
|
||||||
ConsumerNIDs []uint64 `url:"consumer_nids,omitempty" json:"consumer_nids,omitempty"`
|
|
||||||
|
|
||||||
// Enable SEP after creation
|
// Enable SEP after creation
|
||||||
// Required: false
|
// Required: false
|
||||||
Enable bool `url:"enable,omitempty" json:"enable,omitempty"`
|
Enable bool `url:"enable,omitempty" json:"enable,omitempty"`
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ type DelConsumerNodesRequest struct {
|
|||||||
|
|
||||||
// The force flag must be set to true only if the node will never come back online
|
// The force flag must be set to true only if the node will never come back online
|
||||||
// Default: false
|
// Default: false
|
||||||
// Required: true
|
// Required: false
|
||||||
Force bool `url:"force" json:"force" validate:"required"`
|
Force bool `url:"force" json:"force"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DelConsumerNodes excludes consumer nodes from SEP parameters
|
// DelConsumerNodes excludes consumer nodes from SEP parameters
|
||||||
|
|||||||
@@ -42,6 +42,9 @@ type ListRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
|
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
|
||||||
|
|
||||||
|
// Sort by SEP IDs
|
||||||
|
SepIDs []uint64 `url:"sep_ids,omitempty" json:"sep_ids,omitempty"`
|
||||||
|
|
||||||
// Page size
|
// Page size
|
||||||
// Required: false
|
// Required: false
|
||||||
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
|
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
|
||||||
|
|||||||
@@ -56,6 +56,10 @@ type ListRequest struct {
|
|||||||
// Search by pool name
|
// Search by pool name
|
||||||
// Required: false
|
// Required: false
|
||||||
PoolName string `url:"pool_name,omitempty" json:"pool_name,omitempty"`
|
PoolName string `url:"pool_name,omitempty" json:"pool_name,omitempty"`
|
||||||
|
|
||||||
|
// Filter SEP's by tech status (ENABLED, DISABLED)
|
||||||
|
// Required: false
|
||||||
|
SepTechStatus string `url:"sep_tech_status,omitempty" json:"sep_tech_status,omitempty" validate:"omitempty,sepTechStatus"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List gets list of storage policies as a ListStoragePolicies struct
|
// List gets list of storage policies as a ListStoragePolicies struct
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/constants"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -13,6 +14,10 @@ type UpdateRequest struct {
|
|||||||
// Required: true
|
// Required: true
|
||||||
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
|
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
|
||||||
|
|
||||||
|
// List of storage endpoint access objects
|
||||||
|
// Required: false
|
||||||
|
AccessSEPsPools []AccessSEPsPool `url:"access_seps_pools,omitempty" json:"access_seps_pools,omitempty"`
|
||||||
|
|
||||||
// New name for the storage policy
|
// New name for the storage policy
|
||||||
// Required: false
|
// Required: false
|
||||||
Name string `url:"name,omitempty" json:"name,omitempty"`
|
Name string `url:"name,omitempty" json:"name,omitempty"`
|
||||||
@@ -51,6 +56,6 @@ func (sp StPolicy) UpdateRaw(ctx context.Context, req UpdateRequest) ([]byte, er
|
|||||||
|
|
||||||
url := "/cloudbroker/storage_policy/update"
|
url := "/cloudbroker/storage_policy/update"
|
||||||
|
|
||||||
res, err := sp.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := sp.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,11 @@ type CreateRequest struct {
|
|||||||
// Native VLAN ID
|
// Native VLAN ID
|
||||||
// Required: false
|
// Required: false
|
||||||
NativeVLANID uint64 `url:"native_vlan_id,omitempty" json:"native_vlan_id,omitempty"`
|
NativeVLANID uint64 `url:"native_vlan_id,omitempty" json:"native_vlan_id,omitempty"`
|
||||||
|
|
||||||
|
// MTU
|
||||||
|
// Default value: 1500
|
||||||
|
// Required: false
|
||||||
|
MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create creates a user.
|
// Create creates a user.
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ type ItemTrunk struct {
|
|||||||
// MAC
|
// MAC
|
||||||
MAC string `json:"mac"`
|
MAC string `json:"mac"`
|
||||||
|
|
||||||
|
// MTU
|
||||||
|
MTU uint64 `json:"mtu"`
|
||||||
|
|
||||||
// Name of a trunk
|
// Name of a trunk
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
|
||||||
|
|||||||
@@ -15,12 +15,12 @@ type UpdateRequest struct {
|
|||||||
TrunkID uint64 `url:"id" json:"id" validate:"required"`
|
TrunkID uint64 `url:"id" json:"id" validate:"required"`
|
||||||
|
|
||||||
// New name of the trunk
|
// New name of the trunk
|
||||||
// Required: true
|
// Required: false
|
||||||
Name string `url:"name" json:"name" validate:"required"`
|
Name string `url:"name,omitempty" json:"name,omitempty"`
|
||||||
|
|
||||||
// List of trunk tags (values between 1-4095)
|
// List of trunk tags (values between 1-4095)
|
||||||
// Required: true
|
// Required: false
|
||||||
TrunkTags string `url:"trunk_tags" json:"trunk_tags" validate:"required,trunkTags"`
|
TrunkTags string `url:"trunk_tags,omitempty" json:"trunk_tags,omitempty" validate:"omitempty,trunkTags"`
|
||||||
|
|
||||||
// New description of the trunk
|
// New description of the trunk
|
||||||
// Required: false
|
// Required: false
|
||||||
@@ -29,6 +29,11 @@ type UpdateRequest struct {
|
|||||||
// New native VLAN ID
|
// New native VLAN ID
|
||||||
// Required: false
|
// Required: false
|
||||||
NativeVLANID uint64 `url:"native_vlan_id,omitempty" json:"native_vlan_id,omitempty"`
|
NativeVLANID uint64 `url:"native_vlan_id,omitempty" json:"native_vlan_id,omitempty"`
|
||||||
|
|
||||||
|
// MTU
|
||||||
|
// Default value: 1500
|
||||||
|
// Required: false
|
||||||
|
MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update updates a trunk
|
// Update updates a trunk
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ type GetMatchingUsernamesRequest struct {
|
|||||||
UsernameRegex string `url:"usernameregex" json:"usernameregex" validate:"required"`
|
UsernameRegex string `url:"usernameregex" json:"usernameregex" validate:"required"`
|
||||||
|
|
||||||
// The number of usernames to return.
|
// The number of usernames to return.
|
||||||
// Required: true
|
// Required: false
|
||||||
Limit uint64 `url:"limit" json:"limit" validate:"required"`
|
Limit uint64 `url:"limit,omitempty" json:"limit,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetMatchingUsernames gets a list of the matching usernames for a given string.
|
// GetMatchingUsernames gets a list of the matching usernames for a given string.
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ type ListZones struct {
|
|||||||
|
|
||||||
// Detailed information about the zone record
|
// Detailed information about the zone record
|
||||||
type RecordZone struct {
|
type RecordZone struct {
|
||||||
|
// If true, all nodes belonging to the given zone will be marked for autostart
|
||||||
|
AutoStart bool `json:"autostart"`
|
||||||
|
|
||||||
// ID
|
// ID
|
||||||
ID uint64 `json:"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/dynamix-golang-sdk/v13/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
|
// Description
|
||||||
// Required: false
|
// Required: false
|
||||||
Description string `url:"description,omitempty" json:"description,omitempty"`
|
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
|
// Update updates zone object
|
||||||
|
|||||||
Reference in New Issue
Block a user