Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0dee6360a |
59
CHANGELOG.md
59
CHANGELOG.md
@@ -1,21 +1,68 @@
|
|||||||
## Version 1.12.10
|
## Version 1.13.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 с соответствующими фильтрами
|
||||||
Метод `ListStacks` в 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 и будут удалены в следующих версиях |
|
||||||
|
|
||||||
Все методы группы `.SDN()` находятся в альфа-версии.
|
Все методы группы `.SDN()` находятся в альфа-версии.
|
||||||
|
|
||||||
### Добавлено
|
### Добавлено
|
||||||
|
|
||||||
#### ClientInterface
|
#### kvmx86
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | ---|
|
| --- | ---|
|
||||||
| BGOS-673 | Добавлен mock для интерфейса ClientInterface с примерами |
|
| BGOS-665 | Опциональные поля `HPBacked`, `CPUPin`, `NumaAffinity` в структуру запроса `CreateBlankRequest` в cloudapi/kvmx86 и cloudbroker/kvmx86 |
|
||||||
|
|
||||||
|
#### node
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | ---|
|
||||||
|
| BGOS-664 | Методы `GetLogicalCoresCount`, `SetCpuAllocationRatio`, `SetMemAllocationRatio` и структуры `GetLogicalCoresCountRequest`,`SetCpuAllocationRatioRequest`,`SetMemAllocationRatioRequest` в cloudbroker/node|
|
||||||
|
| BGOS-666 | Поля `OpenvSwitchBridges`, `Description`, `SDNHypervisorName` в структуру ответа `RecordNode` и поля `OpenvSwitchBridges`, `APIUrl`, `Drivers`, `OldCompatLVMID` в структуру ответа `ItemNode` в cloudbroker/node |
|
||||||
|
| BGOS-676 | Поля `Flags`, `ModelName`, в структуру ответа `CpuInfo` и поля `CPUAllocationRatio`, `MemAllocationRatio`, `Packages` в структуру ответа `ItemNode` в cloudbroker/node |
|
||||||
|
|
||||||
|
|
||||||
|
#### compute
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | ---|
|
||||||
|
| BGOS-675 | Метод `ChangeReadOnly` в cloudbroker/compute |
|
||||||
|
| BGOS-675 | Поле `ReadOnly` в структуру `InfoCompute`, `RecordCompute`, `ItemCompute` в cloudbroker/compute и cloudapi/compute |
|
||||||
|
|
||||||
|
### Изменено
|
||||||
|
|
||||||
|
#### Общее
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-664 | StackID был заменен на NodeID |
|
||||||
|
|
||||||
|
#### node
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | ---|
|
||||||
|
| BGOS-666 | Изменен json-тег поля `VCPU` на `vCPUs` в структуре `FreeResourcesInfo` в cloudbroker/node |
|
||||||
|
|
||||||
|
#### account
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | ---|
|
||||||
|
| BGOS-667 | Валидатор `accountCUType` теперь допускает значения `CU_M`, `CU_C`, `CU_D`, `CU_DM`, `CU_I`, `gpu_units` |
|
||||||
|
|
||||||
|
#### compute
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | ---|
|
||||||
|
| BGOS-683 | Изменен тип поля `StoragePolicyID` с required на optional в структурах запроса `RedeployRequest` в cloudapi/compute и cloudbroker/compute |
|
||||||
|
|
||||||
### Удалено
|
### Удалено
|
||||||
|
|
||||||
#### logical ports
|
#### account
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | ---|
|
| --- | ---|
|
||||||
| BGOS-668 | Поля `LogicalPortID` и `VersionID` в структуре запроса `CreateRequest` |
|
| BGOS-667 | Поле `MaxNetworkPeerTransfer` из структур запросов `UpdateRequest` и `CreateRequest` в cloudapi/account и cloudbroker/account |
|
||||||
|
|
||||||
|
#### rg
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | ---|
|
||||||
|
| BGOS-670 | Поля `MaxNetworkPeerTransfer` из структур запроса `CreateRequest` и `UpdateRequest`, поле `CUNP` из структуры`ResourceLimits` в cloudapi/rg и cloudbroker/rg |
|
||||||
|
|
||||||
|
#### stack
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-664 | Удалена группа stack |
|
||||||
|
|||||||
11
README.md
11
README.md
@@ -17,6 +17,7 @@ Decort SDK - это библиотека, написанная на языке G
|
|||||||
- Версия 1.10.х Decort-SDK соответствует 4.2.0 версии платформы
|
- Версия 1.10.х Decort-SDK соответствует 4.2.0 версии платформы
|
||||||
- Версия 1.11.х Decort-SDK соответствует 4.3.0 версии платформы
|
- Версия 1.11.х Decort-SDK соответствует 4.3.0 версии платформы
|
||||||
- Версия 1.12.х Decort-SDK соответствует 4.4.0 версии платформы
|
- Версия 1.12.х Decort-SDK соответствует 4.4.0 версии платформы
|
||||||
|
- Версия 1.13.х Decort-SDK соответствует 4.5.0 версии платформы
|
||||||
|
|
||||||
## Оглавление
|
## Оглавление
|
||||||
|
|
||||||
@@ -125,7 +126,6 @@ go get -u repository.basistech.ru/BASIS/decort-golang-sdk
|
|||||||
- `RG` - управление ресурсными группами аккаунта;
|
- `RG` - управление ресурсными группами аккаунта;
|
||||||
- `Security group` – управление группами безопасности;
|
- `Security group` – управление группами безопасности;
|
||||||
- `SEP` - управление storage endpoint (sep);
|
- `SEP` - управление storage endpoint (sep);
|
||||||
- `Stack` - получение информации о вычислительных узлах;
|
|
||||||
- `Storage policy` – получение информации о политиках хранения;
|
- `Storage policy` – получение информации о политиках хранения;
|
||||||
- `Tasks` - получение информации о ходе выполнения асинхронных задач (например, создание кластера);
|
- `Tasks` - получение информации о ходе выполнения асинхронных задач (например, создание кластера);
|
||||||
- `Trunk` - получение информации о транковых портах;
|
- `Trunk` - получение информации о транковых портах;
|
||||||
@@ -162,7 +162,6 @@ go get -u repository.basistech.ru/BASIS/decort-golang-sdk
|
|||||||
- `RG` - управление ресурсными группами аккаунта;
|
- `RG` - управление ресурсными группами аккаунта;
|
||||||
- `Security group` – управление группами безопасности;
|
- `Security group` – управление группами безопасности;
|
||||||
- `SEP` - управление storage endpoint (sep);
|
- `SEP` - управление storage endpoint (sep);
|
||||||
- `Stack` - получение информации о вычислительных узлах;
|
|
||||||
- `Storage policy` – управление политиками хранения;
|
- `Storage policy` – управление политиками хранения;
|
||||||
- `Tasks` - получение информации о ходе выполнения асинхронных задач (например, создание кластера);
|
- `Tasks` - получение информации о ходе выполнения асинхронных задач (например, создание кластера);
|
||||||
- `Trunk` - управление транковыми портами;
|
- `Trunk` - управление транковыми портами;
|
||||||
@@ -337,7 +336,6 @@ func main() {
|
|||||||
- `pkg/cloudapi/rg` - для `RG`
|
- `pkg/cloudapi/rg` - для `RG`
|
||||||
- `pkg/cloudapi/secgroup` - для `Security group`
|
- `pkg/cloudapi/secgroup` - для `Security group`
|
||||||
- `pkg/cloudapi/sep` - для `SEP`
|
- `pkg/cloudapi/sep` - для `SEP`
|
||||||
- `pkg/cloudapi/stack` - для `Stack`
|
|
||||||
- `pkg/cloudapi/stpolicy` - для `Storage policy`
|
- `pkg/cloudapi/stpolicy` - для `Storage policy`
|
||||||
- `pkg/cloudapi/tasks` - для `Tasks`
|
- `pkg/cloudapi/tasks` - для `Tasks`
|
||||||
- `pkg/cloudapi/trunk` - для `Trunk`
|
- `pkg/cloudapi/trunk` - для `Trunk`
|
||||||
@@ -369,7 +367,6 @@ func main() {
|
|||||||
- `pkg/cloudbroker/rg` - для `RG`
|
- `pkg/cloudbroker/rg` - для `RG`
|
||||||
- `pkg/cloudbroker/secgroup` - для `Security group`
|
- `pkg/cloudbroker/secgroup` - для `Security group`
|
||||||
- `pkg/cloudbroker/sep` - для `SEP`
|
- `pkg/cloudbroker/sep` - для `SEP`
|
||||||
- `pkg/cloudbroker/stack` - для `Stack`
|
|
||||||
- `pkg/cloudbroker/stpolicy` - для `Storage policy`
|
- `pkg/cloudbroker/stpolicy` - для `Storage policy`
|
||||||
- `pkg/cloudbroker/tasks` - для `Tasks`
|
- `pkg/cloudbroker/tasks` - для `Tasks`
|
||||||
- `pkg/cloudbroker/trunk` - для `Trunk`
|
- `pkg/cloudbroker/trunk` - для `Trunk`
|
||||||
@@ -466,9 +463,9 @@ type CreateRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
Start bool `url:"start,omitempty" json:"start,omitempty"`
|
Start bool `url:"start,omitempty" json:"start,omitempty"`
|
||||||
|
|
||||||
// Stack ID
|
// Node ID
|
||||||
// Required: false
|
// Required: false
|
||||||
StackID uint64 `url:"stackId,omitempty" json:"stackId,omitempty"`
|
NodeID uint64 `url:"nodeId,omitempty" json:"nodeId,omitempty"`
|
||||||
|
|
||||||
// System name
|
// System name
|
||||||
// Required: false
|
// Required: false
|
||||||
@@ -545,7 +542,6 @@ func main() {
|
|||||||
- `.RG()` - для работы с `RG`
|
- `.RG()` - для работы с `RG`
|
||||||
- `.SecurityGroup()` - для работы с `Security Group`
|
- `.SecurityGroup()` - для работы с `Security Group`
|
||||||
- `.SEP()` - для работы с `SEP`
|
- `.SEP()` - для работы с `SEP`
|
||||||
- `.Stack()` - для работы с `Stack`
|
|
||||||
- `.StPolicy()` - для работы с `Storage Policy`
|
- `.StPolicy()` - для работы с `Storage Policy`
|
||||||
- `.Tasks()` - для работы с `Tasks`
|
- `.Tasks()` - для работы с `Tasks`
|
||||||
- `.Trunk()` - для работы с `Trunk`
|
- `.Trunk()` - для работы с `Trunk`
|
||||||
@@ -579,7 +575,6 @@ func main() {
|
|||||||
- `.RG()` - для работы с `RG`
|
- `.RG()` - для работы с `RG`
|
||||||
- `.SecurityGroup()` - для работы с `Security Group`
|
- `.SecurityGroup()` - для работы с `Security Group`
|
||||||
- `.SEP()` - для работы с `SEP`
|
- `.SEP()` - для работы с `SEP`
|
||||||
- `.Stack()` - для работы с `Stack`
|
|
||||||
- `.StPolicy()` - для работы с `Storage Policy`
|
- `.StPolicy()` - для работы с `Storage Policy`
|
||||||
- `.Tasks()` - для работы с `Tasks`
|
- `.Tasks()` - для работы с `Tasks`
|
||||||
- `.Trunk()` - для работы с `Trunk`
|
- `.Trunk()` - для работы с `Trunk`
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ var FileName = map[string]string{
|
|||||||
var K8sValues = []string{"labels", "taints", "annotations, additionalSANs"}
|
var K8sValues = []string{"labels", "taints", "annotations, additionalSANs"}
|
||||||
|
|
||||||
var VersionMap = map[string]string{
|
var VersionMap = map[string]string{
|
||||||
|
"4.5.0": "-",
|
||||||
"4.4.0": "-",
|
"4.4.0": "-",
|
||||||
"4.3.0": "-",
|
"4.3.0": "-",
|
||||||
"4.2.0": "-",
|
"4.2.0": "-",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ var (
|
|||||||
resTypesValues = []string{"compute", "vins", "k8s", "openshift", "lb", "flipgroup"}
|
resTypesValues = []string{"compute", "vins", "k8s", "openshift", "lb", "flipgroup"}
|
||||||
protoValues = []string{"tcp", "udp"}
|
protoValues = []string{"tcp", "udp"}
|
||||||
|
|
||||||
accountCUTypeValues = []string{"CU_M", "CU_C", "CU_D", "CU_DM", "CU_S", "CU_A", "CU_NO", "CU_I", "CU_NP"}
|
accountCUTypeValues = []string{"CU_M", "CU_C", "CU_D", "CU_DM", "CU_I", "gpu_units"}
|
||||||
|
|
||||||
bserviceModeValues = []string{"ABSOLUTE", "RELATIVE"}
|
bserviceModeValues = []string{"ABSOLUTE", "RELATIVE"}
|
||||||
|
|
||||||
|
|||||||
@@ -27,11 +27,8 @@ type GetConsumedCloudUnitsByTypeRequest struct {
|
|||||||
// - CU_C: returns number of virtual cpu cores
|
// - CU_C: returns number of virtual cpu cores
|
||||||
// - CU_D: returns consumed virtual disk storage in GB
|
// - CU_D: returns consumed virtual disk storage in GB
|
||||||
// - CU_DM: returns consumed max virtual disk storage in GB
|
// - CU_DM: returns consumed max virtual disk storage in GB
|
||||||
// - CU_S: returns consumed primary storage (NAS) in TB
|
|
||||||
// - CU_A: returns consumed secondary storage (Archive) in TB
|
|
||||||
// - CU_NO: returns sent/received network transfer in operator in GB
|
|
||||||
// - CU_NP: returns sent/received network transfer peering in GB
|
|
||||||
// - CU_I: returns number of public IPs
|
// - CU_I: returns number of public IPs
|
||||||
|
// - gpu_units: return number of GPU units
|
||||||
func (a Account) GetConsumedCloudUnitsByType(ctx context.Context, req GetConsumedCloudUnitsByTypeRequest) (float64, error) {
|
func (a Account) GetConsumedCloudUnitsByType(ctx context.Context, req GetConsumedCloudUnitsByTypeRequest) (float64, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -34,10 +34,6 @@ type UpdateRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"`
|
MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"`
|
||||||
|
|
||||||
// Max sent/received network transfer peering
|
|
||||||
// Required: false
|
|
||||||
MaxNetworkPeerTransfer int64 `url:"maxNetworkPeerTransfer,omitempty" json:"maxNetworkPeerTransfer,omitempty"`
|
|
||||||
|
|
||||||
// Max number of assigned public IPs
|
// Max number of assigned public IPs
|
||||||
// Required: false
|
// Required: false
|
||||||
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`
|
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ type GroupAddRequest struct {
|
|||||||
UserData string `url:"userData,omitempty" json:"userData,omitempty"`
|
UserData string `url:"userData,omitempty" json:"userData,omitempty"`
|
||||||
|
|
||||||
// Chipset "i440fx" or "Q35
|
// Chipset "i440fx" or "Q35
|
||||||
|
// Default value : Q35
|
||||||
// Required: false
|
// Required: false
|
||||||
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"chipset,omitempty"`
|
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"chipset,omitempty"`
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ 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 : i440fx
|
// Default value : Q35
|
||||||
// Required: true
|
// Required: true
|
||||||
Chipset string `url:"chipset" json:"chipset" validate:"required,chipset"`
|
Chipset string `url:"chipset" json:"chipset" validate:"required,chipset"`
|
||||||
|
|
||||||
|
|||||||
@@ -119,8 +119,8 @@ type ItemCompute struct {
|
|||||||
// Resource group ID
|
// Resource group ID
|
||||||
RGID uint64 `json:"rgId"`
|
RGID uint64 `json:"rgId"`
|
||||||
|
|
||||||
// StackID
|
// NodeID
|
||||||
StackID uint64 `json:"stackId"`
|
NodeID uint64 `json:"node_id"`
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ var computes = ListComputes{
|
|||||||
MigrationJob: 0,
|
MigrationJob: 0,
|
||||||
Milestones: 363500,
|
Milestones: 363500,
|
||||||
Name: "test",
|
Name: "test",
|
||||||
PinnedToStack: true,
|
PinnedToNode: true,
|
||||||
RAM: 4096,
|
RAM: 4096,
|
||||||
ReferenceID: "c7cb19ac-af4a-4067-852f-c5572949207e",
|
ReferenceID: "c7cb19ac-af4a-4067-852f-c5572949207e",
|
||||||
Registered: true,
|
Registered: true,
|
||||||
@@ -126,7 +126,7 @@ var computes = ListComputes{
|
|||||||
RAM: 4096,
|
RAM: 4096,
|
||||||
ReferenceID: "a542c449-5b1c-4f90-88c5-7bb5f8ae68ff",
|
ReferenceID: "a542c449-5b1c-4f90-88c5-7bb5f8ae68ff",
|
||||||
Registered: true,
|
Registered: true,
|
||||||
PinnedToStack: true,
|
PinnedToNode: true,
|
||||||
ResName: "compute-48556",
|
ResName: "compute-48556",
|
||||||
RGID: 79727,
|
RGID: 79727,
|
||||||
RGName: "sdk_negative_fields_test",
|
RGName: "sdk_negative_fields_test",
|
||||||
|
|||||||
@@ -476,8 +476,8 @@ type RecordCompute struct {
|
|||||||
// List OS Users
|
// List OS Users
|
||||||
OSUsers ListOSUser `json:"osUsers"`
|
OSUsers ListOSUser `json:"osUsers"`
|
||||||
|
|
||||||
// Pinned to stack
|
// Pinned to node
|
||||||
PinnedToStack bool `json:"pinnedToStack"`
|
PinnedToNode bool `json:"pinnedToNode"`
|
||||||
|
|
||||||
// PreferredCPU
|
// PreferredCPU
|
||||||
PreferredCPU []int64 `json:"preferredCpu"`
|
PreferredCPU []int64 `json:"preferredCpu"`
|
||||||
@@ -485,6 +485,9 @@ type RecordCompute struct {
|
|||||||
// Qemu_quest
|
// Qemu_quest
|
||||||
QemuQuest QemuQuest `json:"qemu_guest"`
|
QemuQuest QemuQuest `json:"qemu_guest"`
|
||||||
|
|
||||||
|
// ReadOnly indicates read-only mode state
|
||||||
|
ReadOnly bool `json:"read_only"`
|
||||||
|
|
||||||
// Number of RAM
|
// Number of RAM
|
||||||
RAM uint64 `json:"ram"`
|
RAM uint64 `json:"ram"`
|
||||||
|
|
||||||
@@ -1151,8 +1154,8 @@ type ItemCompute struct {
|
|||||||
//NumaNodeId
|
//NumaNodeId
|
||||||
NumaNodeId int64 `json:"numaNodeId"`
|
NumaNodeId int64 `json:"numaNodeId"`
|
||||||
|
|
||||||
// Pinned to stack
|
// Pinned to node
|
||||||
PinnedToStack bool `json:"pinnedToStack"`
|
PinnedToNode bool `json:"pinnedToNode"`
|
||||||
|
|
||||||
// PreferredCPU
|
// PreferredCPU
|
||||||
PreferredCPU []int64 `json:"preferredCpu"`
|
PreferredCPU []int64 `json:"preferredCpu"`
|
||||||
@@ -1166,6 +1169,9 @@ type ItemCompute struct {
|
|||||||
// Qemu_quest
|
// Qemu_quest
|
||||||
QemuQuest QemuQuest `json:"qemu_guest"`
|
QemuQuest QemuQuest `json:"qemu_guest"`
|
||||||
|
|
||||||
|
// ReadOnly indicates read-only mode state
|
||||||
|
ReadOnly bool `json:"read_only"`
|
||||||
|
|
||||||
// Reference ID
|
// Reference ID
|
||||||
ReferenceID string `json:"referenceId"`
|
ReferenceID string `json:"referenceId"`
|
||||||
|
|
||||||
@@ -1331,8 +1337,8 @@ type ItemPCIDevice struct {
|
|||||||
// Resource group ID
|
// Resource group ID
|
||||||
RGID uint64 `json:"rgId"`
|
RGID uint64 `json:"rgId"`
|
||||||
|
|
||||||
// Stack ID
|
// Node ID
|
||||||
StackID uint64 `json:"stackId"`
|
NodeID uint64 `json:"nodeId"`
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import (
|
|||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PinToStackRequest struct to pin compute to stack
|
// PinToNodeRequest struct to pin compute to node
|
||||||
type PinToStackRequest struct {
|
type PinToNodeRequest struct {
|
||||||
// ID of the compute instance
|
// ID of the compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
@@ -20,14 +20,14 @@ type PinToStackRequest struct {
|
|||||||
AutoStart bool `url:"autoStart" json:"autoStart"`
|
AutoStart bool `url:"autoStart" json:"autoStart"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PinToStack pin compute to current stack
|
// PinToNode pin compute to current node
|
||||||
func (c Compute) PinToStack(ctx context.Context, req PinToStackRequest) (bool, error) {
|
func (c Compute) PinToNode(ctx context.Context, req PinToNodeRequest) (bool, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudapi/compute/pinToStack"
|
url := "/cloudapi/compute/pin_to_node"
|
||||||
|
|
||||||
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -16,7 +16,7 @@ type RedeployRequest struct {
|
|||||||
|
|
||||||
// Storage policy id of compute. The rules of the specified storage policy will be used.
|
// Storage policy id of compute. The rules of the specified storage policy will be used.
|
||||||
// Required: true
|
// Required: true
|
||||||
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
|
StoragePolicyID uint64 `url:"storage_policy_id,omitempty" json:"storage_policy_id,omitempty"`
|
||||||
|
|
||||||
// ID of the new OS image, if image change is required
|
// ID of the new OS image, if image change is required
|
||||||
// Required: false
|
// Required: false
|
||||||
|
|||||||
@@ -8,21 +8,21 @@ import (
|
|||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// UnpinFromStackRequest struct for unpin from stack
|
// UnpinFromNodeRequest struct for unpin from node
|
||||||
type UnpinFromStackRequest struct {
|
type UnpinFromNodeRequest struct {
|
||||||
// ID of the compute instance
|
// ID of the compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnpinFromStack unpins compute from current stack
|
// UnpinFromNode unpins compute from current node
|
||||||
func (c Compute) UnpinFromStack(ctx context.Context, req UnpinFromStackRequest) (bool, error) {
|
func (c Compute) UnpinFromNode(ctx context.Context, req UnpinFromNodeRequest) (bool, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudapi/compute/unpinFromStack"
|
url := "/cloudapi/compute/unpin_from_node"
|
||||||
|
|
||||||
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -169,6 +169,7 @@ type CreateRequest struct {
|
|||||||
|
|
||||||
// Type of the emulated system, Q35 or i440fx
|
// Type of the emulated system, Q35 or i440fx
|
||||||
// Required: false
|
// Required: false
|
||||||
|
// Default: Q35
|
||||||
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
||||||
|
|
||||||
// Zone ID
|
// Zone ID
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ type WorkerAddRequest struct {
|
|||||||
|
|
||||||
// Type of the emulated system, Q35 or i440fx
|
// Type of the emulated system, Q35 or i440fx
|
||||||
// Required: false
|
// Required: false
|
||||||
|
// Default: Q35
|
||||||
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ type WorkersGroupAddRequest struct {
|
|||||||
|
|
||||||
// Type of the emulated system, Q35 or i440fx
|
// Type of the emulated system, Q35 or i440fx
|
||||||
// Required: false
|
// Required: false
|
||||||
|
// Default: Q35
|
||||||
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -189,6 +189,7 @@ type CreateRequest struct {
|
|||||||
|
|
||||||
// Type of the emulated system, Q35 or i440fx
|
// Type of the emulated system, Q35 or i440fx
|
||||||
// Required: false
|
// Required: false
|
||||||
|
// Default: Q35
|
||||||
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
||||||
|
|
||||||
// Use Huge Pages to allocate RAM of the virtual machine. The system must be pre-configured by allocating Huge Pages on the physical node
|
// Use Huge Pages to allocate RAM of the virtual machine. The system must be pre-configured by allocating Huge Pages on the physical node
|
||||||
|
|||||||
@@ -63,8 +63,27 @@ type CreateBlankRequest struct {
|
|||||||
|
|
||||||
// Type of the emulated system, Q35 or i440fx
|
// Type of the emulated system, Q35 or i440fx
|
||||||
// Required: false
|
// Required: false
|
||||||
|
// Default: Q35
|
||||||
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
||||||
|
|
||||||
|
// Use Huge Pages to allocate RAM of the virtual machine. The system must be pre-configured by allocating Huge Pages on the physical node
|
||||||
|
// Required: false
|
||||||
|
// Default: false
|
||||||
|
HPBacked bool `url:"hp_backed" json:"hp_backed"`
|
||||||
|
|
||||||
|
// Run VM on dedicated CPUs. To use this feature, the system must be pre-configured by allocating CPUs on the physical node
|
||||||
|
// Required: false
|
||||||
|
// Default: false
|
||||||
|
CPUPin bool `url:"cpu_pin" json:"cpu_pin"`
|
||||||
|
|
||||||
|
// Rule for VM placement with NUMA affinity.
|
||||||
|
// Possible values - none (placement without NUMA affinity),
|
||||||
|
// strict (strictly with NUMA affinity, if not possible - do not start VM),
|
||||||
|
// loose (use NUMA affinity if possible)
|
||||||
|
// Required: false
|
||||||
|
// Default: none
|
||||||
|
NumaAffinity string `url:"numa_affinity,omitempty" json:"numa_affinity,omitempty" validate:"omitempty,numaAffinity"`
|
||||||
|
|
||||||
// Text description of this VM
|
// Text description of this VM
|
||||||
// Required: false
|
// Required: false
|
||||||
Description string `url:"desc,omitempty" json:"desc,omitempty"`
|
Description string `url:"desc,omitempty" json:"desc,omitempty"`
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ type ItemPCIDevice struct {
|
|||||||
// Resource group ID
|
// Resource group ID
|
||||||
RGID uint64 `json:"rgId"`
|
RGID uint64 `json:"rgId"`
|
||||||
|
|
||||||
// Stack ID
|
// Node ID
|
||||||
StackID uint64 `json:"stackId"`
|
NodeID uint64 `json:"nodeId"`
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
@@ -47,4 +47,3 @@ type ListPCIDevices struct {
|
|||||||
// Entry count
|
// Entry count
|
||||||
EntryCount uint64 `json:"entryCount"`
|
EntryCount uint64 `json:"entryCount"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,10 +39,6 @@ type CreateRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"`
|
MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"`
|
||||||
|
|
||||||
// Max sent/received network transfer peering
|
|
||||||
// Required: false
|
|
||||||
MaxNetworkPeerTransfer int64 `url:"maxNetworkPeerTransfer,omitempty" json:"maxNetworkPeerTransfer,omitempty"`
|
|
||||||
|
|
||||||
// Max number of assigned public IPs
|
// Max number of assigned public IPs
|
||||||
// Required: false
|
// Required: false
|
||||||
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`
|
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ var rgs = ListResourceGroups{
|
|||||||
CUC: -1,
|
CUC: -1,
|
||||||
CUI: -1,
|
CUI: -1,
|
||||||
CUM: -1,
|
CUM: -1,
|
||||||
CUNP: -1,
|
|
||||||
GPUUnits: -1,
|
GPUUnits: -1,
|
||||||
},
|
},
|
||||||
Secret: "",
|
Secret: "",
|
||||||
@@ -76,7 +75,6 @@ var rgs = ListResourceGroups{
|
|||||||
CUC: -1,
|
CUC: -1,
|
||||||
CUI: -1,
|
CUI: -1,
|
||||||
CUM: -1,
|
CUM: -1,
|
||||||
CUNP: -1,
|
|
||||||
GPUUnits: -1,
|
GPUUnits: -1,
|
||||||
},
|
},
|
||||||
Secret: "",
|
Secret: "",
|
||||||
@@ -118,7 +116,6 @@ var rgs = ListResourceGroups{
|
|||||||
CUC: -1,
|
CUC: -1,
|
||||||
CUI: -1,
|
CUI: -1,
|
||||||
CUM: -1,
|
CUM: -1,
|
||||||
CUNP: -1,
|
|
||||||
GPUUnits: -1,
|
GPUUnits: -1,
|
||||||
},
|
},
|
||||||
Secret: "",
|
Secret: "",
|
||||||
|
|||||||
@@ -309,9 +309,6 @@ type ResourceLimits struct {
|
|||||||
// CUM
|
// CUM
|
||||||
CUM float64 `json:"CU_M"`
|
CUM float64 `json:"CU_M"`
|
||||||
|
|
||||||
// CUNP
|
|
||||||
CUNP float64 `json:"CU_NP"`
|
|
||||||
|
|
||||||
// GPU units
|
// GPU units
|
||||||
GPUUnits float64 `json:"gpu_units"`
|
GPUUnits float64 `json:"gpu_units"`
|
||||||
|
|
||||||
|
|||||||
@@ -35,10 +35,6 @@ type UpdateRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"`
|
MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"`
|
||||||
|
|
||||||
// Max sent/received network transfer peering
|
|
||||||
// Required: false
|
|
||||||
MaxNetworkPeerTransfer int64 `url:"maxNetworkPeerTransfer,omitempty" json:"maxNetworkPeerTransfer,omitempty"`
|
|
||||||
|
|
||||||
// Max number of assigned public IPs
|
// Max number of assigned public IPs
|
||||||
// Required: false
|
// Required: false
|
||||||
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`
|
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ type SecurityGroup struct {
|
|||||||
client interfaces.Caller
|
client interfaces.Caller
|
||||||
}
|
}
|
||||||
|
|
||||||
// Builder for stack endpoint
|
// Builder for security policy endpoint
|
||||||
func New(client interfaces.Caller) *SecurityGroup {
|
func New(client interfaces.Caller) *SecurityGroup {
|
||||||
return &SecurityGroup{
|
return &SecurityGroup{
|
||||||
client: client,
|
client: client,
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
package cloudapi
|
|
||||||
|
|
||||||
import (
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/stack"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Accessing the Stack method group
|
|
||||||
func (ca *CloudAPI) Stack() *stack.Stack {
|
|
||||||
return stack.New(ca.client)
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
package stack
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"encoding/json"
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
|
||||||
)
|
|
||||||
|
|
||||||
// GetRequest struct to get info of stack
|
|
||||||
type GetRequest struct {
|
|
||||||
// Find by ID
|
|
||||||
// Required: true
|
|
||||||
StackId uint64 `url:"stackId" json:"stackId" validate:"required"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get gets stack details by ID as an InfoStack struct
|
|
||||||
func (i Stack) Get(ctx context.Context, req GetRequest) (*InfoStack, error) {
|
|
||||||
res, err := i.GetRaw(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
info := InfoStack{}
|
|
||||||
|
|
||||||
err = json.Unmarshal(res, &info)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return &info, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetRaw gets stack details by ID as an array of bytes
|
|
||||||
func (i Stack) GetRaw(ctx context.Context, req GetRequest) ([]byte, error) {
|
|
||||||
err := validators.ValidateRequest(req)
|
|
||||||
if err != nil {
|
|
||||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
url := "/cloudapi/stack/get"
|
|
||||||
|
|
||||||
res, err := i.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
|
||||||
return res, err
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
package stack
|
|
||||||
|
|
||||||
// IDs gets array of StackIDs from ListStacks struct
|
|
||||||
func (ls ListStacks) IDs() []uint64 {
|
|
||||||
res := make([]uint64, 0, len(ls.Data))
|
|
||||||
for _, s := range ls.Data {
|
|
||||||
res = append(res, s.ID)
|
|
||||||
}
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
package stack
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"encoding/json"
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
|
||||||
)
|
|
||||||
|
|
||||||
// ListRequest struct to get list of stacks
|
|
||||||
type ListRequest struct {
|
|
||||||
// Find by ID
|
|
||||||
// Required: false
|
|
||||||
ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`
|
|
||||||
|
|
||||||
// Find by name
|
|
||||||
// Required: false
|
|
||||||
Name string `url:"name,omitempty" json:"name,omitempty"`
|
|
||||||
|
|
||||||
// Find by type
|
|
||||||
// Required: false
|
|
||||||
Type string `url:"type,omitempty" json:"type,omitempty"`
|
|
||||||
|
|
||||||
// Find by status
|
|
||||||
// Required: false
|
|
||||||
Status string `url:"status,omitempty" json:"status,omitempty"`
|
|
||||||
|
|
||||||
// Sort by one of supported fields, format +|-(field)
|
|
||||||
// Required: false
|
|
||||||
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
|
|
||||||
|
|
||||||
// Page number
|
|
||||||
// Required: false
|
|
||||||
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
|
||||||
|
|
||||||
// Page size
|
|
||||||
// Required: false
|
|
||||||
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// List gets list of stacks as a ListStacks struct
|
|
||||||
func (i Stack) List(ctx context.Context, req ListRequest) (*ListStacks, error) {
|
|
||||||
|
|
||||||
res, err := i.ListRaw(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
list := ListStacks{}
|
|
||||||
|
|
||||||
err = json.Unmarshal(res, &list)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return &list, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ListRaw gets list of stacks as an array of bytes
|
|
||||||
func (i Stack) ListRaw(ctx context.Context, req ListRequest) ([]byte, error) {
|
|
||||||
|
|
||||||
if err := validators.ValidateRequest(req); err != nil {
|
|
||||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
url := "/cloudapi/stack/list"
|
|
||||||
|
|
||||||
res, err := i.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
|
||||||
return res, err
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
package stack
|
|
||||||
|
|
||||||
// Main information about stack
|
|
||||||
type InfoStack struct {
|
|
||||||
// CPU allocation ratio
|
|
||||||
CPUAllocationRatio float64 `json:"cpu_allocation_ratio"`
|
|
||||||
|
|
||||||
// Descr
|
|
||||||
Descr string `json:"descr"`
|
|
||||||
|
|
||||||
// Drivers
|
|
||||||
Drivers []string `json:"drivers"`
|
|
||||||
|
|
||||||
// ID
|
|
||||||
ID uint64 `json:"id"`
|
|
||||||
|
|
||||||
// Mem allocation ratio
|
|
||||||
MemAllocationRatio float64 `json:"mem_allocation_ratio"`
|
|
||||||
|
|
||||||
// Name
|
|
||||||
Name string `json:"name"`
|
|
||||||
|
|
||||||
// Status
|
|
||||||
Status string `json:"status"`
|
|
||||||
|
|
||||||
// Type
|
|
||||||
Type string `json:"type"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Information about stack in list
|
|
||||||
type ItemStack struct {
|
|
||||||
// ID
|
|
||||||
ID uint64 `json:"id"`
|
|
||||||
|
|
||||||
// Name
|
|
||||||
Name string `json:"name"`
|
|
||||||
|
|
||||||
// Status
|
|
||||||
Status string `json:"status"`
|
|
||||||
|
|
||||||
// Type
|
|
||||||
Type string `json:"type"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// List of stacks
|
|
||||||
type ListStacks struct {
|
|
||||||
|
|
||||||
//List
|
|
||||||
Data []ItemStack `json:"data"`
|
|
||||||
|
|
||||||
//Entry count
|
|
||||||
EntryCount uint64 `json:"entryCount"`
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
// Lists all the stack.
|
|
||||||
package stack
|
|
||||||
|
|
||||||
import "repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
|
||||||
|
|
||||||
// Structure for creating request to stack
|
|
||||||
type Stack struct {
|
|
||||||
client interfaces.Caller
|
|
||||||
}
|
|
||||||
|
|
||||||
// Builder for stack endpoint
|
|
||||||
func New(client interfaces.Caller) *Stack {
|
|
||||||
return &Stack{
|
|
||||||
client: client,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -7,7 +7,7 @@ type StPolicy struct {
|
|||||||
client interfaces.Caller
|
client interfaces.Caller
|
||||||
}
|
}
|
||||||
|
|
||||||
// Builder for stack endpoint
|
// Builder for storage policy endpoint
|
||||||
func New(client interfaces.Caller) *StPolicy {
|
func New(client interfaces.Caller) *StPolicy {
|
||||||
return &StPolicy{
|
return &StPolicy{
|
||||||
client: client,
|
client: client,
|
||||||
|
|||||||
@@ -251,8 +251,8 @@ type RecordResources struct {
|
|||||||
// Number of RAM
|
// Number of RAM
|
||||||
RAM uint64 `json:"ram"`
|
RAM uint64 `json:"ram"`
|
||||||
|
|
||||||
// Stack ID
|
// Node ID
|
||||||
StackID uint64 `json:"stackId"`
|
NodeID uint64 `json:"node_id"`
|
||||||
|
|
||||||
// UUID
|
// UUID
|
||||||
UUID string `json:"uuid"`
|
UUID string `json:"uuid"`
|
||||||
|
|||||||
@@ -43,10 +43,6 @@ type CreateRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"`
|
MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"`
|
||||||
|
|
||||||
// Max sent/received network transfer peering
|
|
||||||
// Required: false
|
|
||||||
MaxNetworkPeerTransfer int64 `url:"maxNetworkPeerTransfer,omitempty" json:"maxNetworkPeerTransfer,omitempty"`
|
|
||||||
|
|
||||||
// Max number of assigned public IPs
|
// Max number of assigned public IPs
|
||||||
// Required: false
|
// Required: false
|
||||||
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`
|
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`
|
||||||
|
|||||||
@@ -35,10 +35,6 @@ type UpdateRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"`
|
MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"`
|
||||||
|
|
||||||
// Max sent/received network transfer peering
|
|
||||||
// Required: false
|
|
||||||
MaxNetworkPeerTransfer int64 `url:"maxNetworkPeerTransfer,omitempty" json:"maxNetworkPeerTransfer,omitempty"`
|
|
||||||
|
|
||||||
// Max number of assigned public IPs
|
// Max number of assigned public IPs
|
||||||
// Required: false
|
// Required: false
|
||||||
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`
|
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`
|
||||||
|
|||||||
@@ -158,7 +158,6 @@ type CloudBrokerEndpoints struct {
|
|||||||
Machine []string `json:"machine,omitempty"`
|
Machine []string `json:"machine,omitempty"`
|
||||||
Metering []string `json:"metering,omitempty"`
|
Metering []string `json:"metering,omitempty"`
|
||||||
Milestones []string `json:"milestones,omitempty"`
|
Milestones []string `json:"milestones,omitempty"`
|
||||||
Node []string `json:"node,omitempty"`
|
|
||||||
Openshift []string `json:"openshift,omitempty"`
|
Openshift []string `json:"openshift,omitempty"`
|
||||||
OpenshiftCI []string `json:"openshiftci,omitempty"`
|
OpenshiftCI []string `json:"openshiftci,omitempty"`
|
||||||
Ovsnode []string `json:"ovsnode,omitempty"`
|
Ovsnode []string `json:"ovsnode,omitempty"`
|
||||||
@@ -169,7 +168,7 @@ type CloudBrokerEndpoints struct {
|
|||||||
Resmon interface{} `json:"resmon,omitempty"`
|
Resmon interface{} `json:"resmon,omitempty"`
|
||||||
RG []string `json:"rg,omitempty"`
|
RG []string `json:"rg,omitempty"`
|
||||||
Sep []string `json:"sep,omitempty"`
|
Sep []string `json:"sep,omitempty"`
|
||||||
Stack []string `json:"stack,omitempty"`
|
Node []string `json:"node,omitempty"`
|
||||||
Tasks []string `json:"tasks,omitempty"`
|
Tasks []string `json:"tasks,omitempty"`
|
||||||
TLock []string `json:"tlock,omitempty"`
|
TLock []string `json:"tlock,omitempty"`
|
||||||
User []string `json:"user,omitempty"`
|
User []string `json:"user,omitempty"`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/audit"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/audit"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Accessing the Stack method group
|
// Accessing the Audit method group
|
||||||
func (cb *CloudBroker) Audit() *audit.Audit {
|
func (cb *CloudBroker) Audit() *audit.Audit {
|
||||||
return audit.New(cb.client)
|
return audit.New(cb.client)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ type GroupAddRequest struct {
|
|||||||
UserData string `url:"userData,omitempty" json:"userData,omitempty"`
|
UserData string `url:"userData,omitempty" json:"userData,omitempty"`
|
||||||
|
|
||||||
// Chipset "i440fx" or "Q35
|
// Chipset "i440fx" or "Q35
|
||||||
|
// Default value : Q35
|
||||||
// Required: false
|
// Required: false
|
||||||
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"chipset"`
|
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"chipset"`
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ 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 : i440fx
|
//Default value : Q35
|
||||||
//Required: true
|
//Required: true
|
||||||
Chipset string `url:"chipset" json:"chipset" validate:"required,chipset"`
|
Chipset string `url:"chipset" json:"chipset" validate:"required,chipset"`
|
||||||
|
|
||||||
|
|||||||
@@ -146,8 +146,8 @@ type ItemCompute struct {
|
|||||||
// Resource group ID
|
// Resource group ID
|
||||||
RGID uint64 `json:"rgId"`
|
RGID uint64 `json:"rgId"`
|
||||||
|
|
||||||
// StackID
|
// NodeID
|
||||||
StackID uint64 `json:"stackId"`
|
NodeID uint64 `json:"node_id"`
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
|
|||||||
41
pkg/cloudbroker/compute/change_read_only.go
Normal file
41
pkg/cloudbroker/compute/change_read_only.go
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
package compute
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ChangeReadOnlyRequest defines parameters for toggling read-only mode.
|
||||||
|
type ChangeReadOnlyRequest struct {
|
||||||
|
// Compute ID
|
||||||
|
// Required: true
|
||||||
|
ComputeID uint64 `url:"compute_id" json:"compute_id" validate:"required"`
|
||||||
|
|
||||||
|
// ReadOnly indicates whether the read-only mode is enabled
|
||||||
|
// Required: true
|
||||||
|
ReadOnly bool `url:"read_only" json:"read_only" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ChangeReadOnly toggles compute read-only mode.
|
||||||
|
func (c Compute) ChangeReadOnly(ctx context.Context, req ChangeReadOnlyRequest) (bool, error) {
|
||||||
|
if err := validators.ValidateRequest(req); err != nil {
|
||||||
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/compute/change_read_only"
|
||||||
|
|
||||||
|
res, err := c.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
|
||||||
|
}
|
||||||
@@ -65,7 +65,7 @@ var computes = ListComputes{
|
|||||||
MigrationJob: 0,
|
MigrationJob: 0,
|
||||||
Milestones: 363500,
|
Milestones: 363500,
|
||||||
Name: "test",
|
Name: "test",
|
||||||
PinnedToStack: 1,
|
PinnedToNode: 1,
|
||||||
RAM: 4096,
|
RAM: 4096,
|
||||||
ReferenceID: "c7cb19ac-af4a-4067-852f-c5572949207e",
|
ReferenceID: "c7cb19ac-af4a-4067-852f-c5572949207e",
|
||||||
Registered: true,
|
Registered: true,
|
||||||
@@ -127,7 +127,7 @@ var computes = ListComputes{
|
|||||||
MigrationJob: 0,
|
MigrationJob: 0,
|
||||||
Milestones: 363853,
|
Milestones: 363853,
|
||||||
Name: "compute_2",
|
Name: "compute_2",
|
||||||
PinnedToStack: 1,
|
PinnedToNode: 1,
|
||||||
RAM: 4096,
|
RAM: 4096,
|
||||||
ReferenceID: "a542c449-5b1c-4f90-88c5-7bb5f8ae68ff",
|
ReferenceID: "a542c449-5b1c-4f90-88c5-7bb5f8ae68ff",
|
||||||
Registered: true,
|
Registered: true,
|
||||||
|
|||||||
@@ -42,17 +42,17 @@ type ListRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
IPAddress string `url:"ipAddress,omitempty" json:"ipAddress,omitempty"`
|
IPAddress string `url:"ipAddress,omitempty" json:"ipAddress,omitempty"`
|
||||||
|
|
||||||
// Find by stack ID
|
// Find by node ID
|
||||||
// Required: false
|
// Required: false
|
||||||
StackID uint64 `url:"stackId,omitempty" json:"stackId,omitempty"`
|
NodeID uint64 `url:"node_id,omitempty" json:"node_id,omitempty"`
|
||||||
|
|
||||||
// Find by CD image ID
|
// Find by CD image ID
|
||||||
// Required: false
|
// Required: false
|
||||||
CDImageID uint64 `url:"cdImageId,omitempty" json:"cdImageId,omitempty"`
|
CDImageID uint64 `url:"cdImageId,omitempty" json:"cdImageId,omitempty"`
|
||||||
|
|
||||||
// Find by stack name
|
// Find by node name
|
||||||
// Required: false
|
// Required: false
|
||||||
StackName string `url:"stackName,omitempty" json:"stackName,omitempty"`
|
NodeName string `url:"nodeName,omitempty" json:"nodeName,omitempty"`
|
||||||
|
|
||||||
// Find by external network name
|
// Find by external network name
|
||||||
// Required: false
|
// Required: false
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ type MigrateRequest struct {
|
|||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
// Particular Stack ID to migrate this compute to
|
// Particular Node ID to migrate this compute to
|
||||||
// Required: false
|
// Required: false
|
||||||
TargetStackID uint64 `url:"targetStackId,omitempty" json:"targetStackId,omitempty"`
|
TargetNodeID uint64 `url:"targetNodeId,omitempty" json:"targetNodeId,omitempty"`
|
||||||
|
|
||||||
// If live migration fails, destroy compute
|
// If live migration fails, destroy compute
|
||||||
// on source node and recreate on the target
|
// on source node and recreate on the target
|
||||||
@@ -30,7 +30,7 @@ type AsyncWrapperMigrateRequest struct {
|
|||||||
SyncMode bool `url:"sync"`
|
SyncMode bool `url:"sync"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Migrate migrates compute to another stack
|
// Migrate migrates compute to another node
|
||||||
func (c Compute) Migrate(ctx context.Context, req MigrateRequest) (bool, error) {
|
func (c Compute) Migrate(ctx context.Context, req MigrateRequest) (bool, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -54,7 +54,7 @@ func (c Compute) Migrate(ctx context.Context, req MigrateRequest) (bool, error)
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// AsyncMigrate migrates compute to another stack in async mode
|
// AsyncMigrate migrates compute to another node in async mode
|
||||||
func (c Compute) AsyncMigrate(ctx context.Context, req MigrateRequest) (string, error) {
|
func (c Compute) AsyncMigrate(ctx context.Context, req MigrateRequest) (string, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ type MigrateStorageRequest struct {
|
|||||||
// Required: true
|
// Required: true
|
||||||
PoolName string `url:"poolName" json:"poolName" validate:"required"`
|
PoolName string `url:"poolName" json:"poolName" validate:"required"`
|
||||||
|
|
||||||
// Target stack ID
|
// Target node ID
|
||||||
// Required: true
|
// Required: true
|
||||||
StackID uint64 `url:"stackId" json:"stackId" validate:"required"`
|
NodeID uint64 `url:"node_id" json:"node_id" validate:"required"`
|
||||||
|
|
||||||
// Async API call
|
// Async API call
|
||||||
// Required: true
|
// Required: true
|
||||||
@@ -32,7 +32,7 @@ type MigrateStorageRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MigrateStorage gets complex compute migration
|
// MigrateStorage gets complex compute migration
|
||||||
// Compute will be migrated to specified stack, and compute disks will
|
// Compute will be migrated to specified node, and compute disks will
|
||||||
// be migrated to specified SEP to specified pool.
|
// be migrated to specified SEP to specified pool.
|
||||||
// This action can take up to 84 hours
|
// This action can take up to 84 hours
|
||||||
func (c Compute) MigrateStorage(ctx context.Context, req MigrateStorageRequest) (string, error) {
|
func (c Compute) MigrateStorage(ctx context.Context, req MigrateStorageRequest) (string, error) {
|
||||||
|
|||||||
@@ -804,8 +804,8 @@ type InfoCompute struct {
|
|||||||
// Name of OS
|
// Name of OS
|
||||||
OSVersion string `json:"os_version"`
|
OSVersion string `json:"os_version"`
|
||||||
|
|
||||||
// Pinned to stack
|
// Pinned to node
|
||||||
PinnedToStack int64 `json:"pinnedToStack"`
|
PinnedToNode int64 `json:"pinnedToNode"`
|
||||||
|
|
||||||
// PreferredCPU
|
// PreferredCPU
|
||||||
PreferredCPU []int64 `json:"preferredCpu"`
|
PreferredCPU []int64 `json:"preferredCpu"`
|
||||||
@@ -813,6 +813,9 @@ type InfoCompute struct {
|
|||||||
// Qemu_quest
|
// Qemu_quest
|
||||||
QemuQuest QemuQuest `json:"qemu_guest"`
|
QemuQuest QemuQuest `json:"qemu_guest"`
|
||||||
|
|
||||||
|
// ReadOnly indicates read-only mode state
|
||||||
|
ReadOnly bool `json:"read_only"`
|
||||||
|
|
||||||
// Number of RAM
|
// Number of RAM
|
||||||
RAM uint64 `json:"ram"`
|
RAM uint64 `json:"ram"`
|
||||||
|
|
||||||
@@ -837,11 +840,11 @@ type InfoCompute struct {
|
|||||||
// SnapSets
|
// SnapSets
|
||||||
SnapSets ListSnapshots `json:"snapSets"`
|
SnapSets ListSnapshots `json:"snapSets"`
|
||||||
|
|
||||||
// Stack ID
|
// Node ID
|
||||||
StackID uint64 `json:"stackId"`
|
NodeID uint64 `json:"nodeId"`
|
||||||
|
|
||||||
// Stack name
|
// Node name
|
||||||
StackName string `json:"stackName"`
|
NodeName string `json:"nodeName"`
|
||||||
|
|
||||||
// Stateless SEP ID
|
// Stateless SEP ID
|
||||||
StatelessSEPID int64 `json:"statelessSepId"`
|
StatelessSEPID int64 `json:"statelessSepId"`
|
||||||
@@ -1055,9 +1058,6 @@ type RecordCompute struct {
|
|||||||
// Name
|
// Name
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
|
||||||
// Node ID
|
|
||||||
NodeID uint64 `json:"nodeId"`
|
|
||||||
|
|
||||||
// Natable VINS ID
|
// Natable VINS ID
|
||||||
NatableVINSID uint64 `json:"natableVinsId"`
|
NatableVINSID uint64 `json:"natableVinsId"`
|
||||||
|
|
||||||
@@ -1091,8 +1091,8 @@ type RecordCompute struct {
|
|||||||
// Name of OS
|
// Name of OS
|
||||||
OSVersion string `json:"os_version"`
|
OSVersion string `json:"os_version"`
|
||||||
|
|
||||||
// Pinned to stack
|
// Pinned to node
|
||||||
PinnedToStack int64 `json:"pinnedToStack"`
|
PinnedToNode int64 `json:"pinnedToNode"`
|
||||||
|
|
||||||
// PreferredCPU
|
// PreferredCPU
|
||||||
PreferredCPU []int64 `json:"preferredCpu"`
|
PreferredCPU []int64 `json:"preferredCpu"`
|
||||||
@@ -1100,6 +1100,9 @@ type RecordCompute struct {
|
|||||||
// Qemu_quest
|
// Qemu_quest
|
||||||
QemuQuest QemuQuest `json:"qemu_guest"`
|
QemuQuest QemuQuest `json:"qemu_guest"`
|
||||||
|
|
||||||
|
// ReadOnly indicates read-only mode state
|
||||||
|
ReadOnly bool `json:"read_only"`
|
||||||
|
|
||||||
// Number of RAM
|
// Number of RAM
|
||||||
RAM uint64 `json:"ram"`
|
RAM uint64 `json:"ram"`
|
||||||
|
|
||||||
@@ -1124,11 +1127,11 @@ type RecordCompute struct {
|
|||||||
// SnapSets
|
// SnapSets
|
||||||
SnapSets ListSnapshots `json:"snapSets"`
|
SnapSets ListSnapshots `json:"snapSets"`
|
||||||
|
|
||||||
// Stack ID
|
// Node ID
|
||||||
StackID uint64 `json:"stackId"`
|
NodeID uint64 `json:"node_id"`
|
||||||
|
|
||||||
// Stack name
|
// Node name
|
||||||
StackName string `json:"stackName"`
|
NodeName string `json:"nodeName"`
|
||||||
|
|
||||||
// Stateless SEP ID
|
// Stateless SEP ID
|
||||||
StatelessSEPID int64 `json:"statelessSepId"`
|
StatelessSEPID int64 `json:"statelessSepId"`
|
||||||
@@ -1338,8 +1341,8 @@ type ItemPCIDevice struct {
|
|||||||
// Resource group ID
|
// Resource group ID
|
||||||
RGID uint64 `json:"rgId"`
|
RGID uint64 `json:"rgId"`
|
||||||
|
|
||||||
// Stack ID
|
// Node ID
|
||||||
StackID uint64 `json:"stackId"`
|
NodeID uint64 `json:"nodeId"`
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
@@ -1441,14 +1444,14 @@ type MigrateStorageItem struct {
|
|||||||
// Migration process log
|
// Migration process log
|
||||||
Log []string `json:"log"`
|
Log []string `json:"log"`
|
||||||
|
|
||||||
// Source stack ID
|
// Source node ID
|
||||||
SourceStackID uint64 `json:"sourceStackId"`
|
SourceNodeID uint64 `json:"sourceNodeId"`
|
||||||
|
|
||||||
// Migration status
|
// Migration status
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
|
|
||||||
// Target stack ID
|
// Target node ID
|
||||||
TargetStackID uint64 `json:"targetStackId"`
|
TargetNodeID uint64 `json:"targetNodeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type RecordCloneStatus struct {
|
type RecordCloneStatus struct {
|
||||||
|
|||||||
@@ -8,15 +8,15 @@ import (
|
|||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PinToStackRequest struct to pin compute to stack
|
// PinToNodeRequest struct to pin compute to node
|
||||||
type PinToStackRequest struct {
|
type PinToNodeRequest struct {
|
||||||
// ID of the compute instance
|
// ID of the compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
// Stack ID to pin to
|
// Node ID to pin to
|
||||||
// Required: false
|
// Required: false
|
||||||
TargetStackID uint64 `url:"targetStackId" json:"targetStackId"`
|
TargetNodeID uint64 `url:"targetNodeId" json:"targetNodeId"`
|
||||||
|
|
||||||
// Try to migrate or not if compute in running states
|
// Try to migrate or not if compute in running states
|
||||||
// Required: false
|
// Required: false
|
||||||
@@ -28,14 +28,14 @@ type PinToStackRequest struct {
|
|||||||
AutoStart bool `url:"autoStart" json:"autoStart"`
|
AutoStart bool `url:"autoStart" json:"autoStart"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PinToStack pins compute to current stack
|
// PinToNode pins compute to current node
|
||||||
func (c Compute) PinToStack(ctx context.Context, req PinToStackRequest) (uint64, error) {
|
func (c Compute) PinToNode(ctx context.Context, req PinToNodeRequest) (uint64, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/compute/pinToStack"
|
url := "/cloudbroker/compute/pin_to_node"
|
||||||
|
|
||||||
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -24,7 +24,7 @@ type RedeployRequest struct {
|
|||||||
|
|
||||||
// Storage policy id of compute. The rules of the specified storage policy will be used.
|
// Storage policy id of compute. The rules of the specified storage policy will be used.
|
||||||
// Required: true
|
// Required: true
|
||||||
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
|
StoragePolicyID uint64 `url:"storage_policy_id,omitempty" json:"storage_policy_id,omitempty"`
|
||||||
|
|
||||||
// New size for the boot disk in GB, if boot disk size change is required
|
// New size for the boot disk in GB, if boot disk size change is required
|
||||||
// Required: false
|
// Required: false
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ type StartRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
AltBootID uint64 `url:"altBootId,omitempty" json:"altBootId,omitempty"`
|
AltBootID uint64 `url:"altBootId,omitempty" json:"altBootId,omitempty"`
|
||||||
|
|
||||||
// ID of stack to start compute
|
// ID of node to start compute
|
||||||
// Required: false
|
// Required: false
|
||||||
StackID uint64 `url:"stackId,omitempty" json:"stackId,omitempty"`
|
NodeID uint64 `url:"nodeId,omitempty" json:"nodeId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start starts compute
|
// Start starts compute
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ type StartMigrationINRequest struct {
|
|||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
// ID of the stack where the compute will be staged for migration-in
|
// ID of the node where the compute will be staged for migration-in
|
||||||
// Required: false
|
// Required: false
|
||||||
StackID uint64 `url:"stackId,omitempty" json:"stackId,omitempty"`
|
NodeID uint64 `url:"node_id,omitempty" json:"node_id,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// StartMigrationIN starts compute for external migration in
|
// StartMigrationIN starts compute for external migration in
|
||||||
|
|||||||
@@ -8,21 +8,21 @@ import (
|
|||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// UnpinFromStackRequest struct to unpin from stack
|
// UnpinFromNodeRequest struct to unpin from node
|
||||||
type UnpinFromStackRequest struct {
|
type UnpinFromNodeRequest struct {
|
||||||
// ID of the compute instance
|
// ID of the compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnpinFromStack unpins compute from current stack
|
// UnpinFromNode unpins compute from current node
|
||||||
func (c Compute) UnpinFromStack(ctx context.Context, req UnpinFromStackRequest) (bool, error) {
|
func (c Compute) UnpinFromNode(ctx context.Context, req UnpinFromNodeRequest) (bool, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/compute/unpinFromStack"
|
url := "/cloudbroker/compute/unpin_from_node"
|
||||||
|
|
||||||
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -14,9 +14,9 @@ type DeviceMigrateRequest struct {
|
|||||||
// Required: true
|
// Required: true
|
||||||
NetID uint64 `url:"net_id" json:"net_id" validate:"required"`
|
NetID uint64 `url:"net_id" json:"net_id" validate:"required"`
|
||||||
|
|
||||||
// Target stack ID to migrate to
|
// Target node ID to migrate to
|
||||||
// Required: false
|
// Required: false
|
||||||
StackID uint64 `url:"stackId,omitempty" json:"stackId,omitempty"`
|
NodeID uint64 `url:"node_id,omitempty" json:"node_id,omitempty"`
|
||||||
|
|
||||||
// Target device to migrate
|
// Target device to migrate
|
||||||
// Required: false
|
// Required: false
|
||||||
|
|||||||
@@ -9,15 +9,6 @@ func (li ListImages) IDs() []uint64 {
|
|||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDs gets array of StackIDs from ListStacks struct
|
|
||||||
func (ls ListStacks) IDs() []uint64 {
|
|
||||||
res := make([]uint64, 0, len(ls.Data))
|
|
||||||
for _, h := range ls.Data {
|
|
||||||
res = append(res, h.ID)
|
|
||||||
}
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
|
|
||||||
// IDs gets array of HistoryIDs from ListHistory struct
|
// IDs gets array of HistoryIDs from ListHistory struct
|
||||||
func (lh ListHistory) IDs() []uint64 {
|
func (lh ListHistory) IDs() []uint64 {
|
||||||
res := make([]uint64, 0, len(lh))
|
res := make([]uint64, 0, len(lh))
|
||||||
|
|||||||
@@ -1,65 +0,0 @@
|
|||||||
package image
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"encoding/json"
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
|
||||||
)
|
|
||||||
|
|
||||||
// ListStacksRequest struct to get list of stack
|
|
||||||
type ListStacksRequest struct {
|
|
||||||
// Image ID
|
|
||||||
// Required: true
|
|
||||||
ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`
|
|
||||||
|
|
||||||
// Page number
|
|
||||||
// Required: false
|
|
||||||
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
|
||||||
|
|
||||||
// Page size
|
|
||||||
// Required: false
|
|
||||||
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
|
|
||||||
|
|
||||||
// Find by name
|
|
||||||
// Required: false
|
|
||||||
Name string `url:"name,omitempty" json:"name,omitempty"`
|
|
||||||
|
|
||||||
// Find by status
|
|
||||||
// Required: false
|
|
||||||
Status string `url:"status,omitempty" json:"status,omitempty"`
|
|
||||||
|
|
||||||
// Find by type
|
|
||||||
// Required: false
|
|
||||||
Type string `url:"type,omitempty" json:"type,omitempty"`
|
|
||||||
|
|
||||||
// Sort by one of supported fields, format +|-(field)
|
|
||||||
// Required: false
|
|
||||||
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// ListStacks gets list stack by image ID
|
|
||||||
func (i Image) ListStacks(ctx context.Context, req ListStacksRequest) (*ListStacks, error) {
|
|
||||||
|
|
||||||
err := validators.ValidateRequest(req)
|
|
||||||
if err != nil {
|
|
||||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
url := "/cloudbroker/image/listStacks"
|
|
||||||
|
|
||||||
res, err := i.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
list := ListStacks{}
|
|
||||||
|
|
||||||
err = json.Unmarshal(res, &list)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return &list, nil
|
|
||||||
}
|
|
||||||
@@ -329,84 +329,6 @@ func (r *GUID) UnmarshalJSON(b []byte) error {
|
|||||||
// List history
|
// List history
|
||||||
type ListHistory []History
|
type ListHistory []History
|
||||||
|
|
||||||
// List stacks
|
|
||||||
type ListStacks struct {
|
|
||||||
// Data
|
|
||||||
Data []ItemListStacks `json:"data"`
|
|
||||||
|
|
||||||
// Entry count
|
|
||||||
EntryCount uint64 `json:"entryCount"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Detailed information about image
|
|
||||||
type ItemListStacks struct {
|
|
||||||
// CKey
|
|
||||||
CKey string `json:"_ckey"`
|
|
||||||
|
|
||||||
// API URL
|
|
||||||
APIURL string `json:"apiUrl"`
|
|
||||||
|
|
||||||
// API key
|
|
||||||
APIKey string `json:"apikey"`
|
|
||||||
|
|
||||||
// App ID
|
|
||||||
AppID string `json:"appId"`
|
|
||||||
|
|
||||||
// CPU allocation ratio
|
|
||||||
CPUAllocationRatio float64 `json:"cpu_allocation_ratio"`
|
|
||||||
|
|
||||||
// Description
|
|
||||||
Description string `json:"desc"`
|
|
||||||
|
|
||||||
// Descr
|
|
||||||
Descr string `json:"descr"`
|
|
||||||
|
|
||||||
// Drivers
|
|
||||||
Drivers []string `json:"drivers"`
|
|
||||||
|
|
||||||
// Eco
|
|
||||||
Eco interface{} `json:"eco"`
|
|
||||||
|
|
||||||
// Error
|
|
||||||
Error uint64 `json:"error"`
|
|
||||||
|
|
||||||
// Grid ID
|
|
||||||
GID uint64 `json:"gid"`
|
|
||||||
|
|
||||||
// GID
|
|
||||||
GUID uint64 `json:"guid"`
|
|
||||||
|
|
||||||
// ID
|
|
||||||
ID uint64 `json:"id"`
|
|
||||||
|
|
||||||
// List image IDs
|
|
||||||
Images []uint64 `json:"images"`
|
|
||||||
|
|
||||||
// Login
|
|
||||||
Login string `json:"login"`
|
|
||||||
|
|
||||||
// Mem allocation ratio
|
|
||||||
MemAllocationRatio float64 `json:"mem_allocation_ratio"`
|
|
||||||
|
|
||||||
// Name
|
|
||||||
Name string `json:"name"`
|
|
||||||
|
|
||||||
// Packegas
|
|
||||||
Packages Packages `json:"packages"`
|
|
||||||
|
|
||||||
// Password
|
|
||||||
Password string `json:"passwd"`
|
|
||||||
|
|
||||||
// Reference ID
|
|
||||||
ReferenceID string `json:"referenceId"`
|
|
||||||
|
|
||||||
// Status
|
|
||||||
Status string `json:"status"`
|
|
||||||
|
|
||||||
// Type
|
|
||||||
Type string `json:"type"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Package
|
// Package
|
||||||
type Packages struct {
|
type Packages struct {
|
||||||
// LibvirtBin
|
// LibvirtBin
|
||||||
|
|||||||
@@ -171,6 +171,7 @@ type CreateRequest struct {
|
|||||||
|
|
||||||
// Type of the emulated system, Q35 or i440fx
|
// Type of the emulated system, Q35 or i440fx
|
||||||
// Required: false
|
// Required: false
|
||||||
|
// Default: Q35
|
||||||
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
||||||
|
|
||||||
// Zone ID
|
// Zone ID
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ type WorkerAddRequest struct {
|
|||||||
|
|
||||||
// Type of the emulated system, Q35 or i440fx
|
// Type of the emulated system, Q35 or i440fx
|
||||||
// Required: false
|
// Required: false
|
||||||
|
// Default: Q35
|
||||||
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ type WorkersGroupAddRequest struct {
|
|||||||
|
|
||||||
// Type of the emulated system, Q35 or i440fx
|
// Type of the emulated system, Q35 or i440fx
|
||||||
// Required: false
|
// Required: false
|
||||||
|
// Default: Q35
|
||||||
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -160,9 +160,9 @@ type CreateRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
Start bool `url:"start" json:"start"`
|
Start bool `url:"start" json:"start"`
|
||||||
|
|
||||||
// Stack ID
|
// Node ID
|
||||||
// Required: false
|
// Required: false
|
||||||
StackID uint64 `url:"stackId,omitempty" json:"stackId,omitempty"`
|
NodeID uint64 `url:"node_id,omitempty" json:"node_id,omitempty"`
|
||||||
|
|
||||||
// System name
|
// System name
|
||||||
// Required: false
|
// Required: false
|
||||||
@@ -191,6 +191,7 @@ type CreateRequest struct {
|
|||||||
|
|
||||||
// Type of the emulated system, Q35 or i440fx
|
// Type of the emulated system, Q35 or i440fx
|
||||||
// Required: false
|
// Required: false
|
||||||
|
// Default: Q35
|
||||||
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
||||||
|
|
||||||
// Use Huge Pages to allocate RAM of the virtual machine. The system must be pre-configured by allocating Huge Pages on the physical node
|
// Use Huge Pages to allocate RAM of the virtual machine. The system must be pre-configured by allocating Huge Pages on the physical node
|
||||||
|
|||||||
@@ -67,8 +67,27 @@ type CreateBlankRequest struct {
|
|||||||
|
|
||||||
// Type of the emulated system, Q35 or i440fx
|
// Type of the emulated system, Q35 or i440fx
|
||||||
// Required: false
|
// Required: false
|
||||||
|
// Default: Q35
|
||||||
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
||||||
|
|
||||||
|
// Use Huge Pages to allocate RAM of the virtual machine. The system must be pre-configured by allocating Huge Pages on the physical node
|
||||||
|
// Required: false
|
||||||
|
// Default: false
|
||||||
|
HPBacked bool `url:"hp_backed" json:"hp_backed"`
|
||||||
|
|
||||||
|
// Run VM on dedicated CPUs. To use this feature, the system must be pre-configured by allocating CPUs on the physical node
|
||||||
|
// Required: false
|
||||||
|
// Default: false
|
||||||
|
CPUPin bool `url:"cpu_pin" json:"cpu_pin"`
|
||||||
|
|
||||||
|
// Rule for VM placement with NUMA affinity.
|
||||||
|
// Possible values - none (placement without NUMA affinity),
|
||||||
|
// strict (strictly with NUMA affinity, if not possible - do not start VM),
|
||||||
|
// loose (use NUMA affinity if possible)
|
||||||
|
// Required: false
|
||||||
|
// Default: none
|
||||||
|
NumaAffinity string `url:"numa_affinity,omitempty" json:"numa_affinity,omitempty" validate:"omitempty,numaAffinity"`
|
||||||
|
|
||||||
// Recommended isolated CPUs. Field is ignored if compute.cpupin=False or compute.pinned=False
|
// Recommended isolated CPUs. Field is ignored if compute.cpupin=False or compute.pinned=False
|
||||||
// Required: false
|
// Required: false
|
||||||
PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"`
|
PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"`
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package stack
|
package node
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@@ -8,21 +8,21 @@ import (
|
|||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetLogicalCoresCountRequest struct to get logical cores count by stack
|
// GetLogicalCoresCountRequest struct to get logical cores count by node
|
||||||
type GetLogicalCoresCountRequest struct {
|
type GetLogicalCoresCountRequest struct {
|
||||||
// Stack ID
|
// Node ID
|
||||||
// Required: true
|
// Required: true
|
||||||
StackId uint64 `url:"stackId" json:"stackId" validate:"required"`
|
NodeId uint64 `url:"node_id" json:"node_id" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetLogicalCoresCount get logical cores count by stack
|
// GetLogicalCoresCount get logical cores count by node
|
||||||
func (i Stack) GetLogicalCoresCount(ctx context.Context, req GetLogicalCoresCountRequest) (uint64, error) {
|
func (i Node) GetLogicalCoresCount(ctx context.Context, req GetLogicalCoresCountRequest) (uint64, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/stack/getLogicalCoresCount"
|
url := "/cloudbroker/node/get_logical_cores_count"
|
||||||
|
|
||||||
res, err := i.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := i.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -53,9 +53,6 @@ type RecordNode struct {
|
|||||||
// SriovEnabled
|
// SriovEnabled
|
||||||
SriovEnabled bool `json:"sriovEnabled"`
|
SriovEnabled bool `json:"sriovEnabled"`
|
||||||
|
|
||||||
// StackID
|
|
||||||
StackID uint64 `json:"stackId"`
|
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
|
|
||||||
@@ -76,6 +73,15 @@ type RecordNode struct {
|
|||||||
|
|
||||||
// Zone ID
|
// Zone ID
|
||||||
ZoneID uint64 `json:"zoneId"`
|
ZoneID uint64 `json:"zoneId"`
|
||||||
|
|
||||||
|
// OpenvSwitch Bridges
|
||||||
|
OpenvSwitchBridges []string `json:"openvswitch_bridges"`
|
||||||
|
|
||||||
|
// Description
|
||||||
|
Description string `json:"description"`
|
||||||
|
|
||||||
|
// SDN Hypervisor Name
|
||||||
|
SDNHypervisorName string `json:"sdn_hypervisor_name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resource consumption of the node
|
// Resource consumption of the node
|
||||||
@@ -102,7 +108,7 @@ type FreeResourcesInfo struct {
|
|||||||
RAM float64 `json:"RAM"`
|
RAM float64 `json:"RAM"`
|
||||||
|
|
||||||
// VCPU
|
// VCPU
|
||||||
VCPU uint64 `json:"vCPU"`
|
VCPU uint64 `json:"vCPUs"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resources Info
|
// Resources Info
|
||||||
@@ -136,6 +142,12 @@ type CpuInfo struct {
|
|||||||
|
|
||||||
// PhysCount
|
// PhysCount
|
||||||
PhysCount uint64 `json:"physCount"`
|
PhysCount uint64 `json:"physCount"`
|
||||||
|
|
||||||
|
// Flags
|
||||||
|
Flags []string `json:"flags"`
|
||||||
|
|
||||||
|
// Mddel name
|
||||||
|
ModelName string `json:"model_name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Main information about node
|
// Main information about node
|
||||||
@@ -245,9 +257,6 @@ type ItemNode struct {
|
|||||||
// SriovEnabled
|
// SriovEnabled
|
||||||
SriovEnabled bool `json:"sriovEnabled"`
|
SriovEnabled bool `json:"sriovEnabled"`
|
||||||
|
|
||||||
// StackID
|
|
||||||
StackID uint64 `json:"stackId"`
|
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
|
|
||||||
@@ -265,6 +274,34 @@ type ItemNode struct {
|
|||||||
|
|
||||||
// Zone ID
|
// Zone ID
|
||||||
ZoneID uint64 `json:"zoneId"`
|
ZoneID uint64 `json:"zoneId"`
|
||||||
|
|
||||||
|
// OpenvSwitch Bridges
|
||||||
|
OpenvSwitchBridges []string `json:"openvswitch_bridges"`
|
||||||
|
|
||||||
|
// APIUrl
|
||||||
|
APIUrl string `json:"apiUrl"`
|
||||||
|
|
||||||
|
// Drivers
|
||||||
|
Drivers []string `json:"drivers"`
|
||||||
|
|
||||||
|
// Old Compat LVM ID
|
||||||
|
OldCompatLVMID uint64 `json:"old_compat_lvm_id"`
|
||||||
|
|
||||||
|
// CPU Allocation ratio
|
||||||
|
CPUAllocationRatio float64 `json:"cpu_allocation_ratio"`
|
||||||
|
|
||||||
|
// MemAllocationRatio
|
||||||
|
|
||||||
|
MemAllocationRatio float64 `json:"mem_allocation_ratio"`
|
||||||
|
// Packages
|
||||||
|
Packages map[string]PackageInfo `json:"packages"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type PackageInfo struct {
|
||||||
|
// Installed size
|
||||||
|
InstalledSize string `json:"installed_size"`
|
||||||
|
// Version
|
||||||
|
Ver string `json:"ver"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Numa Topology Info
|
// Numa Topology Info
|
||||||
|
|||||||
36
pkg/cloudbroker/node/set_cpu_allocation_ratio.go
Normal file
36
pkg/cloudbroker/node/set_cpu_allocation_ratio.go
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
package node
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// SetCpuAllocationRatioRequest struct to set CPU allocation ratio
|
||||||
|
type SetCpuAllocationRatioRequest struct {
|
||||||
|
// Node ID
|
||||||
|
// Required: true
|
||||||
|
NodeID uint64 `url:"node_id" json:"node_id" validate:"required"`
|
||||||
|
|
||||||
|
// Allocation ratio (zero or positive value)
|
||||||
|
// Required: true
|
||||||
|
Ratio float64 `url:"ratio" json:"ratio" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetCpuAllocationRatio set CPU allocation ratio
|
||||||
|
func (i Node) SetCpuAllocationRatio(ctx context.Context, req SetCpuAllocationRatioRequest) error {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/node/set_cpu_allocation_ratio"
|
||||||
|
|
||||||
|
_, err = i.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
36
pkg/cloudbroker/node/set_mem_allocation_ratio.go
Normal file
36
pkg/cloudbroker/node/set_mem_allocation_ratio.go
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
package node
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// SetMemAllocationRatioRequest struct to set memory allocation ratio
|
||||||
|
type SetMemAllocationRatioRequest struct {
|
||||||
|
// Node ID
|
||||||
|
// Required: true
|
||||||
|
NodeID uint64 `url:"node_id" json:"node_id" validate:"required"`
|
||||||
|
|
||||||
|
// Allocation ratio (zero or positive value)
|
||||||
|
// Required: true
|
||||||
|
Ratio float64 `url:"ratio" json:"ratio" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetMemAllocationRatio set memory allocation ratio
|
||||||
|
func (i Node) SetMemAllocationRatio(ctx context.Context, req SetMemAllocationRatioRequest) error {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/node/set_mem_allocation_ratio"
|
||||||
|
|
||||||
|
_, err = i.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@@ -3,15 +3,16 @@ package pcidevice
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CreateRequest struct to creating PCI device
|
// CreateRequest struct to creating PCI device
|
||||||
type CreateRequest struct {
|
type CreateRequest struct {
|
||||||
// StackID
|
// NodeID
|
||||||
// Required: true
|
// Required: true
|
||||||
StackID uint64 `url:"stackId" json:"stackId" validate:"required"`
|
NodeID uint64 `url:"node_id" json:"node_id" validate:"required"`
|
||||||
|
|
||||||
// Resource group ID
|
// Resource group ID
|
||||||
// Required: true
|
// Required: true
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ type ItemPCIDevice struct {
|
|||||||
// Resource group ID
|
// Resource group ID
|
||||||
RGID uint64 `json:"rgId"`
|
RGID uint64 `json:"rgId"`
|
||||||
|
|
||||||
// Stack ID
|
// Node ID
|
||||||
StackID uint64 `json:"stackId"`
|
NodeID uint64 `json:"nodeId"`
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
@@ -47,4 +47,3 @@ type ListPCIDevices struct {
|
|||||||
// Entry count
|
// Entry count
|
||||||
EntryCount uint64 `json:"entryCount"`
|
EntryCount uint64 `json:"entryCount"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ import (
|
|||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GetByStackRequest struct {
|
type GetByNodeRequest struct {
|
||||||
// Stack ID
|
// Node ID
|
||||||
// Required: true
|
// Required: true
|
||||||
StackID uint64 `url:"stackId" json:"stackId" validate:"required"`
|
NodeID uint64 `url:"nodeId" json:"nodeId" validate:"required"`
|
||||||
|
|
||||||
// Start of time period - unixtime
|
// Start of time period - unixtime
|
||||||
// Required: false
|
// Required: false
|
||||||
@@ -23,13 +23,13 @@ type GetByStackRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get a grid resource monitoring for the specified time period
|
// Get a grid resource monitoring for the specified time period
|
||||||
func (r Resmon) GetByStack(ctx context.Context, req GetByStackRequest) (*GetByStackData, error) {
|
func (r Resmon) GetByNode(ctx context.Context, req GetByNodeRequest) (*GetByNodeData, error) {
|
||||||
res, err := r.GetByStackRaw(ctx, req)
|
res, err := r.GetByNodeRaw(ctx, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := GetByStackData{}
|
info := GetByNodeData{}
|
||||||
|
|
||||||
err = json.Unmarshal(res, &info)
|
err = json.Unmarshal(res, &info)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -40,13 +40,13 @@ func (r Resmon) GetByStack(ctx context.Context, req GetByStackRequest) (*GetBySt
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetRaw gets information about compute as an array of bytes
|
// GetRaw gets information about compute as an array of bytes
|
||||||
func (r Resmon) GetByStackRaw(ctx context.Context, req GetByStackRequest) ([]byte, error) {
|
func (r Resmon) GetByNodeRaw(ctx context.Context, req GetByNodeRequest) ([]byte, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/resmon/getByStack"
|
url := "/cloudbroker/resmon/get_by_node"
|
||||||
|
|
||||||
res, err := r.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := r.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
return res, err
|
return res, err
|
||||||
@@ -8,7 +8,7 @@ import (
|
|||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GetByStacksRequest struct {
|
type GetByNodesRequest struct {
|
||||||
// Start of time period - unixtime
|
// Start of time period - unixtime
|
||||||
// Required: false
|
// Required: false
|
||||||
StartTime uint64 `url:"starttime,omitempty" json:"starttime,omitempty"`
|
StartTime uint64 `url:"starttime,omitempty" json:"starttime,omitempty"`
|
||||||
@@ -19,13 +19,13 @@ type GetByStacksRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get a grid resource monitoring for the specified time period
|
// Get a grid resource monitoring for the specified time period
|
||||||
func (r Resmon) GetByStacks(ctx context.Context, req GetByStacksRequest) (*GetByStackData, error) {
|
func (r Resmon) GetByNodes(ctx context.Context, req GetByNodesRequest) (*GetByNodeData, error) {
|
||||||
res, err := r.GetByStacksRaw(ctx, req)
|
res, err := r.GetByNodesRaw(ctx, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
info := GetByStackData{}
|
info := GetByNodeData{}
|
||||||
|
|
||||||
err = json.Unmarshal(res, &info)
|
err = json.Unmarshal(res, &info)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -36,13 +36,13 @@ func (r Resmon) GetByStacks(ctx context.Context, req GetByStacksRequest) (*GetBy
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetRaw gets information about compute as an array of bytes
|
// GetRaw gets information about compute as an array of bytes
|
||||||
func (r Resmon) GetByStacksRaw(ctx context.Context, req GetByStacksRequest) ([]byte, error) {
|
func (r Resmon) GetByNodesRaw(ctx context.Context, req GetByNodesRequest) ([]byte, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/resmon/getByStacks"
|
url := "/cloudbroker/resmon/get_by_nodes"
|
||||||
|
|
||||||
res, err := r.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := r.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
return res, err
|
return res, err
|
||||||
@@ -12,7 +12,7 @@ type GetByComputePoint struct {
|
|||||||
Usage ComputeUsage `json:"usage"`
|
Usage ComputeUsage `json:"usage"`
|
||||||
Disks []ItemDisk `json:"disks"`
|
Disks []ItemDisk `json:"disks"`
|
||||||
UID string `json:"uid"`
|
UID string `json:"uid"`
|
||||||
StackID uint64 `json:"stackId"`
|
NodeID uint64 `json:"nodeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ComputeUsage struct {
|
type ComputeUsage struct {
|
||||||
@@ -46,7 +46,7 @@ type GetByGRIDPoint struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ItemTotalByGRID struct {
|
type ItemTotalByGRID struct {
|
||||||
StacksCPU uint64 `json:"stacksCPU"`
|
NodesCPU uint64 `json:"nodesCPU"`
|
||||||
StorageCapacity uint64 `json:"storageCapacity"`
|
StorageCapacity uint64 `json:"storageCapacity"`
|
||||||
CPUPower uint64 `json:"cpuPower"`
|
CPUPower uint64 `json:"cpuPower"`
|
||||||
CPUUtil uint64 `json:"cpuUtil"`
|
CPUUtil uint64 `json:"cpuUtil"`
|
||||||
@@ -64,17 +64,17 @@ type ItemStorage struct {
|
|||||||
UID string `json:"uid"`
|
UID string `json:"uid"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetByStackData represents an array of data points
|
// GetByNodeData represents an array of data points
|
||||||
type GetByStackData []GetByStackPoint
|
type GetByNodeData []GetByNodePoint
|
||||||
|
|
||||||
type GetByStackPoint struct {
|
type GetByNodePoint struct {
|
||||||
Usage StackUsage `json:"usage"`
|
Usage NodeUsage `json:"usage"`
|
||||||
CPUInfo CPUinfoByStack `json:"cpuInfo"`
|
CPUInfo CPUinfoByNode `json:"cpuInfo"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
ID uint64 `json:"id"`
|
ID uint64 `json:"id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type StackUsage struct {
|
type NodeUsage struct {
|
||||||
CPUPower uint64 `json:"cpuPower"`
|
CPUPower uint64 `json:"cpuPower"`
|
||||||
UsedVCPUs uint64 `json:"usedVcpus"`
|
UsedVCPUs uint64 `json:"usedVcpus"`
|
||||||
PCPU uint64 `json:"pcpu"`
|
PCPU uint64 `json:"pcpu"`
|
||||||
@@ -84,7 +84,7 @@ type StackUsage struct {
|
|||||||
FreeMem uint64 `json:"freeMem"`
|
FreeMem uint64 `json:"freeMem"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CPUinfoByStack struct {
|
type CPUinfoByNode struct {
|
||||||
ClockSpeed uint64 `json:"clockSpeed"`
|
ClockSpeed uint64 `json:"clockSpeed"`
|
||||||
CoreCount uint64 `json:"coreCount"`
|
CoreCount uint64 `json:"coreCount"`
|
||||||
PhysCount uint64 `json:"physCount"`
|
PhysCount uint64 `json:"physCount"`
|
||||||
|
|||||||
@@ -39,10 +39,6 @@ type CreateRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"`
|
MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"`
|
||||||
|
|
||||||
// Max sent/received network transfer peering
|
|
||||||
// Required: false
|
|
||||||
MaxNetworkPeerTransfer int64 `url:"maxNetworkPeerTransfer,omitempty" json:"maxNetworkPeerTransfer,omitempty"`
|
|
||||||
|
|
||||||
// Max number of assigned public IPs
|
// Max number of assigned public IPs
|
||||||
// Required: false
|
// Required: false
|
||||||
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`
|
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ var rgs = ListRG{
|
|||||||
CuD: -1,
|
CuD: -1,
|
||||||
CUI: -1,
|
CUI: -1,
|
||||||
CUM: -1,
|
CUM: -1,
|
||||||
CUNP: -1,
|
|
||||||
GPUUnits: -1,
|
GPUUnits: -1,
|
||||||
},
|
},
|
||||||
Secret: "",
|
Secret: "",
|
||||||
@@ -78,7 +77,6 @@ var rgs = ListRG{
|
|||||||
CuD: -1,
|
CuD: -1,
|
||||||
CUI: -1,
|
CUI: -1,
|
||||||
CUM: -1,
|
CUM: -1,
|
||||||
CUNP: -1,
|
|
||||||
GPUUnits: -1,
|
GPUUnits: -1,
|
||||||
},
|
},
|
||||||
Secret: "",
|
Secret: "",
|
||||||
@@ -121,7 +119,6 @@ var rgs = ListRG{
|
|||||||
CuD: -1,
|
CuD: -1,
|
||||||
CUI: -1,
|
CUI: -1,
|
||||||
CUM: -1,
|
CUM: -1,
|
||||||
CUNP: -1,
|
|
||||||
GPUUnits: -1,
|
GPUUnits: -1,
|
||||||
},
|
},
|
||||||
Secret: "",
|
Secret: "",
|
||||||
|
|||||||
@@ -121,9 +121,6 @@ type ResourceLimits struct {
|
|||||||
// CUM
|
// CUM
|
||||||
CUM float64 `json:"CU_M"`
|
CUM float64 `json:"CU_M"`
|
||||||
|
|
||||||
// CUNP
|
|
||||||
CUNP float64 `json:"CU_NP"`
|
|
||||||
|
|
||||||
// GPU units
|
// GPU units
|
||||||
GPUUnits float64 `json:"gpu_units"`
|
GPUUnits float64 `json:"gpu_units"`
|
||||||
|
|
||||||
|
|||||||
@@ -35,10 +35,6 @@ type UpdateRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"`
|
MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"`
|
||||||
|
|
||||||
// Max sent/received network transfer peering
|
|
||||||
// Required: false
|
|
||||||
MaxNetworkPeerTransfer int64 `url:"maxNetworkPeerTransfer,omitempty" json:"maxNetworkPeerTransfer,omitempty"`
|
|
||||||
|
|
||||||
// Max number of assigned public IPs
|
// Max number of assigned public IPs
|
||||||
// Required: false
|
// Required: false
|
||||||
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`
|
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ type SecurityGroup struct {
|
|||||||
client interfaces.Caller
|
client interfaces.Caller
|
||||||
}
|
}
|
||||||
|
|
||||||
// Builder for stack endpoint
|
// Builder for security group endpoint
|
||||||
func New(client interfaces.Caller) *SecurityGroup {
|
func New(client interfaces.Caller) *SecurityGroup {
|
||||||
return &SecurityGroup{
|
return &SecurityGroup{
|
||||||
client: client,
|
client: client,
|
||||||
|
|||||||
@@ -13,12 +13,13 @@ type AddPoolRequest struct {
|
|||||||
// Required: true
|
// Required: true
|
||||||
SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
|
SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
|
||||||
|
|
||||||
// method Async/Sync
|
// Method Async/Sync
|
||||||
// Default: true
|
// Default: true
|
||||||
// Required: false
|
// Required: false
|
||||||
Sync bool `url:"sync" json:"sync"`
|
Sync bool `url:"sync" json:"sync"`
|
||||||
|
|
||||||
// Pool structure which contains fields such as "name", "types", "accessAccountIds", "accessResGroupIds"
|
// Pool structure which contains fields such as "name", "usage_limit", "types", "system", "accessAccountIds", "accessResGroupIds". Added fields for other pool types: Des, Ovs - "uris" list of "ip, port".
|
||||||
|
// Dorado, Tatlin no additional fields required. Hitachi - "id", "snapshotable", "snapshot_pool_id", "minLdevId", "maxLdevId", "clone_technology". Shared - "description", "wwns", "allocate_type", "stripes", "metadata_size", "metadatatalun". Local - "description", "node_consumer", "block_disk".
|
||||||
// Required: true
|
// Required: true
|
||||||
Pool string `url:"pool" json:"pool" validate:"required"`
|
Pool string `url:"pool" json:"pool" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
package cloudbroker
|
|
||||||
|
|
||||||
import (
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/stack"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Accessing the Stack method group
|
|
||||||
func (cb *CloudBroker) Stack() *stack.Stack {
|
|
||||||
return stack.New(cb.client)
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
package stack
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"encoding/json"
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
|
||||||
)
|
|
||||||
|
|
||||||
// GetRequest struct to get list of stacks
|
|
||||||
type GetRequest struct {
|
|
||||||
// Find by ID
|
|
||||||
// Required: true
|
|
||||||
StackId uint64 `url:"stackId" json:"stackId" validate:"required"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get gets stack details by ID as an InfoStack struct
|
|
||||||
func (i Stack) Get(ctx context.Context, req GetRequest) (*InfoStack, error) {
|
|
||||||
res, err := i.GetRaw(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
info := InfoStack{}
|
|
||||||
|
|
||||||
err = json.Unmarshal(res, &info)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return &info, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetRaw gets stack details by ID as an array of bytes
|
|
||||||
func (i Stack) GetRaw(ctx context.Context, req GetRequest) ([]byte, error) {
|
|
||||||
err := validators.ValidateRequest(req)
|
|
||||||
if err != nil {
|
|
||||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
url := "/cloudbroker/stack/get"
|
|
||||||
|
|
||||||
res, err := i.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
|
||||||
return res, err
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
package stack
|
|
||||||
|
|
||||||
// IDs gets array of StackIDs from ListStacks struct
|
|
||||||
func (ls ListStacks) IDs() []uint64 {
|
|
||||||
res := make([]uint64, 0, len(ls.Data))
|
|
||||||
for _, s := range ls.Data {
|
|
||||||
res = append(res, s.ID)
|
|
||||||
}
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
package stack
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"encoding/json"
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
|
||||||
)
|
|
||||||
|
|
||||||
// ListRequest struct to get list of stacks
|
|
||||||
type ListRequest struct {
|
|
||||||
// Find by ID
|
|
||||||
// Required: false
|
|
||||||
ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`
|
|
||||||
|
|
||||||
// Find by name
|
|
||||||
// Required: false
|
|
||||||
Name string `url:"name,omitempty" json:"name,omitempty"`
|
|
||||||
|
|
||||||
// Find by type
|
|
||||||
// Required: false
|
|
||||||
Type string `url:"type,omitempty" json:"type,omitempty"`
|
|
||||||
|
|
||||||
// Find by status
|
|
||||||
// Required: false
|
|
||||||
Status string `url:"status,omitempty" json:"status,omitempty"`
|
|
||||||
|
|
||||||
// Sort by one of supported fields, format +|-(field)
|
|
||||||
// Required: false
|
|
||||||
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
|
|
||||||
|
|
||||||
// Page number
|
|
||||||
// Required: false
|
|
||||||
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
|
||||||
|
|
||||||
// Page size
|
|
||||||
// Required: false
|
|
||||||
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// List gets list of stacks as a ListStacks struct
|
|
||||||
func (i Stack) List(ctx context.Context, req ListRequest) (*ListStacks, error) {
|
|
||||||
|
|
||||||
res, err := i.ListRaw(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
list := ListStacks{}
|
|
||||||
|
|
||||||
err = json.Unmarshal(res, &list)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return &list, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ListRaw gets list of stacks as an array of bytes
|
|
||||||
func (i Stack) ListRaw(ctx context.Context, req ListRequest) ([]byte, error) {
|
|
||||||
|
|
||||||
err := validators.ValidateRequest(req)
|
|
||||||
if err != nil {
|
|
||||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
url := "/cloudbroker/stack/list"
|
|
||||||
|
|
||||||
res, err := i.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
|
||||||
return res, err
|
|
||||||
}
|
|
||||||
@@ -1,180 +0,0 @@
|
|||||||
package stack
|
|
||||||
|
|
||||||
// Main information about stack
|
|
||||||
type InfoStack struct {
|
|
||||||
// CKey
|
|
||||||
Ckey string `json:"_ckey"`
|
|
||||||
|
|
||||||
// Meta
|
|
||||||
Meta []interface{} `json:"_meta"`
|
|
||||||
|
|
||||||
//API URL
|
|
||||||
APIURL string `json:"apiUrl"`
|
|
||||||
|
|
||||||
//API key
|
|
||||||
Apikey string `json:"apikey"`
|
|
||||||
|
|
||||||
// App ID
|
|
||||||
AppID string `json:"appId"`
|
|
||||||
|
|
||||||
// CPU allocation ratio
|
|
||||||
CPUAllocationRatio float64 `json:"cpu_allocation_ratio"`
|
|
||||||
|
|
||||||
// Description
|
|
||||||
Description string `json:"desc"`
|
|
||||||
|
|
||||||
// Descr
|
|
||||||
Descr string `json:"descr"`
|
|
||||||
|
|
||||||
// Drivers
|
|
||||||
Drivers []string `json:"drivers"`
|
|
||||||
|
|
||||||
// Eco
|
|
||||||
Eco interface{} `json:"eco"`
|
|
||||||
|
|
||||||
// Error
|
|
||||||
Error uint64 `json:"error"`
|
|
||||||
|
|
||||||
// Grid ID
|
|
||||||
GID uint64 `json:"gid"`
|
|
||||||
|
|
||||||
// GID
|
|
||||||
GUID uint64 `json:"guid"`
|
|
||||||
|
|
||||||
// ID
|
|
||||||
ID uint64 `json:"id"`
|
|
||||||
|
|
||||||
// List image IDs
|
|
||||||
Images []uint64 `json:"images"`
|
|
||||||
|
|
||||||
// Login
|
|
||||||
Login string `json:"login"`
|
|
||||||
|
|
||||||
// Mem allocation ratio
|
|
||||||
MemAllocationRatio float64 `json:"mem_allocation_ratio"`
|
|
||||||
|
|
||||||
// Name
|
|
||||||
Name string `json:"name"`
|
|
||||||
|
|
||||||
// Packegas
|
|
||||||
Packages Packages `json:"packages"`
|
|
||||||
|
|
||||||
//Password
|
|
||||||
Password string `json:"passwd"`
|
|
||||||
|
|
||||||
// Reference ID
|
|
||||||
ReferenceID string `json:"referenceId"`
|
|
||||||
|
|
||||||
// Status
|
|
||||||
Status string `json:"status"`
|
|
||||||
|
|
||||||
// Type
|
|
||||||
Type string `json:"type"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// List of stacks
|
|
||||||
type ListStacks struct {
|
|
||||||
//List
|
|
||||||
Data []InfoStack `json:"data"`
|
|
||||||
|
|
||||||
//Entry count
|
|
||||||
EntryCount uint64 `json:"entryCount"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Package
|
|
||||||
type Packages struct {
|
|
||||||
// LibGuestFSTools
|
|
||||||
LibGuestFSTools LibGuestFSTools `json:"libguestfs-tools"`
|
|
||||||
|
|
||||||
// LibvirtBin
|
|
||||||
LibvirtBin LibvirtBin `json:"libvirt-bin"`
|
|
||||||
|
|
||||||
// LibvirtDaemon
|
|
||||||
LibvirtDaemon LibvirtDaemon `json:"libvirt-daemon"`
|
|
||||||
|
|
||||||
// Lvm2Lockd
|
|
||||||
Lvm2Lockd Lvm2Lockd `json:"lvm2-lockd"`
|
|
||||||
|
|
||||||
// OpenvswitchCommon
|
|
||||||
OpenvswitchCommon OpenvswitchCommon `json:"openvswitch-common"`
|
|
||||||
|
|
||||||
// OpenvswitchSwitch
|
|
||||||
OpenvswitchSwitch OpenvswitchSwitch `json:"openvswitch-switch"`
|
|
||||||
|
|
||||||
// QemuSystemX86
|
|
||||||
QemuSystemX86 QemuSystemX86 `json:"qemu-system-x86"`
|
|
||||||
|
|
||||||
// Sanlock
|
|
||||||
Sanlock Sanlock `json:"sanlock"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// LibGuestFSTools
|
|
||||||
type LibGuestFSTools struct {
|
|
||||||
// InstalledSize
|
|
||||||
InstalledSize string `json:"installed_size"`
|
|
||||||
|
|
||||||
// Version
|
|
||||||
Ver string `json:"ver"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// LibvirtBin
|
|
||||||
type LibvirtBin struct {
|
|
||||||
// InstalledSize
|
|
||||||
InstalledSize string `json:"installed_size"`
|
|
||||||
|
|
||||||
// Version
|
|
||||||
Ver string `json:"ver"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type LibvirtDaemon struct {
|
|
||||||
// InstalledSize
|
|
||||||
InstalledSize string `json:"installed_size"`
|
|
||||||
|
|
||||||
// Version
|
|
||||||
Ver string `json:"ver"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Lvm2Lockd
|
|
||||||
type Lvm2Lockd struct {
|
|
||||||
// InstalledSize
|
|
||||||
InstalledSize string `json:"installed_size"`
|
|
||||||
|
|
||||||
// Version
|
|
||||||
Ver string `json:"ver"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// OpenvswitchCommon
|
|
||||||
type OpenvswitchCommon struct {
|
|
||||||
// InstalledSize
|
|
||||||
InstalledSize string `json:"installed_size"`
|
|
||||||
|
|
||||||
// Version
|
|
||||||
Ver string `json:"ver"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// OpenvswitchSwitch
|
|
||||||
type OpenvswitchSwitch struct {
|
|
||||||
// InstalledSize
|
|
||||||
InstalledSize string `json:"installed_size"`
|
|
||||||
|
|
||||||
// Version
|
|
||||||
Ver string `json:"ver"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// QemuSystemX86
|
|
||||||
type QemuSystemX86 struct {
|
|
||||||
// InstalledSize
|
|
||||||
InstalledSize string `json:"installed_size"`
|
|
||||||
|
|
||||||
// Version
|
|
||||||
Ver string `json:"ver"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sanlock
|
|
||||||
type Sanlock struct {
|
|
||||||
// InstalledSize
|
|
||||||
InstalledSize string `json:"installed_size"`
|
|
||||||
|
|
||||||
// Version
|
|
||||||
Ver string `json:"ver"`
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
package stack
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"encoding/json"
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
|
||||||
)
|
|
||||||
|
|
||||||
// SetCpuAllocationRatioRequest struct to set CPU allocation ratio
|
|
||||||
type SetCpuAllocationRatioRequest struct {
|
|
||||||
// Stack ID
|
|
||||||
// Required: true
|
|
||||||
StackId uint64 `url:"stackId" json:"stackId" validate:"required"`
|
|
||||||
|
|
||||||
// Allocation ratio (zero or positive value)
|
|
||||||
// Required: true
|
|
||||||
Ratio float64 `url:"ratio" json:"ratio" validate:"required"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetCpuAllocationRatio set CPU allocation ratio
|
|
||||||
func (i Stack) SetCpuAllocationRatio(ctx context.Context, req SetCpuAllocationRatioRequest) (*InfoStack, error) {
|
|
||||||
err := validators.ValidateRequest(req)
|
|
||||||
if err != nil {
|
|
||||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
url := "/cloudbroker/stack/setCpuAllocationRatio"
|
|
||||||
|
|
||||||
res, err := i.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
info := InfoStack{}
|
|
||||||
|
|
||||||
err = json.Unmarshal(res, &info)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return &info, nil
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
package stack
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"encoding/json"
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
|
||||||
)
|
|
||||||
|
|
||||||
// SetMemAllocationRatioRequest struct to set memory allocation ratio
|
|
||||||
type SetMemAllocationRatioRequest struct {
|
|
||||||
// Stack ID
|
|
||||||
// Required: true
|
|
||||||
StackId uint64 `url:"stackId" json:"stackId" validate:"required"`
|
|
||||||
|
|
||||||
// Allocation ratio (zero or positive value)
|
|
||||||
// Required: true
|
|
||||||
Ratio float64 `url:"ratio" json:"ratio" validate:"required"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetMemAllocationRatio set memory allocation ratio
|
|
||||||
func (i Stack) SetMemAllocationRatio(ctx context.Context, req SetMemAllocationRatioRequest) (*InfoStack, error) {
|
|
||||||
err := validators.ValidateRequest(req)
|
|
||||||
if err != nil {
|
|
||||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
url := "/cloudbroker/stack/setMemAllocationRatio"
|
|
||||||
|
|
||||||
res, err := i.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
info := InfoStack{}
|
|
||||||
|
|
||||||
err = json.Unmarshal(res, &info)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return &info, nil
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
package stack
|
|
||||||
|
|
||||||
import "repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
|
||||||
|
|
||||||
// Structure for creating request to stack
|
|
||||||
type Stack struct {
|
|
||||||
client interfaces.Caller
|
|
||||||
}
|
|
||||||
|
|
||||||
// Builder for stack endpoint
|
|
||||||
func New(client interfaces.Caller) *Stack {
|
|
||||||
return &Stack{
|
|
||||||
client: client,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -7,7 +7,7 @@ type StPolicy struct {
|
|||||||
client interfaces.Caller
|
client interfaces.Caller
|
||||||
}
|
}
|
||||||
|
|
||||||
// Builder for stack endpoint
|
// Builder for storage policy endpoint
|
||||||
func New(client interfaces.Caller) *StPolicy {
|
func New(client interfaces.Caller) *StPolicy {
|
||||||
return &StPolicy{
|
return &StPolicy{
|
||||||
client: client,
|
client: client,
|
||||||
|
|||||||
@@ -237,7 +237,6 @@ type CloudBrokerEndpoints struct {
|
|||||||
Machine []string `json:"machine,omitempty"`
|
Machine []string `json:"machine,omitempty"`
|
||||||
Metering []string `json:"metering,omitempty"`
|
Metering []string `json:"metering,omitempty"`
|
||||||
Milestones []string `json:"milestones,omitempty"`
|
Milestones []string `json:"milestones,omitempty"`
|
||||||
Node []string `json:"node,omitempty"`
|
|
||||||
Openshift []string `json:"openshift,omitempty"`
|
Openshift []string `json:"openshift,omitempty"`
|
||||||
OpenshiftCI []string `json:"openshiftci,omitempty"`
|
OpenshiftCI []string `json:"openshiftci,omitempty"`
|
||||||
Ovsnode []string `json:"ovsnode,omitempty"`
|
Ovsnode []string `json:"ovsnode,omitempty"`
|
||||||
@@ -248,7 +247,7 @@ type CloudBrokerEndpoints struct {
|
|||||||
Resmon []string `json:"resmon,omitempty"`
|
Resmon []string `json:"resmon,omitempty"`
|
||||||
RG []string `json:"rg,omitempty"`
|
RG []string `json:"rg,omitempty"`
|
||||||
Sep []string `json:"sep,omitempty"`
|
Sep []string `json:"sep,omitempty"`
|
||||||
Stack []string `json:"stack,omitempty"`
|
Node []string `json:"node,omitempty"`
|
||||||
Tasks []string `json:"tasks,omitempty"`
|
Tasks []string `json:"tasks,omitempty"`
|
||||||
TLock []string `json:"tlock,omitempty"`
|
TLock []string `json:"tlock,omitempty"`
|
||||||
User []string `json:"user,omitempty"`
|
User []string `json:"user,omitempty"`
|
||||||
|
|||||||
@@ -74,8 +74,8 @@ type Resources struct {
|
|||||||
// Number of RAM
|
// Number of RAM
|
||||||
RAM uint64 `json:"ram"`
|
RAM uint64 `json:"ram"`
|
||||||
|
|
||||||
// Stack ID
|
// Node ID
|
||||||
StackID uint64 `json:"stackId"`
|
NodeID uint64 `json:"node_id"`
|
||||||
|
|
||||||
// UUID
|
// UUID
|
||||||
UUID string `json:"uuid"`
|
UUID string `json:"uuid"`
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ FAIL
|
|||||||
Пример вывода:
|
Пример вывода:
|
||||||
```go
|
```go
|
||||||
=== RUN TestRequestsCloudbroker
|
=== RUN TestRequestsCloudbroker
|
||||||
utils_requests.go:125: Path /cloudbroker/image/updateNodes has following errors: [Field enabledStacks has different type parameters on the platform and in golang structure]
|
utils_requests.go:125: Path /cloudbroker/image/updateNodes has following errors: [Field enabledNodes has different type parameters on the platform and in golang structure]
|
||||||
utils_requests.go:125: Path /cloudbroker/lb/listDeleted has following errors: [Platform has field accountId that golang structure doesn't]
|
utils_requests.go:125: Path /cloudbroker/lb/listDeleted has following errors: [Platform has field accountId that golang structure doesn't]
|
||||||
utils_requests.go:125: Path /cloudbroker/k8ci/listDeleted has following errors: [Platform has field k8cId that golang structure doesn't]
|
utils_requests.go:125: Path /cloudbroker/k8ci/listDeleted has following errors: [Platform has field k8cId that golang structure doesn't]
|
||||||
<...>
|
<...>
|
||||||
@@ -108,12 +108,12 @@ FAIL
|
|||||||
/cloudbroker/account/listVMs
|
/cloudbroker/account/listVMs
|
||||||
/cloudapi/user/brief
|
/cloudapi/user/brief
|
||||||
/cloudapi/user/search
|
/cloudapi/user/search
|
||||||
/cloudbroker/stack/setMemAllocationRatio
|
/cloudbroker/node/setMemAllocationRatio
|
||||||
/cloudbroker/image/computeciUnset
|
/cloudbroker/image/computeciUnset
|
||||||
/cloudbroker/image/uploadImageFile
|
/cloudbroker/image/uploadImageFile
|
||||||
/cloudapi/account/getStats
|
/cloudapi/account/getStats
|
||||||
/cloudapi/disks/fromPlatformDisk
|
/cloudapi/disks/fromPlatformDisk
|
||||||
/cloudbroker/stack/getLogicalCoresCount
|
/cloudbroker/node/getLogicalCoresCount
|
||||||
/cloudapi/lb/stop
|
/cloudapi/lb/stop
|
||||||
/cloudapi/account/listVMs
|
/cloudapi/account/listVMs
|
||||||
/cloudapi/user/setData
|
/cloudapi/user/setData
|
||||||
@@ -122,7 +122,7 @@ FAIL
|
|||||||
/cloudapi/user/getAudit
|
/cloudapi/user/getAudit
|
||||||
/cloudbroker/account/listCS
|
/cloudbroker/account/listCS
|
||||||
/cloudapi/account/listCS
|
/cloudapi/account/listCS
|
||||||
/cloudbroker/stack/setCpuAllocationRatio
|
/cloudbroker/node/setCpuAllocationRatio
|
||||||
/cloudbroker/grid/setPasswordPolicy
|
/cloudbroker/grid/setPasswordPolicy
|
||||||
/cloudapi/user/apiList
|
/cloudapi/user/apiList
|
||||||
/cloudbroker/disks/fromPlatformDisk
|
/cloudbroker/disks/fromPlatformDisk
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import (
|
|||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/rg"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/rg"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/secgroup"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/secgroup"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/sep"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/sep"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/stack"
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/stpolicy"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/stpolicy"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/tasks"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/tasks"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/trunk"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/trunk"
|
||||||
@@ -28,11 +27,11 @@ import (
|
|||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/acsgroups"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/acsgroups"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/adrspools"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/adrspools"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/defsecpolicies"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/defsecpolicies"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/segments"
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/secpolicies"
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/secpolicies/rule"
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/logicalports"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/logicalports"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/routers"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/routers"
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/secpolicies"
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/secpolicies/rule"
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/segments"
|
||||||
|
|
||||||
account_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/account"
|
account_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/account"
|
||||||
audit_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/audit"
|
audit_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/audit"
|
||||||
@@ -51,7 +50,6 @@ import (
|
|||||||
rg_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/rg"
|
rg_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/rg"
|
||||||
secgroup_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/secgroup"
|
secgroup_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/secgroup"
|
||||||
sep_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/sep"
|
sep_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/sep"
|
||||||
stack_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/stack"
|
|
||||||
stpolicy_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/stpolicy"
|
stpolicy_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/stpolicy"
|
||||||
tasks_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/tasks"
|
tasks_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/tasks"
|
||||||
trunk_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/trunk"
|
trunk_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/trunk"
|
||||||
@@ -309,14 +307,6 @@ func TestGetListCloudAPI(t *testing.T) {
|
|||||||
}
|
}
|
||||||
getResult("SEP list", bytes, sep.ListAvailableSEP{}, t)
|
getResult("SEP list", bytes, sep.ListAvailableSEP{}, t)
|
||||||
|
|
||||||
// Stack
|
|
||||||
// List
|
|
||||||
bytes, err = client.CloudAPI().Stack().ListRaw(context.Background(), stack.ListRequest{})
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
getResult("Stack list", bytes, stack.ListStacks{}, t)
|
|
||||||
|
|
||||||
// Storage policy
|
// Storage policy
|
||||||
// List
|
// List
|
||||||
bytes, err = client.CloudAPI().StPolicy().ListRaw(context.Background(), stpolicy.ListRequest{})
|
bytes, err = client.CloudAPI().StPolicy().ListRaw(context.Background(), stpolicy.ListRequest{})
|
||||||
@@ -383,7 +373,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
getResult("Trunk list", bytes, tasks.ListTasks{}, t)
|
getResult("Trunk list", bytes, trunk.ListTrunks{}, t)
|
||||||
// Get
|
// Get
|
||||||
listTrunk, _ := client.CloudAPI().Trunk().List(context.Background(), trunk.ListRequest{})
|
listTrunk, _ := client.CloudAPI().Trunk().List(context.Background(), trunk.ListRequest{})
|
||||||
if len(listTrunk.Data) > 0 {
|
if len(listTrunk.Data) > 0 {
|
||||||
@@ -423,7 +413,7 @@ func TestGetListCloudAPI(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
}
|
}
|
||||||
getResult("Zone list", bytes, vins.ListVINS{}, t)
|
getResult("Zone list", bytes, zone.ListZones{}, t)
|
||||||
// Get
|
// Get
|
||||||
ListZones, _ := client.CloudAPI().Zone().List(context.Background(), zone.ListRequest{})
|
ListZones, _ := client.CloudAPI().Zone().List(context.Background(), zone.ListRequest{})
|
||||||
if len(ListZones.Data) > 0 {
|
if len(ListZones.Data) > 0 {
|
||||||
@@ -783,26 +773,6 @@ func TestGetListCloudbroker(t *testing.T) {
|
|||||||
}
|
}
|
||||||
getResult("SEP and pools list", bytes, sep_cb.ListAvailableSEP{}, t)
|
getResult("SEP and pools list", bytes, sep_cb.ListAvailableSEP{}, t)
|
||||||
|
|
||||||
// Stack
|
|
||||||
// List
|
|
||||||
bytes, err = client.CloudBroker().Stack().ListRaw(context.Background(), stack_cb.ListRequest{})
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
getResult("Stack list", bytes, stack_cb.ListStacks{}, t)
|
|
||||||
// Get
|
|
||||||
listStack, _ := client.CloudBroker().Stack().List(context.Background(), stack_cb.ListRequest{})
|
|
||||||
if len(listStack.Data) > 0 {
|
|
||||||
id := listStack.Data[0].ID
|
|
||||||
bytes, err = client.CloudBroker().Stack().GetRaw(context.Background(), stack_cb.GetRequest{StackId: id})
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
}
|
|
||||||
getResult("Stack get", bytes, stack_cb.InfoStack{}, t)
|
|
||||||
} else {
|
|
||||||
t.Errorf("Can not test Stack get because Stack list is empty")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Storage policy
|
// Storage policy
|
||||||
// List
|
// List
|
||||||
bytes, err = client.CloudBroker().StPolicy().ListRaw(context.Background(), stpolicy_cb.ListRequest{})
|
bytes, err = client.CloudBroker().StPolicy().ListRaw(context.Background(), stpolicy_cb.ListRequest{})
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import (
|
|||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/rg"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/rg"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/secgroup"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/secgroup"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/sep"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/sep"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/stack"
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/stpolicy"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/stpolicy"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/tasks"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/tasks"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/trunk"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/trunk"
|
||||||
@@ -31,13 +30,13 @@ import (
|
|||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/acsgroups"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/acsgroups"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/adrspools"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/adrspools"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/defsecpolicies"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/defsecpolicies"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/segments"
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/secpolicies"
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/secpolicies/rule"
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/logicalports"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/logicalports"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/routers"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/routers"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/routers/gwport"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/routers/gwport"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/routers/policies"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/routers/policies"
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/secpolicies"
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/secpolicies/rule"
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/segments"
|
||||||
|
|
||||||
account_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/account"
|
account_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/account"
|
||||||
apiaccess_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/apiaccess"
|
apiaccess_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/apiaccess"
|
||||||
@@ -61,7 +60,6 @@ import (
|
|||||||
rg_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/rg"
|
rg_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/rg"
|
||||||
secgroup_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/secgroup"
|
secgroup_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/secgroup"
|
||||||
sep_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/sep"
|
sep_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/sep"
|
||||||
stack_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/stack"
|
|
||||||
stpolicy_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/stpolicy"
|
stpolicy_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/stpolicy"
|
||||||
tasks_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/tasks"
|
tasks_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/tasks"
|
||||||
trunk_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/trunk"
|
trunk_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/trunk"
|
||||||
@@ -72,8 +70,8 @@ import (
|
|||||||
zone_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/zone"
|
zone_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/zone"
|
||||||
|
|
||||||
extnet_sdn "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/extnet"
|
extnet_sdn "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/extnet"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/netobjgroups"
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/flips"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/flips"
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/netobjgroups"
|
||||||
)
|
)
|
||||||
|
|
||||||
type EmptyStruct struct{}
|
type EmptyStruct struct{}
|
||||||
@@ -196,7 +194,7 @@ func getRequestsMapCloudAPI() map[string]interface{} {
|
|||||||
"/restmachine/cloudapi/compute/pfwDel": compute.PFWDelRequest{},
|
"/restmachine/cloudapi/compute/pfwDel": compute.PFWDelRequest{},
|
||||||
"/restmachine/cloudapi/compute/pfwList": compute.PFWListRequest{},
|
"/restmachine/cloudapi/compute/pfwList": compute.PFWListRequest{},
|
||||||
"/restmachine/cloudapi/compute/pause": compute.PauseRequest{},
|
"/restmachine/cloudapi/compute/pause": compute.PauseRequest{},
|
||||||
"/restmachine/cloudapi/compute/pinToStack": compute.PinToStackRequest{},
|
"/restmachine/cloudapi/compute/pinToNode": compute.PinToNodeRequest{},
|
||||||
"/restmachine/cloudapi/compute/powerCycle": compute.PowerCycleRequest{},
|
"/restmachine/cloudapi/compute/powerCycle": compute.PowerCycleRequest{},
|
||||||
"/restmachine/cloudapi/compute/reboot": compute.RebootRequest{},
|
"/restmachine/cloudapi/compute/reboot": compute.RebootRequest{},
|
||||||
"/restmachine/cloudapi/compute/redeploy": compute.RedeployRequest{},
|
"/restmachine/cloudapi/compute/redeploy": compute.RedeployRequest{},
|
||||||
@@ -214,7 +212,7 @@ func getRequestsMapCloudAPI() map[string]interface{} {
|
|||||||
"/restmachine/cloudapi/compute/stop": compute.StopRequest{},
|
"/restmachine/cloudapi/compute/stop": compute.StopRequest{},
|
||||||
"/restmachine/cloudapi/compute/tagAdd": compute.TagAddRequest{},
|
"/restmachine/cloudapi/compute/tagAdd": compute.TagAddRequest{},
|
||||||
"/restmachine/cloudapi/compute/tagRemove": compute.TagRemoveRequest{},
|
"/restmachine/cloudapi/compute/tagRemove": compute.TagRemoveRequest{},
|
||||||
"/restmachine/cloudapi/compute/unpinFromStack": compute.UnpinFromStackRequest{},
|
"/restmachine/cloudapi/compute/unpinFromNode": compute.UnpinFromNodeRequest{},
|
||||||
"/restmachine/cloudapi/compute/update": compute.UpdateRequest{},
|
"/restmachine/cloudapi/compute/update": compute.UpdateRequest{},
|
||||||
"/restmachine/cloudapi/compute/userGrant": compute.UserGrantRequest{},
|
"/restmachine/cloudapi/compute/userGrant": compute.UserGrantRequest{},
|
||||||
"/restmachine/cloudapi/compute/userList": compute.UserListRequest{},
|
"/restmachine/cloudapi/compute/userList": compute.UserListRequest{},
|
||||||
@@ -413,9 +411,7 @@ func getRequestsMapCloudAPI() map[string]interface{} {
|
|||||||
// sep
|
// sep
|
||||||
"/restmachine/cloudapi/sep/listAvailableSepAndPools": sep.ListAvailableSEPAndPoolsRequest{},
|
"/restmachine/cloudapi/sep/listAvailableSepAndPools": sep.ListAvailableSEPAndPoolsRequest{},
|
||||||
|
|
||||||
// stack, tasks
|
// tasks
|
||||||
"/restmachine/cloudapi/stack/get": stack.GetRequest{},
|
|
||||||
"/restmachine/cloudapi/stack/list": stack.ListRequest{},
|
|
||||||
"/restmachine/cloudapi/tasks/get": tasks.GetRequest{},
|
"/restmachine/cloudapi/tasks/get": tasks.GetRequest{},
|
||||||
"/restmachine/cloudapi/tasks/list": tasks.ListRequest{},
|
"/restmachine/cloudapi/tasks/list": tasks.ListRequest{},
|
||||||
|
|
||||||
@@ -617,7 +613,7 @@ func getRequestsMapCloudbroker() map[string]interface{} {
|
|||||||
"/restmachine/cloudbroker/compute/pfwDel": compute_cb.PFWDelRequest{},
|
"/restmachine/cloudbroker/compute/pfwDel": compute_cb.PFWDelRequest{},
|
||||||
"/restmachine/cloudbroker/compute/pfwList": compute_cb.PFWListRequest{},
|
"/restmachine/cloudbroker/compute/pfwList": compute_cb.PFWListRequest{},
|
||||||
"/restmachine/cloudbroker/compute/pause": compute_cb.PauseRequest{},
|
"/restmachine/cloudbroker/compute/pause": compute_cb.PauseRequest{},
|
||||||
"/restmachine/cloudbroker/compute/pinToStack": compute_cb.PinToStackRequest{},
|
"/restmachine/cloudbroker/compute/pin_to_node": compute_cb.PinToNodeRequest{},
|
||||||
"/restmachine/cloudbroker/compute/powerCycle": compute_cb.PowerCycleRequest{},
|
"/restmachine/cloudbroker/compute/powerCycle": compute_cb.PowerCycleRequest{},
|
||||||
"/restmachine/cloudbroker/compute/raiseDown": EmptyStruct{},
|
"/restmachine/cloudbroker/compute/raiseDown": EmptyStruct{},
|
||||||
"/restmachine/cloudbroker/compute/reboot": compute_cb.RebootRequest{},
|
"/restmachine/cloudbroker/compute/reboot": compute_cb.RebootRequest{},
|
||||||
@@ -639,7 +635,7 @@ func getRequestsMapCloudbroker() map[string]interface{} {
|
|||||||
"/restmachine/cloudbroker/compute/stop_migration_in": compute_cb.StopMigrationINRequest{},
|
"/restmachine/cloudbroker/compute/stop_migration_in": compute_cb.StopMigrationINRequest{},
|
||||||
"/restmachine/cloudbroker/compute/tagAdd": compute_cb.TagAddRequest{},
|
"/restmachine/cloudbroker/compute/tagAdd": compute_cb.TagAddRequest{},
|
||||||
"/restmachine/cloudbroker/compute/tagRemove": compute_cb.TagRemoveRequest{},
|
"/restmachine/cloudbroker/compute/tagRemove": compute_cb.TagRemoveRequest{},
|
||||||
"/restmachine/cloudbroker/compute/unpinFromStack": compute_cb.UnpinFromStackRequest{},
|
"/restmachine/cloudbroker/compute/unpin_from_node": compute_cb.UnpinFromNodeRequest{},
|
||||||
"/restmachine/cloudbroker/compute/update": compute_cb.UpdateRequest{},
|
"/restmachine/cloudbroker/compute/update": compute_cb.UpdateRequest{},
|
||||||
"/restmachine/cloudbroker/compute/userGrant": compute_cb.UserGrantRequest{},
|
"/restmachine/cloudbroker/compute/userGrant": compute_cb.UserGrantRequest{},
|
||||||
"/restmachine/cloudbroker/compute/userList": compute_cb.UserListRequest{},
|
"/restmachine/cloudbroker/compute/userList": compute_cb.UserListRequest{},
|
||||||
@@ -653,6 +649,7 @@ func getRequestsMapCloudbroker() map[string]interface{} {
|
|||||||
"/restmachine/cloudbroker/compute/guest_agent_execute": compute_cb.GuestAgentExecuteRequest{},
|
"/restmachine/cloudbroker/compute/guest_agent_execute": compute_cb.GuestAgentExecuteRequest{},
|
||||||
"/restmachine/cloudbroker/compute/guest_agent_feature_get": compute_cb.GuestAgentFeatureGetRequest{},
|
"/restmachine/cloudbroker/compute/guest_agent_feature_get": compute_cb.GuestAgentFeatureGetRequest{},
|
||||||
"/restmachine/cloudbroker/compute/guest_agent_feature_update": compute_cb.GuestAgentFeatureUpdateRequest{},
|
"/restmachine/cloudbroker/compute/guest_agent_feature_update": compute_cb.GuestAgentFeatureUpdateRequest{},
|
||||||
|
"/restmachine/cloudbroker/compute/change_read_only": compute_cb.ChangeReadOnlyRequest{},
|
||||||
|
|
||||||
// disks
|
// disks
|
||||||
"/restmachine/cloudbroker/disks/change_disk_storage_policy": disks_cb.ChangeDiskStoragePolicyRequest{},
|
"/restmachine/cloudbroker/disks/change_disk_storage_policy": disks_cb.ChangeDiskStoragePolicyRequest{},
|
||||||
@@ -784,7 +781,6 @@ func getRequestsMapCloudbroker() map[string]interface{} {
|
|||||||
"/restmachine/cloudbroker/image/grantAccess": image_cb.GrantAccessRequest{},
|
"/restmachine/cloudbroker/image/grantAccess": image_cb.GrantAccessRequest{},
|
||||||
"/restmachine/cloudbroker/image/link": image_cb.LinkRequest{},
|
"/restmachine/cloudbroker/image/link": image_cb.LinkRequest{},
|
||||||
"/restmachine/cloudbroker/image/list": image_cb.ListRequest{},
|
"/restmachine/cloudbroker/image/list": image_cb.ListRequest{},
|
||||||
"/restmachine/cloudbroker/image/listStacks": image_cb.ListStacksRequest{},
|
|
||||||
"/restmachine/cloudbroker/image/rename": image_cb.RenameRequest{},
|
"/restmachine/cloudbroker/image/rename": image_cb.RenameRequest{},
|
||||||
"/restmachine/cloudbroker/image/revokeAccess": image_cb.RevokeAccessRequest{},
|
"/restmachine/cloudbroker/image/revokeAccess": image_cb.RevokeAccessRequest{},
|
||||||
"/restmachine/cloudbroker/image/share": image_cb.ShareRequest{},
|
"/restmachine/cloudbroker/image/share": image_cb.ShareRequest{},
|
||||||
@@ -881,6 +877,9 @@ func getRequestsMapCloudbroker() map[string]interface{} {
|
|||||||
"/restmachine/cloudbroker/node/update": node_cb.UpdateRequest{},
|
"/restmachine/cloudbroker/node/update": node_cb.UpdateRequest{},
|
||||||
"/restmachine/cloudbroker/node/update_description": node_cb.UpdateDescriptionRequest{},
|
"/restmachine/cloudbroker/node/update_description": node_cb.UpdateDescriptionRequest{},
|
||||||
"/restmachine/cloudbroker/node/setVFsParams": node_cb.VFParam{},
|
"/restmachine/cloudbroker/node/setVFsParams": node_cb.VFParam{},
|
||||||
|
"/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{},
|
||||||
|
|
||||||
// pcidevice
|
// pcidevice
|
||||||
"/restmachine/cloudbroker/pcidevice/create": pcidevice_cb.CreateRequest{},
|
"/restmachine/cloudbroker/pcidevice/create": pcidevice_cb.CreateRequest{},
|
||||||
@@ -978,13 +977,6 @@ func getRequestsMapCloudbroker() map[string]interface{} {
|
|||||||
"/restmachine/cloudbroker/sep/listAvailableSepAndPools": sep_cb.ListAvailableSEPAndPoolsRequest{},
|
"/restmachine/cloudbroker/sep/listAvailableSepAndPools": sep_cb.ListAvailableSEPAndPoolsRequest{},
|
||||||
"/restmachine/cloudbroker/sep/sharedLockStart": sep_cb.SharedLockStartRequest{},
|
"/restmachine/cloudbroker/sep/sharedLockStart": sep_cb.SharedLockStartRequest{},
|
||||||
|
|
||||||
// stack
|
|
||||||
"/restmachine/cloudbroker/stack/get": stack_cb.GetRequest{},
|
|
||||||
"/restmachine/cloudbroker/stack/getLogicalCoresCount": stack_cb.GetLogicalCoresCountRequest{},
|
|
||||||
"/restmachine/cloudbroker/stack/list": stack_cb.ListRequest{},
|
|
||||||
"/restmachine/cloudbroker/stack/setCpuAllocationRatio": stack_cb.SetCpuAllocationRatioRequest{},
|
|
||||||
"/restmachine/cloudbroker/stack/setMemAllocationRatio": stack_cb.SetMemAllocationRatioRequest{},
|
|
||||||
|
|
||||||
// storage_policy
|
// storage_policy
|
||||||
"/restmachine/cloudbroker/storage_policy/get": stpolicy_cb.GetRequest{},
|
"/restmachine/cloudbroker/storage_policy/get": stpolicy_cb.GetRequest{},
|
||||||
"/restmachine/cloudbroker/storage_policy/list": stpolicy_cb.ListRequest{},
|
"/restmachine/cloudbroker/storage_policy/list": stpolicy_cb.ListRequest{},
|
||||||
|
|||||||
Reference in New Issue
Block a user