Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9192f307e1 | |||
|
|
aee072c194 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,5 +6,4 @@ 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
|
||||||
|
|||||||
60
CHANGELOG.md
60
CHANGELOG.md
@@ -1,64 +1,8 @@
|
|||||||
## Version 1.10.0
|
## Version 1.9.4
|
||||||
|
|
||||||
### Добавлено
|
|
||||||
|
|
||||||
#### compute
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-204 | Вычисляемое поле `VNCPassword` в моделях `RecordCompute` в cloudapi/compute и cloudbroker/compute |
|
|
||||||
| BGOS-204 | Опциональное поле `CDImageID` в структуре `ListRequest` в cloudbroker/compute |
|
|
||||||
| BGOS-211 | Вычисляемое поле `AutoStart` в моделях `RecordCompute, ItemCompute, InfoCompute` в cloudapi/compute и cloudbroker/compute |
|
|
||||||
| BGOS-211 | Опциональное поле `AutoStart` в структурах `PinToStackRequest, UpdateRequest` в cloudapi/compute и cloudbroker/compute |
|
|
||||||
|
|
||||||
#### extnet
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-204 | Вычисляемое поле `AccountID` в модели `ItemReservation` в cloudapi/extnet и cloudbroker/extnet |
|
|
||||||
| BGOS-205 | Методы API `cloudbroker/extnet/addReservedIp, cloudbroker/extnet/getReservedIp, cloudapi/extnet/getReservedIp, cloudbroker/extnet/delReservedIp` в cloudapi/extnet и cloudbroker/extnet |
|
|
||||||
|
|
||||||
#### image
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-214 | Вычисляемое поле `SnapshotID` в модели `RecordImage, ItemImage` в cloudbroker/image |
|
|
||||||
|
|
||||||
#### node
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-204 | Обязательное поле `Spoofchk` в структуре `SetVFsNumberRequest` в cloudbroker/node |
|
|
||||||
| BGOS-213 | Вычисляемое поле `NetAddr` в модели `RecordNode` в cloudbroker/node |
|
|
||||||
|
|
||||||
#### vgpu
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-204 | Опциональное поле `NID` в структуре `ListRequest` в cloudbroker/vgpu |
|
|
||||||
|
|
||||||
#### vins
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-204 | Вычисляемое поле `VNCPassword` в модели `RecordVNFDev` в cloudapi/vins и cloudbroker/vins |
|
|
||||||
| BGOS-204 | Вычисляемое поле `AccoundID` в модели `ItemReservation` в cloudapi/vins |
|
|
||||||
|
|
||||||
### Удалено
|
|
||||||
|
|
||||||
#### disks
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-206 | Метод `Resize` в cloudapi/disks и cloudbroker/disks |
|
|
||||||
|
|
||||||
#### sep
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-206 | Метод `UpdateCapacityLimit` cloudbroker/sep |
|
|
||||||
|
|
||||||
#### vins
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-204 | Вычисляемые поля `ClientType,Description,DomainName,Hostname` в модели `ItemReservation` в cloudapi/vins и cloudbroker/vins |
|
|
||||||
| BGOS-204 | Вычисляемое поле `СomputeIds` в структуре `StaticRouteAddRequest` в cloudapi/vins и cloudbroker/vins |
|
|
||||||
|
|
||||||
### Исправлено
|
### Исправлено
|
||||||
|
|
||||||
#### compute
|
#### compute
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BATF-215 | Изменены возвращаемые параметры метода `PinToStack` на `bool,error` в cloudapi/compute |
|
| BGOS-485 | Изменен тип параметров `VGPUs` с []uint64 на []VGPUItem в структуре `RecordCompute` в cloudapi/compute и в cloudbroker/compute |
|
||||||
@@ -14,7 +14,6 @@ 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 версии платформы
|
|
||||||
|
|
||||||
## Оглавление
|
## Оглавление
|
||||||
|
|
||||||
@@ -142,6 +141,8 @@ go get -u repository.basistech.ru/BASIS/decort-golang-sdk
|
|||||||
- `LB` - управление балансировщиками нагрузки;
|
- `LB` - управление балансировщиками нагрузки;
|
||||||
- `Node` - управление нодами платформы;
|
- `Node` - управление нодами платформы;
|
||||||
- `PCIDevice` - управление устройствами;
|
- `PCIDevice` - управление устройствами;
|
||||||
|
- `Prometheus` - получение статистики prometheus;
|
||||||
|
- `Resmon` - получение статистики resource monitoring;
|
||||||
- `RG` - управление ресурсными группами аккаунта;
|
- `RG` - управление ресурсными группами аккаунта;
|
||||||
- `SEP` - управление storage endpoint (sep);
|
- `SEP` - управление storage endpoint (sep);
|
||||||
- `Stack` - получение информации о вычислительных узлах;
|
- `Stack` - получение информации о вычислительных узлах;
|
||||||
@@ -319,6 +320,8 @@ func main() {
|
|||||||
- `pkg/cloudbroker/lb` - для `LB`
|
- `pkg/cloudbroker/lb` - для `LB`
|
||||||
- `pkg/cloudbroker/node` - для `Node`
|
- `pkg/cloudbroker/node` - для `Node`
|
||||||
- `pkg/cloudbroker/pcidevice` - для `PCIDevice`
|
- `pkg/cloudbroker/pcidevice` - для `PCIDevice`
|
||||||
|
- `pkg/cloudbroker/prometheus` - для `Prometheus`
|
||||||
|
- `pkg/cloudbroker/resmon` - для `Resmon`
|
||||||
- `pkg/cloudbroker/rg` - для `RG`
|
- `pkg/cloudbroker/rg` - для `RG`
|
||||||
- `pkg/cloudbroker/sep` - для `SEP`
|
- `pkg/cloudbroker/sep` - для `SEP`
|
||||||
- `pkg/cloudbroker/stack` - для `Stack`
|
- `pkg/cloudbroker/stack` - для `Stack`
|
||||||
@@ -480,6 +483,7 @@ func main() {
|
|||||||
- `.LB()` - для работы с `LB`
|
- `.LB()` - для работы с `LB`
|
||||||
- `.Locations()` - для работы с `Locations`
|
- `.Locations()` - для работы с `Locations`
|
||||||
- `.RG()` - для работы с `RG`
|
- `.RG()` - для работы с `RG`
|
||||||
|
- `.Resmon()` - для работы с `Resmon`
|
||||||
- `.Stack()` - для работы с `Stack`
|
- `.Stack()` - для работы с `Stack`
|
||||||
- `.Tasks()` - для работы с `Tasks`
|
- `.Tasks()` - для работы с `Tasks`
|
||||||
- `.VFPool()` - для работы с `VFPool`
|
- `.VFPool()` - для работы с `VFPool`
|
||||||
@@ -505,6 +509,8 @@ func main() {
|
|||||||
- `.LB()` - для работы с `LB`
|
- `.LB()` - для работы с `LB`
|
||||||
- `.Node()` - для работы с `Node`
|
- `.Node()` - для работы с `Node`
|
||||||
- `.PCIDevice()` - для работы с `PCIDevice`
|
- `.PCIDevice()` - для работы с `PCIDevice`
|
||||||
|
- `.Prometheus()` - для работы с `Prometheus`
|
||||||
|
- `.Resmon()` - для работы с `Resmon`
|
||||||
- `.RG()` - для работы с `RG`
|
- `.RG()` - для работы с `RG`
|
||||||
- `.SEP()` - для работы с `SEP`
|
- `.SEP()` - для работы с `SEP`
|
||||||
- `.Stack()` - для работы с `Stack`
|
- `.Stack()` - для работы с `Stack`
|
||||||
|
|||||||
@@ -374,6 +374,7 @@ 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)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,9 +299,6 @@ 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"`
|
||||||
|
|
||||||
@@ -479,17 +476,14 @@ type RecordCompute struct {
|
|||||||
// Userdata
|
// Userdata
|
||||||
Userdata interface{} `json:"userdata"`
|
Userdata interface{} `json:"userdata"`
|
||||||
|
|
||||||
// vGPU IDs
|
// vGPU list
|
||||||
VGPUs []uint64 `json:"vgpus"`
|
VGPUs []ItemVGPU `json:"vgpus"`
|
||||||
|
|
||||||
// Virtual image ID
|
// Virtual image ID
|
||||||
VirtualImageID uint64 `json:"virtualImageId"`
|
VirtualImageID uint64 `json:"virtualImageId"`
|
||||||
|
|
||||||
// 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
|
||||||
@@ -872,9 +866,6 @@ 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"`
|
||||||
|
|
||||||
|
|||||||
@@ -13,30 +13,25 @@ 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) (bool, error) {
|
func (c Compute) PinToStack(ctx context.Context, req PinToStackRequest) (uint64, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/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 false, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := strconv.ParseBool(string(res))
|
result, err := strconv.ParseUint(string(res), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
|
|||||||
@@ -43,11 +43,6 @@ 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"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update updates some properties of the compute
|
// Update updates some properties of the compute
|
||||||
|
|||||||
@@ -19,6 +19,31 @@ 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.
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
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,9 +87,6 @@ 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"`
|
||||||
|
|
||||||
@@ -229,20 +226,3 @@ 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"`
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -208,9 +208,6 @@ 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
|
||||||
@@ -796,8 +793,17 @@ type ListNATRules struct {
|
|||||||
|
|
||||||
// Main information about reservation
|
// Main information about reservation
|
||||||
type ItemReservation struct {
|
type ItemReservation struct {
|
||||||
// Account ID
|
// Client type
|
||||||
AccountID uint64 `json:"account_id"`
|
ClientType string `json:"clientType"`
|
||||||
|
|
||||||
|
// 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,6 +25,10 @@ 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
|
||||||
|
|||||||
@@ -50,10 +50,6 @@ 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,9 +624,6 @@ 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"`
|
||||||
|
|
||||||
@@ -849,9 +846,6 @@ 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"`
|
||||||
|
|
||||||
@@ -1041,17 +1035,14 @@ type RecordCompute struct {
|
|||||||
// Userdata
|
// Userdata
|
||||||
Userdata interface{} `json:"userdata"`
|
Userdata interface{} `json:"userdata"`
|
||||||
|
|
||||||
// List VGPU IDs
|
// List VGPUs
|
||||||
VGPUs []uint64 `json:"vgpus"`
|
VGPUs []ItemVGPU `json:"vgpus"`
|
||||||
|
|
||||||
// Virtual image ID
|
// Virtual image ID
|
||||||
VirtualImageID uint64 `json:"virtualImageId"`
|
VirtualImageID uint64 `json:"virtualImageId"`
|
||||||
|
|
||||||
// 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,11 +21,6 @@ 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
|
||||||
|
|||||||
@@ -43,11 +43,6 @@ 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"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update updates some properties of the compute
|
// Update updates some properties of the compute
|
||||||
|
|||||||
@@ -19,6 +19,31 @@ 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.
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
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
|
|
||||||
}
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
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
|
|
||||||
}
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
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,9 +17,6 @@ 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"`
|
||||||
|
|
||||||
@@ -241,20 +238,3 @@ 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,6 +2,7 @@ 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"
|
||||||
@@ -38,7 +39,7 @@ func (g Grid) GetDiagnosisGET(ctx context.Context, req GetDiagnosisRequest) (str
|
|||||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/grid/getDiagnosis"
|
url := fmt.Sprintf("/cloudbroker/grid/getDiagnosis/?gid=%d", req.GID)
|
||||||
|
|
||||||
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,9 +104,6 @@ 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"`
|
||||||
|
|
||||||
@@ -230,9 +227,6 @@ 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"`
|
||||||
|
|
||||||
|
|||||||
@@ -29,9 +29,6 @@ type RecordNode struct {
|
|||||||
// NeedReboot
|
// NeedReboot
|
||||||
NeedReboot bool `json:"needReboot"`
|
NeedReboot bool `json:"needReboot"`
|
||||||
|
|
||||||
// Netaddr
|
|
||||||
NetAddr NetAddr `json:"netaddr"`
|
|
||||||
|
|
||||||
// Nic Info
|
// Nic Info
|
||||||
NicInfo ListNicInfo `json:"nicInfo"`
|
NicInfo ListNicInfo `json:"nicInfo"`
|
||||||
|
|
||||||
@@ -317,12 +314,3 @@ 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"`
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -24,10 +24,6 @@ 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
|
||||||
|
|||||||
8
pkg/cloudbroker/prometheus.go
Normal file
8
pkg/cloudbroker/prometheus.go
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
package cloudbroker
|
||||||
|
|
||||||
|
import "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/prometheus"
|
||||||
|
|
||||||
|
// Accessing the Prometheus method group
|
||||||
|
func (cb *CloudBroker) Prometheus() *prometheus.Prometheus {
|
||||||
|
return prometheus.New(cb.client)
|
||||||
|
}
|
||||||
57
pkg/cloudbroker/prometheus/compute_cpu_load.go
Normal file
57
pkg/cloudbroker/prometheus/compute_cpu_load.go
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
package prometheus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ComputeCPULoadRequest struct {
|
||||||
|
// Compute ID
|
||||||
|
// Required: true
|
||||||
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
|
// Time to loads of statistic in seconds
|
||||||
|
// Required: false
|
||||||
|
ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"`
|
||||||
|
|
||||||
|
// The reading interval in seconds
|
||||||
|
// Required: true
|
||||||
|
Step uint64 `url:"step,omitempty" json:"step,omitempty"`
|
||||||
|
|
||||||
|
// Number of zeros after the decimal point
|
||||||
|
// Required: true
|
||||||
|
DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Per-second CPU time consumed by Compute in percent, average over the time step specified
|
||||||
|
func (p Prometheus) ComputeCPULoad(ctx context.Context, req ComputeCPULoadRequest) (*PrometheusData, error) {
|
||||||
|
res, err := p.ComputeCPULoadRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := PrometheusData{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about compute as an array of bytes
|
||||||
|
func (p Prometheus) ComputeCPULoadRaw(ctx context.Context, req ComputeCPULoadRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/prometheus/computeCPUload"
|
||||||
|
|
||||||
|
res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
53
pkg/cloudbroker/prometheus/compute_memory_available.go
Normal file
53
pkg/cloudbroker/prometheus/compute_memory_available.go
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
package prometheus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ComputeMemoryAvailableRequest struct {
|
||||||
|
// Compute ID
|
||||||
|
// Required: true
|
||||||
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
|
// Time to loads of statistic in seconds
|
||||||
|
// Required: false
|
||||||
|
ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"`
|
||||||
|
|
||||||
|
// The reading interval in seconds
|
||||||
|
// Required: true
|
||||||
|
Step uint64 `url:"step,omitempty" json:"step,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Available Memory
|
||||||
|
func (p Prometheus) ComputeMemoryAvailable(ctx context.Context, req ComputeMemoryAvailableRequest) (*PrometheusData, error) {
|
||||||
|
res, err := p.ComputeMemoryAvailableRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := PrometheusData{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about compute as an array of bytes
|
||||||
|
func (p Prometheus) ComputeMemoryAvailableRaw(ctx context.Context, req ComputeMemoryAvailableRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/prometheus/computeMemoryAvailable"
|
||||||
|
|
||||||
|
res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
53
pkg/cloudbroker/prometheus/compute_memory_unused.go
Normal file
53
pkg/cloudbroker/prometheus/compute_memory_unused.go
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
package prometheus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ComputeMemoryUnusedRequest struct {
|
||||||
|
// Compute ID
|
||||||
|
// Required: true
|
||||||
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
|
// Time to loads of statistic in seconds
|
||||||
|
// Required: false
|
||||||
|
ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"`
|
||||||
|
|
||||||
|
// The reading interval in seconds
|
||||||
|
// Required: true
|
||||||
|
Step uint64 `url:"step,omitempty" json:"step,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unused Memory
|
||||||
|
func (p Prometheus) ComputeMemoryUnused(ctx context.Context, req ComputeMemoryUnusedRequest) (*PrometheusData, error) {
|
||||||
|
res, err := p.ComputeMemoryUnusedRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := PrometheusData{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about compute as an array of bytes
|
||||||
|
func (p Prometheus) ComputeMemoryUnusedRaw(ctx context.Context, req ComputeMemoryUnusedRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/prometheus/computeMemoryUnused"
|
||||||
|
|
||||||
|
res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
53
pkg/cloudbroker/prometheus/compute_memory_usable.go
Normal file
53
pkg/cloudbroker/prometheus/compute_memory_usable.go
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
package prometheus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ComputeMemoryUsableRequest struct {
|
||||||
|
// Compute ID
|
||||||
|
// Required: true
|
||||||
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
|
// Time to loads of statistic in seconds
|
||||||
|
// Required: false
|
||||||
|
ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"`
|
||||||
|
|
||||||
|
// The reading interval in seconds
|
||||||
|
// Required: true
|
||||||
|
Step uint64 `url:"step,omitempty" json:"step,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Usable Memory
|
||||||
|
func (p Prometheus) ComputeMemoryUsable(ctx context.Context, req ComputeMemoryUsableRequest) (*PrometheusData, error) {
|
||||||
|
res, err := p.ComputeMemoryUsableRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := PrometheusData{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about compute as an array of bytes
|
||||||
|
func (p Prometheus) ComputeMemoryUsableRaw(ctx context.Context, req ComputeMemoryUsableRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/prometheus/computeMemoryUsable"
|
||||||
|
|
||||||
|
res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
53
pkg/cloudbroker/prometheus/compute_memory_usage.go
Normal file
53
pkg/cloudbroker/prometheus/compute_memory_usage.go
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
package prometheus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ComputeMemoryUsageRequest struct {
|
||||||
|
// Compute ID
|
||||||
|
// Required: true
|
||||||
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
|
// Time to loads of statistic in seconds
|
||||||
|
// Required: false
|
||||||
|
ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"`
|
||||||
|
|
||||||
|
// The reading interval in seconds
|
||||||
|
// Required: true
|
||||||
|
Step uint64 `url:"step,omitempty" json:"step,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Memory Usage
|
||||||
|
func (p Prometheus) ComputeMemoryUsage(ctx context.Context, req ComputeMemoryUsageRequest) (*PrometheusData, error) {
|
||||||
|
res, err := p.ComputeMemoryUsageRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := PrometheusData{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about compute as an array of bytes
|
||||||
|
func (p Prometheus) ComputeMemoryUsageRaw(ctx context.Context, req ComputeMemoryUsageRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/prometheus/computeMemoryUsage"
|
||||||
|
|
||||||
|
res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
53
pkg/cloudbroker/prometheus/compute_memory_used.go
Normal file
53
pkg/cloudbroker/prometheus/compute_memory_used.go
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
package prometheus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ComputeMemoryUsedRequest struct {
|
||||||
|
// Compute ID
|
||||||
|
// Required: true
|
||||||
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
|
// Time to loads of statistic in seconds
|
||||||
|
// Required: false
|
||||||
|
ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"`
|
||||||
|
|
||||||
|
// The reading interval in seconds
|
||||||
|
// Required: true
|
||||||
|
Step uint64 `url:"step,omitempty" json:"step,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Used Memory
|
||||||
|
func (p Prometheus) ComputeMemoryUsed(ctx context.Context, req ComputeMemoryUsedRequest) (*PrometheusData, error) {
|
||||||
|
res, err := p.ComputeMemoryUsedRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := PrometheusData{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about compute as an array of bytes
|
||||||
|
func (p Prometheus) ComputeMemoryUsedRaw(ctx context.Context, req ComputeMemoryUsedRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/prometheus/computeMemoryUsed"
|
||||||
|
|
||||||
|
res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
57
pkg/cloudbroker/prometheus/compute_read_bytes.go
Normal file
57
pkg/cloudbroker/prometheus/compute_read_bytes.go
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
package prometheus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ComputeReadBytesRequest struct {
|
||||||
|
// Compute ID
|
||||||
|
// Required: true
|
||||||
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
|
// Time to loads of statistic in seconds
|
||||||
|
// Required: false
|
||||||
|
ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"`
|
||||||
|
|
||||||
|
// The reading interval in seconds
|
||||||
|
// Required: true
|
||||||
|
Step uint64 `url:"step,omitempty" json:"step,omitempty"`
|
||||||
|
|
||||||
|
// Number of zeros after the decimal point
|
||||||
|
// Required: true
|
||||||
|
DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read Bytes
|
||||||
|
func (p Prometheus) ComputeReadBytes(ctx context.Context, req ComputeReadBytesRequest) (*PrometheusData, error) {
|
||||||
|
res, err := p.ComputeReadBytesRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := PrometheusData{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about compute as an array of bytes
|
||||||
|
func (p Prometheus) ComputeReadBytesRaw(ctx context.Context, req ComputeReadBytesRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/prometheus/computeReadBytes"
|
||||||
|
|
||||||
|
res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
57
pkg/cloudbroker/prometheus/compute_read_requests.go
Normal file
57
pkg/cloudbroker/prometheus/compute_read_requests.go
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
package prometheus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ComputeReadRequestsRequest struct {
|
||||||
|
// Compute ID
|
||||||
|
// Required: true
|
||||||
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
|
// Time to loads of statistic in seconds
|
||||||
|
// Required: false
|
||||||
|
ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"`
|
||||||
|
|
||||||
|
// The reading interval in seconds
|
||||||
|
// Required: true
|
||||||
|
Step uint64 `url:"step,omitempty" json:"step,omitempty"`
|
||||||
|
|
||||||
|
// Number of zeros after the decimal point
|
||||||
|
// Required: true
|
||||||
|
DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read Requests
|
||||||
|
func (p Prometheus) ComputeReadRequests(ctx context.Context, req ComputeReadRequestsRequest) (*PrometheusData, error) {
|
||||||
|
res, err := p.ComputeReadRequestsRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := PrometheusData{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about compute as an array of bytes
|
||||||
|
func (p Prometheus) ComputeReadRequestsRaw(ctx context.Context, req ComputeReadRequestsRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/prometheus/computeReadRequests"
|
||||||
|
|
||||||
|
res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
57
pkg/cloudbroker/prometheus/compute_receive_bytes.go
Normal file
57
pkg/cloudbroker/prometheus/compute_receive_bytes.go
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
package prometheus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ComputeReceiveBytesRequest struct {
|
||||||
|
// Compute ID
|
||||||
|
// Required: true
|
||||||
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
|
// Time to loads of statistic in seconds
|
||||||
|
// Required: false
|
||||||
|
ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"`
|
||||||
|
|
||||||
|
// The reading interval in seconds
|
||||||
|
// Required: true
|
||||||
|
Step uint64 `url:"step,omitempty" json:"step,omitempty"`
|
||||||
|
|
||||||
|
// Number of zeros after the decimal point
|
||||||
|
// Required: true
|
||||||
|
DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Receive Bytes
|
||||||
|
func (p Prometheus) ComputeReceiveBytes(ctx context.Context, req ComputeReceiveBytesRequest) (*PrometheusData, error) {
|
||||||
|
res, err := p.ComputeReceiveBytesRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := PrometheusData{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about compute as an array of bytes
|
||||||
|
func (p Prometheus) ComputeReceiveBytesRaw(ctx context.Context, req ComputeReceiveBytesRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/prometheus/computeReceiveBytes"
|
||||||
|
|
||||||
|
res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
57
pkg/cloudbroker/prometheus/compute_receive_packets.go
Normal file
57
pkg/cloudbroker/prometheus/compute_receive_packets.go
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
package prometheus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ComputeReceivePacketsRequest struct {
|
||||||
|
// Compute ID
|
||||||
|
// Required: true
|
||||||
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
|
// Time to loads of statistic in seconds
|
||||||
|
// Required: false
|
||||||
|
ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"`
|
||||||
|
|
||||||
|
// The reading interval in seconds
|
||||||
|
// Required: true
|
||||||
|
Step uint64 `url:"step,omitempty" json:"step,omitempty"`
|
||||||
|
|
||||||
|
// Number of zeros after the decimal point
|
||||||
|
// Required: true
|
||||||
|
DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Receive Packets
|
||||||
|
func (p Prometheus) ComputeReceivePackets(ctx context.Context, req ComputeReceivePacketsRequest) (*PrometheusData, error) {
|
||||||
|
res, err := p.ComputeReceivePacketsRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := PrometheusData{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about compute as an array of bytes
|
||||||
|
func (p Prometheus) ComputeReceivePacketsRaw(ctx context.Context, req ComputeReceivePacketsRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/prometheus/computeReceivePackets"
|
||||||
|
|
||||||
|
res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
57
pkg/cloudbroker/prometheus/compute_transmit_bytes.go
Normal file
57
pkg/cloudbroker/prometheus/compute_transmit_bytes.go
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
package prometheus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ComputeTransmitBytesRequest struct {
|
||||||
|
// Compute ID
|
||||||
|
// Required: true
|
||||||
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
|
// Time to loads of statistic in seconds
|
||||||
|
// Required: false
|
||||||
|
ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"`
|
||||||
|
|
||||||
|
// The reading interval in seconds
|
||||||
|
// Required: true
|
||||||
|
Step uint64 `url:"step,omitempty" json:"step,omitempty"`
|
||||||
|
|
||||||
|
// Number of zeros after the decimal point
|
||||||
|
// Required: true
|
||||||
|
DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Transmit Bytes
|
||||||
|
func (p Prometheus) ComputeTransmitBytes(ctx context.Context, req ComputeTransmitBytesRequest) (*PrometheusData, error) {
|
||||||
|
res, err := p.ComputeTransmitBytesRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := PrometheusData{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about compute as an array of bytes
|
||||||
|
func (p Prometheus) ComputeTransmitBytesRaw(ctx context.Context, req ComputeTransmitBytesRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/prometheus/computeTransmitBytes"
|
||||||
|
|
||||||
|
res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
57
pkg/cloudbroker/prometheus/compute_transmit_packets.go
Normal file
57
pkg/cloudbroker/prometheus/compute_transmit_packets.go
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
package prometheus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ComputeTransmitPacketsRequest struct {
|
||||||
|
// Compute ID
|
||||||
|
// Required: true
|
||||||
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
|
// Time to loads of statistic in seconds
|
||||||
|
// Required: false
|
||||||
|
ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"`
|
||||||
|
|
||||||
|
// The reading interval in seconds
|
||||||
|
// Required: true
|
||||||
|
Step uint64 `url:"step,omitempty" json:"step,omitempty"`
|
||||||
|
|
||||||
|
// Number of zeros after the decimal point
|
||||||
|
// Required: true
|
||||||
|
DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Transmit Packets
|
||||||
|
func (p Prometheus) ComputeTransmitPackets(ctx context.Context, req ComputeTransmitPacketsRequest) (*PrometheusData, error) {
|
||||||
|
res, err := p.ComputeTransmitPacketsRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := PrometheusData{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about compute as an array of bytes
|
||||||
|
func (p Prometheus) ComputeTransmitPacketsRaw(ctx context.Context, req ComputeTransmitPacketsRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/prometheus/computeTransmitPackets"
|
||||||
|
|
||||||
|
res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
57
pkg/cloudbroker/prometheus/compute_write_bytes.go
Normal file
57
pkg/cloudbroker/prometheus/compute_write_bytes.go
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
package prometheus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ComputeWriteBytesRequest struct {
|
||||||
|
// Compute ID
|
||||||
|
// Required: true
|
||||||
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
|
// Time to loads of statistic in seconds
|
||||||
|
// Required: false
|
||||||
|
ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"`
|
||||||
|
|
||||||
|
// The reading interval in seconds
|
||||||
|
// Required: true
|
||||||
|
Step uint64 `url:"step,omitempty" json:"step,omitempty"`
|
||||||
|
|
||||||
|
// Number of zeros after the decimal point
|
||||||
|
// Required: true
|
||||||
|
DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write Bytes
|
||||||
|
func (p Prometheus) ComputeWriteBytes(ctx context.Context, req ComputeWriteBytesRequest) (*PrometheusData, error) {
|
||||||
|
res, err := p.ComputeWriteBytesRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := PrometheusData{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about compute as an array of bytes
|
||||||
|
func (p Prometheus) ComputeWriteBytesRaw(ctx context.Context, req ComputeWriteBytesRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/prometheus/computeWriteBytes"
|
||||||
|
|
||||||
|
res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
57
pkg/cloudbroker/prometheus/compute_write_requests.go
Normal file
57
pkg/cloudbroker/prometheus/compute_write_requests.go
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
package prometheus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ComputeWriteRequestsRequest struct {
|
||||||
|
// Compute ID
|
||||||
|
// Required: true
|
||||||
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
|
// Time to loads of statistic in seconds
|
||||||
|
// Required: false
|
||||||
|
ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"`
|
||||||
|
|
||||||
|
// The reading interval in seconds
|
||||||
|
// Required: true
|
||||||
|
Step uint64 `url:"step,omitempty" json:"step,omitempty"`
|
||||||
|
|
||||||
|
// Number of zeros after the decimal point
|
||||||
|
// Required: true
|
||||||
|
DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write Requests
|
||||||
|
func (p Prometheus) ComputeWriteRequests(ctx context.Context, req ComputeWriteRequestsRequest) (*PrometheusData, error) {
|
||||||
|
res, err := p.ComputeWriteRequestsRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := PrometheusData{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about compute as an array of bytes
|
||||||
|
func (p Prometheus) ComputeWriteRequestsRaw(ctx context.Context, req ComputeWriteRequestsRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/prometheus/computeWriteRequests"
|
||||||
|
|
||||||
|
res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
13
pkg/cloudbroker/prometheus/models.go
Normal file
13
pkg/cloudbroker/prometheus/models.go
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
package prometheus
|
||||||
|
|
||||||
|
// PrometheusData represents an array of data points
|
||||||
|
type PrometheusData []PrometheusPoint
|
||||||
|
|
||||||
|
// PrometheusPoint represents a single data point
|
||||||
|
type PrometheusPoint struct {
|
||||||
|
// Value of the metric at a specific point in time
|
||||||
|
Value float64 `json:"value"`
|
||||||
|
|
||||||
|
// Timestamp the Unix timestamp.
|
||||||
|
Timestamp uint64 `json:"timestamp"`
|
||||||
|
}
|
||||||
17
pkg/cloudbroker/prometheus/prometheus.go
Normal file
17
pkg/cloudbroker/prometheus/prometheus.go
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
package prometheus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Structure for creating request to prometheus
|
||||||
|
type Prometheus struct {
|
||||||
|
client interfaces.Caller
|
||||||
|
}
|
||||||
|
|
||||||
|
// Builder for prometheus endpoints
|
||||||
|
func New(client interfaces.Caller) *Prometheus {
|
||||||
|
return &Prometheus{
|
||||||
|
client: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
10
pkg/cloudbroker/resmon.go
Normal file
10
pkg/cloudbroker/resmon.go
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
package cloudbroker
|
||||||
|
|
||||||
|
import (
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/resmon"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Accessing the Resmon method group
|
||||||
|
func (cb *CloudBroker) Resmon() *resmon.Resmon {
|
||||||
|
return resmon.New(cb.client)
|
||||||
|
}
|
||||||
53
pkg/cloudbroker/resmon/get_by_compute.go
Normal file
53
pkg/cloudbroker/resmon/get_by_compute.go
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
package resmon
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GetByComputeRequest struct {
|
||||||
|
// Compute ID
|
||||||
|
// Required: true
|
||||||
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
|
// Start of time period - unixtime
|
||||||
|
// Required: false
|
||||||
|
StartTime uint64 `url:"starttime,omitempty" json:"starttime,omitempty"`
|
||||||
|
|
||||||
|
// End of time period - unixtime
|
||||||
|
// Required: true
|
||||||
|
EndTime uint64 `url:"endtime,omitempty" json:"endtime,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get resource monitoring for the specified time period for the concrete compute instance
|
||||||
|
func (r Resmon) GetByCompute(ctx context.Context, req GetByComputeRequest) (*GetByComputeData, error) {
|
||||||
|
res, err := r.GetByComputeRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := GetByComputeData{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about compute as an array of bytes
|
||||||
|
func (r Resmon) GetByComputeRaw(ctx context.Context, req GetByComputeRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/resmon/getByCompute"
|
||||||
|
|
||||||
|
res, err := r.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
49
pkg/cloudbroker/resmon/get_by_computes.go
Normal file
49
pkg/cloudbroker/resmon/get_by_computes.go
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
package resmon
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GetByComputesRequest struct {
|
||||||
|
// Start of time period - unixtime
|
||||||
|
// Required: false
|
||||||
|
StartTime uint64 `url:"starttime,omitempty" json:"starttime,omitempty"`
|
||||||
|
|
||||||
|
// End of time period - unixtime
|
||||||
|
// Required: true
|
||||||
|
EndTime uint64 `url:"endtime,omitempty" json:"endtime,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get compute instances resource monitoring for the specified time period
|
||||||
|
func (r Resmon) GetByComputes(ctx context.Context, req GetByComputesRequest) (*GetByComputeData, error) {
|
||||||
|
res, err := r.GetByComputesRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := GetByComputeData{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about compute as an array of bytes
|
||||||
|
func (r Resmon) GetByComputesRaw(ctx context.Context, req GetByComputesRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/resmon/getByComputes"
|
||||||
|
|
||||||
|
res, err := r.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
49
pkg/cloudbroker/resmon/get_by_grid.go
Normal file
49
pkg/cloudbroker/resmon/get_by_grid.go
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
package resmon
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GetByGRIDRequest struct {
|
||||||
|
// Start of time period - unixtime
|
||||||
|
// Required: false
|
||||||
|
StartTime uint64 `url:"starttime,omitempty" json:"starttime,omitempty"`
|
||||||
|
|
||||||
|
// End of time period - unixtime
|
||||||
|
// Required: true
|
||||||
|
EndTime uint64 `url:"endtime,omitempty" json:"endtime,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get a grid resource monitoring for the specified time period
|
||||||
|
func (r Resmon) GetByGRID(ctx context.Context, req GetByGRIDRequest) (*GetByGRIDData, error) {
|
||||||
|
res, err := r.GetByGRIDRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := GetByGRIDData{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about compute as an array of bytes
|
||||||
|
func (r Resmon) GetByGRIDRaw(ctx context.Context, req GetByGRIDRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/resmon/getByGrid"
|
||||||
|
|
||||||
|
res, err := r.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
53
pkg/cloudbroker/resmon/get_by_stack.go
Normal file
53
pkg/cloudbroker/resmon/get_by_stack.go
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
package resmon
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GetByStackRequest struct {
|
||||||
|
// Stack ID
|
||||||
|
// Required: true
|
||||||
|
StackID uint64 `url:"stackId" json:"stackId" validate:"required"`
|
||||||
|
|
||||||
|
// Start of time period - unixtime
|
||||||
|
// Required: false
|
||||||
|
StartTime uint64 `url:"starttime,omitempty" json:"starttime,omitempty"`
|
||||||
|
|
||||||
|
// End of time period - unixtime
|
||||||
|
// Required: true
|
||||||
|
EndTime uint64 `url:"endtime,omitempty" json:"endtime,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get a grid resource monitoring for the specified time period
|
||||||
|
func (r Resmon) GetByStack(ctx context.Context, req GetByStackRequest) (*GetByStackData, error) {
|
||||||
|
res, err := r.GetByStackRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := GetByStackData{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about compute as an array of bytes
|
||||||
|
func (r Resmon) GetByStackRaw(ctx context.Context, req GetByStackRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/resmon/getByStack"
|
||||||
|
|
||||||
|
res, err := r.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
49
pkg/cloudbroker/resmon/get_by_stacks.go
Normal file
49
pkg/cloudbroker/resmon/get_by_stacks.go
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
package resmon
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GetByStacksRequest struct {
|
||||||
|
// Start of time period - unixtime
|
||||||
|
// Required: false
|
||||||
|
StartTime uint64 `url:"starttime,omitempty" json:"starttime,omitempty"`
|
||||||
|
|
||||||
|
// End of time period - unixtime
|
||||||
|
// Required: true
|
||||||
|
EndTime uint64 `url:"endtime,omitempty" json:"endtime,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get a grid resource monitoring for the specified time period
|
||||||
|
func (r Resmon) GetByStacks(ctx context.Context, req GetByStacksRequest) (*GetByStackData, error) {
|
||||||
|
res, err := r.GetByStacksRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := GetByStackData{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRaw gets information about compute as an array of bytes
|
||||||
|
func (r Resmon) GetByStacksRaw(ctx context.Context, req GetByStacksRequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudbroker/resmon/getByStacks"
|
||||||
|
|
||||||
|
res, err := r.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
89
pkg/cloudbroker/resmon/models.go
Normal file
89
pkg/cloudbroker/resmon/models.go
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
package resmon
|
||||||
|
|
||||||
|
// GetByComputeData represents an array of data points
|
||||||
|
type GetByComputeData []GetByComputePoint
|
||||||
|
|
||||||
|
type GetByComputePoint struct {
|
||||||
|
ID uint64 `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
ComputeID uint64 `json:"computeId"`
|
||||||
|
AccountID uint64 `json:"accountId"`
|
||||||
|
RGID uint64 `json:"rgId"`
|
||||||
|
Usage ComputeUsage `json:"usage"`
|
||||||
|
Disks []ItemDisk `json:"disks"`
|
||||||
|
UID string `json:"uid"`
|
||||||
|
StackID uint64 `json:"stackId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ComputeUsage struct {
|
||||||
|
VCPUsConsumed uint64 `json:"vcpusConsumed"`
|
||||||
|
Storage uint64 `json:"storage"`
|
||||||
|
CPUTime uint64 `json:"cpuTime"`
|
||||||
|
ExtIPs uint64 `json:"extips"`
|
||||||
|
RAMConsumed uint64 `json:"ramConsumed"`
|
||||||
|
VCPUsReserved uint64 `json:"vcpusReserved"`
|
||||||
|
IsUp uint64 `json:"isUp"`
|
||||||
|
RAMConsumedReal uint64 `json:"ramConsumedReal"`
|
||||||
|
RAMReserved uint64 `json:"ramReserved"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ItemDisk struct {
|
||||||
|
Pool string `json:"pool"`
|
||||||
|
ResID string `json:"resId"`
|
||||||
|
SizeUsed uint64 `json:"sizeUsed"`
|
||||||
|
SizeMax uint64 `json:"sizeMax"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetByGRIDData represents an array of data points
|
||||||
|
type GetByGRIDData []GetByGRIDPoint
|
||||||
|
|
||||||
|
type GetByGRIDPoint struct {
|
||||||
|
UID string `json:"uid"`
|
||||||
|
Total ItemTotalByGRID `json:"total"`
|
||||||
|
Storages map[string]ItemStorage `json:"storages"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ItemTotalByGRID struct {
|
||||||
|
StacksCPU uint64 `json:"stacksCPU"`
|
||||||
|
StorageCapacity uint64 `json:"storageCapacity"`
|
||||||
|
CPUPower uint64 `json:"cpuPower"`
|
||||||
|
CPUUtil uint64 `json:"cpuUtil"`
|
||||||
|
TotalMem uint64 `json:"totalMem"`
|
||||||
|
ReservedMem uint64 `json:"reservedMem"`
|
||||||
|
UsedMem uint64 `json:"usedMem"`
|
||||||
|
FreeMem uint64 `json:"freeMem"`
|
||||||
|
VCPUConsumed uint64 `json:"vcpuConsumed"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ItemStorage struct {
|
||||||
|
CapacityLimit uint64 `json:"capacityLimit"`
|
||||||
|
Consumed uint64 `json:"consumed"`
|
||||||
|
Type string `json:"type"`
|
||||||
|
UID string `json:"uid"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetByStackData represents an array of data points
|
||||||
|
type GetByStackData []GetByStackPoint
|
||||||
|
|
||||||
|
type GetByStackPoint struct {
|
||||||
|
Usage StackUsage `json:"usage"`
|
||||||
|
CPUInfo CPUinfoByStack `json:"cpuInfo"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
ID uint64 `json:"id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type StackUsage struct {
|
||||||
|
CPUPower uint64 `json:"cpuPower"`
|
||||||
|
UsedVCPUs uint64 `json:"usedVcpus"`
|
||||||
|
PCPU uint64 `json:"pcpu"`
|
||||||
|
UsedMem uint64 `json:"usedMem"`
|
||||||
|
CPUUtil uint64 `json:"cpuUtil"`
|
||||||
|
ReservedMem uint64 `json:"reservedMem"`
|
||||||
|
FreeMem uint64 `json:"freeMem"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CPUinfoByStack struct {
|
||||||
|
ClockSpeed uint64 `json:"clockSpeed"`
|
||||||
|
CoreCount uint64 `json:"coreCount"`
|
||||||
|
PhysCount uint64 `json:"physCount"`
|
||||||
|
}
|
||||||
15
pkg/cloudbroker/resmon/resmon.go
Normal file
15
pkg/cloudbroker/resmon/resmon.go
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package resmon
|
||||||
|
|
||||||
|
import "repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
||||||
|
|
||||||
|
// Structure for creating request to resource monitoring
|
||||||
|
type Resmon struct {
|
||||||
|
client interfaces.Caller
|
||||||
|
}
|
||||||
|
|
||||||
|
// Builder for resource monitoring endpoints
|
||||||
|
func New(client interfaces.Caller) *Resmon {
|
||||||
|
return &Resmon{
|
||||||
|
client: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
38
pkg/cloudbroker/sep/update_capacity_limit.go
Normal file
38
pkg/cloudbroker/sep/update_capacity_limit.go
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
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,10 +30,6 @@ 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,13 +235,22 @@ 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
|
||||||
|
ClientType string `json:"clientType"`
|
||||||
|
|
||||||
|
// 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,6 +25,10 @@ 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,7 +20,6 @@ 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"
|
||||||
@@ -564,26 +563,6 @@ 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{})
|
||||||
@@ -705,19 +684,10 @@ func TestGetAllPaths(t *testing.T) {
|
|||||||
|
|
||||||
decortUrls := readUrlFromDir("../../pkg", len(jsonUrls))
|
decortUrls := readUrlFromDir("../../pkg", len(jsonUrls))
|
||||||
|
|
||||||
missingUrls := getMissingDecortUrls(jsonUrls, decortUrls)
|
result := getMissingDecortUrls(jsonUrls, decortUrls)
|
||||||
if len(missingUrls) > 0 {
|
if len(result) > 0 {
|
||||||
errorText := fmt.Sprintf("Below API handlers (%d in total) need to be added to decort-sdk:\n", len(missingUrls))
|
errorText := fmt.Sprintf("Below API handlers (%d in total) need to be added to decort-sdk:\n", len(result))
|
||||||
for _, r := range missingUrls {
|
for _, r := range result {
|
||||||
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,11 +2,9 @@ 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"
|
||||||
@@ -29,7 +27,6 @@ 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"
|
||||||
@@ -81,9 +78,6 @@ 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{},
|
||||||
@@ -113,6 +107,7 @@ 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{},
|
||||||
@@ -208,6 +203,7 @@ 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{},
|
||||||
@@ -216,16 +212,11 @@ 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{},
|
|
||||||
|
|
||||||
// flipgroup
|
// flipgroup
|
||||||
"/restmachine/cloudapi/flipgroup/computeAdd": flipgroup.ComputeAddRequest{},
|
"/restmachine/cloudapi/flipgroup/computeAdd": flipgroup.ComputeAddRequest{},
|
||||||
@@ -362,32 +353,34 @@ func getRequestsMapCloudAPI() map[string]interface{} {
|
|||||||
"/restmachine/cloudapi/vfpool/list": vfpool.ListRequest{},
|
"/restmachine/cloudapi/vfpool/list": vfpool.ListRequest{},
|
||||||
|
|
||||||
// vins
|
// vins
|
||||||
"/restmachine/cloudapi/vins/audits": vins.AuditsRequest{},
|
"/restmachine/cloudapi/vins/audits": vins.AuditsRequest{},
|
||||||
"/restmachine/cloudapi/vins/createInAccount": vins.CreateInAccountRequest{},
|
"/restmachine/cloudapi/vins/createInAccount": vins.CreateInAccountRequest{},
|
||||||
"/restmachine/cloudapi/vins/createInRG": vins.CreateInRGRequest{},
|
"/restmachine/cloudapi/vins/createInRG": vins.CreateInRGRequest{},
|
||||||
"/restmachine/cloudapi/vins/delete": vins.DeleteRequest{},
|
"/restmachine/cloudapi/vins/delete": vins.DeleteRequest{},
|
||||||
"/restmachine/cloudapi/vins/disable": vins.DisableEnableRequest{},
|
"/restmachine/cloudapi/vins/disable": vins.DisableEnableRequest{},
|
||||||
"/restmachine/cloudapi/vins/dnsApply": vins.DNSApplyRequest{},
|
"/restmachine/cloudapi/vins/dnsApply": vins.DNSApplyRequest{},
|
||||||
"/restmachine/cloudapi/vins/enable": vins.DisableEnableRequest{},
|
"/restmachine/cloudapi/vins/enable": vins.DisableEnableRequest{},
|
||||||
"/restmachine/cloudapi/vins/extNetConnect": vins.ExtNetConnectRequest{},
|
"/restmachine/cloudapi/vins/extNetConnect": vins.ExtNetConnectRequest{},
|
||||||
"/restmachine/cloudapi/vins/extNetDisconnect": vins.ExtNetDisconnectRequest{},
|
"/restmachine/cloudapi/vins/extNetDisconnect": vins.ExtNetDisconnectRequest{},
|
||||||
"/restmachine/cloudapi/vins/extNetList": vins.ExtNetListRequest{},
|
"/restmachine/cloudapi/vins/extNetList": vins.ExtNetListRequest{},
|
||||||
"/restmachine/cloudapi/vins/get": vins.GetRequest{},
|
"/restmachine/cloudapi/vins/get": vins.GetRequest{},
|
||||||
"/restmachine/cloudapi/vins/ipList": vins.IPListRequest{},
|
"/restmachine/cloudapi/vins/ipList": vins.IPListRequest{},
|
||||||
"/restmachine/cloudapi/vins/ipRelease": vins.IPReleaseRequest{},
|
"/restmachine/cloudapi/vins/ipRelease": vins.IPReleaseRequest{},
|
||||||
"/restmachine/cloudapi/vins/ipReserve": vins.IPReserveRequest{},
|
"/restmachine/cloudapi/vins/ipReserve": vins.IPReserveRequest{},
|
||||||
"/restmachine/cloudapi/vins/list": vins.ListRequest{},
|
"/restmachine/cloudapi/vins/list": vins.ListRequest{},
|
||||||
"/restmachine/cloudapi/vins/listDeleted": vins.ListDeletedRequest{},
|
"/restmachine/cloudapi/vins/listDeleted": vins.ListDeletedRequest{},
|
||||||
"/restmachine/cloudapi/vins/natRuleAdd": vins.NATRuleAddRequest{},
|
"/restmachine/cloudapi/vins/natRuleAdd": vins.NATRuleAddRequest{},
|
||||||
"/restmachine/cloudapi/vins/natRuleDel": vins.NATRuleDelRequest{},
|
"/restmachine/cloudapi/vins/natRuleDel": vins.NATRuleDelRequest{},
|
||||||
"/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/staticRouteAdd": vins.StaticRouteAddRequest{},
|
"/restmachine/cloudapi/vins/staticRouteAccessGrant": vins.StaticRouteAccessGrantRequest{},
|
||||||
"/restmachine/cloudapi/vins/staticRouteDel": vins.StaticRouteDelRequest{},
|
"/restmachine/cloudapi/vins/staticRouteAccessRevoke": vins.StaticRouteAccessRevokeRequest{},
|
||||||
"/restmachine/cloudapi/vins/staticRouteList": vins.StaticRouteListRequest{},
|
"/restmachine/cloudapi/vins/staticRouteAdd": vins.StaticRouteAddRequest{},
|
||||||
"/restmachine/cloudapi/vins/vnfdevRedeploy": vins.VNFDevRedeployRequest{},
|
"/restmachine/cloudapi/vins/staticRouteDel": vins.StaticRouteDelRequest{},
|
||||||
"/restmachine/cloudapi/vins/vnfdevRestart": vins.VNFDevRestartRequest{},
|
"/restmachine/cloudapi/vins/staticRouteList": vins.StaticRouteListRequest{},
|
||||||
|
"/restmachine/cloudapi/vins/vnfdevRedeploy": vins.VNFDevRedeployRequest{},
|
||||||
|
"/restmachine/cloudapi/vins/vnfdevRestart": vins.VNFDevRestartRequest{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -583,23 +576,12 @@ 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{},
|
||||||
@@ -609,7 +591,6 @@ 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{},
|
||||||
@@ -813,29 +794,30 @@ func getRequestsMapCloudbroker() map[string]interface{} {
|
|||||||
"/restmachine/cloudbroker/rg/usage": rg_cb.UsageRequest{},
|
"/restmachine/cloudbroker/rg/usage": rg_cb.UsageRequest{},
|
||||||
|
|
||||||
// sep
|
// sep
|
||||||
"/restmachine/cloudbroker/sep/accessGrant": sep_cb.AccessGrantRequest{},
|
"/restmachine/cloudbroker/sep/accessGrant": sep_cb.AccessGrantRequest{},
|
||||||
"/restmachine/cloudbroker/sep/accessGrantToPool": sep_cb.AccessGrantToPoolRequest{},
|
"/restmachine/cloudbroker/sep/accessGrantToPool": sep_cb.AccessGrantToPoolRequest{},
|
||||||
"/restmachine/cloudbroker/sep/accessRevoke": sep_cb.AccessRevokeRequest{},
|
"/restmachine/cloudbroker/sep/accessRevoke": sep_cb.AccessRevokeRequest{},
|
||||||
"/restmachine/cloudbroker/sep/accessRevokeToPool": sep_cb.AccessRevokeToPoolRequest{},
|
"/restmachine/cloudbroker/sep/accessRevokeToPool": sep_cb.AccessRevokeToPoolRequest{},
|
||||||
"/restmachine/cloudbroker/sep/addConsumerNodes": sep_cb.AddConsumerNodesRequest{},
|
"/restmachine/cloudbroker/sep/addConsumerNodes": sep_cb.AddConsumerNodesRequest{},
|
||||||
"/restmachine/cloudbroker/sep/addPool": sep_cb.AddPoolRequest{},
|
"/restmachine/cloudbroker/sep/addPool": sep_cb.AddPoolRequest{},
|
||||||
"/restmachine/cloudbroker/sep/addProviderNodes": sep_cb.AddProviderNodesRequest{},
|
"/restmachine/cloudbroker/sep/addProviderNodes": sep_cb.AddProviderNodesRequest{},
|
||||||
"/restmachine/cloudbroker/sep/configFieldEdit": sep_cb.ConfigFieldEditRequest{},
|
"/restmachine/cloudbroker/sep/configFieldEdit": sep_cb.ConfigFieldEditRequest{},
|
||||||
"/restmachine/cloudbroker/sep/configInsert": sep_cb.ConfigInsertRequest{},
|
"/restmachine/cloudbroker/sep/configInsert": sep_cb.ConfigInsertRequest{},
|
||||||
"/restmachine/cloudbroker/sep/configValidate": sep_cb.ConfigValidateRequest{},
|
"/restmachine/cloudbroker/sep/configValidate": sep_cb.ConfigValidateRequest{},
|
||||||
"/restmachine/cloudbroker/sep/consumption": sep_cb.ConsumptionRequest{},
|
"/restmachine/cloudbroker/sep/consumption": sep_cb.ConsumptionRequest{},
|
||||||
"/restmachine/cloudbroker/sep/create": sep_cb.CreateRequest{},
|
"/restmachine/cloudbroker/sep/create": sep_cb.CreateRequest{},
|
||||||
"/restmachine/cloudbroker/sep/decommission": sep_cb.DecommissionRequest{},
|
"/restmachine/cloudbroker/sep/decommission": sep_cb.DecommissionRequest{},
|
||||||
"/restmachine/cloudbroker/sep/delConsumerNodes": sep_cb.DelConsumerNodesRequest{},
|
"/restmachine/cloudbroker/sep/delConsumerNodes": sep_cb.DelConsumerNodesRequest{},
|
||||||
"/restmachine/cloudbroker/sep/delete": sep_cb.DeleteRequest{},
|
"/restmachine/cloudbroker/sep/delete": sep_cb.DeleteRequest{},
|
||||||
"/restmachine/cloudbroker/sep/delPool": sep_cb.DelPoolRequest{},
|
"/restmachine/cloudbroker/sep/delPool": sep_cb.DelPoolRequest{},
|
||||||
"/restmachine/cloudbroker/sep/disable": sep_cb.DisableRequest{},
|
"/restmachine/cloudbroker/sep/disable": sep_cb.DisableRequest{},
|
||||||
"/restmachine/cloudbroker/sep/diskList": sep_cb.DiskListRequest{},
|
"/restmachine/cloudbroker/sep/diskList": sep_cb.DiskListRequest{},
|
||||||
"/restmachine/cloudbroker/sep/enable": sep_cb.EnableRequest{},
|
"/restmachine/cloudbroker/sep/enable": sep_cb.EnableRequest{},
|
||||||
"/restmachine/cloudbroker/sep/get": sep_cb.GetRequest{},
|
"/restmachine/cloudbroker/sep/get": sep_cb.GetRequest{},
|
||||||
"/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{},
|
||||||
|
|||||||
31
tests/platform_upgrade/test_get_list_cloudAPI.log
Normal file
31
tests/platform_upgrade/test_get_list_cloudAPI.log
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
[
|
||||||
|
"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"
|
||||||
|
]
|
||||||
34
tests/platform_upgrade/test_get_list_cloudbroker.log
Normal file
34
tests/platform_upgrade/test_get_list_cloudbroker.log
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[
|
||||||
|
"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"
|
||||||
|
]
|
||||||
14
tests/platform_upgrade/test_requests_cloudAPI.log
Normal file
14
tests/platform_upgrade/test_requests_cloudAPI.log
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
[
|
||||||
|
"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
tests/platform_upgrade/test_requests_cloudbroker.log
Normal file
1
tests/platform_upgrade/test_requests_cloudbroker.log
Normal file
@@ -0,0 +1 @@
|
|||||||
|
["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,14 +15,10 @@ 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",
|
||||||
@@ -46,9 +42,6 @@ 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
|
||||||
@@ -102,26 +95,6 @@ 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