Compare commits

..

1 Commits

Author SHA1 Message Date
dayterr
ee35db8ec6 v1.12.11
v1.12.11
2026-03-20 17:28:03 +03:00
155 changed files with 1280 additions and 1162 deletions

View File

@@ -1,10 +1,8 @@
## Version 1.13.9
## Version 1.12.11
Методы `Audits` в cloudapi/compute, cloudbroker/compute, cloudapi/account, cloudbroker/account, cloudapi/vins, cloudbroker/vins, cloudapi/rg и cloudbroker/rg стали deprecated и в следующих версиях будут удалены, вместо них необходимо использовать метод `List` в cloudapi/audit и cloudbroker/audit с соответствующими фильтрами
Метод `ListNodes` в cloudbroker/image стал deprecated и в следующих версиях будет удалён
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и в следующих версиях будут удалены
Методы `ComputeCISet`, `ComputeCIUnset`, `GetAudits` в cloudbroker/compute и `GetAudits` в cloudapi/compute стали deprecated и будут удалены в следующих версиях
Методы `ComputeCISet`, `ComputeCIUnset` в cloudbroker/image стали deprecated и будут удалены в следующих версиях
Метод `ListStacks` в cloudbroker/image стал deprecated и в следующих версиях будет удалён
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и в следующих версиях будут удалены
Все методы группы `.SDN()` находятся в альфа-версии.
@@ -13,4 +11,4 @@
#### rg
| Идентификатор<br>задачи | Описание |
| --- | --- |
| BGOS-815 | JSON-тэг у поля `RGID` в структуре ответа `ItemResourceConsumption` с `rgid` на `id` в cloudbroker/rg |
| BGOS-815 | JSON-тэг у поля `RGID` в структуре ответа `ItemResourceConsumption` с `rgid` на `id` в cloudbroker/rg |

View File

@@ -17,7 +17,6 @@ Decort SDK - это библиотека, написанная на языке G
- Версия 1.10.х Decort-SDK соответствует 4.2.0 версии платформы
- Версия 1.11.х Decort-SDK соответствует 4.3.0 версии платформы
- Версия 1.12.х Decort-SDK соответствует 4.4.0 версии платформы
- Версия 1.13.х Decort-SDK соответствует 4.5.0 версии платформы
## Оглавление
@@ -126,6 +125,7 @@ go get -u repository.basistech.ru/BASIS/decort-golang-sdk
- `RG` - управление ресурсными группами аккаунта;
- `Security group` управление группами безопасности;
- `SEP` - управление storage endpoint (sep);
- `Stack` - получение информации о вычислительных узлах;
- `Storage policy` получение информации о политиках хранения;
- `Tasks` - получение информации о ходе выполнения асинхронных задач (например, создание кластера);
- `Trunk` - получение информации о транковых портах;
@@ -162,6 +162,7 @@ go get -u repository.basistech.ru/BASIS/decort-golang-sdk
- `RG` - управление ресурсными группами аккаунта;
- `Security group` управление группами безопасности;
- `SEP` - управление storage endpoint (sep);
- `Stack` - получение информации о вычислительных узлах;
- `Storage policy` управление политиками хранения;
- `Tasks` - получение информации о ходе выполнения асинхронных задач (например, создание кластера);
- `Trunk` - управление транковыми портами;
@@ -336,6 +337,7 @@ func main() {
- `pkg/cloudapi/rg` - для `RG`
- `pkg/cloudapi/secgroup` - для `Security group`
- `pkg/cloudapi/sep` - для `SEP`
- `pkg/cloudapi/stack` - для `Stack`
- `pkg/cloudapi/stpolicy` - для `Storage policy`
- `pkg/cloudapi/tasks` - для `Tasks`
- `pkg/cloudapi/trunk` - для `Trunk`
@@ -367,6 +369,7 @@ func main() {
- `pkg/cloudbroker/rg` - для `RG`
- `pkg/cloudbroker/secgroup` - для `Security group`
- `pkg/cloudbroker/sep` - для `SEP`
- `pkg/cloudbroker/stack` - для `Stack`
- `pkg/cloudbroker/stpolicy` - для `Storage policy`
- `pkg/cloudbroker/tasks` - для `Tasks`
- `pkg/cloudbroker/trunk` - для `Trunk`
@@ -463,9 +466,9 @@ type CreateRequest struct {
// Required: false
Start bool `url:"start,omitempty" json:"start,omitempty"`
// Node ID
// Stack ID
// Required: false
NodeID uint64 `url:"nodeId,omitempty" json:"nodeId,omitempty"`
StackID uint64 `url:"stackId,omitempty" json:"stackId,omitempty"`
// System name
// Required: false
@@ -542,6 +545,7 @@ func main() {
- `.RG()` - для работы с `RG`
- `.SecurityGroup()` - для работы с `Security Group`
- `.SEP()` - для работы с `SEP`
- `.Stack()` - для работы с `Stack`
- `.StPolicy()` - для работы с `Storage Policy`
- `.Tasks()` - для работы с `Tasks`
- `.Trunk()` - для работы с `Trunk`
@@ -575,6 +579,7 @@ func main() {
- `.RG()` - для работы с `RG`
- `.SecurityGroup()` - для работы с `Security Group`
- `.SEP()` - для работы с `SEP`
- `.Stack()` - для работы с `Stack`
- `.StPolicy()` - для работы с `Storage Policy`
- `.Tasks()` - для работы с `Tasks`
- `.Trunk()` - для работы с `Trunk`

View File

@@ -28,7 +28,6 @@ var FileName = map[string]string{
var K8sValues = []string{"labels", "taints", "annotations, additionalSANs"}
var VersionMap = map[string]string{
"4.5.0": "-",
"4.4.0": "-",
"4.3.0": "-",
"4.2.0": "-",

View File

@@ -471,10 +471,3 @@ func addressPoolNetTypeValidator(fe validator.FieldLevel) bool {
return IsInSlice(fieldValue, addressPoolNetTypeValues)
}
// sepTechStatusValidator is used to validate SepTechStatus fields
func sepTechStatusValidator(fe validator.FieldLevel) bool {
fieldValue := fe.Field().String()
return IsInSlice(fieldValue, sepTechStatusValues)
}

View File

@@ -366,12 +366,6 @@ func errorMessage(fe validator.FieldError) string {
prefix,
fe.Field(),
joinValues(ipTypeValues))
case "sepTechStatus":
return fmt.Sprintf("%s %s must be one of the following: %s",
prefix,
fe.Field(),
joinValues(sepTechStatusValues))
}
return fe.Error()

View File

@@ -311,10 +311,5 @@ func registerAllValidators(validate *validator.Validate) error {
return err
}
err = validate.RegisterValidation("sepTechStatus", sepTechStatusValidator)
if err != nil {
return err
}
return nil
}

View File

@@ -7,7 +7,7 @@ var (
resTypesValues = []string{"compute", "vins", "k8s", "openshift", "lb", "flipgroup"}
protoValues = []string{"tcp", "udp"}
accountCUTypeValues = []string{"CU_M", "CU_C", "CU_D", "CU_DM", "CU_I", "gpu_units"}
accountCUTypeValues = []string{"CU_M", "CU_C", "CU_D", "CU_DM", "CU_S", "CU_A", "CU_NO", "CU_I", "CU_NP"}
bserviceModeValues = []string{"ABSOLUTE", "RELATIVE"}
@@ -66,7 +66,7 @@ var (
loaderTypeValues = []string{"linux", "windows", "unknown"}
sepTypeValues = []string{"hitachi", "dorado", "tatlin", "shared", "local", "des", "ustor"}
sepTypeValues = []string{"hitachi", "dorado", "tatlin", "shared", "local", "des"}
languageValues = []string{"ru", "en"}
@@ -81,8 +81,6 @@ var (
addressPoolNetTypeValues = []string{"IPv4", "IPv6", "MAC"}
ipTypeValues = []string{"v4, v6"}
sepTechStatusValues = []string{"ENABLED", "DISABLED"}
)
const (

View File

@@ -27,8 +27,11 @@ type GetConsumedCloudUnitsByTypeRequest struct {
// - CU_C: returns number of virtual cpu cores
// - CU_D: returns consumed 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
// - gpu_units: return number of GPU units
func (a Account) GetConsumedCloudUnitsByType(ctx context.Context, req GetConsumedCloudUnitsByTypeRequest) (float64, error) {
err := validators.ValidateRequest(req)
if err != nil {

View File

@@ -68,6 +68,9 @@ type ResourceLimits struct {
// RAM size, MB
CUM float64 `json:"CU_M"`
// Traffic volume, GB
CUNP float64 `json:"CU_NP"`
// Number of graphics cores
GPUUnits float64 `json:"gpu_units"`
@@ -147,6 +150,9 @@ type Resource struct {
// Number of External IPs
ExtIPs int64 `json:"extips"`
// External traffic
ExtTraffic int64 `json:"exttraffic"`
// Number of grafic cores
GPU int64 `json:"gpu"`
@@ -548,6 +554,9 @@ type LimitsRG struct {
// Number of External IPs
ExtIPs int64 `json:"extips"`
// External traffic
ExtTraffic int64 `json:"exttraffic"`
// Number of grafic cores
GPU int64 `json:"gpu"`
@@ -556,9 +565,6 @@ type LimitsRG struct {
// SEPs
SEPs uint64 `json:"seps"`
// Policies
Policies map[string]Policy `json:"policies"`
}
// Main information about resource group

View File

@@ -34,6 +34,10 @@ type UpdateRequest struct {
// Required: false
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
// Required: false
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`

View File

@@ -38,6 +38,10 @@ type GroupAddRequest struct {
// Required: true
ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`
// Compute driver like a KVM_X86, etc.
// Required: true
Driver string `url:"driver" json:"driver" validate:"required"`
// Storage endpoint provider ID
// Required: false
SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`
@@ -66,9 +70,8 @@ type GroupAddRequest struct {
// Required: false
UserData string `url:"userData,omitempty" json:"userData,omitempty"`
// Chipset "i440fx" or "Q35
// Default value : Q35
// Required: false
//Chipset "i440fx" or "Q35
//Required: false
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"chipset,omitempty"`
// ID of the chosen storage policy

View File

@@ -22,18 +22,18 @@ type GroupResizeRequest struct {
// Required: true
Count int64 `url:"count" json:"count" validate:"required"`
// Chipset for new computes, either i440fx or Q35 (i440fx by default)
// Available values : i440fx, Q35
// Default value : Q35
// Required: false
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
//Chipset for new computes, either i440fx or Q35 (i440fx by default)
//Available values : i440fx, Q35
//Default value : i440fx
//Required: true
Chipset string `url:"chipset" json:"chipset" validate:"required,chipset"`
// Either delta or absolute value of computes
// Should be one of:
// - ABSOLUTE
// - RELATIVE
// Required: false
Mode string `url:"mode,omitempty" json:"mode,omitempty" validate:"omitempty,bserviceMode"`
// Required: true
Mode string `url:"mode" json:"mode" validate:"bserviceMode"`
}
// GroupResize resize the group by changing the number of computes

View File

@@ -119,8 +119,8 @@ type ItemCompute struct {
// Resource group ID
RGID uint64 `json:"rgId"`
// NodeID
NodeID uint64 `json:"node_id"`
// StackID
StackID uint64 `json:"stackId"`
// Status
Status string `json:"status"`

View File

@@ -38,8 +38,9 @@ type AffinityRuleAddRequest struct {
Key string `url:"key" json:"key" validate:"required"`
// Value that must match the key to be taken into account when analyzing this rule
// Required: true
Value string `url:"value" json:"value" validate:"required"`
// Required: false
// Not required on purpose: despite required tag on platform, empty string is allowed
Value string `url:"value" json:"value"`
}
// AffinityRuleAdd add affinity rule

View File

@@ -38,8 +38,9 @@ type AffinityRuleRemoveRequest struct {
Key string `url:"key" json:"key" validate:"required"`
// Value that must match the key to be taken into account when analyzing this rule
// Required: true
Value string `url:"value" json:"value" validate:"required"`
// Required: false
// Not required on purpose: despite required tag on platform, empty string is allowed
Value string `url:"value" json:"value"`
}
// AffinityRuleRemove remove affinity rule

View File

@@ -38,8 +38,9 @@ type AntiAffinityRuleAddRequest struct {
Key string `url:"key" json:"key" validate:"required"`
// Value that must match the key to be taken into account when analyzing this rule
// Required: true
Value string `url:"value" json:"value" validate:"required"`
// Required: false
// Not required on purpose: despite required tag on platform, empty string is allowed
Value string `url:"value" json:"value"`
}
// AntiAffinityRuleAdd add anti affinity rule

View File

@@ -38,8 +38,9 @@ type AntiAffinityRuleRemoveRequest struct {
Key string `url:"key" json:"key" validate:"required"`
// Value that must match the key to be taken into account when analyzing this rule
// Required: true
Value string `url:"value" json:"value" validate:"required"`
// Required: false
// Not required on purpose: despite required tag on platform, empty string is allowed
Value string `url:"value" json:"value"`
}
// AntiAffinityRuleRemove remove anti affinity rule

View File

@@ -62,7 +62,7 @@ var computes = ListComputes{
MigrationJob: 0,
Milestones: 363500,
Name: "test",
PinnedToNode: true,
PinnedToStack: true,
RAM: 4096,
ReferenceID: "c7cb19ac-af4a-4067-852f-c5572949207e",
Registered: true,
@@ -126,7 +126,7 @@ var computes = ListComputes{
RAM: 4096,
ReferenceID: "a542c449-5b1c-4f90-88c5-7bb5f8ae68ff",
Registered: true,
PinnedToNode: true,
PinnedToStack: true,
ResName: "compute-48556",
RGID: 79727,
RGName: "sdk_negative_fields_test",

View File

@@ -476,8 +476,8 @@ type RecordCompute struct {
// List OS Users
OSUsers ListOSUser `json:"osUsers"`
// Pinned to node
PinnedToNode bool `json:"pinnedToNode"`
// Pinned to stack
PinnedToStack bool `json:"pinnedToStack"`
// PreferredCPU
PreferredCPU []int64 `json:"preferredCpu"`
@@ -485,9 +485,6 @@ type RecordCompute struct {
// Qemu_quest
QemuQuest QemuQuest `json:"qemu_guest"`
// ReadOnly indicates read-only mode state
ReadOnly bool `json:"read_only"`
// Number of RAM
RAM uint64 `json:"ram"`
@@ -789,18 +786,12 @@ type ItemComputeDisk struct {
// Account ID
AccountID uint64 `json:"accountId"`
// BLK Discard
BLKDiscard bool `json:"blkdiscard"`
// Boot partition
BootPartition uint64 `json:"bootPartition"`
// Bus number
BusNumber uint64 `json:"bus_number"`
// Chache
Cache string `json:"cache"`
// Created by
CreatedBy string `json:"createdBy"`
@@ -1160,8 +1151,8 @@ type ItemCompute struct {
//NumaNodeId
NumaNodeId int64 `json:"numaNodeId"`
// Pinned to node
PinnedToNode bool `json:"pinnedToNode"`
// Pinned to stack
PinnedToStack bool `json:"pinnedToStack"`
// PreferredCPU
PreferredCPU []int64 `json:"preferredCpu"`
@@ -1175,9 +1166,6 @@ type ItemCompute struct {
// Qemu_quest
QemuQuest QemuQuest `json:"qemu_guest"`
// ReadOnly indicates read-only mode state
ReadOnly bool `json:"read_only"`
// Reference ID
ReferenceID string `json:"referenceId"`
@@ -1243,9 +1231,6 @@ type ListInfoDisks []InfoDisk
type InfoDisk struct {
// ID
ID uint64 `json:"id"`
// SEP ID
SepID int64 `json:"sepId"`
}
// List information about computes
@@ -1346,8 +1331,8 @@ type ItemPCIDevice struct {
// Resource group ID
RGID uint64 `json:"rgId"`
// Node ID
NodeID uint64 `json:"nodeId"`
// Stack ID
StackID uint64 `json:"stackId"`
// Status
Status string `json:"status"`

View File

@@ -20,7 +20,7 @@ type NetAttachRequest struct {
// 'VFNIC' for connect to vfpool
// 'DPDK' for connect to DPDK
// `EMPTY` for connect empty network
// `SDN` for connect to SDN
// `SDT` for connect to SDN
// `TRUNK` for connect to TRUNK
// Required: true
NetType string `url:"netType" json:"netType" validate:"computex86NetType"`
@@ -45,27 +45,6 @@ type NetAttachRequest struct {
// Required: false
MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty" validate:"omitempty,mtu"`
// Net mask
// Used only to DPDK or VFNIC net type
// Required: false
NetMask uint64 `url:"netMask,omitempty" json:"netMask,omitempty"`
// SDN Segment ID
// Required: false
SDNSegmentID string `url:"sdn_segment_id,omitempty" json:"sdn_segment_id,omitempty"`
// SDN Object Group ID
// Required: false
SDNObjectGroupID string `url:"sdn_object_group_id,omitempty" json:"sdn_object_group_id,omitempty"`
// SDN Logical Port Display Name
// Required: false
SDNLogicalPortDisplayName string `url:"sdn_logical_port_display_name,omitempty" json:"sdn_logical_port_display_name,omitempty"`
// SDN Logical Port Description
// Required: false
SDNLogicalPortDescription string `url:"sdn_logical_port_description,omitempty" json:"sdn_logical_port_description,omitempty"`
// Unique identifier of logical port on SDN side
// Required: false
SDNInterfaceID string `url:"sdn_interface_id,omitempty" json:"sdn_interface_id,omitempty" validate:"omitempty"`

View File

@@ -8,8 +8,8 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// PinToNodeRequest struct to pin compute to node
type PinToNodeRequest struct {
// PinToStackRequest struct to pin compute to stack
type PinToStackRequest struct {
// ID of the compute instance
// Required: true
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
@@ -20,14 +20,14 @@ type PinToNodeRequest struct {
AutoStart bool `url:"autoStart" json:"autoStart"`
}
// PinToNode pin compute to current node
func (c Compute) PinToNode(ctx context.Context, req PinToNodeRequest) (bool, error) {
// PinToStack pin compute to current stack
func (c Compute) PinToStack(ctx context.Context, req PinToStackRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/compute/pin_to_node"
url := "/cloudapi/compute/pinToStack"
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {

View File

@@ -16,12 +16,12 @@ type RedeployRequest struct {
// Storage policy id of compute. The rules of the specified storage policy will be used.
// Required: true
StoragePolicyID uint64 `url:"storage_policy_id,omitempty" json:"storage_policy_id,omitempty"`
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
// ID of the new OS image, if image change is required
// Required: false
ImageID uint64 `url:"imageId,omitempty" json:"imageId,omitempty"`
// The OS version that will be installed on the virtual machine
// Required: false
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`

View File

@@ -8,21 +8,21 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// UnpinFromNodeRequest struct for unpin from node
type UnpinFromNodeRequest struct {
// UnpinFromStackRequest struct for unpin from stack
type UnpinFromStackRequest struct {
// ID of the compute instance
// Required: true
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
}
// UnpinFromNode unpins compute from current node
func (c Compute) UnpinFromNode(ctx context.Context, req UnpinFromNodeRequest) (bool, error) {
// UnpinFromStack unpins compute from current stack
func (c Compute) UnpinFromStack(ctx context.Context, req UnpinFromStackRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/compute/unpin_from_node"
url := "/cloudapi/compute/unpinFromStack"
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {

View File

@@ -11,9 +11,6 @@ type ItemDisk struct {
// Account name
AccountName string `json:"accountName"`
// BLK Discard
BLKDiscard bool `json:"blkdiscard"`
// Computes
Computes map[string]string `json:"computes"`
@@ -142,12 +139,12 @@ type ItemDisk struct {
// Updated by
UpdatedBy string `json:"updatedBy"`
// Cache mode of disk
Cache string `json:"cache"`
}
type ItemDiskUnattached struct {
// CKey
CKey string `json:"_ckey"`
// Meta
Meta []interface{} `json:"_meta"`
@@ -160,15 +157,9 @@ type ItemDiskUnattached struct {
// Access Control List
ACL map[string]interface{} `json:"acl"`
// BLK Discard
BLKDiscard bool `json:"blkdiscard"`
// Boot Partition
BootPartition uint64 `json:"bootPartition"`
// Cache
Cache string `json:"cache"`
// Created time
CreatedTime uint64 `json:"createdTime"`
@@ -384,9 +375,6 @@ type RecordDisk struct {
// Account name
AccountName string `json:"accountName"`
// BLK Discard
BLKDiscard bool `json:"blkdiscard"`
// Computes
Computes map[string]string `json:"computes"`
@@ -515,9 +503,6 @@ type RecordDisk struct {
// Updated by
UpdatedBy string `json:"updatedBy"`
// Cache mode of disk
Cache string `json:"cache"`
}
type ItemReplication struct {

View File

@@ -34,6 +34,10 @@ type ListRequest struct {
// Required: false
AccountId uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
// Find by resource group ID
// Required: false
RGID uint64 `url:"rgId,omitempty" json:"rgId,omitempty"`
// Find by id
// Required: false
ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`

View File

@@ -85,6 +85,12 @@ type RecordFLIPGroup struct {
// Network
Network string `json:"network"`
// Resource group ID
RGID uint64 `json:"rgId"`
// Resource group name
RGName string `json:"rgName"`
// Status
Status string `json:"status"`

View File

@@ -92,6 +92,9 @@ type RecordImage struct {
// UNCPathj
UNCPath string `json:"UNCPath"`
// CKey
CKey string `json:"_ckey"`
// Account ID
AccountID uint64 `json:"accountId"`

View File

@@ -169,7 +169,6 @@ type CreateRequest struct {
// Type of the emulated system, Q35 or i440fx
// Required: false
// Default: Q35
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
// Zone ID

View File

@@ -24,7 +24,6 @@ type WorkerAddRequest struct {
// Type of the emulated system, Q35 or i440fx
// Required: false
// Default: Q35
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
}

View File

@@ -66,7 +66,6 @@ type WorkersGroupAddRequest struct {
// Type of the emulated system, Q35 or i440fx
// Required: false
// Default: Q35
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
}

View File

@@ -35,31 +35,10 @@ type Interface struct {
// Required: false
MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty" validate:"omitempty,mtu"`
// Net mask
// Used only to DPDK or VFNIC net type
// Required: false
NetMask uint64 `url:"netMask,omitempty" json:"netMask,omitempty"`
// MAC address to assign to this VM when connecting to the specified network
// Required: false
MAC string `url:"mac,omitempty" json:"mac,omitempty" validate:"omitempty"`
// SDN Segment ID
// Required: false
SDNSegmentID string `url:"sdn_segment_id,omitempty" json:"sdn_segment_id,omitempty"`
// SDN Object Group ID
// Required: false
SDNObjectGroupID string `url:"sdn_object_group_id,omitempty" json:"sdn_object_group_id,omitempty"`
// SDN Logical Port Display Name
// Required: false
SDNLogicalPortDisplayName string `url:"sdn_logical_port_display_name,omitempty" json:"sdn_logical_port_display_name,omitempty"`
// SDN Logical Port Description
// Required: false
SDNLogicalPortDescription string `url:"sdn_logical_port_description,omitempty" json:"sdn_logical_port_description,omitempty"`
// SDN interface id
// Required: false
SDNInterfaceID string `url:"sdn_interface_id,omitempty" json:"sdn_interface_id,omitempty"`
@@ -210,7 +189,6 @@ type CreateRequest struct {
// Type of the emulated system, Q35 or i440fx
// Required: false
// Default: Q35
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

View File

@@ -63,27 +63,8 @@ type CreateBlankRequest struct {
// Type of the emulated system, Q35 or i440fx
// Required: false
// Default: Q35
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
// Required: false
Description string `url:"desc,omitempty" json:"desc,omitempty"`

View File

@@ -38,8 +38,8 @@ type CreateRequest struct {
HighlyAvailable bool `url:"highlyAvailable,omitempty" json:"highlyAvailable,omitempty"`
// Start now Load balancer
// Required: false
Start interface{} `url:"start,omitempty" json:"start,omitempty" validate:"omitempty,isBool"`
// Required: true
Start bool `url:"start" json:"start" validate:"required"`
// Text description of this load balancer
// Required: false

View File

@@ -29,8 +29,8 @@ type ItemPCIDevice struct {
// Resource group ID
RGID uint64 `json:"rgId"`
// Node ID
NodeID uint64 `json:"nodeId"`
// Stack ID
StackID uint64 `json:"stackId"`
// Status
Status string `json:"status"`
@@ -47,3 +47,4 @@ type ListPCIDevices struct {
// Entry count
EntryCount uint64 `json:"entryCount"`
}

View File

@@ -39,6 +39,10 @@ type CreateRequest struct {
// Required: false
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
// Required: false
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`

View File

@@ -34,6 +34,7 @@ var rgs = ListResourceGroups{
CUC: -1,
CUI: -1,
CUM: -1,
CUNP: -1,
GPUUnits: -1,
},
Secret: "",
@@ -75,6 +76,7 @@ var rgs = ListResourceGroups{
CUC: -1,
CUI: -1,
CUM: -1,
CUNP: -1,
GPUUnits: -1,
},
Secret: "",
@@ -116,6 +118,7 @@ var rgs = ListResourceGroups{
CUC: -1,
CUI: -1,
CUM: -1,
CUNP: -1,
GPUUnits: -1,
},
Secret: "",

View File

@@ -14,6 +14,9 @@ type Resource struct {
// Number of External IPs
ExtIPs int64 `json:"extips"`
// External traffic
ExtTraffic int64 `json:"exttraffic"`
// Number of grafic cores
GPU int64 `json:"gpu"`
@@ -306,6 +309,9 @@ type ResourceLimits struct {
// CUM
CUM float64 `json:"CU_M"`
// CUNP
CUNP float64 `json:"CU_NP"`
// GPU units
GPUUnits float64 `json:"gpu_units"`
@@ -843,6 +849,9 @@ type RecordResourceUsage struct {
// Number of external IPs
ExtIPs uint64 `json:"extips"`
// ExtraTraffic
ExtraTraffic uint64 `json:"exttraffic"`
// Number of GPU
GPU uint64 `json:"gpu"`

View File

@@ -35,6 +35,10 @@ type UpdateRequest struct {
// Required: false
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
// Required: false
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`

View File

@@ -7,7 +7,7 @@ type SecurityGroup struct {
client interfaces.Caller
}
// Builder for security policy endpoint
// Builder for stack endpoint
func New(client interfaces.Caller) *SecurityGroup {
return &SecurityGroup{
client: client,

10
pkg/cloudapi/stack.go Normal file
View File

@@ -0,0 +1,10 @@
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)
}

46
pkg/cloudapi/stack/get.go Normal file
View File

@@ -0,0 +1,46 @@
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
}

10
pkg/cloudapi/stack/ids.go Normal file
View File

@@ -0,0 +1,10 @@
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
}

View File

@@ -0,0 +1,71 @@
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
}

View File

@@ -0,0 +1,53 @@
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"`
}

View File

@@ -0,0 +1,16 @@
// 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,
}
}

View File

@@ -56,10 +56,6 @@ type ListRequest struct {
// Search by pool name
// Required: false
PoolName string `url:"pool_name,omitempty" json:"pool_name,omitempty"`
// Filter SEP's by tech status (ENABLED, DISABLED)
// Required: false
SepTechStatus string `url:"sep_tech_status,omitempty" json:"sep_tech_status,omitempty" validate:"omitempty,sepTechStatus"`
}
// List gets list of storage policies as a ListStoragePolicies struct

View File

@@ -77,9 +77,6 @@ type AccessSEPPool struct {
// Pool names
PoolNames []string `json:"pool_names"`
// Technical status of the SEP
SepTechStatus string `json:"sep_tech_status"`
}
type Usage struct {

View File

@@ -7,7 +7,7 @@ type StPolicy struct {
client interfaces.Caller
}
// Builder for storage policy endpoint
// Builder for stack endpoint
func New(client interfaces.Caller) *StPolicy {
return &StPolicy{
client: client,

View File

@@ -29,9 +29,6 @@ type ItemTrunk struct {
// MAC
MAC string `json:"mac"`
// MTU
MTU uint64 `json:"mtu"`
// Name of a trunk
Name string `json:"name"`

View File

@@ -156,6 +156,9 @@ type Resources struct {
// ExtIPs
ExtIPs uint64 `json:"extips"`
// ExtTraffic
ExtTraffic uint64 `json:"exttraffic"`
// GPU
GPU uint64 `json:"gpu"`

View File

@@ -251,8 +251,8 @@ type RecordResources struct {
// Number of RAM
RAM uint64 `json:"ram"`
// Node ID
NodeID uint64 `json:"node_id"`
// Stack ID
StackID uint64 `json:"stackId"`
// UUID
UUID string `json:"uuid"`

View File

@@ -10,9 +10,6 @@ type ListZones struct {
// Detailed information about the zone record
type RecordZone struct {
// If true, all nodes belonging to the given zone will be marked for autostart
AutoStart bool `json:"autostart"`
// ID
ID uint64 `json:"id"`

View File

@@ -43,6 +43,10 @@ type CreateRequest struct {
// Required: false
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
// Required: false
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`

View File

@@ -71,6 +71,9 @@ type Resource struct {
// Number of External IPs
ExtIPs int64 `json:"extips"`
// External traffic
ExtTraffic int64 `json:"exttraffic"`
// Number of grafic cores
GPU int64 `json:"gpu"`
@@ -140,6 +143,9 @@ type ResourceLimits struct {
// CuM
CuM float64 `json:"CU_M"`
// CuNP
CuNP float64 `json:"CU_NP"`
// GPUUnits
GPUUnits float64 `json:"gpu_units"`
@@ -474,6 +480,9 @@ type Limits struct {
// External IPs
ExtIPs int64 `json:"extips"`
// External traffic
ExtTraffic int64 `json:"exttraffic"`
// Number of GPU
GPU int64 `json:"gpu"`
@@ -482,9 +491,6 @@ type Limits struct {
// SEPs number
SEPs uint64 `json:"seps"`
// Policies
Policies map[string]Policy `json:"policies"`
}
// Resources of resource group

View File

@@ -35,6 +35,10 @@ type UpdateRequest struct {
// Required: false
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
// Required: false
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`

View File

@@ -158,6 +158,7 @@ type CloudBrokerEndpoints struct {
Machine []string `json:"machine,omitempty"`
Metering []string `json:"metering,omitempty"`
Milestones []string `json:"milestones,omitempty"`
Node []string `json:"node,omitempty"`
Openshift []string `json:"openshift,omitempty"`
OpenshiftCI []string `json:"openshiftci,omitempty"`
Ovsnode []string `json:"ovsnode,omitempty"`
@@ -168,7 +169,7 @@ type CloudBrokerEndpoints struct {
Resmon interface{} `json:"resmon,omitempty"`
RG []string `json:"rg,omitempty"`
Sep []string `json:"sep,omitempty"`
Node []string `json:"node,omitempty"`
Stack []string `json:"stack,omitempty"`
Tasks []string `json:"tasks,omitempty"`
TLock []string `json:"tlock,omitempty"`
User []string `json:"user,omitempty"`

View File

@@ -4,7 +4,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/audit"
)
// Accessing the Audit method group
// Accessing the Stack method group
func (cb *CloudBroker) Audit() *audit.Audit {
return audit.New(cb.client)
}

View File

@@ -95,15 +95,6 @@ type RecordAudit struct {
// TTL
TTL string `json:"_ttl"`
// Resgroup ID
ResgroupID uint64 `json:"resgroup_id"`
// Account ID
AccountID uint64 `json:"account_id"`
// Compute ID
ComputeID uint64 `json:"compute_id"`
}
// List of Linked Jobs

View File

@@ -14,9 +14,6 @@ type RestoreDiskFromBackupRequest struct {
// Compute ID
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
// Node ID
NodeID uint64 `url:"nodeId,omitempty" json:"nodeId,omitempty"`
// Disk ID
DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`

View File

@@ -25,9 +25,6 @@ type RestoreDisksFromBackupRequest struct {
// Compute ID
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
// Node ID
NodeID uint64 `url:"nodeId,omitempty" json:"nodeId,omitempty"`
//Backup files
BackupFiles []BackupFile `url:"disks" json:"disks" validate:"required,dive"`
}

View File

@@ -38,6 +38,10 @@ type GroupAddRequest struct {
// Required: true
ImageID uint64 `url:"imageId" json:"imageId" validate:"required"`
// Compute driver like a KVM_X86, etc.
// Required: true
Driver string `url:"driver" json:"driver" validate:"required"`
// Storage endpoint provider ID
// Required: false
SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`
@@ -66,9 +70,8 @@ type GroupAddRequest struct {
// Required: false
UserData string `url:"userData,omitempty" json:"userData,omitempty"`
// Chipset "i440fx" or "Q35
// Default value : Q35
// Required: false
//Chipset "i440fx" or "Q35
//Required: false
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"chipset"`
// ID of the chosen storage policy

View File

@@ -22,18 +22,18 @@ type GroupResizeRequest struct {
// Required: true
Count int64 `url:"count" json:"count" validate:"required"`
// Chipset for new computes, either i440fx or Q35 (i440fx by default)
// Available values : i440fx, Q35
// Default value : Q35
// Required: false
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
//Chipset for new computes, either i440fx or Q35 (i440fx by default)
//Available values : i440fx, Q35
//Default value : i440fx
//Required: true
Chipset string `url:"chipset" json:"chipset" validate:"required,chipset"`
// Either delta or absolute value of computes
// Should be one of:
// - ABSOLUTE
// - RELATIVE
// Required: false
Mode string `url:"mode,omitempty" json:"mode,omitempty" validate:"omitempty,bserviceMode"`
// Required: true
Mode string `url:"mode" json:"mode" validate:"bserviceMode"`
}
// GroupResize resize the group by changing the number of computes

View File

@@ -146,8 +146,8 @@ type ItemCompute struct {
// Resource group ID
RGID uint64 `json:"rgId"`
// NodeID
NodeID uint64 `json:"node_id"`
// StackID
StackID uint64 `json:"stackId"`
// Status
Status string `json:"status"`

View File

@@ -40,8 +40,9 @@ type AffinityRuleAddRequest struct {
Key string `url:"key" json:"key" validate:"required"`
// Value that must match the key to be taken into account when analyzing this rule
// Required: true
Value string `url:"value" json:"value" validate:"required"`
// Required: false
// Not required on purpose: despite required tag on platform, empty string is allowed
Value string `url:"value" json:"value"`
}
// AffinityRuleAdd adds affinity rule

View File

@@ -38,8 +38,9 @@ type AffinityRuleRemoveRequest struct {
Key string `url:"key" json:"key" validate:"required"`
// Value that must match the key to be taken into account when analyzing this rule
// Required: true
Value string `url:"value" json:"value" validate:"required"`
// Required: false
// Not required on purpose: despite required tag on platform, empty string is allowed
Value string `url:"value" json:"value"`
}
// AffinityRuleRemove remove affinity rule

View File

@@ -38,8 +38,9 @@ type AntiAffinityRuleAddRequest struct {
Key string `url:"key" json:"key" validate:"required"`
// Value that must match the key to be taken into account when analyzing this rule
// Required: true
Value string `url:"value" json:"value" validate:"required"`
// Required: false
// Not required on purpose: despite required tag on platform, empty string is allowed
Value string `url:"value" json:"value"`
}
// AntiAffinityRuleAdd adds anti affinity rule

View File

@@ -38,8 +38,9 @@ type AntiAffinityRuleRemoveRequest struct {
Key string `url:"key" json:"key" validate:"required"`
// Value that must match the key to be taken into account when analyzing this rule
// Required: true
Value string `url:"value" json:"value" validate:"required"`
// Required: false
// Not required on purpose: despite required tag on platform, empty string is allowed
Value string `url:"value" json:"value"`
}
// AntiAffinityRuleRemove removes anti affinity rule

View File

@@ -1,41 +0,0 @@
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
}

View File

@@ -12,7 +12,7 @@ import (
type GetCloneStatusRequest struct {
// ID of compute instance
// Required: true
ComputeID string `url:"compute_id" json:"compute_id" validate:"required"`
ComputeID uint64 `url:"compute_id" json:"compute_id" validate:"required"`
}
// GetCloneStatus gets information about compute clone status as a RecordCloneStatus struct

View File

@@ -58,14 +58,6 @@ type DiskAddRequest struct {
// Desired bus number (hex string, e.g. "0x03")
// Required: false
BusNumber string `url:"bus_number,omitempty" json:"bus_number,omitempty"`
// Disk cache mode
// Required: false
Cache string `url:"cache,omitempty" json:"cache,omitempty"`
// BLK Discard
// Required: false
BLKDiscard interface{} `url:"blkdiscard,omitempty" json:"blkdiscard,omitempty" validate:"omitempty,isBool"`
}
// DiskAdd creates new disk and attach to compute

View File

@@ -65,7 +65,7 @@ var computes = ListComputes{
MigrationJob: 0,
Milestones: 363500,
Name: "test",
PinnedToNode: 1,
PinnedToStack: 1,
RAM: 4096,
ReferenceID: "c7cb19ac-af4a-4067-852f-c5572949207e",
Registered: true,
@@ -127,7 +127,7 @@ var computes = ListComputes{
MigrationJob: 0,
Milestones: 363853,
Name: "compute_2",
PinnedToNode: 1,
PinnedToStack: 1,
RAM: 4096,
ReferenceID: "a542c449-5b1c-4f90-88c5-7bb5f8ae68ff",
Registered: true,

View File

@@ -42,17 +42,17 @@ type ListRequest struct {
// Required: false
IPAddress string `url:"ipAddress,omitempty" json:"ipAddress,omitempty"`
// Find by node ID
// Find by stack ID
// Required: false
NodeID uint64 `url:"node_id,omitempty" json:"node_id,omitempty"`
StackID uint64 `url:"stackId,omitempty" json:"stackId,omitempty"`
// Find by CD image ID
// Required: false
CDImageID uint64 `url:"cdImageId,omitempty" json:"cdImageId,omitempty"`
// Find by node name
// Find by stack name
// Required: false
NodeName string `url:"nodeName,omitempty" json:"nodeName,omitempty"`
StackName string `url:"stackName,omitempty" json:"stackName,omitempty"`
// Find by external network name
// Required: false

View File

@@ -15,9 +15,9 @@ type MigrateRequest struct {
// Required: true
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
// Particular Node ID to migrate this compute to
// Particular Stack ID to migrate this compute to
// Required: false
TargetNodeID uint64 `url:"targetNodeId,omitempty" json:"targetNodeId,omitempty"`
TargetStackID uint64 `url:"targetStackId,omitempty" json:"targetStackId,omitempty"`
// If live migration fails, destroy compute
// on source node and recreate on the target
@@ -30,7 +30,7 @@ type AsyncWrapperMigrateRequest struct {
SyncMode bool `url:"sync"`
}
// Migrate migrates compute to another node
// Migrate migrates compute to another stack
func (c Compute) Migrate(ctx context.Context, req MigrateRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
@@ -54,7 +54,7 @@ func (c Compute) Migrate(ctx context.Context, req MigrateRequest) (bool, error)
return result, nil
}
// AsyncMigrate migrates compute to another node in async mode
// AsyncMigrate migrates compute to another stack in async mode
func (c Compute) AsyncMigrate(ctx context.Context, req MigrateRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {

View File

@@ -22,9 +22,9 @@ type MigrateStorageRequest struct {
// Required: true
PoolName string `url:"poolName" json:"poolName" validate:"required"`
// Target node ID
// Target stack ID
// Required: true
NodeID uint64 `url:"node_id" json:"node_id" validate:"required"`
StackID uint64 `url:"stackId" json:"stackId" validate:"required"`
// Async API call
// Required: true
@@ -32,7 +32,7 @@ type MigrateStorageRequest struct {
}
// MigrateStorage gets complex compute migration
// Compute will be migrated to specified node, and compute disks will
// Compute will be migrated to specified stack, and compute disks will
// be migrated to specified SEP to specified pool.
// This action can take up to 84 hours
func (c Compute) MigrateStorage(ctx context.Context, req MigrateStorageRequest) (string, error) {

View File

@@ -391,18 +391,12 @@ type ItemDisk struct {
// Access Control List
ACL ItemACL `json:"acl"`
// BLK Discard
BLKDiscard bool `json:"blkdiscard"`
// Boot partition
BootPartition uint64 `json:"bootPartition"`
// Bus number
BusNumber uint64 `json:"bus_number"`
// Chache
Cache string `json:"cache"`
// Created by
CreatedBy string `json:"createdBy"`
@@ -810,8 +804,8 @@ type InfoCompute struct {
// Name of OS
OSVersion string `json:"os_version"`
// Pinned to node
PinnedToNode int64 `json:"pinnedToNode"`
// Pinned to stack
PinnedToStack int64 `json:"pinnedToStack"`
// PreferredCPU
PreferredCPU []int64 `json:"preferredCpu"`
@@ -819,9 +813,6 @@ type InfoCompute struct {
// Qemu_quest
QemuQuest QemuQuest `json:"qemu_guest"`
// ReadOnly indicates read-only mode state
ReadOnly bool `json:"read_only"`
// Number of RAM
RAM uint64 `json:"ram"`
@@ -846,11 +837,11 @@ type InfoCompute struct {
// SnapSets
SnapSets ListSnapshots `json:"snapSets"`
// Node ID
NodeID uint64 `json:"node_id"`
// Stack ID
StackID uint64 `json:"stackId"`
// Node name
NodeName string `json:"nodeName"`
// Stack name
StackName string `json:"stackName"`
// Stateless SEP ID
StatelessSEPID int64 `json:"statelessSepId"`
@@ -1064,6 +1055,9 @@ type RecordCompute struct {
// Name
Name string `json:"name"`
// Node ID
NodeID uint64 `json:"nodeId"`
// Natable VINS ID
NatableVINSID uint64 `json:"natableVinsId"`
@@ -1097,8 +1091,8 @@ type RecordCompute struct {
// Name of OS
OSVersion string `json:"os_version"`
// Pinned to node
PinnedToNode int64 `json:"pinnedToNode"`
// Pinned to stack
PinnedToStack int64 `json:"pinnedToStack"`
// PreferredCPU
PreferredCPU []int64 `json:"preferredCpu"`
@@ -1106,9 +1100,6 @@ type RecordCompute struct {
// Qemu_quest
QemuQuest QemuQuest `json:"qemu_guest"`
// ReadOnly indicates read-only mode state
ReadOnly bool `json:"read_only"`
// Number of RAM
RAM uint64 `json:"ram"`
@@ -1133,11 +1124,11 @@ type RecordCompute struct {
// SnapSets
SnapSets ListSnapshots `json:"snapSets"`
// Node ID
NodeID uint64 `json:"node_id"`
// Stack ID
StackID uint64 `json:"stackId"`
// Node name
NodeName string `json:"nodeName"`
// Stack name
StackName string `json:"stackName"`
// Stateless SEP ID
StatelessSEPID int64 `json:"statelessSepId"`
@@ -1177,9 +1168,6 @@ type RecordCompute struct {
// Zone ID
ZoneID uint64 `json:"zoneId"`
//todo
_ uint64 `json:"nodeId"`
}
type LoaderMetaIso struct {
@@ -1289,9 +1277,6 @@ type ItemDeletedCompute struct {
type InfoDisk struct {
// ID
ID uint64 `json:"id"`
// SEP ID
SepID int64 `json:"sepId"`
}
// List computes
@@ -1353,8 +1338,8 @@ type ItemPCIDevice struct {
// Resource group ID
RGID uint64 `json:"rgId"`
// Node ID
NodeID uint64 `json:"nodeId"`
// Stack ID
StackID uint64 `json:"stackId"`
// Status
Status string `json:"status"`
@@ -1456,14 +1441,14 @@ type MigrateStorageItem struct {
// Migration process log
Log []string `json:"log"`
// Source node ID
SourceNodeID uint64 `json:"sourceNodeId"`
// Source stack ID
SourceStackID uint64 `json:"sourceStackId"`
// Migration status
Status string `json:"status"`
// Target node ID
TargetNodeID uint64 `json:"targetNodeId"`
// Target stack ID
TargetStackID uint64 `json:"targetStackId"`
}
type RecordCloneStatus struct {

View File

@@ -20,7 +20,7 @@ type NetAttachRequest struct {
// 'VFNIC' for connect to vfpool
// 'DPDK' for connect to DPDK
// `EMPTY` for connect empty network
// `SDN` for connect to SDN
// `SDT` for connect to SDN
// `TRUNK` for connect to TRUNK
// Required: true
NetType string `url:"netType" json:"netType" validate:"computex86NetType"`
@@ -45,27 +45,6 @@ type NetAttachRequest struct {
// Required: false
MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty" validate:"omitempty,mtu"`
// Net mask
// Used only to DPDK or VFNIC net type
// Required: false
NetMask uint64 `url:"netMask,omitempty" json:"netMask,omitempty"`
// SDN Segment ID
// Required: false
SDNSegmentID string `url:"sdn_segment_id,omitempty" json:"sdn_segment_id,omitempty"`
// SDN Object Group ID
// Required: false
SDNObjectGroupID string `url:"sdn_object_group_id,omitempty" json:"sdn_object_group_id,omitempty"`
// SDN Logical Port Display Name
// Required: false
SDNLogicalPortDisplayName string `url:"sdn_logical_port_display_name,omitempty" json:"sdn_logical_port_display_name,omitempty"`
// SDN Logical Port Description
// Required: false
SDNLogicalPortDescription string `url:"sdn_logical_port_description,omitempty" json:"sdn_logical_port_description,omitempty"`
// Unique identifier of logical port on SDN side
// Required: false
SDNInterfaceID string `url:"sdn_interface_id,omitempty" json:"sdn_interface_id,omitempty" validate:"omitempty"`

View File

@@ -8,15 +8,15 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// PinToNodeRequest struct to pin compute to node
type PinToNodeRequest struct {
// PinToStackRequest struct to pin compute to stack
type PinToStackRequest struct {
// ID of the compute instance
// Required: true
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
// Node ID to pin to
// Stack ID to pin to
// Required: false
TargetNodeID uint64 `url:"targetNodeId" json:"targetNodeId"`
TargetStackID uint64 `url:"targetStackId" json:"targetStackId"`
// Try to migrate or not if compute in running states
// Required: false
@@ -28,14 +28,14 @@ type PinToNodeRequest struct {
AutoStart bool `url:"autoStart" json:"autoStart"`
}
// PinToNode pins compute to current node
func (c Compute) PinToNode(ctx context.Context, req PinToNodeRequest) (uint64, error) {
// PinToStack pins compute to current stack
func (c Compute) PinToStack(ctx context.Context, req PinToStackRequest) (uint64, error) {
err := validators.ValidateRequest(req)
if err != nil {
return 0, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/compute/pin_to_node"
url := "/cloudbroker/compute/pinToStack"
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {

View File

@@ -24,7 +24,7 @@ type RedeployRequest struct {
// Storage policy id of compute. The rules of the specified storage policy will be used.
// Required: true
StoragePolicyID uint64 `url:"storage_policy_id,omitempty" json:"storage_policy_id,omitempty"`
StoragePolicyID uint64 `url:"storage_policy_id" json:"storage_policy_id" validate:"required"`
// New size for the boot disk in GB, if boot disk size change is required
// Required: false

View File

@@ -18,9 +18,9 @@ type StartRequest struct {
// Required: false
AltBootID uint64 `url:"altBootId,omitempty" json:"altBootId,omitempty"`
// ID of node to start compute
// ID of stack to start compute
// Required: false
NodeID uint64 `url:"node_id,omitempty" json:"node_id,omitempty"`
StackID uint64 `url:"stackId,omitempty" json:"stackId,omitempty"`
}
// Start starts compute

View File

@@ -13,9 +13,9 @@ type StartMigrationINRequest struct {
// Required: true
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
// ID of the node where the compute will be staged for migration-in
// ID of the stack where the compute will be staged for migration-in
// Required: false
NodeID uint64 `url:"node_id,omitempty" json:"node_id,omitempty"`
StackID uint64 `url:"stackId,omitempty" json:"stackId,omitempty"`
}
// StartMigrationIN starts compute for external migration in

View File

@@ -33,11 +33,7 @@ type StartMigrationOutRequest struct {
// Mapping of guest disk target names to absolute paths on the destination host.
// Required: false
DiskMap map[string]string `url:"diskmap,omitempty" json:"diskmap,omitempty"`
// Mapping of network interfaces
// Required: false
NetMap map[string]string `url:"netmap,omitempty" json:"netmap,omitempty"`
Diskmap map[string]string `url:"diskmap,omitempty" json:"diskmap,omitempty"`
// Mapping for CD/DVD devices or their source paths to new ISO/device paths on the destination
// Required: false

View File

@@ -8,21 +8,21 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// UnpinFromNodeRequest struct to unpin from node
type UnpinFromNodeRequest struct {
// UnpinFromStackRequest struct to unpin from stack
type UnpinFromStackRequest struct {
// ID of the compute instance
// Required: true
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
}
// UnpinFromNode unpins compute from current node
func (c Compute) UnpinFromNode(ctx context.Context, req UnpinFromNodeRequest) (bool, error) {
// UnpinFromStack unpins compute from current stack
func (c Compute) UnpinFromStack(ctx context.Context, req UnpinFromStackRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/compute/unpin_from_node"
url := "/cloudbroker/compute/unpinFromStack"
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {

View File

@@ -37,14 +37,6 @@ type CreateRequest struct {
// Pool name to create disk
// Required: false
Pool string `url:"pool,omitempty" json:"pool,omitempty"`
// Cache mode of disk
// Required: false
Cache string `url:"cache,omitempty" json:"cache,omitempty"`
// BLK Discard
// Required: false
BLKDiscard interface{} `url:"blkdiscard,omitempty" json:"blkdiscard,omitempty" validate:"omitempty,isBool"`
}
// Create creates a disk

View File

@@ -53,9 +53,6 @@ type InfoDisk struct {
// Access Control Control
ACL map[string]interface{} `json:"acl"`
// BLK Discard
BLKDiscard bool `json:"blkdiscard"`
// Boot partition
BootPartition uint64 `json:"bootPartition"`
@@ -190,9 +187,6 @@ type InfoDisk struct {
// Updated by
UpdatedBy string `json:"updatedBy"`
// Cache mode of disk
Cache string `json:"cache"`
}
type ItemReplication struct {
@@ -267,6 +261,9 @@ type SearchListDisks []ItemDisk
// Main information about unattached disk
type ItemUnattachedDisk struct {
// CKey
CKey string `json:"_ckey"`
// Meta
Meta []interface{} `json:"_meta"`

View File

@@ -1,46 +0,0 @@
package disks
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// UpdateRequest struct to update disk
type UpdateRequest struct {
// ID of the disk to update
// Required: true
DiskID uint64 `url:"disk_id" json:"disk_id" validate:"required"`
// Cache mode of disk
// Required: false
Cache string `url:"cache,omitempty" json:"cache,omitempty"`
// BLK Discard
// Required: false
BLKDiscard interface{} `url:"blkdiscard,omitempty" json:"blkdiscard,omitempty" validate:"omitempty,isBool"`
}
// Update updates disk
func (d Disks) Update(ctx context.Context, req UpdateRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/disks/update"
res, err := d.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}

View File

@@ -14,9 +14,9 @@ type DeviceMigrateRequest struct {
// Required: true
NetID uint64 `url:"net_id" json:"net_id" validate:"required"`
// Target node ID to migrate to
// Target stack ID to migrate to
// Required: false
NodeID uint64 `url:"node_id,omitempty" json:"node_id,omitempty"`
StackID uint64 `url:"stackId,omitempty" json:"stackId,omitempty"`
// Target device to migrate
// Required: false

View File

@@ -34,6 +34,10 @@ type ListRequest struct {
// Required: false
AccountId uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
// Find by resource group ID
// Required: false
RGID uint64 `url:"rgId,omitempty" json:"rgId,omitempty"`
// Find by id
// Required: false
ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`

View File

@@ -11,7 +11,7 @@ type RecordFLIPGroupCreated struct {
// IP
IP string `json:"ip"`
// Name
// Name
Name string `json:"name"`
// Network mask
@@ -85,6 +85,12 @@ type RecordFLIPGroup struct {
// Network
Network string `json:"network"`
// Resource group ID
RGID uint64 `json:"rgId"`
// Resource group name
RGName string `json:"rgName"`
// Status
Status string `json:"status"`

View File

@@ -11,6 +11,7 @@ var grids = ListGrids{
DiskSize: 976,
DiskSizeMax: 1200,
ExtIPs: 132,
ExtTraffic: 0,
GPU: 79500,
RAM: 0,
SEPs: map[string]map[string]DiskUsage{},
@@ -20,6 +21,7 @@ var grids = ListGrids{
DiskSize: 976,
DiskSizeMax: 1200,
ExtIPs: 132,
ExtTraffic: 0,
GPU: 0,
RAM: 152600,
SEPs: map[string]map[string]DiskUsage{},
@@ -39,6 +41,7 @@ var grids = ListGrids{
DiskSize: 976,
DiskSizeMax: 1200,
ExtIPs: 132,
ExtTraffic: 0,
GPU: 79500,
RAM: 0,
SEPs: map[string]map[string]DiskUsage{},
@@ -48,6 +51,7 @@ var grids = ListGrids{
DiskSize: 976,
DiskSizeMax: 1200,
ExtIPs: 132,
ExtTraffic: 0,
GPU: 0,
RAM: 152600,
SEPs: map[string]map[string]DiskUsage{},
@@ -67,6 +71,7 @@ var grids = ListGrids{
DiskSize: 976,
DiskSizeMax: 1200,
ExtIPs: 132,
ExtTraffic: 0,
GPU: 79500,
RAM: 0,
SEPs: map[string]map[string]DiskUsage{},
@@ -76,6 +81,7 @@ var grids = ListGrids{
DiskSize: 976,
DiskSizeMax: 1200,
ExtIPs: 132,
ExtTraffic: 0,
GPU: 0,
RAM: 152600,
SEPs: map[string]map[string]DiskUsage{},

View File

@@ -43,6 +43,9 @@ type RecordResource struct {
// External IPs
ExtIPs uint64 `json:"extips"`
// External traffic
ExtTraffic uint64 `json:"exttraffic"`
// Number of GPU
GPU uint64 `json:"gpu"`

View File

@@ -15,8 +15,8 @@ type PurgeLogsRequest struct {
GID uint64 `url:"gid" json:"gid" validate:"required"`
// Age of the records to remove, e.g. -1h for records older than 1 hour, -1w - one week, etc
// Required: false
Age string `url:"age,omitempty" json:"age,omitempty"`
// Required: true
Age string `url:"age" json:"age" validate:"required"`
}
// PurgeLogs clear Log and ECO records that are older than the specified age.

View File

@@ -9,6 +9,15 @@ func (li ListImages) IDs() []uint64 {
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
func (lh ListHistory) IDs() []uint64 {
res := make([]uint64, 0, len(lh))

View File

@@ -0,0 +1,65 @@
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
}

View File

@@ -329,6 +329,84 @@ func (r *GUID) UnmarshalJSON(b []byte) error {
// List 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
type Packages struct {
// LibvirtBin

View File

@@ -171,7 +171,6 @@ type CreateRequest struct {
// Type of the emulated system, Q35 or i440fx
// Required: false
// Default: Q35
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
// Zone ID

View File

@@ -24,7 +24,6 @@ type WorkerAddRequest struct {
// Type of the emulated system, Q35 or i440fx
// Required: false
// Default: Q35
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
}

View File

@@ -69,7 +69,6 @@ type WorkersGroupAddRequest struct {
// Type of the emulated system, Q35 or i440fx
// Required: false
// Default: Q35
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
}

View File

@@ -37,11 +37,6 @@ type Interface struct {
// Required: false
MAC string `url:"mac,omitempty" json:"mac,omitempty" validate:"omitempty"`
// Net mask
// Used only to DPDK or VFNIC net type
// Required: false
NetMask uint64 `url:"netMask,omitempty" json:"netMask,omitempty"`
// SDN interface id
// Required: false
SDNInterfaceID string `url:"sdn_interface_id,omitempty" json:"sdn_interface_id,omitempty"`
@@ -57,22 +52,6 @@ type Interface struct {
// Flag indicating whether this interface is enabled (only for VINS, EXTNET, DPDK, SDN, TRUNK)
// Required: false
Enabled interface{} `url:"enabled,omitempty" json:"enabled,omitempty" validate:"omitempty,isBool"`
// SDN Segment ID
// Required: false
SDNSegmentID string `url:"sdn_segment_id,omitempty" json:"sdn_segment_id,omitempty"`
// SDN Object Group ID
// Required: false
SDNObjectGroupID string `url:"sdn_object_group_id,omitempty" json:"sdn_object_group_id,omitempty"`
// SDN Logical Port Display Name
// Required: false
SDNLogicalPortDisplayName string `url:"sdn_logical_port_display_name,omitempty" json:"sdn_logical_port_display_name,omitempty"`
// SDN Logical Port Description
// Required: false
SDNLogicalPortDescription string `url:"sdn_logical_port_description,omitempty" json:"sdn_logical_port_description,omitempty"`
}
// DataDisk detailed struct for DataDisks field in CreateRequest, CreateBlankRequest and MassCreateRequest
@@ -106,14 +85,6 @@ type DataDisk struct {
// Specify image id for create disk from template
// Required: false
ImageID uint64 `url:"imageId,omitempty" json:"imageId,omitempty"`
// Cache mode for disk
// Required: false
Cache string `url:"cache,omitempty" json:"cache,omitempty"`
// BLK Discard
// Required: false
BLKDiscard interface{} `url:"blkdiscard,omitempty" json:"blkdiscard,omitempty" validate:"omitempty,isBool"`
}
// CreateRequest struct to create KVM x86 VM
@@ -189,9 +160,9 @@ type CreateRequest struct {
// Required: false
Start bool `url:"start" json:"start"`
// Node ID
// Stack ID
// Required: false
NodeID uint64 `url:"node_id,omitempty" json:"node_id,omitempty"`
StackID uint64 `url:"stackId,omitempty" json:"stackId,omitempty"`
// System name
// Required: false
@@ -220,7 +191,6 @@ type CreateRequest struct {
// Type of the emulated system, Q35 or i440fx
// Required: false
// Default: Q35
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
@@ -235,14 +205,6 @@ type CreateRequest struct {
// Zone ID
// Required: false
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
// Cache mode for boot disk
// Required: false
BootDiskCache string `url:"boot_disk_cache,omitempty" json:"boot_disk_cache,omitempty"`
// Boot Disk BLK Discard
// Required: false
BootDiskBLKDiscard interface{} `url:"boot_disk_blkdiscard,omitempty" json:"boot_disk_blkdiscard,omitempty" validate:"omitempty,isBool"`
}
// GetRAM returns RAM field values

View File

@@ -67,27 +67,8 @@ type CreateBlankRequest struct {
// Type of the emulated system, Q35 or i440fx
// Required: false
// Default: Q35
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
// Required: false
PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"`
@@ -115,14 +96,6 @@ type CreateBlankRequest struct {
// The OS version that will be installed on the virtual machine
// Required: false
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
// Cache mode for boot disk
// Required: false
BootDiskCache string `url:"boot_disk_cache,omitempty" json:"boot_disk_cache,omitempty"`
// Boot Disk BLK Discard
// Required: false
BootDiskBLKDiscard interface{} `url:"boot_disk_blkdiscard" json:"boot_disk_blkdiscard" validate:"omitempty,isBool"`
}
// GetRAM returns RAM field values

View File

@@ -14,13 +14,9 @@ type InterfaceMassCreate struct {
// - VINS
// - EXTNET
// - TRUNK
// - SDN
// For SDN, one of the fields sdn_interface_id or sdn_segment_id is specified, but not both at the same time
// Required: false
NetType string `url:"netType" json:"netType" validate:"required,massCreateNetType"`
// Network ID for connect
// Required: false
NetID uint64 `url:"netId" json:"netId" validate:"required"`
// IP address to assign to this VM when connecting to the specified network
@@ -51,22 +47,6 @@ type InterfaceMassCreate struct {
// Flag indicating whether this interface is enabled (only for VINS, EXTNET, DPDK, SDN, TRUNK)
// Required: false
Enabled interface{} `url:"enabled,omitempty" json:"enabled,omitempty" validate:"omitempty,isBool"`
// SDN Segment ID
// Required: false
SDNSegmentID string `url:"sdn_segment_id,omitempty" json:"sdn_segment_id,omitempty"`
// SDN Object Group ID
// Required: false
SDNObjectGroupID string `url:"sdn_object_group_id,omitempty" json:"sdn_object_group_id,omitempty"`
// SDN Logical Port Display Name
// Required: false
SDNLogicalPortDisplayName string `url:"sdn_logical_port_display_name,omitempty" json:"sdn_logical_port_display_name,omitempty"`
// SDN Logical Port Description
// Required: false
SDNLogicalPortDescription string `url:"sdn_logical_port_description,omitempty" json:"sdn_logical_port_description,omitempty"`
}
// MassCreateRequest struct to mass create KVM x86
@@ -152,14 +132,6 @@ type MassCreateRequest struct {
// The OS version that will be installed on the virtual machine
// Required: false
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
// Cache mode for boot disk
// Required: false
BootDiskCache string `url:"boot_disk_cache,omitempty" json:"boot_disk_cache,omitempty"`
// Boot Disk BLK Discard
// Required: false
BootDiskBLKDiscard interface{} `url:"boot_disk_blkdiscard" json:"boot_disk_blkdiscard" validate:"omitempty,isBool"`
}
type asyncWrapperMassCreateRequest struct {

Some files were not shown because too many files have changed in this diff Show More