Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cbce7f434f | |||
| e04dc42d2b |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,4 +6,5 @@ cmd/
|
|||||||
tests/platform_upgrade/.env
|
tests/platform_upgrade/.env
|
||||||
tests/platform_upgrade/input.json
|
tests/platform_upgrade/input.json
|
||||||
tests/platform_upgrade/*.txt
|
tests/platform_upgrade/*.txt
|
||||||
|
tests/platform_upgrade/*.log
|
||||||
*.env
|
*.env
|
||||||
|
|||||||
34
CHANGELOG.md
34
CHANGELOG.md
@@ -1,14 +1,40 @@
|
|||||||
## Version 1.9.2
|
## Version 1.10.1
|
||||||
|
|
||||||
### Добавлено
|
### Добавлено
|
||||||
|
|
||||||
#### kvmvm
|
#### compute
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-196 | Опциональное поле `MTU` в структуре `CreateRequest/Interface` в cloudapi/kvmvm и cloudbroker/kvmvm |
|
| BGOS-268 | Вычисляемое поле `PreferredCPU` в моделях `RecordCompute, ItemCompute, InfoCompute` в cloudapi/compute и cloudbroker/compute |
|
||||||
|
| BGOS-268 | Опциональное поле `PreferredCPU` в структурах `ResizeRequest, UpdateRequest` в cloudapi/compute и cloudbroker/compute |
|
||||||
|
|
||||||
|
#### kvmx86
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-268 | Опциональное поле `PreferredCPU` в структурах `CreateRequest, CreateBlankRequest` в cloudapi/kvmx86 и cloudbroker/kvmx86 |
|
||||||
|
|
||||||
|
#### node
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-270 | Вычисляемые поля `DPDK, UEFIFirmwareFile` в модели `ItemNode` в cloudbroker/node |
|
||||||
|
| BGOS-271 | Вычисляемые поля `DPDK, NetworkMode, ToActive, ToInstalling, ToMaintenance, ToRestricted` в моделях `RecordNode` в cloudbroker/node |
|
||||||
|
|
||||||
|
#### sep
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-273 | Вычисляемое поле `MultipathNum` в модели `RecordSEP` cloudbroker/sep |
|
||||||
|
|
||||||
|
#### vins
|
||||||
|
| Идентификатор<br>задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-265 | Вычисляемое поле `AccoundID` в модели `ItemReservation` в cloudbroker/vins |
|
||||||
|
|
||||||
### Удалено
|
### Удалено
|
||||||
|
|
||||||
|
#### sep
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-197 | Readme-файл `README_EN.md` |
|
| BGOS-272 | Вычисляемые поля `_ckey,_meta` в модели `RecordSEP` в cloudbroker/sep |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ Decort SDK - это библиотека, написанная на языке G
|
|||||||
- Версия 1.7.х Decort-SDK соответствует 3.8.9 версии платформы
|
- Версия 1.7.х Decort-SDK соответствует 3.8.9 версии платформы
|
||||||
- Версия 1.8.х Decort-SDK соответствует 4.0.0 версии платформы
|
- Версия 1.8.х Decort-SDK соответствует 4.0.0 версии платформы
|
||||||
- Версия 1.9.х Decort-SDK соответствует 4.1.0 версии платформы
|
- Версия 1.9.х Decort-SDK соответствует 4.1.0 версии платформы
|
||||||
|
- Версия 1.10.х Decort-SDK соответствует 4.2.0 версии платформы
|
||||||
|
|
||||||
## Оглавление
|
## Оглавление
|
||||||
|
|
||||||
|
|||||||
@@ -374,11 +374,25 @@ func urlValidartor(fl validator.FieldLevel) bool {
|
|||||||
|
|
||||||
func chipsetValidator(fe validator.FieldLevel) bool {
|
func chipsetValidator(fe validator.FieldLevel) bool {
|
||||||
fieldValue := fe.Field().String()
|
fieldValue := fe.Field().String()
|
||||||
fieldValue = strings.ToLower(fieldValue)
|
|
||||||
|
|
||||||
return IsInSlice(fieldValue, chipsetValues)
|
return IsInSlice(fieldValue, chipsetValues)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func preferredCPUValidator(fe validator.FieldLevel) bool {
|
||||||
|
fieldSlice, ok := fe.Field().Interface().([]int64)
|
||||||
|
if !ok {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, value := range fieldSlice {
|
||||||
|
if value < -1 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
// ValidateRAM checks if request contains RAM value that is positive integer divisible by divisibility passed.
|
// ValidateRAM checks if request contains RAM value that is positive integer divisible by divisibility passed.
|
||||||
// It is recommended to pass constants.RAM_DIVISIBILITY as divisility arguement
|
// It is recommended to pass constants.RAM_DIVISIBILITY as divisility arguement
|
||||||
func ValidateRAM(r interfaces.RequestWithRAM, divisibility uint64) error {
|
func ValidateRAM(r interfaces.RequestWithRAM, divisibility uint64) error {
|
||||||
|
|||||||
@@ -94,6 +94,9 @@ func errorMessage(fe validator.FieldError) string {
|
|||||||
case "mtu":
|
case "mtu":
|
||||||
return fmt.Sprint(prefix, fe.Field(), "must be ", mtuMin, "-", mtuMax)
|
return fmt.Sprint(prefix, fe.Field(), "must be ", mtuMin, "-", mtuMax)
|
||||||
|
|
||||||
|
case "preferredCPU":
|
||||||
|
return fmt.Sprint(prefix, fe.Field(), "must be equal to or greater than", -1)
|
||||||
|
|
||||||
case "computex86NetType":
|
case "computex86NetType":
|
||||||
return fmt.Sprintf("%s %s must be one of the following: %s",
|
return fmt.Sprintf("%s %s must be one of the following: %s",
|
||||||
prefix,
|
prefix,
|
||||||
|
|||||||
@@ -261,5 +261,10 @@ func registerAllValidators(validate *validator.Validate) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = validate.RegisterValidation("preferredCPU", preferredCPUValidator)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ func (c Compute) GetLogGet(ctx context.Context, req GetLogRequest) (string, erro
|
|||||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudapi//compute/getLog"
|
url := "/cloudapi/compute/getLog"
|
||||||
|
|
||||||
res, err := c.client.DecortApiCall(ctx, http.MethodGet, url, req)
|
res, err := c.client.DecortApiCall(ctx, http.MethodGet, url, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -299,6 +299,9 @@ type RecordCompute struct {
|
|||||||
// List anti affinity rules
|
// List anti affinity rules
|
||||||
AntiAffinityRules ListRules `json:"antiAffinityRules"`
|
AntiAffinityRules ListRules `json:"antiAffinityRules"`
|
||||||
|
|
||||||
|
// Auto start when node restarted
|
||||||
|
AutoStart bool `json:"autoStart"`
|
||||||
|
|
||||||
// Architecture
|
// Architecture
|
||||||
Architecture string `json:"arch"`
|
Architecture string `json:"arch"`
|
||||||
|
|
||||||
@@ -425,6 +428,9 @@ type RecordCompute struct {
|
|||||||
// Pinned or not
|
// Pinned or not
|
||||||
Pinned bool `json:"pinned"`
|
Pinned bool `json:"pinned"`
|
||||||
|
|
||||||
|
// PreferredCPU
|
||||||
|
PreferredCPU []int64 `json:"preferredCpu"`
|
||||||
|
|
||||||
// Number of RAM
|
// Number of RAM
|
||||||
RAM uint64 `json:"ram"`
|
RAM uint64 `json:"ram"`
|
||||||
|
|
||||||
@@ -484,6 +490,9 @@ type RecordCompute struct {
|
|||||||
|
|
||||||
// Virtual image name
|
// Virtual image name
|
||||||
VirtualImageName string `json:"virtualImageName"`
|
VirtualImageName string `json:"virtualImageName"`
|
||||||
|
|
||||||
|
// VNC password
|
||||||
|
VNCPassword string `json:"vncPasswd"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Information about libvirt settings
|
// Information about libvirt settings
|
||||||
@@ -866,6 +875,9 @@ type ItemCompute struct {
|
|||||||
// List anti affinity rules
|
// List anti affinity rules
|
||||||
AntiAffinityRules ListRules `json:"antiAffinityRules"`
|
AntiAffinityRules ListRules `json:"antiAffinityRules"`
|
||||||
|
|
||||||
|
// Auto start when node restarted
|
||||||
|
AutoStart bool `json:"autoStart"`
|
||||||
|
|
||||||
// Architecture
|
// Architecture
|
||||||
Architecture string `json:"arch"`
|
Architecture string `json:"arch"`
|
||||||
|
|
||||||
@@ -971,6 +983,9 @@ type ItemCompute struct {
|
|||||||
// Pinned or not
|
// Pinned or not
|
||||||
Pinned bool `json:"pinned"`
|
Pinned bool `json:"pinned"`
|
||||||
|
|
||||||
|
// PreferredCPU
|
||||||
|
PreferredCPU []int64 `json:"preferredCpu"`
|
||||||
|
|
||||||
// Number of RAM
|
// Number of RAM
|
||||||
RAM uint64 `json:"ram"`
|
RAM uint64 `json:"ram"`
|
||||||
|
|
||||||
|
|||||||
@@ -13,25 +13,30 @@ type PinToStackRequest 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"`
|
||||||
|
|
||||||
|
// Auto start when node restarted
|
||||||
|
// Required: false
|
||||||
|
// Default: false
|
||||||
|
AutoStart bool `url:"autoStart" json:"autoStart"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PinToStack pin compute to current stack
|
// PinToStack pin compute to current stack
|
||||||
func (c Compute) PinToStack(ctx context.Context, req PinToStackRequest) (uint64, error) {
|
func (c Compute) PinToStack(ctx context.Context, req PinToStackRequest) (bool, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudapi/compute/pinToStack"
|
url := "/cloudapi/compute/pinToStack"
|
||||||
|
|
||||||
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 {
|
||||||
return 0, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := strconv.ParseUint(string(res), 10, 64)
|
result, err := strconv.ParseBool(string(res))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ type ResizeRequest struct {
|
|||||||
// Force compute resize
|
// Force compute resize
|
||||||
// Required: false
|
// Required: false
|
||||||
Force bool `url:"force,omitempty" json:"force,omitempty"`
|
Force bool `url:"force,omitempty" json:"force,omitempty"`
|
||||||
|
|
||||||
|
// 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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRAM returns RAM field values
|
// GetRAM returns RAM field values
|
||||||
|
|||||||
@@ -43,6 +43,15 @@ type UpdateRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
// Default: false
|
// Default: false
|
||||||
HPBacked bool `url:"hpBacked" json:"hpBacked"`
|
HPBacked bool `url:"hpBacked" json:"hpBacked"`
|
||||||
|
|
||||||
|
// Auto start when node restarted
|
||||||
|
// Required: false
|
||||||
|
// Default: false
|
||||||
|
AutoStart bool `url:"autoStart" json:"autoStart"`
|
||||||
|
|
||||||
|
// 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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update updates some properties of the compute
|
// Update updates some properties of the compute
|
||||||
|
|||||||
@@ -19,31 +19,6 @@ type ResizeRequest struct {
|
|||||||
Size uint64 `url:"size" json:"size" validate:"required"`
|
Size uint64 `url:"size" json:"size" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resize resizes disk
|
|
||||||
// Returns 200 if disk is resized online, else will return 202,
|
|
||||||
// in that case please stop and start your machine after changing the disk size, for your changes to be reflected.
|
|
||||||
// This method will not be used for disks, assigned to computes. Only unassigned disks and disks, assigned with "old" virtual machines.
|
|
||||||
func (d Disks) Resize(ctx context.Context, req ResizeRequest) (bool, error) {
|
|
||||||
err := validators.ValidateRequest(req)
|
|
||||||
if err != nil {
|
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
url := "/cloudapi/disks/resize"
|
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
// Resize2 resize disk
|
// Resize2 resize disk
|
||||||
// Returns 200 if disk is resized online, else will return 202,
|
// Returns 200 if disk is resized online, else will return 202,
|
||||||
// in that case please stop and start your machine after changing the disk size, for your changes to be reflected.
|
// in that case please stop and start your machine after changing the disk size, for your changes to be reflected.
|
||||||
|
|||||||
50
pkg/cloudapi/extnet/get_reserved_ip.go
Normal file
50
pkg/cloudapi/extnet/get_reserved_ip.go
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
package extnet
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetRequest struct to get information about reserved address or address poll
|
||||||
|
type GetReservedIP struct {
|
||||||
|
// AccountID of the account whose reservation information we want to receive
|
||||||
|
// Required: true
|
||||||
|
AccountID uint64 `url:"accountId" json:"accountId" validate:"required"`
|
||||||
|
|
||||||
|
// Field for specifying the ID of extnet whose reservation information we want to receive
|
||||||
|
// Required: false
|
||||||
|
ExtNetID uint64 `url:"extnetId,omitempty" json:"extnetId,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetReservedIP gets information about reserved address or address poll as a slice of RecordReservedIP struct
|
||||||
|
func (e ExtNet) GetReservedIP(ctx context.Context, req GetReservedIP) ([]RecordReservedIP, error) {
|
||||||
|
res, err := e.GetReservedIPRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
reservedIP := make([]RecordReservedIP, 0)
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &reservedIP)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return reservedIP, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets detailed information about external network as an array of bytes
|
||||||
|
func (e ExtNet) GetReservedIPRaw(ctx context.Context, req GetReservedIP) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudapi/extnet/getReservedIp"
|
||||||
|
|
||||||
|
res, err := e.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
@@ -87,6 +87,9 @@ type QOS struct {
|
|||||||
|
|
||||||
// Main information about reservations
|
// Main information about reservations
|
||||||
type ItemReservation struct {
|
type ItemReservation struct {
|
||||||
|
// Account ID
|
||||||
|
AccountID uint64 `json:"account_id"`
|
||||||
|
|
||||||
// ClientType
|
// ClientType
|
||||||
ClientType string `json:"clientType"`
|
ClientType string `json:"clientType"`
|
||||||
|
|
||||||
@@ -226,3 +229,20 @@ type RecordExtNet struct {
|
|||||||
// VNFs
|
// VNFs
|
||||||
VNFs VNFs `json:"vnfs"`
|
VNFs VNFs `json:"vnfs"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Detailed information about reserved address or address pool
|
||||||
|
type RecordReservedIP struct {
|
||||||
|
ExtnetID int `json:"extnet_id"`
|
||||||
|
Reservations []Reservations `json:"reservations"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Reservations struct {
|
||||||
|
AccountID int `json:"account_id"`
|
||||||
|
ClientType string `json:"clientType"`
|
||||||
|
DomainName string `json:"domainname"`
|
||||||
|
Hostname string `json:"hostname"`
|
||||||
|
IP string `json:"ip"`
|
||||||
|
Mac string `json:"mac"`
|
||||||
|
Type string `json:"type"`
|
||||||
|
VMID int `json:"vmId"`
|
||||||
|
}
|
||||||
|
|||||||
@@ -164,6 +164,10 @@ type CreateRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
// Default: false
|
// Default: false
|
||||||
HPBacked bool `url:"hpBacked" json:"hpBacked"`
|
HPBacked bool `url:"hpBacked" json:"hpBacked"`
|
||||||
|
|
||||||
|
// 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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRAM returns RAM field values
|
// GetRAM returns RAM field values
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ type CreateBlankRequest struct {
|
|||||||
// 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"`
|
||||||
|
|
||||||
|
// 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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRAM returns RAM field values
|
// GetRAM returns RAM field values
|
||||||
|
|||||||
@@ -208,6 +208,9 @@ type RecordVNFDev struct {
|
|||||||
|
|
||||||
// List of VINS IDs
|
// List of VINS IDs
|
||||||
VINS []uint64 `json:"vins"`
|
VINS []uint64 `json:"vins"`
|
||||||
|
|
||||||
|
// VNC password
|
||||||
|
VNCPassword string `json:"vncPasswd"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// VNF config
|
// VNF config
|
||||||
@@ -793,17 +796,8 @@ type ListNATRules struct {
|
|||||||
|
|
||||||
// Main information about reservation
|
// Main information about reservation
|
||||||
type ItemReservation struct {
|
type ItemReservation struct {
|
||||||
// Client type
|
// Account ID
|
||||||
ClientType string `json:"clientType"`
|
AccountID uint64 `json:"account_id"`
|
||||||
|
|
||||||
// Description
|
|
||||||
Description string `json:"desc"`
|
|
||||||
|
|
||||||
// Domain name
|
|
||||||
DomainName string `json:"domainname"`
|
|
||||||
|
|
||||||
// Hostname
|
|
||||||
Hostname string `json:"hostname"`
|
|
||||||
|
|
||||||
// IP
|
// IP
|
||||||
IP string `json:"ip"`
|
IP string `json:"ip"`
|
||||||
|
|||||||
@@ -25,10 +25,6 @@ type StaticRouteAddRequest struct {
|
|||||||
// Next hop host, IP address from ViNS ID free IP pool
|
// Next hop host, IP address from ViNS ID free IP pool
|
||||||
// Required: true
|
// Required: true
|
||||||
Gateway string `url:"gateway" json:"gateway" validate:"required"`
|
Gateway string `url:"gateway" json:"gateway" validate:"required"`
|
||||||
|
|
||||||
// List of Compute IDs which have access to this route
|
|
||||||
// Required: false
|
|
||||||
ComputeIds []uint64 `url:"computeIds,omitempty" json:"computeIds,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// StaticRouteAdd adds new static route to ViNS
|
// StaticRouteAdd adds new static route to ViNS
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
func (a Audit) ExportAuditsToFile(ctx context.Context) ([]byte, error) {
|
func (a Audit) ExportAuditsToFile(ctx context.Context) ([]byte, error) {
|
||||||
url := "/cloudbroker/audit/exportAuditsToFile"
|
url := "/cloudbroker/audit/exportAuditsToFile"
|
||||||
|
|
||||||
res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, nil)
|
res, err := a.client.DecortApiCall(ctx, http.MethodGet, url, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,10 @@ type ListRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
ImageID uint64 `url:"imageId,omitempty" json:"imageId,omitempty"`
|
ImageID uint64 `url:"imageId,omitempty" json:"imageId,omitempty"`
|
||||||
|
|
||||||
|
// Find by CD image ID
|
||||||
|
// Required: false
|
||||||
|
CDImageID uint64 `url:"cdImageId,omitempty" json:"cdImageId,omitempty"`
|
||||||
|
|
||||||
// Find by external network name
|
// Find by external network name
|
||||||
// Required: false
|
// Required: false
|
||||||
ExtNetName string `url:"extNetName,omitempty" json:"extNetName,omitempty"`
|
ExtNetName string `url:"extNetName,omitempty" json:"extNetName,omitempty"`
|
||||||
|
|||||||
@@ -624,6 +624,9 @@ type InfoCompute struct {
|
|||||||
// Anti affinity rules
|
// Anti affinity rules
|
||||||
AntiAffinityRules ListRules `json:"antiAffinityRules"`
|
AntiAffinityRules ListRules `json:"antiAffinityRules"`
|
||||||
|
|
||||||
|
// Auto start when node restarted
|
||||||
|
AutoStart bool `json:"autoStart"`
|
||||||
|
|
||||||
// Architecture
|
// Architecture
|
||||||
Arch string `json:"arch"`
|
Arch string `json:"arch"`
|
||||||
|
|
||||||
@@ -729,6 +732,9 @@ type InfoCompute struct {
|
|||||||
// Pinned
|
// Pinned
|
||||||
Pinned bool `json:"pinned"`
|
Pinned bool `json:"pinned"`
|
||||||
|
|
||||||
|
// PreferredCPU
|
||||||
|
PreferredCPU []int64 `json:"preferredCpu"`
|
||||||
|
|
||||||
// Number of RAM
|
// Number of RAM
|
||||||
RAM uint64 `json:"ram"`
|
RAM uint64 `json:"ram"`
|
||||||
|
|
||||||
@@ -846,6 +852,9 @@ type RecordCompute struct {
|
|||||||
// Anti affinity rules
|
// Anti affinity rules
|
||||||
AntiAffinityRules ListRules `json:"antiAffinityRules"`
|
AntiAffinityRules ListRules `json:"antiAffinityRules"`
|
||||||
|
|
||||||
|
// Auto start when node restarted
|
||||||
|
AutoStart bool `json:"autoStart"`
|
||||||
|
|
||||||
// Architecture
|
// Architecture
|
||||||
Arch string `json:"arch"`
|
Arch string `json:"arch"`
|
||||||
|
|
||||||
@@ -975,6 +984,9 @@ type RecordCompute struct {
|
|||||||
// Pinned
|
// Pinned
|
||||||
Pinned bool `json:"pinned"`
|
Pinned bool `json:"pinned"`
|
||||||
|
|
||||||
|
// PreferredCPU
|
||||||
|
PreferredCPU []int64 `json:"preferredCpu"`
|
||||||
|
|
||||||
// Number of RAM
|
// Number of RAM
|
||||||
RAM uint64 `json:"ram"`
|
RAM uint64 `json:"ram"`
|
||||||
|
|
||||||
@@ -1043,6 +1055,9 @@ type RecordCompute struct {
|
|||||||
|
|
||||||
// VirtualImageName
|
// VirtualImageName
|
||||||
VirtualImageName string `json:"virtualImageName"`
|
VirtualImageName string `json:"virtualImageName"`
|
||||||
|
|
||||||
|
// VNC password
|
||||||
|
VNCPassword string `json:"vncPasswd"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Information about of disk IDs
|
// Information about of disk IDs
|
||||||
|
|||||||
@@ -21,6 +21,11 @@ type PinToStackRequest struct {
|
|||||||
// Try to migrate or not if compute in running states
|
// Try to migrate or not if compute in running states
|
||||||
// Required: false
|
// Required: false
|
||||||
Force bool `url:"force" json:"force"`
|
Force bool `url:"force" json:"force"`
|
||||||
|
|
||||||
|
// Auto start when node restarted
|
||||||
|
// Required: false
|
||||||
|
// Default: false
|
||||||
|
AutoStart bool `url:"autoStart" json:"autoStart"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PinToStack pins compute to current stack
|
// PinToStack pins compute to current stack
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ type ResizeRequest struct {
|
|||||||
// Force compute resize
|
// Force compute resize
|
||||||
// Required: false
|
// Required: false
|
||||||
Force bool `url:"force,omitempty" json:"force,omitempty"`
|
Force bool `url:"force,omitempty" json:"force,omitempty"`
|
||||||
|
|
||||||
|
// 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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRAM returns RAM field values
|
// GetRAM returns RAM field values
|
||||||
|
|||||||
@@ -43,6 +43,15 @@ type UpdateRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
// Default: false
|
// Default: false
|
||||||
HPBacked bool `url:"hpBacked" json:"hpBacked"`
|
HPBacked bool `url:"hpBacked" json:"hpBacked"`
|
||||||
|
|
||||||
|
// Auto start when node restarted
|
||||||
|
// Required: false
|
||||||
|
// Default: false
|
||||||
|
AutoStart bool `url:"autoStart" json:"autoStart"`
|
||||||
|
|
||||||
|
// 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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update updates some properties of the compute
|
// Update updates some properties of the compute
|
||||||
|
|||||||
@@ -19,31 +19,6 @@ type ResizeRequest struct {
|
|||||||
Size uint64 `url:"size" json:"size" validate:"required"`
|
Size uint64 `url:"size" json:"size" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resize resizes disk
|
|
||||||
// Returns 200 if disk is resized online, else will return 202,
|
|
||||||
// in that case please stop and start your machine after changing the disk size, for your changes to be reflected.
|
|
||||||
// This method will not be used for disks, assigned to computes. Only unassigned disks and disks, assigned with "old" virtual machines.
|
|
||||||
func (d Disks) Resize(ctx context.Context, req ResizeRequest) (bool, error) {
|
|
||||||
err := validators.ValidateRequest(req)
|
|
||||||
if err != nil {
|
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
url := "/cloudbroker/disks/resize"
|
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
|
|
||||||
// Resize2 resize disk
|
// Resize2 resize disk
|
||||||
// Returns 200 if disk is resized online, else will return 202,
|
// Returns 200 if disk is resized online, else will return 202,
|
||||||
// in that case please stop and start your machine after changing the disk size, for your changes to be reflected.
|
// in that case please stop and start your machine after changing the disk size, for your changes to be reflected.
|
||||||
|
|||||||
50
pkg/cloudbroker/extnet/add_reserved_ip.go
Normal file
50
pkg/cloudbroker/extnet/add_reserved_ip.go
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
package extnet
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// AddReserveIPRequest struct to reserved address or address poll
|
||||||
|
type AddReserveIPRequest struct {
|
||||||
|
// AccountID to which a reserved address or address pool is added
|
||||||
|
// Required: true
|
||||||
|
AccountID uint64 `url:"accountId" json:"accountId" validate:"required"`
|
||||||
|
|
||||||
|
// ExtNetID from which the address or address pool is reserved
|
||||||
|
// Required: true
|
||||||
|
ExtNetID uint64 `url:"extnetId" json:"extnetId" validate:"required"`
|
||||||
|
|
||||||
|
// Field for specifying the number of reserved addresses
|
||||||
|
// Required: false
|
||||||
|
IPCount uint64 `url:"ipCount,omitempty" json:"ipCount,omitempty"`
|
||||||
|
|
||||||
|
// List of IPs for specifying the desired address
|
||||||
|
// Required: false
|
||||||
|
IPs []string `url:"ips,omitempty" json:"ips,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// AddReserveIP reserves address or address poll to external network for account ID
|
||||||
|
func (e ExtNet) AddReserveIP(ctx context.Context, req AddReserveIPRequest) (bool, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/extnet/addReservedIp"
|
||||||
|
|
||||||
|
res, err := e.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := strconv.ParseBool(string(res))
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return result, nil
|
||||||
|
}
|
||||||
50
pkg/cloudbroker/extnet/del_reserved_ip.go
Normal file
50
pkg/cloudbroker/extnet/del_reserved_ip.go
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
package extnet
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DelReserveIPRequest struct to delete reserved address or address poll
|
||||||
|
type DelReserveIPRequest struct {
|
||||||
|
// AccountID to which a reserved address or address pool is added
|
||||||
|
// Required: true
|
||||||
|
AccountID uint64 `url:"accountId" json:"accountId" validate:"required"`
|
||||||
|
|
||||||
|
// ExtNetID from which the address or address pool is reserved
|
||||||
|
// Required: true
|
||||||
|
ExtNetID uint64 `url:"extnetId" json:"extnetId" validate:"required"`
|
||||||
|
|
||||||
|
// Field for specifying the number of reserved addresses
|
||||||
|
// Required: false
|
||||||
|
IPCount uint64 `url:"ipCount,omitempty" json:"ipCount,omitempty"`
|
||||||
|
|
||||||
|
// List of IPs for specifying the desired address
|
||||||
|
// Required: false
|
||||||
|
IPs []string `url:"ips,omitempty" json:"ips,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// DelReserveIP deletes reserved address or address poll to external network for account ID
|
||||||
|
func (e ExtNet) DelReserveIP(ctx context.Context, req DelReserveIPRequest) (bool, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/extnet/delReservedIp"
|
||||||
|
|
||||||
|
res, err := e.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := strconv.ParseBool(string(res))
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return result, nil
|
||||||
|
}
|
||||||
50
pkg/cloudbroker/extnet/get_reserved_ip.go
Normal file
50
pkg/cloudbroker/extnet/get_reserved_ip.go
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
package extnet
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetRequest struct to get information about reserved address or address poll
|
||||||
|
type GetReservedIP struct {
|
||||||
|
// AccountID of the account whose reservation information we want to receive
|
||||||
|
// Required: true
|
||||||
|
AccountID uint64 `url:"accountId" json:"accountId" validate:"required"`
|
||||||
|
|
||||||
|
// Field for specifying the ID of extnet whose reservation information we want to receive
|
||||||
|
// Required: false
|
||||||
|
ExtNetID uint64 `url:"extnetId,omitempty" json:"extnetId,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetReservedIP gets information about reserved address or address poll as a slice of RecordReservedIP struct
|
||||||
|
func (e ExtNet) GetReservedIP(ctx context.Context, req GetReservedIP) ([]RecordReservedIP, error) {
|
||||||
|
res, err := e.GetReservedIPRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
reservedIP := make([]RecordReservedIP, 0)
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &reservedIP)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return reservedIP, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets detailed information about external network as an array of bytes
|
||||||
|
func (e ExtNet) GetReservedIPRaw(ctx context.Context, req GetReservedIP) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/extnet/getReservedIp"
|
||||||
|
|
||||||
|
res, err := e.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
@@ -17,6 +17,9 @@ type QOS struct {
|
|||||||
|
|
||||||
// Main information about reservations
|
// Main information about reservations
|
||||||
type ItemReservation struct {
|
type ItemReservation struct {
|
||||||
|
// Account ID
|
||||||
|
AccountID uint64 `json:"account_id"`
|
||||||
|
|
||||||
// Client type
|
// Client type
|
||||||
ClientType string `json:"clientType"`
|
ClientType string `json:"clientType"`
|
||||||
|
|
||||||
@@ -238,3 +241,20 @@ type ItemRoutes struct {
|
|||||||
//Destination network mask in 255.255.255.255 format
|
//Destination network mask in 255.255.255.255 format
|
||||||
Netmask string `json:"netmask"`
|
Netmask string `json:"netmask"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Detailed information about reserved address or address pool
|
||||||
|
type RecordReservedIP struct {
|
||||||
|
ExtnetID int `json:"extnet_id"`
|
||||||
|
Reservations []Reservations `json:"reservations"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Reservations struct {
|
||||||
|
AccountID int `json:"account_id"`
|
||||||
|
ClientType string `json:"clientType"`
|
||||||
|
DomainName string `json:"domainname"`
|
||||||
|
Hostname string `json:"hostname"`
|
||||||
|
IP string `json:"ip"`
|
||||||
|
Mac string `json:"mac"`
|
||||||
|
Type string `json:"type"`
|
||||||
|
VMID int `json:"vmId"`
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package grid
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
@@ -39,7 +38,7 @@ func (g Grid) GetDiagnosisGET(ctx context.Context, req GetDiagnosisRequest) (str
|
|||||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := fmt.Sprintf("/cloudbroker/grid/getDiagnosis/?gid=%d", req.GID)
|
url := "/cloudbroker/grid/getDiagnosis"
|
||||||
|
|
||||||
res, err := g.client.DecortApiCall(ctx, http.MethodGet, url, req)
|
res, err := g.client.DecortApiCall(ctx, http.MethodGet, url, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -104,6 +104,9 @@ type RecordImage struct {
|
|||||||
// Size
|
// Size
|
||||||
Size uint64 `json:"size"`
|
Size uint64 `json:"size"`
|
||||||
|
|
||||||
|
// SnapshotId
|
||||||
|
SnapshotID string `json:"snapshotId"`
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
|
|
||||||
@@ -227,6 +230,9 @@ type ItemImage struct {
|
|||||||
// Size
|
// Size
|
||||||
Size uint64 `json:"size"`
|
Size uint64 `json:"size"`
|
||||||
|
|
||||||
|
// SnapshotId
|
||||||
|
SnapshotID string `json:"snapshotId"`
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
|
|
||||||
|
|||||||
@@ -168,6 +168,10 @@ type CreateRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
// Default: false
|
// Default: false
|
||||||
HPBacked bool `url:"hpBacked" json:"hpBacked"`
|
HPBacked bool `url:"hpBacked" json:"hpBacked"`
|
||||||
|
|
||||||
|
// 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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRAM returns RAM field values
|
// GetRAM returns RAM field values
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ type CreateBlankRequest struct {
|
|||||||
// Type of the emulated system, Q35 or i440fx
|
// Type of the emulated system, Q35 or i440fx
|
||||||
// Required: false
|
// Required: false
|
||||||
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"`
|
||||||
|
|
||||||
|
// 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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRAM returns RAM field values
|
// GetRAM returns RAM field values
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ type RecordNode struct {
|
|||||||
// CPU Allocation Ratio
|
// CPU Allocation Ratio
|
||||||
CPUAllocationRatio float64 `json:"cpu_allocation_ratio"`
|
CPUAllocationRatio float64 `json:"cpu_allocation_ratio"`
|
||||||
|
|
||||||
|
// DPDK info
|
||||||
|
DPDK DPDK `json:"dpdk"`
|
||||||
|
|
||||||
// GID
|
// GID
|
||||||
GID uint64 `json:"gid"`
|
GID uint64 `json:"gid"`
|
||||||
|
|
||||||
@@ -29,6 +32,12 @@ type RecordNode struct {
|
|||||||
// NeedReboot
|
// NeedReboot
|
||||||
NeedReboot bool `json:"needReboot"`
|
NeedReboot bool `json:"needReboot"`
|
||||||
|
|
||||||
|
// Netaddr
|
||||||
|
NetAddr NetAddr `json:"netaddr"`
|
||||||
|
|
||||||
|
// Network mode
|
||||||
|
NetworkMode string `json:"networkmode"`
|
||||||
|
|
||||||
// Nic Info
|
// Nic Info
|
||||||
NicInfo ListNicInfo `json:"nicInfo"`
|
NicInfo ListNicInfo `json:"nicInfo"`
|
||||||
|
|
||||||
@@ -50,6 +59,18 @@ type RecordNode struct {
|
|||||||
// Status
|
// Status
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
|
|
||||||
|
// To active
|
||||||
|
ToActive Role `json:"to_active"`
|
||||||
|
|
||||||
|
// To installing
|
||||||
|
ToInstalling Role `json:"to_installing"`
|
||||||
|
|
||||||
|
// To maintenance
|
||||||
|
ToMaintenance Role `json:"to_maintenance"`
|
||||||
|
|
||||||
|
// To restricted
|
||||||
|
ToRestricted Role `json:"to_restricted"`
|
||||||
|
|
||||||
// Version
|
// Version
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
}
|
}
|
||||||
@@ -122,6 +143,9 @@ type ItemNode struct {
|
|||||||
// Description
|
// Description
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
|
|
||||||
|
// DPDK
|
||||||
|
DPDK DPDK `json:"dpdk"`
|
||||||
|
|
||||||
// GID
|
// GID
|
||||||
GID uint64 `json:"gid"`
|
GID uint64 `json:"gid"`
|
||||||
|
|
||||||
@@ -224,6 +248,9 @@ type ItemNode struct {
|
|||||||
// Type
|
// Type
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
|
|
||||||
|
//UEFI Firmware File
|
||||||
|
UEFIFirmwareFile string `json:"uefiFirmwareFile"`
|
||||||
|
|
||||||
// Version
|
// Version
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
}
|
}
|
||||||
@@ -314,3 +341,42 @@ type ListNodes struct {
|
|||||||
// Entry count
|
// Entry count
|
||||||
EntryCount uint64 `json:"entryCount"`
|
EntryCount uint64 `json:"entryCount"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Net address
|
||||||
|
type NetAddr struct {
|
||||||
|
// Name
|
||||||
|
Name string `json:"name"`
|
||||||
|
|
||||||
|
// IP list backplane1 node
|
||||||
|
IP []string `json:"ip"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// DPDK info
|
||||||
|
type DPDK struct {
|
||||||
|
// Bridges
|
||||||
|
Bridges Bridges `json:"bridges"`
|
||||||
|
|
||||||
|
// hp memory
|
||||||
|
HPMemory map[string]uint64 `json:"hp_memory"`
|
||||||
|
|
||||||
|
// pmd cpu
|
||||||
|
PMDCPU []uint64 `json:"pmd_cpu"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bridges
|
||||||
|
type Bridges struct {
|
||||||
|
Backplane1 Backplane1 `json:"backplane1"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Backplane1
|
||||||
|
type Backplane1 struct {
|
||||||
|
Interfaces []string `json:"interfaces"`
|
||||||
|
NumaNode uint64 `json:"numa_node"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Role
|
||||||
|
type Role struct {
|
||||||
|
Actor string `json:"actor"`
|
||||||
|
Reason string `json:"reason"`
|
||||||
|
Time uint64 `json:"time"`
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ type SetVFsNumberRequest struct {
|
|||||||
// Trust
|
// Trust
|
||||||
// Required: true
|
// Required: true
|
||||||
Trust bool `url:"trust" json:"trust" validate:"required"`
|
Trust bool `url:"trust" json:"trust" validate:"required"`
|
||||||
|
|
||||||
|
// Enable spoof checking
|
||||||
|
// Required: true
|
||||||
|
Spoofchk bool `url:"spoofchk" json:"spoofchk" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetVFsNumber sets number of VFs for individual NIC on node
|
// SetVFsNumber sets number of VFs for individual NIC on node
|
||||||
|
|||||||
@@ -101,12 +101,6 @@ type SEPConfig map[string]interface{}
|
|||||||
|
|
||||||
// Detailed information about SEP
|
// Detailed information about SEP
|
||||||
type RecordSEP struct {
|
type RecordSEP struct {
|
||||||
// CKey
|
|
||||||
CKey string `json:"_ckey"`
|
|
||||||
|
|
||||||
// Meta
|
|
||||||
Meta []interface{} `json:"_meta"`
|
|
||||||
|
|
||||||
// Config
|
// Config
|
||||||
Config SEPConfig `json:"config"`
|
Config SEPConfig `json:"config"`
|
||||||
|
|
||||||
@@ -128,6 +122,9 @@ type RecordSEP struct {
|
|||||||
// Milestones
|
// Milestones
|
||||||
Milestones uint64 `json:"milestones"`
|
Milestones uint64 `json:"milestones"`
|
||||||
|
|
||||||
|
// MultipathNum
|
||||||
|
MultipathNum uint64 `json:"multipathNum"`
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
package sep
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"net/http"
|
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
|
||||||
)
|
|
||||||
|
|
||||||
// UpdateCapacityLimitRequest struct to update capacity limits
|
|
||||||
type UpdateCapacityLimitRequest struct {
|
|
||||||
// Storage endpoint provider ID
|
|
||||||
// Required: true
|
|
||||||
SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// UpdateCapacityLimit updates SEP capacity limit
|
|
||||||
func (s SEP) UpdateCapacityLimit(ctx context.Context, req UpdateCapacityLimitRequest) (uint64, error) {
|
|
||||||
err := validators.ValidateRequest(req)
|
|
||||||
if err != nil {
|
|
||||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
url := "/cloudbroker/sep/updateCapacityLimit"
|
|
||||||
|
|
||||||
res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
|
|
||||||
result, err := strconv.ParseUint(string(res), 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return result, nil
|
|
||||||
}
|
|
||||||
@@ -30,6 +30,10 @@ type ListRequest struct {
|
|||||||
// Required: false
|
// Required: false
|
||||||
RGID uint64 `url:"rgId,omitempty" json:"rgId,omitempty"`
|
RGID uint64 `url:"rgId,omitempty" json:"rgId,omitempty"`
|
||||||
|
|
||||||
|
// Find by id node
|
||||||
|
// Required: false
|
||||||
|
NID uint64 `url:"nid,omitempty" json:"nid,omitempty"`
|
||||||
|
|
||||||
// Find by account id
|
// Find by account id
|
||||||
// Required: false
|
// Required: false
|
||||||
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
|
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
|
||||||
|
|||||||
@@ -235,21 +235,15 @@ type VNFDev struct {
|
|||||||
|
|
||||||
//List of VINS IDs
|
//List of VINS IDs
|
||||||
VINS []uint64 `json:"vins"`
|
VINS []uint64 `json:"vins"`
|
||||||
|
|
||||||
|
// VNC password
|
||||||
|
VNCPassword string `json:"vncPasswd"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Main information about reservation
|
// Main information about reservation
|
||||||
type ItemReservation struct {
|
type ItemReservation struct {
|
||||||
// Client type
|
// Account ID
|
||||||
ClientType string `json:"clientType"`
|
AccountID uint64 `json:"account_id"`
|
||||||
|
|
||||||
// Description
|
|
||||||
Description string `json:"desc"`
|
|
||||||
|
|
||||||
// Domain name
|
|
||||||
DomainName string `json:"domainname"`
|
|
||||||
|
|
||||||
// Hostname
|
|
||||||
Hostname string `json:"hostname"`
|
|
||||||
|
|
||||||
// IP
|
// IP
|
||||||
IP string `json:"ip"`
|
IP string `json:"ip"`
|
||||||
|
|||||||
@@ -25,10 +25,6 @@ type StaticRouteAddRequest struct {
|
|||||||
// Next hop host, IP address from ViNS ID free IP pool
|
// Next hop host, IP address from ViNS ID free IP pool
|
||||||
// Required: true
|
// Required: true
|
||||||
Gateway string `url:"gateway" json:"gateway" validate:"required"`
|
Gateway string `url:"gateway" json:"gateway" validate:"required"`
|
||||||
|
|
||||||
// List of Compute IDs which have access to this route
|
|
||||||
// Required: false
|
|
||||||
ComputeIds []uint64 `url:"computeIds,omitempty" json:"computeIds,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// StaticRouteAdd adds new static route to ViNS
|
// StaticRouteAdd adds new static route to ViNS
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import (
|
|||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/stack"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/stack"
|
||||||
"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/vins"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/vins"
|
||||||
|
node_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/node"
|
||||||
|
|
||||||
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"
|
||||||
@@ -563,6 +564,26 @@ func TestGetListCloudbroker(t *testing.T) {
|
|||||||
t.Errorf("Can not test LB get because LB list is empty")
|
t.Errorf("Can not test LB get because LB list is empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Node
|
||||||
|
// List
|
||||||
|
bytes, err = client.CloudBroker().Node().ListRaw(context.Background(), node_cb.ListRequest{})
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
testLogs = append(testLogs, getResult("Node list", bytes, node_cb.ListNodes{}, t))
|
||||||
|
// Get
|
||||||
|
listNode, _ := client.CloudBroker().Node().List(context.Background(), node_cb.ListRequest{})
|
||||||
|
if len(listLB.Data) > 0 {
|
||||||
|
id := listNode.Data[0].ID
|
||||||
|
bytes, err = client.CloudBroker().Node().GetRaw(context.Background(), node_cb.GetRequest{NID: id})
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
testLogs = append(testLogs, getResult("Node get", bytes, node_cb.RecordNode{}, t))
|
||||||
|
} else {
|
||||||
|
t.Errorf("Can not test Node get because LB list is empty")
|
||||||
|
}
|
||||||
|
|
||||||
// Pcidevice
|
// Pcidevice
|
||||||
// List
|
// List
|
||||||
bytes, err = client.CloudBroker().PCIDevice().ListRaw(context.Background(), pcidevice_cb.ListRequest{})
|
bytes, err = client.CloudBroker().PCIDevice().ListRaw(context.Background(), pcidevice_cb.ListRequest{})
|
||||||
@@ -684,10 +705,19 @@ func TestGetAllPaths(t *testing.T) {
|
|||||||
|
|
||||||
decortUrls := readUrlFromDir("../../pkg", len(jsonUrls))
|
decortUrls := readUrlFromDir("../../pkg", len(jsonUrls))
|
||||||
|
|
||||||
result := getMissingDecortUrls(jsonUrls, decortUrls)
|
missingUrls := getMissingDecortUrls(jsonUrls, decortUrls)
|
||||||
if len(result) > 0 {
|
if len(missingUrls) > 0 {
|
||||||
errorText := fmt.Sprintf("Below API handlers (%d in total) need to be added to decort-sdk:\n", len(result))
|
errorText := fmt.Sprintf("Below API handlers (%d in total) need to be added to decort-sdk:\n", len(missingUrls))
|
||||||
for _, r := range result {
|
for _, r := range missingUrls {
|
||||||
|
errorText += fmt.Sprintln(r)
|
||||||
|
}
|
||||||
|
t.Errorf(errorText)
|
||||||
|
}
|
||||||
|
|
||||||
|
deprecatedUrls := getDeprecatedDecortUrls(jsonUrls, decortUrls)
|
||||||
|
if len(deprecatedUrls) > 0 {
|
||||||
|
errorText := fmt.Sprintf("Below API handlers (%d in total) need to be delete to decort-sdk:\n", len(deprecatedUrls))
|
||||||
|
for _, r := range deprecatedUrls {
|
||||||
errorText += fmt.Sprintln(r)
|
errorText += fmt.Sprintln(r)
|
||||||
}
|
}
|
||||||
t.Errorf(errorText)
|
t.Errorf(errorText)
|
||||||
|
|||||||
@@ -2,9 +2,11 @@ package test
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/account"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/account"
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/audit"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/bservice"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/bservice"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/compute"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/compute"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/disks"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/disks"
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/dpdknet"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/extnet"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/extnet"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/flipgroup"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/flipgroup"
|
||||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/image"
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/image"
|
||||||
@@ -27,6 +29,7 @@ import (
|
|||||||
backup_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/backup"
|
backup_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/backup"
|
||||||
compute_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/compute"
|
compute_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/compute"
|
||||||
disks_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/disks"
|
disks_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/disks"
|
||||||
|
dpdknet_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/dpdknet"
|
||||||
extnet_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/extnet"
|
extnet_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/extnet"
|
||||||
flipgroup_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/flipgroup"
|
flipgroup_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/flipgroup"
|
||||||
grid_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/grid"
|
grid_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/grid"
|
||||||
@@ -78,6 +81,9 @@ func getRequestsMapCloudAPI() map[string]interface{} {
|
|||||||
"/restmachine/cloudapi/account/update": account.UpdateRequest{},
|
"/restmachine/cloudapi/account/update": account.UpdateRequest{},
|
||||||
"/restmachine/cloudapi/account/updateUser": account.UpdateUserRequest{},
|
"/restmachine/cloudapi/account/updateUser": account.UpdateUserRequest{},
|
||||||
|
|
||||||
|
//audit
|
||||||
|
"/restmachine/cloudapi/audit/get": audit.GetRequest{},
|
||||||
|
|
||||||
//bservice
|
//bservice
|
||||||
"/restmachine/cloudapi/bservice/create": bservice.CreateRequest{},
|
"/restmachine/cloudapi/bservice/create": bservice.CreateRequest{},
|
||||||
"/restmachine/cloudapi/bservice/delete": bservice.DeleteRequest{},
|
"/restmachine/cloudapi/bservice/delete": bservice.DeleteRequest{},
|
||||||
@@ -107,7 +113,6 @@ func getRequestsMapCloudAPI() map[string]interface{} {
|
|||||||
"/restmachine/cloudapi/bservice/stop": bservice.StopRequest{},
|
"/restmachine/cloudapi/bservice/stop": bservice.StopRequest{},
|
||||||
|
|
||||||
// compute
|
// compute
|
||||||
"/restmachine/cloudapi/compute/affinityGroupCheckStart": compute.AffinityGroupCheckStartRequest{},
|
|
||||||
"/restmachine/cloudapi/compute/affinityLabelRemove": compute.AffinityLabelRemoveRequest{},
|
"/restmachine/cloudapi/compute/affinityLabelRemove": compute.AffinityLabelRemoveRequest{},
|
||||||
"/restmachine/cloudapi/compute/affinityLabelSet": compute.AffinityLabelSetRequest{},
|
"/restmachine/cloudapi/compute/affinityLabelSet": compute.AffinityLabelSetRequest{},
|
||||||
"/restmachine/cloudapi/compute/affinityRelations": compute.AffinityRelationsRequest{},
|
"/restmachine/cloudapi/compute/affinityRelations": compute.AffinityRelationsRequest{},
|
||||||
@@ -203,7 +208,6 @@ func getRequestsMapCloudAPI() map[string]interface{} {
|
|||||||
"/restmachine/cloudapi/disks/replicationStatus": disks.ReplicationStatusRequest{},
|
"/restmachine/cloudapi/disks/replicationStatus": disks.ReplicationStatusRequest{},
|
||||||
"/restmachine/cloudapi/disks/replicationStop": disks.ReplicationStopRequest{},
|
"/restmachine/cloudapi/disks/replicationStop": disks.ReplicationStopRequest{},
|
||||||
"/restmachine/cloudapi/disks/replicationSuspend": disks.ReplicationSuspendRequest{},
|
"/restmachine/cloudapi/disks/replicationSuspend": disks.ReplicationSuspendRequest{},
|
||||||
"/restmachine/cloudapi/disks/resize": disks.ResizeRequest{},
|
|
||||||
"/restmachine/cloudapi/disks/resize2": disks.ResizeRequest{},
|
"/restmachine/cloudapi/disks/resize2": disks.ResizeRequest{},
|
||||||
"/restmachine/cloudapi/disks/restore": disks.RestoreRequest{},
|
"/restmachine/cloudapi/disks/restore": disks.RestoreRequest{},
|
||||||
"/restmachine/cloudapi/disks/search": disks.SearchRequest{},
|
"/restmachine/cloudapi/disks/search": disks.SearchRequest{},
|
||||||
@@ -212,9 +216,14 @@ func getRequestsMapCloudAPI() map[string]interface{} {
|
|||||||
"/restmachine/cloudapi/disks/snapshotRollback": disks.SnapshotRollbackRequest{},
|
"/restmachine/cloudapi/disks/snapshotRollback": disks.SnapshotRollbackRequest{},
|
||||||
"/restmachine/cloudapi/disks/unshare": disks.UnshareRequest{},
|
"/restmachine/cloudapi/disks/unshare": disks.UnshareRequest{},
|
||||||
|
|
||||||
|
//dpdknet
|
||||||
|
"/restmachine/cloudapi/dpdknet/get": dpdknet.GetRequest{},
|
||||||
|
"/restmachine/cloudapi/dpdknet/list": dpdknet.ListRequest{},
|
||||||
|
|
||||||
// extnet
|
// extnet
|
||||||
"/restmachine/cloudapi/extnet/get": extnet.GetRequest{},
|
"/restmachine/cloudapi/extnet/get": extnet.GetRequest{},
|
||||||
"/restmachine/cloudapi/extnet/getDefault": EmptyStruct{},
|
"/restmachine/cloudapi/extnet/getDefault": EmptyStruct{},
|
||||||
|
"/restmachine/cloudapi/extnet/getReservedIp": extnet.GetReservedIP{},
|
||||||
"/restmachine/cloudapi/extnet/list": extnet.ListRequest{},
|
"/restmachine/cloudapi/extnet/list": extnet.ListRequest{},
|
||||||
"/restmachine/cloudapi/extnet/listComputes": extnet.ListComputesRequest{},
|
"/restmachine/cloudapi/extnet/listComputes": extnet.ListComputesRequest{},
|
||||||
|
|
||||||
@@ -374,8 +383,6 @@ func getRequestsMapCloudAPI() map[string]interface{} {
|
|||||||
"/restmachine/cloudapi/vins/natRuleList": vins.NATRuleListRequest{},
|
"/restmachine/cloudapi/vins/natRuleList": vins.NATRuleListRequest{},
|
||||||
"/restmachine/cloudapi/vins/restore": vins.RestoreRequest{},
|
"/restmachine/cloudapi/vins/restore": vins.RestoreRequest{},
|
||||||
"/restmachine/cloudapi/vins/search": vins.SearchRequest{},
|
"/restmachine/cloudapi/vins/search": vins.SearchRequest{},
|
||||||
"/restmachine/cloudapi/vins/staticRouteAccessGrant": vins.StaticRouteAccessGrantRequest{},
|
|
||||||
"/restmachine/cloudapi/vins/staticRouteAccessRevoke": vins.StaticRouteAccessRevokeRequest{},
|
|
||||||
"/restmachine/cloudapi/vins/staticRouteAdd": vins.StaticRouteAddRequest{},
|
"/restmachine/cloudapi/vins/staticRouteAdd": vins.StaticRouteAddRequest{},
|
||||||
"/restmachine/cloudapi/vins/staticRouteDel": vins.StaticRouteDelRequest{},
|
"/restmachine/cloudapi/vins/staticRouteDel": vins.StaticRouteDelRequest{},
|
||||||
"/restmachine/cloudapi/vins/staticRouteList": vins.StaticRouteListRequest{},
|
"/restmachine/cloudapi/vins/staticRouteList": vins.StaticRouteListRequest{},
|
||||||
@@ -576,12 +583,23 @@ func getRequestsMapCloudbroker() map[string]interface{} {
|
|||||||
"/restmachine/cloudbroker/disks/snapshotRollback": disks_cb.SnapshotRollbackRequest{},
|
"/restmachine/cloudbroker/disks/snapshotRollback": disks_cb.SnapshotRollbackRequest{},
|
||||||
"/restmachine/cloudbroker/disks/unshare": disks_cb.UnshareRequest{},
|
"/restmachine/cloudbroker/disks/unshare": disks_cb.UnshareRequest{},
|
||||||
|
|
||||||
|
// dpdknet
|
||||||
|
"/restmachine/cloudbroker/dpdknet/get": dpdknet_cb.GetRequest{},
|
||||||
|
"/restmachine/cloudbroker/dpdknet/list": dpdknet_cb.ListRequest{},
|
||||||
|
"/restmachine/cloudbroker/dpdknet/disable": dpdknet_cb.DisableRequest{},
|
||||||
|
"/restmachine/cloudbroker/dpdknet/enable": dpdknet_cb.EnableRequest{},
|
||||||
|
"/restmachine/cloudbroker/dpdknet/create": dpdknet_cb.CreateRequest{},
|
||||||
|
"/restmachine/cloudbroker/dpdknet/update": dpdknet_cb.UpdateRequest{},
|
||||||
|
"/restmachine/cloudbroker/dpdknet/delete": dpdknet_cb.DeleteRequest{},
|
||||||
|
|
||||||
// extnet
|
// extnet
|
||||||
"/restmachine/cloudbroker/extnet/accessAdd": extnet_cb.AccessAddRequest{},
|
"/restmachine/cloudbroker/extnet/accessAdd": extnet_cb.AccessAddRequest{},
|
||||||
"/restmachine/cloudbroker/extnet/accessRemove": extnet_cb.AccessRemoveRequest{},
|
"/restmachine/cloudbroker/extnet/accessRemove": extnet_cb.AccessRemoveRequest{},
|
||||||
|
"/restmachine/cloudbroker/extnet/addReservedIp": extnet_cb.AddReserveIPRequest{},
|
||||||
"/restmachine/cloudbroker/extnet/create": extnet_cb.CreateRequest{},
|
"/restmachine/cloudbroker/extnet/create": extnet_cb.CreateRequest{},
|
||||||
"/restmachine/cloudbroker/extnet/dnsApply": extnet_cb.DNSApplyRequest{},
|
"/restmachine/cloudbroker/extnet/dnsApply": extnet_cb.DNSApplyRequest{},
|
||||||
"/restmachine/cloudbroker/extnet/defaultQosUpdate": extnet_cb.DefaultQOSUpdateRequest{},
|
"/restmachine/cloudbroker/extnet/defaultQosUpdate": extnet_cb.DefaultQOSUpdateRequest{},
|
||||||
|
"/restmachine/cloudbroker/extnet/delReservedIp": extnet_cb.DelReserveIPRequest{},
|
||||||
"/restmachine/cloudbroker/extnet/destroy": extnet_cb.DestroyRequest{},
|
"/restmachine/cloudbroker/extnet/destroy": extnet_cb.DestroyRequest{},
|
||||||
"/restmachine/cloudbroker/extnet/deviceDeploy": extnet_cb.DeviceDeployRequest{},
|
"/restmachine/cloudbroker/extnet/deviceDeploy": extnet_cb.DeviceDeployRequest{},
|
||||||
"/restmachine/cloudbroker/extnet/deviceMigrate": extnet_cb.DeviceMigrateRequest{},
|
"/restmachine/cloudbroker/extnet/deviceMigrate": extnet_cb.DeviceMigrateRequest{},
|
||||||
@@ -591,6 +609,7 @@ func getRequestsMapCloudbroker() map[string]interface{} {
|
|||||||
"/restmachine/cloudbroker/extnet/enable": extnet_cb.EnableRequest{},
|
"/restmachine/cloudbroker/extnet/enable": extnet_cb.EnableRequest{},
|
||||||
"/restmachine/cloudbroker/extnet/get": extnet_cb.GetRequest{},
|
"/restmachine/cloudbroker/extnet/get": extnet_cb.GetRequest{},
|
||||||
"/restmachine/cloudbroker/extnet/getDefault": EmptyStruct{},
|
"/restmachine/cloudbroker/extnet/getDefault": EmptyStruct{},
|
||||||
|
"/restmachine/cloudbroker/extnet/getReservedIp": extnet.GetReservedIP{},
|
||||||
"/restmachine/cloudbroker/extnet/ipsExclude": extnet_cb.IPsExcludeRequest{},
|
"/restmachine/cloudbroker/extnet/ipsExclude": extnet_cb.IPsExcludeRequest{},
|
||||||
"/restmachine/cloudbroker/extnet/ipsExcludeRange": extnet_cb.IPsExcludeRangeRequest{},
|
"/restmachine/cloudbroker/extnet/ipsExcludeRange": extnet_cb.IPsExcludeRangeRequest{},
|
||||||
"/restmachine/cloudbroker/extnet/ipsInclude": extnet_cb.IPsExcludeRequest{},
|
"/restmachine/cloudbroker/extnet/ipsInclude": extnet_cb.IPsExcludeRequest{},
|
||||||
@@ -817,7 +836,6 @@ func getRequestsMapCloudbroker() map[string]interface{} {
|
|||||||
"/restmachine/cloudbroker/sep/getConfig": sep_cb.GetConfigRequest{},
|
"/restmachine/cloudbroker/sep/getConfig": sep_cb.GetConfigRequest{},
|
||||||
"/restmachine/cloudbroker/sep/getPool": sep_cb.GetPoolRequest{},
|
"/restmachine/cloudbroker/sep/getPool": sep_cb.GetPoolRequest{},
|
||||||
"/restmachine/cloudbroker/sep/list": sep_cb.ListRequest{},
|
"/restmachine/cloudbroker/sep/list": sep_cb.ListRequest{},
|
||||||
"/restmachine/cloudbroker/sep/updateCapacityLimit": sep_cb.UpdateCapacityLimitRequest{},
|
|
||||||
|
|
||||||
// stack
|
// stack
|
||||||
"/restmachine/cloudbroker/stack/get": stack_cb.GetRequest{},
|
"/restmachine/cloudbroker/stack/get": stack_cb.GetRequest{},
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
[
|
|
||||||
"Account list: OK",
|
|
||||||
"Account get: OK",
|
|
||||||
"",
|
|
||||||
"Bservice get: OK",
|
|
||||||
"Compute list: \nPlatform has these fields that golang struct doesn't: [lb mgmt_target mgmt_mac mgmt_slot]\n",
|
|
||||||
"Compute get: \nPlatform has these fields that golang struct doesn't: [mgmt_target mgmt_mac mgmt_slot lb]\n",
|
|
||||||
"Disk list: OK",
|
|
||||||
"Disk get: OK",
|
|
||||||
"",
|
|
||||||
"ExtNet get: OK",
|
|
||||||
"FLIPGroup list: OK",
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"Image get: \nPlatform has these fields that golang struct doesn't: [12]\n",
|
|
||||||
"K8CI list: OK",
|
|
||||||
"",
|
|
||||||
"K8S list: OK",
|
|
||||||
"K8S get: OK",
|
|
||||||
"LB list: \nPlatform has these fields that golang struct doesn't: [fs.inotify.max_queued_events kernel.kptr_restrict net.ipv4.tcp_congestion_control]\n",
|
|
||||||
"LB get: \nPlatform has these fields that golang struct doesn't: [kernel.kptr_restrict net.ipv4.tcp_congestion_control fs.inotify.max_queued_events]\n",
|
|
||||||
"Locations list: OK",
|
|
||||||
"RG list: OK",
|
|
||||||
"",
|
|
||||||
"Sizes list: OK",
|
|
||||||
"",
|
|
||||||
"Tasks list: \nPlatform has these fields that golang struct doesn't: [completed guid stage updateTime updatedTime auditId error log status]\n",
|
|
||||||
"Tasks get: \nPlatform has these fields that golang struct doesn't: [updatedTime completed error updateTime auditId stage status log]\n",
|
|
||||||
"",
|
|
||||||
"VINS get: OK"
|
|
||||||
]
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
[
|
|
||||||
"Account list: OK",
|
|
||||||
"Account get: OK",
|
|
||||||
"",
|
|
||||||
"Audit get: OK",
|
|
||||||
"Compute list: \nPlatform has these fields that golang struct doesn't: [disks]\n",
|
|
||||||
"Compute get: OK",
|
|
||||||
"Disk list: \nPlatform has these fields that golang struct doesn't: [machineId machineName sepType devicename]\n",
|
|
||||||
"Disk get: \nPlatform has these fields that golang struct doesn't: [devicename sepType updatedBy]\n",
|
|
||||||
"ExtNet list: OK",
|
|
||||||
"ExtNet get: OK",
|
|
||||||
"FLIPGroup list: OK",
|
|
||||||
"",
|
|
||||||
"Grid list: \nPlatform has these fields that golang struct doesn't: [1 90 380 1 90 380]\n",
|
|
||||||
"Grid get: OK",
|
|
||||||
"Image list: OK",
|
|
||||||
"Image get: OK",
|
|
||||||
"K8CI list: \nPlatform has these fields that golang struct doesn't: [createdTime]\n",
|
|
||||||
"K8CI get: OK",
|
|
||||||
"K8S list: OK",
|
|
||||||
"K8S get: OK",
|
|
||||||
"LB list: OK",
|
|
||||||
"LB get: OK",
|
|
||||||
"Pcidevice list: OK",
|
|
||||||
"RG list: OK",
|
|
||||||
"RG get: OK",
|
|
||||||
"SEP list: \nPlatform has these fields that golang struct doesn't: [protocol disk_max_size format name name_prefix pools]\n",
|
|
||||||
"SEP get: \nPlatform has these fields that golang struct doesn't: [format name name_prefix pools protocol disk_max_size]\n",
|
|
||||||
"Stack list: OK",
|
|
||||||
"Stack get: OK",
|
|
||||||
"Tasks list: \nPlatform has these fields that golang struct doesn't: [stage status error log auditId completed updateTime guid]\n",
|
|
||||||
"",
|
|
||||||
"VINS get: \nPlatform has these fields that golang struct doesn't: [computes config config config]\n"
|
|
||||||
]
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
[
|
|
||||||
"Path /cloudapi/compute/antiAffinityRuleAdd has following errors: [Field value has different required parameters on the platform and in golang structure]",
|
|
||||||
"Path /cloudapi/user/setData has following errors: [Field data has different required parameters on the platform and in golang structure]",
|
|
||||||
"Path /cloudapi/compute/affinityRuleRemove has following errors: [Field value has different required parameters on the platform and in golang structure]",
|
|
||||||
"Path /cloudapi/compute/createTemplate has following errors: [Platform (3) and golang structure (2) have different amount of fields. Platform has field asyncMode that golang structure doesn't]",
|
|
||||||
"Path /cloudapi/k8s/create has following errors: [Field oidcCertificate has different type parameters on the platform and in golang structure]",
|
|
||||||
"Path /cloudapi/disks/fromPlatformDisk has following errors: [Platform (14) and golang structure (13) have different amount of fields. Field drivers has different type parameters on the platform and in golang structure Platform has field asyncMode that golang structure doesn't]",
|
|
||||||
"Path /cloudapi/compute/affinityRuleAdd has following errors: [Field value has different required parameters on the platform and in golang structure]",
|
|
||||||
"Path /cloudapi/compute/antiAffinityRuleRemove has following errors: [Field value has different required parameters on the platform and in golang structure]",
|
|
||||||
"Path /cloudapi/compute/createTemplateFromBlank has following errors: [Platform (11) and golang structure (10) have different amount of fields. Platform has field asyncMode that golang structure doesn't]",
|
|
||||||
"Path /cloudapi/lb/create has following errors: [Field extnetId has different required parameters on the platform and in golang structure Field vinsId has different required parameters on the platform and in golang structure]",
|
|
||||||
"Path /cloudapi/image/list has following errors: [Field size has different type parameters on the platform and in golang structure]",
|
|
||||||
"Path /cloudapi/compute/snapshotDelete has following errors: [Platform (3) and golang structure (2) have different amount of fields. Platform has field asyncMode that golang structure doesn't]"
|
|
||||||
]
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
["Path /cloudbroker/compute/createTemplate has following errors: [Platform (4) and golang structure (3) have different amount of fields. Platform has field asyncMode that golang structure doesn't]","Path /cloudbroker/backup/createDisksBackup has following errors: [Platform (3) and golang structure (2) have different amount of fields. Platform has field asyncMode that golang structure doesn't]","Path /cloudbroker/compute/affinityRuleAdd has following errors: [Field value has different required parameters on the platform and in golang structure]","Path /cloudbroker/apiaccess/update has following errors: [Platform has field apis that golang structure doesn't]","Path /cloudbroker/compute/antiAffinityRuleRemove has following errors: [Field value has different required parameters on the platform and in golang structure]","Path /cloudbroker/compute/snapshotDelete has following errors: [Platform (3) and golang structure (2) have different amount of fields. Platform has field asyncMode that golang structure doesn't]","Path /cloudbroker/backup/restoreDiskFromBackup has following errors: [Platform (5) and golang structure (4) have different amount of fields. Platform has field asyncMode that golang structure doesn't]","Path /cloudbroker/backup/createDiskBackup has following errors: [Platform (4) and golang structure (3) have different amount of fields. Platform has field asyncMode that golang structure doesn't]","Path /cloudbroker/compute/createTemplateFromBlank has following errors: [Platform (11) and golang structure (10) have different amount of fields. Platform has field asyncMode that golang structure doesn't]","Path /cloudbroker/account/setCpuAllocationRatio has following errors: [Field ratio has different required parameters on the platform and in golang structure]","Path /cloudbroker/disks/fromPlatformDisk has following errors: [Platform (14) and golang structure (13) have different amount of fields. Field drivers has different type parameters on the platform and in golang structure Platform has field asyncMode that golang structure doesn't]","Path /cloudbroker/lb/create has following errors: [Field extnetId has different required parameters on the platform and in golang structure Field vinsId has different required parameters on the platform and in golang structure]","Path /cloudbroker/stack/setCpuAllocationRatio has following errors: [Field ratio has different required parameters on the platform and in golang structure]","Path /cloudbroker/backup/deleteDiskBackup has following errors: [Platform (3) and golang structure (2) have different amount of fields. Platform has field asyncMode that golang structure doesn't]","Path /cloudbroker/image/updateNodes has following errors: [Field enabledStacks has different type parameters on the platform and in golang structure]","Path /cloudbroker/stack/setMemAllocationRatio has following errors: [Field ratio has different required parameters on the platform and in golang structure]","Path /cloudbroker/compute/antiAffinityRuleAdd has following errors: [Field value has different required parameters on the platform and in golang structure]","Path /cloudbroker/k8s/create has following errors: [Field oidcCertificate has different type parameters on the platform and in golang structure]","Path /cloudbroker/backup/restoreDisksFromBackup has following errors: [Platform (3) and golang structure (2) have different amount of fields. Platform has field disks that golang structure doesn't Platform has field asyncMode that golang structure doesn't]","Path /cloudbroker/node/enable has following errors: [Platform (4) and golang structure (3) have different amount of fields. Platform has field asyncMode that golang structure doesn't]","Path /cloudbroker/compute/affinityRuleRemove has following errors: [Field value has different required parameters on the platform and in golang structure]","Path /cloudbroker/image/list has following errors: [Field size has different type parameters on the platform and in golang structure]"]
|
|
||||||
@@ -15,10 +15,14 @@ var DEPRECATED_GROUPS = []string{
|
|||||||
"//cloudbroker/pgpu/",
|
"//cloudbroker/pgpu/",
|
||||||
"/cloudapi/gpu/",
|
"/cloudapi/gpu/",
|
||||||
"/cloudapi/portforwarding/",
|
"/cloudapi/portforwarding/",
|
||||||
|
"/cloudapi/account/create",
|
||||||
"/cloudapi/account/listVMs",
|
"/cloudapi/account/listVMs",
|
||||||
"/cloudapi/account/listCS",
|
"/cloudapi/account/listCS",
|
||||||
"/cloudapi/account/getStats",
|
"/cloudapi/account/getStats",
|
||||||
"/cloudapi/vgpu/list",
|
"/cloudapi/vgpu/list",
|
||||||
|
"/cloudapi/compute/affinityGroupCheckStart",
|
||||||
|
"/cloudapi/vins/staticRouteAccessGrant",
|
||||||
|
"/cloudapi/vins/staticRouteAccessRevoke",
|
||||||
|
|
||||||
"/cloudbroker/account/listVMs",
|
"/cloudbroker/account/listVMs",
|
||||||
"/cloudbroker/account/listCS",
|
"/cloudbroker/account/listCS",
|
||||||
@@ -42,6 +46,9 @@ var DEPRECATED_GROUPS = []string{
|
|||||||
"/cloudbroker/iaas/",
|
"/cloudbroker/iaas/",
|
||||||
"/cloudbroker/diagnostics/",
|
"/cloudbroker/diagnostics/",
|
||||||
"/cloudbroker/milestones/",
|
"/cloudbroker/milestones/",
|
||||||
|
"/cloudbroker/compute/affinityGroupCheckStart",
|
||||||
|
"/cloudbroker/vins/staticRouteAccessGrant",
|
||||||
|
"/cloudbroker/vins/staticRouteAccessRevoke",
|
||||||
}
|
}
|
||||||
|
|
||||||
// getUrlsFromBytes converts bytes to array of urls strings
|
// getUrlsFromBytes converts bytes to array of urls strings
|
||||||
@@ -95,6 +102,26 @@ func getMissingDecortUrls(jsonUrls, decortUrls []string) []string {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// getMissingDecortUrls returns array of url strings that are present in json swagger docs and absent in decort-sdk handlers.
|
||||||
|
func getDeprecatedDecortUrls(jsonUrls, decortUrls []string) []string {
|
||||||
|
result := make([]string, 0, len(decortUrls))
|
||||||
|
for _, decortUrl := range decortUrls {
|
||||||
|
var found bool
|
||||||
|
for _, jsonUrl := range jsonUrls {
|
||||||
|
if jsonUrl == decortUrl {
|
||||||
|
found = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if !found && validateUrlFromJson(decortUrl) {
|
||||||
|
result = append(result, decortUrl)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
// readUrlFromDir reads all url addresses from given directory and its subdirectories and subfiles and returns array of urls found. Capacity will
|
// readUrlFromDir reads all url addresses from given directory and its subdirectories and subfiles and returns array of urls found. Capacity will
|
||||||
func readUrlFromDir(dirName string, capacity int) []string {
|
func readUrlFromDir(dirName string, capacity int) []string {
|
||||||
result := make([]string, 0, capacity)
|
result := make([]string, 0, capacity)
|
||||||
|
|||||||
Reference in New Issue
Block a user