Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42800ac4fe | ||
|
|
de12bc2acc | ||
|
|
46af79b664 |
49
CHANGELOG.md
49
CHANGELOG.md
@@ -1,48 +1,11 @@
|
|||||||
## Version 1.1.0
|
## Version 1.2.0
|
||||||
|
|
||||||
### Features
|
### Bug fixes
|
||||||
|
|
||||||
#### CloudAPI
|
#### Client
|
||||||
|
|
||||||
- Account
|
- Added legacy client authorization support
|
||||||
- Delete "ResTypes" field in Create/Update request structs
|
|
||||||
- Add fields "DiskSizeMax", "Shareable", "SEPs" in Get/List response structs
|
|
||||||
- BService
|
|
||||||
- Add fields "SEPID", "SEPPool" in GroupAdd request structs
|
|
||||||
- Add field "PoolName" in List/ListDeleted response structs
|
|
||||||
- Compute
|
|
||||||
- Add fields "PresentTo", "Shareable" in Get/List/ListDeleted response structs
|
|
||||||
- Disks
|
|
||||||
- Add fields "PresentTo", "Shareable", "Computes" in Get/List/ListDeleted/ListUnattached/Search response structs
|
|
||||||
- Delete fields "ComputeID", "ComputeName" in List/ListDeleted/ListUnattached/Search response structs
|
|
||||||
- Add Share/Unshare methods
|
|
||||||
- FLIPgroup
|
|
||||||
- Add field "ClientNames" in Get response struct
|
|
||||||
- Image
|
|
||||||
- Add field "PresentTo" in Get response struct
|
|
||||||
- RG
|
|
||||||
- Delete "ResTypes" field in Create/Update request structs
|
|
||||||
- Add fields "DiskSizeMax", "Shareable", "SEPs" in Get/List response structs
|
|
||||||
|
|
||||||
#### Cloudbroker
|
#### All
|
||||||
|
|
||||||
- Account
|
- Add json tags for requests
|
||||||
- Add fields "SEPs", "ResourceTypes", "PresentTo", "DiskSizeMax", "UniqPools", "Shareable" in Get/List/ListDeleted/ListDisks/ListRG response structs
|
|
||||||
- Compute
|
|
||||||
- Add fields "VINSConnected", "TotalDiskSize", "Shareable", "PresentTo" in Get/List/ListDeleted response structs
|
|
||||||
- Disks
|
|
||||||
- Add fields "ReferenceID", "Shareable", "PresentTo", "Computes" in List/ListDeleted/ListUnattached/Search response structs
|
|
||||||
- Delete fields "ComputeID", "ComputeName" in List/ListDeleted/ListUnattached/Search response structs
|
|
||||||
- Add Share/Unshare methods
|
|
||||||
- Grid
|
|
||||||
- Add fields "SEPs", "DiskSizeMax" in Get/List response structs
|
|
||||||
- Image
|
|
||||||
- Add field "PresentTo" in Get response struct
|
|
||||||
- KVMX86
|
|
||||||
- Add field "Userdata" in MassCreate request struct
|
|
||||||
- Delete field "IPAddr" in MassCreate request struct
|
|
||||||
- KVMPPC
|
|
||||||
- Add field "Userdata" in MassCreate request struct
|
|
||||||
- Delete field "IPAddr" in MassCreate request struct
|
|
||||||
- RG
|
|
||||||
- Add fields "DiskSizeMax", "Shareable", "SEPs" in Get/List response structs
|
|
||||||
|
|||||||
73
README.md
73
README.md
@@ -3,8 +3,10 @@
|
|||||||
Decort SDK - это библиотека, написанная на языке GO, позволяющая взаимодействовать с API облачной платформы **DECORT**. Библиотека содеражит в себе структуры и методы, необходимые для отправки запросов. Decort SDK имеет встроенный http-клиент и поддерживает разные способы авторизации на платформе. Библиотека так же содержит в себе модели ответов от платформы.
|
Decort SDK - это библиотека, написанная на языке GO, позволяющая взаимодействовать с API облачной платформы **DECORT**. Библиотека содеражит в себе структуры и методы, необходимые для отправки запросов. Decort SDK имеет встроенный http-клиент и поддерживает разные способы авторизации на платформе. Библиотека так же содержит в себе модели ответов от платформы.
|
||||||
|
|
||||||
## Версии
|
## Версии
|
||||||
- Версия 1.0.0 Decort-SDK соответствует 3.8.4 версии платформы
|
|
||||||
- Версия 1.1.0 Decort-SDK соответствует 3.8.5 версии платформы
|
- Версия 1.0.x Decort-SDK соответствует 3.8.4 версии платформы
|
||||||
|
- Версия 1.1.x Decort-SDK соответствует 3.8.5 версии платформы
|
||||||
|
- Версия 1.2.x Decort-SDK соответствует 3.8.5 версии платформы
|
||||||
|
|
||||||
## Оглавление
|
## Оглавление
|
||||||
|
|
||||||
@@ -17,6 +19,11 @@ Decort SDK - это библиотека, написанная на языке G
|
|||||||
- [Создание клиента](#создание-клиента)
|
- [Создание клиента](#создание-клиента)
|
||||||
- [Создание структуры запроса](#cоздание-структуры-запроса)
|
- [Создание структуры запроса](#cоздание-структуры-запроса)
|
||||||
- [Выполнение запроса](#выполнение-запроса)
|
- [Выполнение запроса](#выполнение-запроса)
|
||||||
|
- [Работа с legacy клиентом](#работа-с-legacy-клиентом)
|
||||||
|
- [Настройка конфигурации legacy клиента](#настройка-конфигурации-legacy-клиента)
|
||||||
|
- [Создание legacy клиента](#создание-legacy-клиента)
|
||||||
|
- [Создание структуры запроса](#cоздание-структуры-запроса)
|
||||||
|
- [Выполнение запроса](#выполнение-запроса)
|
||||||
|
|
||||||
## Установка
|
## Установка
|
||||||
|
|
||||||
@@ -429,3 +436,65 @@ func main() {
|
|||||||
fmt.Println(res)
|
fmt.Println(res)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Работа с legacy клиентом
|
||||||
|
|
||||||
|
Работа с legacy клиентом применяется для пользователей, которые не используют для авторизации decs3o.
|
||||||
|
|
||||||
|
### Настройка конфигурации legacy клиента
|
||||||
|
|
||||||
|
Сначала, необходимо создать переменную конфигурации клиента. Конфигурация состоит как из обязательных, так и необязательных полей.
|
||||||
|
|
||||||
|
| Поле | Тип | Обязательный | Описание |
|
||||||
|
| ------------- | ------ | ------------ | ------------------------------------------------------------------ |
|
||||||
|
| Username | string | Да | username legacy пользователя |
|
||||||
|
| Password | string | Да | пароль legacy пользователя |
|
||||||
|
| DecortURL | string | Да | URL адрес платформы, с которой будет осуществляться взаимодействие |
|
||||||
|
| Retries | uint | Нет | Кол-во неудачных попыток выполнения запроса, по умолчанию - 5 |
|
||||||
|
| SSLSkipVerify | bool | Нет | Пропуск проверки подлинности сертификата, по умолчанию - true |
|
||||||
|
| Token | string | Нет | JWT токен |
|
||||||
|
|
||||||
|
Пример кода:
|
||||||
|
|
||||||
|
```go
|
||||||
|
import (
|
||||||
|
"github.com/rudecs/decort-sdk/config"
|
||||||
|
)
|
||||||
|
func main(){
|
||||||
|
// Настройка конфигурации
|
||||||
|
legacyCfg := config.LegacyConfig{
|
||||||
|
Username: "<USERNAME>",
|
||||||
|
Password: "<PASSWORD>",
|
||||||
|
DecortURL: "https://mr4.digitalenergy.online",
|
||||||
|
Retries: 5,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Создание legacy клиента
|
||||||
|
|
||||||
|
Создание клиента происходит с помощью функции-строителя `NewLegacy` из основного пакета `decort-sdk`, для избежания проблем с именами, пакету можно присвоить алиас `decort`. Функция принимает конфигурацию, возвращает структуру `DecortClient`, с помощью которой можно взаимодействовать с платформой.
|
||||||
|
|
||||||
|
### Пример
|
||||||
|
|
||||||
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/rudecs/decort-sdk/config"
|
||||||
|
decort "github.com/rudecs/decort-sdk"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
// Настройка конфигурации
|
||||||
|
legacyCfg := config.LegacyConfig{
|
||||||
|
Username: "<USERNAME>",
|
||||||
|
Password: "<PASSWORD>",
|
||||||
|
DecortURL: "https://mr4.digitalenergy.online",
|
||||||
|
Retries: 5,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Создание клиента
|
||||||
|
legacyClient := decort.NewLegacy(cfg)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
33
config/legacy-config.go
Normal file
33
config/legacy-config.go
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
// Legacy client configuration
|
||||||
|
type LegacyConfig struct {
|
||||||
|
// ServiceAccount username
|
||||||
|
// Required: true
|
||||||
|
// Example : "osh_mikoev"
|
||||||
|
Username string
|
||||||
|
|
||||||
|
// ServiceAccount password
|
||||||
|
// Required: true
|
||||||
|
// Example: "[1o>hYkjnJr)HI78q7t&#%8Lm"
|
||||||
|
Password string
|
||||||
|
|
||||||
|
// Platform token
|
||||||
|
// Required: false
|
||||||
|
// Example: "158e76424b0d4810b6086hgbhj928fc4a6bc06e"
|
||||||
|
Token string
|
||||||
|
|
||||||
|
// Address of the platform on which the actions are planned
|
||||||
|
// Required: true
|
||||||
|
// Example: "https://mr4.digitalenergy.online"
|
||||||
|
DecortURL string
|
||||||
|
|
||||||
|
// Amount platform request attempts
|
||||||
|
// Default value: 5
|
||||||
|
// Required: false
|
||||||
|
Retries uint64
|
||||||
|
|
||||||
|
// Skip verify, true by default
|
||||||
|
// Required: false
|
||||||
|
SSLSkipVerify bool
|
||||||
|
}
|
||||||
@@ -29,7 +29,7 @@ func NewHttpClient(cfg config.Config) *http.Client {
|
|||||||
retries: cfg.Retries,
|
retries: cfg.Retries,
|
||||||
clientID: cfg.AppID,
|
clientID: cfg.AppID,
|
||||||
clientSecret: cfg.AppSecret,
|
clientSecret: cfg.AppSecret,
|
||||||
SSOURL: cfg.SSOURL,
|
ssoURL: cfg.SSOURL,
|
||||||
token: cfg.Token,
|
token: cfg.Token,
|
||||||
expiryTime: expiredTime,
|
expiryTime: expiredTime,
|
||||||
//TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
//TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||||
|
|||||||
32
internal/client/legacy-http-client.go
Normal file
32
internal/client/legacy-http-client.go
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
package client
|
||||||
|
|
||||||
|
import (
|
||||||
|
"crypto/tls"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/rudecs/decort-sdk/config"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewLegacyHttpClient creates legacy HTTP Client
|
||||||
|
func NewLegacyHttpClient(cfg config.LegacyConfig) *http.Client {
|
||||||
|
transCfg := &http.Transport{
|
||||||
|
TLSClientConfig: &tls.Config{
|
||||||
|
//nolint:gosec
|
||||||
|
InsecureSkipVerify: cfg.SSLSkipVerify,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
return &http.Client{
|
||||||
|
Transport: &transportLegacy{
|
||||||
|
base: transCfg,
|
||||||
|
username: cfg.Username,
|
||||||
|
password: cfg.Password,
|
||||||
|
retries: cfg.Retries,
|
||||||
|
token: cfg.Token,
|
||||||
|
decortURL: cfg.DecortURL,
|
||||||
|
},
|
||||||
|
|
||||||
|
Timeout: 5 * time.Minute,
|
||||||
|
}
|
||||||
|
}
|
||||||
68
internal/client/legacy-transport.go
Normal file
68
internal/client/legacy-transport.go
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
package client
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
type transportLegacy struct {
|
||||||
|
base http.RoundTripper
|
||||||
|
username string
|
||||||
|
password string
|
||||||
|
retries uint64
|
||||||
|
token string
|
||||||
|
decortURL string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *transportLegacy) RoundTrip(request *http.Request) (*http.Response, error) {
|
||||||
|
if t.token == "" {
|
||||||
|
body := fmt.Sprintf("username=%s&password=%s", t.username, t.password)
|
||||||
|
bodyReader := strings.NewReader(body)
|
||||||
|
|
||||||
|
req, _ := http.NewRequestWithContext(request.Context(), "POST", t.decortURL+"/restmachine/cloudapi/user/authenticate", bodyReader)
|
||||||
|
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
|
||||||
|
|
||||||
|
resp, err := t.base.RoundTrip(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("unable to get token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
tokenBytes, _ := io.ReadAll(resp.Body)
|
||||||
|
resp.Body.Close()
|
||||||
|
|
||||||
|
if resp.StatusCode != 200 {
|
||||||
|
return nil, fmt.Errorf("unable to get token: %s", tokenBytes)
|
||||||
|
}
|
||||||
|
|
||||||
|
token := string(tokenBytes)
|
||||||
|
t.token = token
|
||||||
|
}
|
||||||
|
|
||||||
|
tokenValue := fmt.Sprintf("authkey=%s", t.token)
|
||||||
|
tokenReader := strings.NewReader(tokenValue)
|
||||||
|
|
||||||
|
req, _ := http.NewRequestWithContext(request.Context(), request.Method, request.URL.String(), tokenReader)
|
||||||
|
|
||||||
|
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
|
||||||
|
req.Header.Set("Accept", "application/json")
|
||||||
|
|
||||||
|
var resp *http.Response
|
||||||
|
var err error
|
||||||
|
for i := uint64(0); i < t.retries; i++ {
|
||||||
|
resp, err = t.base.RoundTrip(req)
|
||||||
|
if err == nil {
|
||||||
|
if resp.StatusCode == 200 {
|
||||||
|
return resp, nil
|
||||||
|
}
|
||||||
|
respBytes, _ := io.ReadAll(resp.Body)
|
||||||
|
err = fmt.Errorf("%s", respBytes)
|
||||||
|
resp.Body.Close()
|
||||||
|
}
|
||||||
|
|
||||||
|
time.Sleep(time.Second * 5)
|
||||||
|
}
|
||||||
|
return nil, fmt.Errorf("could not execute request: %w", err)
|
||||||
|
}
|
||||||
@@ -14,7 +14,7 @@ type transport struct {
|
|||||||
clientID string
|
clientID string
|
||||||
clientSecret string
|
clientSecret string
|
||||||
token string
|
token string
|
||||||
SSOURL string
|
ssoURL string
|
||||||
expiryTime time.Time
|
expiryTime time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ func (t *transport) RoundTrip(req *http.Request) (*http.Response, error) {
|
|||||||
body := fmt.Sprintf("grant_type=client_credentials&client_id=%s&client_secret=%s&response_type=id_token", t.clientID, t.clientSecret)
|
body := fmt.Sprintf("grant_type=client_credentials&client_id=%s&client_secret=%s&response_type=id_token", t.clientID, t.clientSecret)
|
||||||
bodyReader := strings.NewReader(body)
|
bodyReader := strings.NewReader(body)
|
||||||
|
|
||||||
req, _ := http.NewRequestWithContext(req.Context(), "POST", t.SSOURL+"/v1/oauth/access_token", bodyReader)
|
req, _ := http.NewRequestWithContext(req.Context(), "POST", t.ssoURL+"/v1/oauth/access_token", bodyReader)
|
||||||
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
|
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
|
||||||
|
|
||||||
resp, err := t.base.RoundTrip(req)
|
resp, err := t.base.RoundTrip(req)
|
||||||
|
|||||||
74
legacy-client.go
Normal file
74
legacy-client.go
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
package decortsdk
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"errors"
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/google/go-querystring/query"
|
||||||
|
"github.com/rudecs/decort-sdk/config"
|
||||||
|
"github.com/rudecs/decort-sdk/internal/client"
|
||||||
|
"github.com/rudecs/decort-sdk/pkg/cloudapi"
|
||||||
|
"github.com/rudecs/decort-sdk/pkg/cloudbroker"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Legacy HTTP-client for platform
|
||||||
|
type LegacyDecortClient struct {
|
||||||
|
decortURL string
|
||||||
|
client *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
// Legacy client builder
|
||||||
|
func NewLegacy(cfg config.LegacyConfig) *LegacyDecortClient {
|
||||||
|
if cfg.Retries == 0 {
|
||||||
|
cfg.Retries = 5
|
||||||
|
}
|
||||||
|
|
||||||
|
return &LegacyDecortClient{
|
||||||
|
decortURL: cfg.DecortURL,
|
||||||
|
client: client.NewLegacyHttpClient(cfg),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// CloudAPI builder
|
||||||
|
func (ldc *LegacyDecortClient) CloudAPI() *cloudapi.CloudAPI {
|
||||||
|
return cloudapi.New(ldc)
|
||||||
|
}
|
||||||
|
|
||||||
|
// CloudBroker builder
|
||||||
|
func (ldc *LegacyDecortClient) CloudBroker() *cloudbroker.CloudBroker {
|
||||||
|
return cloudbroker.New(ldc)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DecortApiCall method for sending requests to the platform
|
||||||
|
func (ldc *LegacyDecortClient) DecortApiCall(ctx context.Context, method, url string, params interface{}) ([]byte, error) {
|
||||||
|
values, err := query.Values(params)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
body := strings.NewReader(values.Encode())
|
||||||
|
req, err := http.NewRequestWithContext(ctx, method, ldc.decortURL+"/restmachine"+url, body)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := ldc.client.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
respBytes, err := io.ReadAll(resp.Body)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if resp.StatusCode != 200 {
|
||||||
|
return nil, errors.New(string(respBytes))
|
||||||
|
}
|
||||||
|
|
||||||
|
return respBytes, nil
|
||||||
|
}
|
||||||
@@ -13,18 +13,18 @@ import (
|
|||||||
type AddUserRequest struct {
|
type AddUserRequest struct {
|
||||||
// ID of account to add to
|
// ID of account to add to
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId"`
|
AccountID uint64 `url:"accountId" json:"accountId"`
|
||||||
|
|
||||||
// Name of the user to be given rights
|
// Name of the user to be given rights
|
||||||
// Required: true
|
// Required: true
|
||||||
UserID string `url:"userId"`
|
UserID string `url:"userId" json:"userId"`
|
||||||
|
|
||||||
// Account permission types:
|
// Account permission types:
|
||||||
// - 'R' for read only access
|
// - 'R' for read only access
|
||||||
// - 'RCX' for Write
|
// - 'RCX' for Write
|
||||||
// - 'ARCXDU' for Admin
|
// - 'ARCXDU' for Admin
|
||||||
// Required: true
|
// Required: true
|
||||||
AccessType string `url:"accesstype"`
|
AccessType string `url:"accesstype" json:"accesstype"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq AddUserRequest) validate() error {
|
func (arq AddUserRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type AuditsRequest struct {
|
type AuditsRequest struct {
|
||||||
// ID of the account
|
// ID of the account
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId"`
|
AccountID uint64 `url:"accountId" json:"accountId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq AuditsRequest) validate() error {
|
func (arq AuditsRequest) validate() error {
|
||||||
|
|||||||
@@ -11,43 +11,43 @@ import (
|
|||||||
type CreateRequest struct {
|
type CreateRequest struct {
|
||||||
// Display name
|
// Display name
|
||||||
// Required: true
|
// Required: true
|
||||||
Name string `url:"name"`
|
Name string `url:"name" json:"name"`
|
||||||
|
|
||||||
// Name of the account
|
// Name of the account
|
||||||
// Required: true
|
// Required: true
|
||||||
Username string `url:"username"`
|
Username string `url:"username" json:"username"`
|
||||||
|
|
||||||
// Email
|
// Email
|
||||||
// Required: false
|
// Required: false
|
||||||
EmailAddress string `url:"emailaddress,omitempty"`
|
EmailAddress string `url:"emailaddress,omitempty" json:"emailaddress,omitempty"`
|
||||||
|
|
||||||
// Max size of memory in MB
|
// Max size of memory in MB
|
||||||
// Required: false
|
// Required: false
|
||||||
MaxMemoryCapacity uint64 `url:"maxMemoryCapacity,omitempty"`
|
MaxMemoryCapacity int64 `url:"maxMemoryCapacity,omitempty" json:"maxMemoryCapacity,omitempty"`
|
||||||
|
|
||||||
// Max size of aggregated vdisks in GB
|
// Max size of aggregated vdisks in GB
|
||||||
// Required: false
|
// Required: false
|
||||||
MaxVDiskCapacity uint64 `url:"maxVDiskCapacity,omitempty"`
|
MaxVDiskCapacity int64 `url:"maxVDiskCapacity,omitempty" json:"maxVDiskCapacity,omitempty"`
|
||||||
|
|
||||||
// Max number of CPU cores
|
// Max number of CPU cores
|
||||||
// Required: false
|
// Required: false
|
||||||
MaxCPUCapacity uint64 `url:"maxCPUCapacity,omitempty"`
|
MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"`
|
||||||
|
|
||||||
// Max sent/received network transfer peering
|
// Max sent/received network transfer peering
|
||||||
// Required: false
|
// Required: false
|
||||||
MaxNetworkPeerTransfer uint64 `url:"maxNetworkPeerTransfer,omitempty"`
|
MaxNetworkPeerTransfer int64 `url:"maxNetworkPeerTransfer,omitempty" json:"maxNetworkPeerTransfer,omitempty"`
|
||||||
|
|
||||||
// Max number of assigned public IPs
|
// Max number of assigned public IPs
|
||||||
// Required: false
|
// Required: false
|
||||||
MaxNumPublicIP uint64 `url:"maxNumPublicIP,omitempty"`
|
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`
|
||||||
|
|
||||||
// If true send emails when a user is granted access to resources
|
// If true send emails when a user is granted access to resources
|
||||||
// Required: false
|
// Required: false
|
||||||
SendAccessEmails bool `url:"sendAccessEmails,omitempty"`
|
SendAccessEmails bool `url:"sendAccessEmails,omitempty" json:"sendAccessEmails,omitempty"`
|
||||||
|
|
||||||
// Limit (positive) or disable (0) GPU resources
|
// Limit (positive) or disable (0) GPU resources
|
||||||
// Required: false
|
// Required: false
|
||||||
GPUUnits uint64 `url:"gpu_units,omitempty"`
|
GPUUnits int64 `url:"gpu_units,omitempty" json:"gpu_units,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq CreateRequest) validate() error {
|
func (arq CreateRequest) validate() error {
|
||||||
@@ -69,7 +69,7 @@ func (a Account) Create(ctx context.Context, req CreateRequest) (uint64, error)
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/account/create"
|
url := "/cloudapi/account/create"
|
||||||
|
|
||||||
res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import (
|
|||||||
type DeleteRequest struct {
|
type DeleteRequest struct {
|
||||||
// ID of account to delete
|
// ID of account to delete
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId"`
|
AccountID uint64 `url:"accountId" json:"accountId"`
|
||||||
|
|
||||||
// Whether to completely delete the account
|
// Whether to completely delete the account
|
||||||
// Required: false
|
// Required: false
|
||||||
Permanently bool `url:"permanently,omitempty"`
|
Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq DeleteRequest) validate() error {
|
func (arq DeleteRequest) validate() error {
|
||||||
|
|||||||
@@ -11,15 +11,15 @@ import (
|
|||||||
type DeleteUserRequest struct {
|
type DeleteUserRequest struct {
|
||||||
// ID of the account
|
// ID of the account
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId"`
|
AccountID uint64 `url:"accountId" json:"accountId"`
|
||||||
|
|
||||||
// ID or emailaddress of the user to remove
|
// ID or emailaddress of the user to remove
|
||||||
// Required: true
|
// Required: true
|
||||||
UserID string `url:"userId"`
|
UserID string `url:"userId" json:"userId"`
|
||||||
|
|
||||||
// Recursively revoke access rights from owned cloudspaces and vmachines
|
// Recursively revoke access rights from owned cloudspaces and vmachines
|
||||||
// Required: false
|
// Required: false
|
||||||
RecursiveDelete bool `url:"recursivedelete,omitempty"`
|
RecursiveDelete bool `url:"recursivedelete,omitempty" json:"recursivedelete,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq DeleteUserRequest) validate() error {
|
func (arq DeleteUserRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type DisabelEnableRequest struct {
|
type DisabelEnableRequest struct {
|
||||||
// ID of account
|
// ID of account
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId"`
|
AccountID uint64 `url:"accountId" json:"accountId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq DisabelEnableRequest) validate() error {
|
func (arq DisabelEnableRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type GetRequest struct {
|
type GetRequest struct {
|
||||||
// ID an account
|
// ID an account
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId"`
|
AccountID uint64 `url:"accountId" json:"accountId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq GetRequest) validate() error {
|
func (arq GetRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type GetConsumedAccountUnitsRequest struct {
|
type GetConsumedAccountUnitsRequest struct {
|
||||||
// ID an account
|
// ID an account
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId"`
|
AccountID uint64 `url:"accountId" json:"accountId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq GetConsumedAccountUnitsRequest) validate() error {
|
func (arq GetConsumedAccountUnitsRequest) validate() error {
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ import (
|
|||||||
type GetConsumedCloudUnitsByTypeRequest struct {
|
type GetConsumedCloudUnitsByTypeRequest struct {
|
||||||
// ID an account
|
// ID an account
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId"`
|
AccountID uint64 `url:"accountId" json:"accountId"`
|
||||||
|
|
||||||
// Cloud unit resource type
|
// Cloud unit resource type
|
||||||
// Required: true
|
// Required: true
|
||||||
CUType string `url:"cutype"`
|
CUType string `url:"cutype" json:"cutype"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq GetConsumedCloudUnitsByTypeRequest) validate() error {
|
func (arq GetConsumedCloudUnitsByTypeRequest) validate() error {
|
||||||
|
|||||||
@@ -10,15 +10,15 @@ import (
|
|||||||
type GetConsumtionRequest struct {
|
type GetConsumtionRequest struct {
|
||||||
// ID an account
|
// ID an account
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId"`
|
AccountID uint64 `url:"accountId" json:"accountId"`
|
||||||
|
|
||||||
// Epoch represents the start time
|
// Epoch represents the start time
|
||||||
// Required: true
|
// Required: true
|
||||||
Start uint64 `url:"start"`
|
Start uint64 `url:"start" json:"start"`
|
||||||
|
|
||||||
// Epoch represents the end time
|
// Epoch represents the end time
|
||||||
// Required: true
|
// Required: true
|
||||||
End uint64 `url:"end"`
|
End uint64 `url:"end" json:"end"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq GetConsumtionRequest) validate() error {
|
func (arq GetConsumtionRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type GetReservedAccountUnitsRequest struct {
|
type GetReservedAccountUnitsRequest struct {
|
||||||
// ID an account
|
// ID an account
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId"`
|
AccountID uint64 `url:"accountId" json:"accountId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq GetReservedAccountUnitsRequest) validate() error {
|
func (arq GetReservedAccountUnitsRequest) validate() error {
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import (
|
|||||||
type ListRequest struct {
|
type ListRequest struct {
|
||||||
// Page number
|
// Page number
|
||||||
// Required: false
|
// Required: false
|
||||||
Page uint64 `url:"page"`
|
Page uint64 `url:"page" json:"page"`
|
||||||
|
|
||||||
// Page size
|
// Page size
|
||||||
// Required: false
|
// Required: false
|
||||||
Size uint64 `url:"size"`
|
Size uint64 `url:"size" json:"size"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List gets list all accounts the user has access to
|
// List gets list all accounts the user has access to
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type ListComputesRequest struct {
|
type ListComputesRequest struct {
|
||||||
// ID an account
|
// ID an account
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId"`
|
AccountID uint64 `url:"accountId" json:"accountId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq ListComputesRequest) validate() error {
|
func (arq ListComputesRequest) validate() error {
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import (
|
|||||||
type ListDeletedRequest struct {
|
type ListDeletedRequest struct {
|
||||||
// Page number
|
// Page number
|
||||||
// Required: false
|
// Required: false
|
||||||
Page uint64 `url:"page"`
|
Page uint64 `url:"page" json:"page"`
|
||||||
|
|
||||||
// Page size
|
// Page size
|
||||||
// Required: false
|
// Required: false
|
||||||
Size uint64 `url:"size"`
|
Size uint64 `url:"size" json:"size"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListDeleted gets list all deleted accounts the user has access to
|
// ListDeleted gets list all deleted accounts the user has access to
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type ListDisksRequest struct {
|
type ListDisksRequest struct {
|
||||||
// ID an account
|
// ID an account
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId"`
|
AccountID uint64 `url:"accountId" json:"accountId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq ListDisksRequest) validate() error {
|
func (arq ListDisksRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type ListFLIPGroupsRequest struct {
|
type ListFLIPGroupsRequest struct {
|
||||||
// ID an account
|
// ID an account
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId"`
|
AccountID uint64 `url:"accountId" json:"accountId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq ListFLIPGroupsRequest) validate() error {
|
func (arq ListFLIPGroupsRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type ListRGRequest struct {
|
type ListRGRequest struct {
|
||||||
// ID an account
|
// ID an account
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId"`
|
AccountID uint64 `url:"accountId" json:"accountId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq ListRGRequest) validate() error {
|
func (arq ListRGRequest) validate() error {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
type ListTemplatesRequest struct {
|
type ListTemplatesRequest struct {
|
||||||
// ID an account
|
// ID an account
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId"`
|
AccountID uint64 `url:"accountId" json:"accountId"`
|
||||||
|
|
||||||
// Include deleted images
|
// Include deleted images
|
||||||
// Required: false
|
// Required: false
|
||||||
IncludeDeleted bool `url:"includedeleted"`
|
IncludeDeleted bool `url:"includedeleted" json:"includedeleted"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq ListTemplatesRequest) validate() error {
|
func (arq ListTemplatesRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type ListVINSRequest struct {
|
type ListVINSRequest struct {
|
||||||
// ID an account
|
// ID an account
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId"`
|
AccountID uint64 `url:"accountId" json:"accountId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq ListVINSRequest) validate() error {
|
func (arq ListVINSRequest) validate() error {
|
||||||
|
|||||||
@@ -78,10 +78,10 @@ type Resource struct {
|
|||||||
CPU int64 `json:"cpu"`
|
CPU int64 `json:"cpu"`
|
||||||
|
|
||||||
// Disk size
|
// Disk size
|
||||||
DiskSize int64 `json:"disksize"`
|
DiskSize float64 `json:"disksize"`
|
||||||
|
|
||||||
// Max disk size
|
// Max disk size
|
||||||
DiskSizeMax int64 `json:"disksizemax"`
|
DiskSizeMax uint64 `json:"disksizemax"`
|
||||||
|
|
||||||
// Number of External IPs
|
// Number of External IPs
|
||||||
ExtIPs int64 `json:"extips"`
|
ExtIPs int64 `json:"extips"`
|
||||||
@@ -105,7 +105,7 @@ type DiskUsage struct {
|
|||||||
DiskSize float64 `json:"disksize"`
|
DiskSize float64 `json:"disksize"`
|
||||||
|
|
||||||
// Disk size max
|
// Disk size max
|
||||||
DiskSizeMax float64 `json:"disksizemax"`
|
DiskSizeMax uint64 `json:"disksizemax"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Information about resources
|
// Information about resources
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type RestoreRequest struct {
|
type RestoreRequest struct {
|
||||||
// ID an account
|
// ID an account
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId"`
|
AccountID uint64 `url:"accountId" json:"accountId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq RestoreRequest) validate() error {
|
func (arq RestoreRequest) validate() error {
|
||||||
|
|||||||
@@ -11,39 +11,39 @@ import (
|
|||||||
type UpdateRequest struct {
|
type UpdateRequest struct {
|
||||||
// ID an account
|
// ID an account
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId"`
|
AccountID uint64 `url:"accountId" json:"accountId"`
|
||||||
|
|
||||||
// Name of the account
|
// Name of the account
|
||||||
// Required: false
|
// Required: false
|
||||||
Name string `url:"name,omitempty"`
|
Name string `url:"name,omitempty" json:"name,omitempty"`
|
||||||
|
|
||||||
// Max size of memory in MB
|
// Max size of memory in MB
|
||||||
// Required: false
|
// Required: false
|
||||||
MaxMemoryCapacity uint64 `url:"maxMemoryCapacity,omitempty"`
|
MaxMemoryCapacity uint64 `url:"maxMemoryCapacity,omitempty" json:"maxMemoryCapacity,omitempty"`
|
||||||
|
|
||||||
// Max size of aggregated vdisks in GB
|
// Max size of aggregated vdisks in GB
|
||||||
// Required: false
|
// Required: false
|
||||||
MaxVDiskCapacity uint64 `url:"maxVDiskCapacity,omitempty"`
|
MaxVDiskCapacity uint64 `url:"maxVDiskCapacity,omitempty" json:"maxVDiskCapacity,omitempty"`
|
||||||
|
|
||||||
// Max number of CPU cores
|
// Max number of CPU cores
|
||||||
// Required: false
|
// Required: false
|
||||||
MaxCPUCapacity uint64 `url:"maxCPUCapacity,omitempty"`
|
MaxCPUCapacity uint64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"`
|
||||||
|
|
||||||
// Max sent/received network transfer peering
|
// Max sent/received network transfer peering
|
||||||
// Required: false
|
// Required: false
|
||||||
MaxNetworkPeerTransfer uint64 `url:"maxNetworkPeerTransfer,omitempty"`
|
MaxNetworkPeerTransfer uint64 `url:"maxNetworkPeerTransfer,omitempty" json:"maxNetworkPeerTransfer,omitempty"`
|
||||||
|
|
||||||
// Max number of assigned public IPs
|
// Max number of assigned public IPs
|
||||||
// Required: false
|
// Required: false
|
||||||
MaxNumPublicIP uint64 `url:"maxNumPublicIP,omitempty"`
|
MaxNumPublicIP uint64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`
|
||||||
|
|
||||||
// If true send emails when a user is granted access to resources
|
// If true send emails when a user is granted access to resources
|
||||||
// Required: false
|
// Required: false
|
||||||
SendAccessEmails bool `url:"sendAccessEmails,omitempty"`
|
SendAccessEmails bool `url:"sendAccessEmails,omitempty" json:"sendAccessEmails,omitempty"`
|
||||||
|
|
||||||
// Limit (positive) or disable (0) GPU resources
|
// Limit (positive) or disable (0) GPU resources
|
||||||
// Required: false
|
// Required: false
|
||||||
GPUUnits uint64 `url:"gpu_units,omitempty"`
|
GPUUnits uint64 `url:"gpu_units,omitempty" json:"gpu_units,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq UpdateRequest) validate() error {
|
func (arq UpdateRequest) validate() error {
|
||||||
|
|||||||
@@ -13,18 +13,18 @@ import (
|
|||||||
type UpdateUserRequest struct {
|
type UpdateUserRequest struct {
|
||||||
// ID of the account
|
// ID of the account
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId"`
|
AccountID uint64 `url:"accountId" json:"accountId"`
|
||||||
|
|
||||||
// Userid/Email for registered users or emailaddress for unregistered users
|
// Userid/Email for registered users or emailaddress for unregistered users
|
||||||
// Required: true
|
// Required: true
|
||||||
UserID string `url:"userId"`
|
UserID string `url:"userId" json:"userId"`
|
||||||
|
|
||||||
// Account permission types:
|
// Account permission types:
|
||||||
// - 'R' for read only access
|
// - 'R' for read only access
|
||||||
// - 'RCX' for Write
|
// - 'RCX' for Write
|
||||||
// - 'ARCXDU' for Admin
|
// - 'ARCXDU' for Admin
|
||||||
// Required: true
|
// Required: true
|
||||||
AccessType string `url:"accesstype"`
|
AccessType string `url:"accesstype" json:"accesstype"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (arq UpdateUserRequest) validate() error {
|
func (arq UpdateUserRequest) validate() error {
|
||||||
|
|||||||
@@ -11,19 +11,19 @@ import (
|
|||||||
type CreateRequest struct {
|
type CreateRequest struct {
|
||||||
// Name of the service
|
// Name of the service
|
||||||
// Required: true
|
// Required: true
|
||||||
Name string `url:"name"`
|
Name string `url:"name" json:"name"`
|
||||||
|
|
||||||
// ID of the Resource Group where this service will be placed
|
// ID of the Resource Group where this service will be placed
|
||||||
// Required: true
|
// Required: true
|
||||||
RGID uint64 `url:"rgId"`
|
RGID uint64 `url:"rgId" json:"rgId"`
|
||||||
|
|
||||||
// Name of the user to deploy SSH key for. Pass empty string if no SSH key deployment is required
|
// Name of the user to deploy SSH key for. Pass empty string if no SSH key deployment is required
|
||||||
// Required: false
|
// Required: false
|
||||||
SSHUser string `url:"sshUser,omitempty"`
|
SSHUser string `url:"sshUser,omitempty" json:"sshUser,omitempty"`
|
||||||
|
|
||||||
// SSH key to deploy for the specified user. Same key will be deployed to all computes of the service
|
// SSH key to deploy for the specified user. Same key will be deployed to all computes of the service
|
||||||
// Required: false
|
// Required: false
|
||||||
SSHKey string `url:"sshKey,omitempty"`
|
SSHKey string `url:"sshKey,omitempty" json:"sshKey,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq CreateRequest) validate() error {
|
func (bsrq CreateRequest) validate() error {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
type DeleteRequest struct {
|
type DeleteRequest struct {
|
||||||
// ID of the BasicService to be delete
|
// ID of the BasicService to be delete
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
|
|
||||||
// If set to False, Basic service will be deleted to recycle bin. Otherwise destroyed immediately
|
// If set to False, Basic service will be deleted to recycle bin. Otherwise destroyed immediately
|
||||||
// Required: true
|
// Required: true
|
||||||
Permanently bool `url:"permanently,omitempty"`
|
Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq DeleteRequest) validate() error {
|
func (bsrq DeleteRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type DisableRequest struct {
|
type DisableRequest struct {
|
||||||
// ID of the service to disable
|
// ID of the service to disable
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq DisableRequest) validate() error {
|
func (bsrq DisableRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type EnableRequest struct {
|
type EnableRequest struct {
|
||||||
// ID of the service to enable
|
// ID of the service to enable
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq EnableRequest) validate() error {
|
func (bsrq EnableRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type GetRequest struct {
|
type GetRequest struct {
|
||||||
// ID of the service to query information
|
// ID of the service to query information
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq GetRequest) validate() error {
|
func (bsrq GetRequest) validate() error {
|
||||||
|
|||||||
@@ -11,62 +11,62 @@ import (
|
|||||||
type GroupAddRequest struct {
|
type GroupAddRequest struct {
|
||||||
// ID of the Basic Service to add a group to
|
// ID of the Basic Service to add a group to
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
|
|
||||||
// Name of the Compute Group to add
|
// Name of the Compute Group to add
|
||||||
// Required: true
|
// Required: true
|
||||||
Name string `url:"name"`
|
Name string `url:"name" json:"name"`
|
||||||
|
|
||||||
// Computes number. Defines how many computes must be there in the group
|
// Computes number. Defines how many computes must be there in the group
|
||||||
// Required: true
|
// Required: true
|
||||||
Count uint64 `url:"count"`
|
Count uint64 `url:"count" json:"count"`
|
||||||
|
|
||||||
// Compute CPU number. All computes in the group have the same CPU count
|
// Compute CPU number. All computes in the group have the same CPU count
|
||||||
// Required: true
|
// Required: true
|
||||||
CPU uint64 `url:"cpu"`
|
CPU uint64 `url:"cpu" json:"cpu"`
|
||||||
|
|
||||||
// Compute RAM volume in MB. All computes in the group have the same RAM volume
|
// Compute RAM volume in MB. All computes in the group have the same RAM volume
|
||||||
// Required: true
|
// Required: true
|
||||||
RAM uint64 `url:"ram"`
|
RAM uint64 `url:"ram" json:"ram"`
|
||||||
|
|
||||||
// Compute boot disk size in GB
|
// Compute boot disk size in GB
|
||||||
// Required: true
|
// Required: true
|
||||||
Disk uint64 `url:"disk"`
|
Disk uint64 `url:"disk" json:"disk"`
|
||||||
|
|
||||||
// OS image ID to create computes from
|
// OS image ID to create computes from
|
||||||
// Required: true
|
// Required: true
|
||||||
ImageID uint64 `url:"imageId"`
|
ImageID uint64 `url:"imageId" json:"imageId"`
|
||||||
|
|
||||||
// Compute driver
|
// Compute driver
|
||||||
// should be one of:
|
// should be one of:
|
||||||
// - KVM_X86
|
// - KVM_X86
|
||||||
// - KVM_PPC
|
// - KVM_PPC
|
||||||
// Required: true
|
// Required: true
|
||||||
Driver string `url:"driver"`
|
Driver string `url:"driver" json:"driver"`
|
||||||
|
|
||||||
// Storage endpoint provider ID
|
// Storage endpoint provider ID
|
||||||
// Required: false
|
// Required: false
|
||||||
SEPID uint64 `url:"sepId,omitempty"`
|
SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`
|
||||||
|
|
||||||
// Pool to use if sepId is set, can be also empty if needed to be chosen by system
|
// Pool to use if sepId is set, can be also empty if needed to be chosen by system
|
||||||
// Required: false
|
// Required: false
|
||||||
SEPPool string `url:"sepPool,omitempty"`
|
SEPPool string `url:"sepPool,omitempty" json:"sepPool,omitempty"`
|
||||||
|
|
||||||
// Group role tag. Can be empty string, does not have to be unique
|
// Group role tag. Can be empty string, does not have to be unique
|
||||||
// Required: false
|
// Required: false
|
||||||
Role string `url:"role,omitempty"`
|
Role string `url:"role,omitempty" json:"role,omitempty"`
|
||||||
|
|
||||||
// List of ViNSes to connect computes to
|
// List of ViNSes to connect computes to
|
||||||
// Required: false
|
// Required: false
|
||||||
VINSes []uint64 `url:"vinses,omitempty"`
|
VINSes []uint64 `url:"vinses,omitempty" json:"vinses,omitempty"`
|
||||||
|
|
||||||
// List of external networks to connect computes to
|
// List of external networks to connect computes to
|
||||||
// Required: false
|
// Required: false
|
||||||
ExtNets []uint64 `url:"extnets,omitempty"`
|
ExtNets []uint64 `url:"extnets,omitempty" json:"extnets,omitempty"`
|
||||||
|
|
||||||
// Time of Compute Group readiness
|
// Time of Compute Group readiness
|
||||||
// Required: false
|
// Required: false
|
||||||
TimeoutStart uint64 `url:"timeoutStart"`
|
TimeoutStart uint64 `url:"timeoutStart" json:"timeoutStart"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq GroupAddRequest) validate() error {
|
func (bsrq GroupAddRequest) validate() error {
|
||||||
|
|||||||
@@ -11,15 +11,15 @@ import (
|
|||||||
type GroupComputeRemoveRequest struct {
|
type GroupComputeRemoveRequest struct {
|
||||||
// ID of the Basic Service
|
// ID of the Basic Service
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
|
|
||||||
// ID of the Compute GROUP
|
// ID of the Compute GROUP
|
||||||
// Required: true
|
// Required: true
|
||||||
CompGroupID uint64 `url:"compgroupId"`
|
CompGroupID uint64 `url:"compgroupId" json:"compgroupId"`
|
||||||
|
|
||||||
// ID of the Compute
|
// ID of the Compute
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq GroupComputeRemoveRequest) validate() error {
|
func (bsrq GroupComputeRemoveRequest) validate() error {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
type GroupGetRequest struct {
|
type GroupGetRequest struct {
|
||||||
// ID of the Basic Service of Compute Group
|
// ID of the Basic Service of Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
|
|
||||||
// ID of the Compute Group
|
// ID of the Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
CompGroupID uint64 `url:"compgroupId"`
|
CompGroupID uint64 `url:"compgroupId" json:"compgroupId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq GroupGetRequest) validate() error {
|
func (bsrq GroupGetRequest) validate() error {
|
||||||
|
|||||||
@@ -12,15 +12,15 @@ import (
|
|||||||
type GroupParentAddRequest struct {
|
type GroupParentAddRequest struct {
|
||||||
// ID of the Basic Service of Compute Group
|
// ID of the Basic Service of Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
|
|
||||||
// ID of the Compute Group
|
// ID of the Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
CompGroupID uint64 `url:"compgroupId"`
|
CompGroupID uint64 `url:"compgroupId" json:"compgroupId"`
|
||||||
|
|
||||||
// ID of the parent Compute Group to register with the current Compute Group
|
// ID of the parent Compute Group to register with the current Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
ParentID uint64 `url:"parentId"`
|
ParentID uint64 `url:"parentId" json:"parentId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq GroupParentAddRequest) validate() error {
|
func (bsrq GroupParentAddRequest) validate() error {
|
||||||
|
|||||||
@@ -12,16 +12,16 @@ import (
|
|||||||
type GroupParentRemoveRequest struct {
|
type GroupParentRemoveRequest struct {
|
||||||
// ID of the Basic Service of Compute Group
|
// ID of the Basic Service of Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
|
|
||||||
// ID of the Compute Group
|
// ID of the Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
CompGroupID uint64 `url:"compgroupId"`
|
CompGroupID uint64 `url:"compgroupId" json:"compgroupId"`
|
||||||
|
|
||||||
// ID of the parent Compute Group
|
// ID of the parent Compute Group
|
||||||
// to remove from the current Compute Group
|
// to remove from the current Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
ParentID uint64 `url:"parentId"`
|
ParentID uint64 `url:"parentId" json:"parentId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq GroupParentRemoveRequest) validate() error {
|
func (bsrq GroupParentRemoveRequest) validate() error {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
type GroupRemoveRequest struct {
|
type GroupRemoveRequest struct {
|
||||||
// ID of the Basic Service of Compute Group
|
// ID of the Basic Service of Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
|
|
||||||
// ID of the Compute Group
|
// ID of the Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
CompGroupID uint64 `url:"compgroupId"`
|
CompGroupID uint64 `url:"compgroupId" json:"compgroupId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq GroupRemoveRequest) validate() error {
|
func (bsrq GroupRemoveRequest) validate() error {
|
||||||
|
|||||||
@@ -13,22 +13,22 @@ import (
|
|||||||
type GroupResizeRequest struct {
|
type GroupResizeRequest struct {
|
||||||
// ID of the Basic Service of Compute Group
|
// ID of the Basic Service of Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
|
|
||||||
// ID of the Compute Group to resize
|
// ID of the Compute Group to resize
|
||||||
// Required: true
|
// Required: true
|
||||||
CompGroupID uint64 `url:"compgroupId"`
|
CompGroupID uint64 `url:"compgroupId" json:"compgroupId"`
|
||||||
|
|
||||||
// Either delta or absolute value of computes
|
// Either delta or absolute value of computes
|
||||||
// Required: true
|
// Required: true
|
||||||
Count int64 `url:"count"`
|
Count int64 `url:"count" json:"count"`
|
||||||
|
|
||||||
// Either delta or absolute value of computes
|
// Either delta or absolute value of computes
|
||||||
// Should be one of:
|
// Should be one of:
|
||||||
// - ABSOLUTE
|
// - ABSOLUTE
|
||||||
// - RELATIVE
|
// - RELATIVE
|
||||||
// Required: true
|
// Required: true
|
||||||
Mode string `url:"mode"`
|
Mode string `url:"mode" json:"mode"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq GroupResizeRequest) validate() error {
|
func (bsrq GroupResizeRequest) validate() error {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
type GroupStartRequest struct {
|
type GroupStartRequest struct {
|
||||||
// ID of the Basic Service of Compute Group
|
// ID of the Basic Service of Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
|
|
||||||
// ID of the Compute Group to start
|
// ID of the Compute Group to start
|
||||||
// Required: true
|
// Required: true
|
||||||
CompGroupID uint64 `url:"compgroupId"`
|
CompGroupID uint64 `url:"compgroupId" json:"compgroupId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq GroupStartRequest) validate() error {
|
func (bsrq GroupStartRequest) validate() error {
|
||||||
|
|||||||
@@ -11,15 +11,15 @@ import (
|
|||||||
type GroupStopRequest struct {
|
type GroupStopRequest struct {
|
||||||
// ID of the Basic Service of Compute Group
|
// ID of the Basic Service of Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
|
|
||||||
// ID of the Compute Group to stop
|
// ID of the Compute Group to stop
|
||||||
// Required: true
|
// Required: true
|
||||||
CompGroupID uint64 `url:"compgroupId"`
|
CompGroupID uint64 `url:"compgroupId" json:"compgroupId"`
|
||||||
|
|
||||||
// Force stop Compute Group
|
// Force stop Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
Force bool `url:"force,omitempty"`
|
Force bool `url:"force,omitempty" json:"force,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq GroupStopRequest) validate() error {
|
func (bsrq GroupStopRequest) validate() error {
|
||||||
|
|||||||
@@ -11,35 +11,35 @@ import (
|
|||||||
type GroupUpdateRequest struct {
|
type GroupUpdateRequest struct {
|
||||||
// ID of the Basic Service of Compute Group
|
// ID of the Basic Service of Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
|
|
||||||
// ID of the Compute Group
|
// ID of the Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
CompGroupID uint64 `url:"compgroupId"`
|
CompGroupID uint64 `url:"compgroupId" json:"compgroupId"`
|
||||||
|
|
||||||
// Specify non-empty string to update Compute Group name
|
// Specify non-empty string to update Compute Group name
|
||||||
// Required: false
|
// Required: false
|
||||||
Name string `url:"name,omitempty"`
|
Name string `url:"name,omitempty" json:"name,omitempty"`
|
||||||
|
|
||||||
// Specify non-empty string to update group role
|
// Specify non-empty string to update group role
|
||||||
// Required: false
|
// Required: false
|
||||||
Role string `url:"role,omitempty"`
|
Role string `url:"role,omitempty" json:"role,omitempty"`
|
||||||
|
|
||||||
// Specify positive value to set new compute CPU count
|
// Specify positive value to set new compute CPU count
|
||||||
// Required: false
|
// Required: false
|
||||||
CPU uint64 `url:"cpu,omitempty"`
|
CPU uint64 `url:"cpu,omitempty" json:"cpu,omitempty"`
|
||||||
|
|
||||||
// Specify positive value to set new compute RAM volume in MB
|
// Specify positive value to set new compute RAM volume in MB
|
||||||
// Required: false
|
// Required: false
|
||||||
RAM uint64 `url:"ram,omitempty"`
|
RAM uint64 `url:"ram,omitempty" json:"ram,omitempty"`
|
||||||
|
|
||||||
// Specify new compute boot disk size in GB
|
// Specify new compute boot disk size in GB
|
||||||
// Required: false
|
// Required: false
|
||||||
Disk uint64 `url:"disk,omitempty"`
|
Disk uint64 `url:"disk,omitempty" json:"disk,omitempty"`
|
||||||
|
|
||||||
// Force resize Compute Group
|
// Force resize Compute Group
|
||||||
// Required: false
|
// Required: false
|
||||||
Force bool `url:"force,omitempty"`
|
Force bool `url:"force,omitempty" json:"force,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq GroupUpdateRequest) validate() error {
|
func (bsrq GroupUpdateRequest) validate() error {
|
||||||
|
|||||||
@@ -11,15 +11,15 @@ import (
|
|||||||
type GroupUpdateExtNetRequest struct {
|
type GroupUpdateExtNetRequest struct {
|
||||||
// ID of the Basic Service of Compute Group
|
// ID of the Basic Service of Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
|
|
||||||
// ID of the Compute Group
|
// ID of the Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
CompGroupID uint64 `url:"compgroupId"`
|
CompGroupID uint64 `url:"compgroupId" json:"compgroupId"`
|
||||||
|
|
||||||
// List of Extnets to connect computes
|
// List of Extnets to connect computes
|
||||||
// Required: false
|
// Required: false
|
||||||
ExtNets []uint64 `url:"extnets,omitempty"`
|
ExtNets []uint64 `url:"extnets,omitempty" json:"extnets,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq GroupUpdateExtNetRequest) validate() error {
|
func (bsrq GroupUpdateExtNetRequest) validate() error {
|
||||||
|
|||||||
@@ -11,15 +11,15 @@ import (
|
|||||||
type GroupUpdateVINSRequest struct {
|
type GroupUpdateVINSRequest struct {
|
||||||
// ID of the Basic Service of Compute Group
|
// ID of the Basic Service of Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
|
|
||||||
// ID of the Compute Group
|
// ID of the Compute Group
|
||||||
// Required: true
|
// Required: true
|
||||||
CompGroupID uint64 `url:"compgroupId"`
|
CompGroupID uint64 `url:"compgroupId" json:"compgroupId"`
|
||||||
|
|
||||||
// List of ViNSes to connect computes
|
// List of ViNSes to connect computes
|
||||||
// Required: false
|
// Required: false
|
||||||
VINSes []uint64 `url:"vinses,omitempty"`
|
VINSes []uint64 `url:"vinses,omitempty" json:"vinses,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq GroupUpdateVINSRequest) validate() error {
|
func (bsrq GroupUpdateVINSRequest) validate() error {
|
||||||
|
|||||||
@@ -10,19 +10,19 @@ import (
|
|||||||
type ListRequest struct {
|
type ListRequest struct {
|
||||||
// ID of the account to query for BasicService instances
|
// ID of the account to query for BasicService instances
|
||||||
// Required: false
|
// Required: false
|
||||||
AccountID uint64 `url:"accountId,omitempty"`
|
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
|
||||||
|
|
||||||
// ID of the resource group to query for BasicService instances
|
// ID of the resource group to query for BasicService instances
|
||||||
// Required: false
|
// Required: false
|
||||||
RGID uint64 `url:"rgId,omitempty"`
|
RGID uint64 `url:"rgId,omitempty" json:"rgId,omitempty"`
|
||||||
|
|
||||||
// Page number
|
// Page number
|
||||||
// Required: false
|
// Required: false
|
||||||
Page uint64 `url:"page,omitempty"`
|
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
||||||
|
|
||||||
// Page size
|
// Page size
|
||||||
// Required: false
|
// Required: false
|
||||||
Size uint64 `url:"size,omitempty"`
|
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List gets list BasicService instances associated with the specified Resource Group
|
// List gets list BasicService instances associated with the specified Resource Group
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type RestoreRequest struct {
|
type RestoreRequest struct {
|
||||||
// ID of the BasicService to be restored
|
// ID of the BasicService to be restored
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq RestoreRequest) validate() error {
|
func (bsrq RestoreRequest) validate() error {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
type SnapshotCreateRequest struct {
|
type SnapshotCreateRequest struct {
|
||||||
// ID of the Basic Service
|
// ID of the Basic Service
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
|
|
||||||
// Label of the snapshot
|
// Label of the snapshot
|
||||||
// Required: true
|
// Required: true
|
||||||
Label string `url:"label"`
|
Label string `url:"label" json:"label"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq SnapshotCreateRequest) validate() error {
|
func (bsrq SnapshotCreateRequest) validate() error {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
type SnapshotDeleteRequest struct {
|
type SnapshotDeleteRequest struct {
|
||||||
// ID of the Basic Service
|
// ID of the Basic Service
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
|
|
||||||
// Label of the snapshot
|
// Label of the snapshot
|
||||||
// Required: true
|
// Required: true
|
||||||
Label string `url:"label"`
|
Label string `url:"label" json:"label"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq SnapshotDeleteRequest) validate() error {
|
func (bsrq SnapshotDeleteRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type SnapshotListRequest struct {
|
type SnapshotListRequest struct {
|
||||||
// ID of the Basic Service
|
// ID of the Basic Service
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq SnapshotListRequest) validate() error {
|
func (bsrq SnapshotListRequest) validate() error {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
type SnapshotRollbackRequest struct {
|
type SnapshotRollbackRequest struct {
|
||||||
// ID of the Basic Service
|
// ID of the Basic Service
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
|
|
||||||
// Label of the snapshot
|
// Label of the snapshot
|
||||||
// Required: true
|
// Required: true
|
||||||
Label string `url:"label"`
|
Label string `url:"label" json:"label"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq SnapshotRollbackRequest) validate() error {
|
func (bsrq SnapshotRollbackRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type StartRequest struct {
|
type StartRequest struct {
|
||||||
// ID of the service to start
|
// ID of the service to start
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq StartRequest) validate() error {
|
func (bsrq StartRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type StopRequest struct {
|
type StopRequest struct {
|
||||||
// ID of the service to stop
|
// ID of the service to stop
|
||||||
// Required: true
|
// Required: true
|
||||||
ServiceID uint64 `url:"serviceId"`
|
ServiceID uint64 `url:"serviceId" json:"serviceId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bsrq StopRequest) validate() error {
|
func (bsrq StopRequest) validate() error {
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import (
|
|||||||
type AffinityGroupCheckStartRequest struct {
|
type AffinityGroupCheckStartRequest struct {
|
||||||
// ID of the resource group
|
// ID of the resource group
|
||||||
// Required: true
|
// Required: true
|
||||||
RGID uint64 `url:"rgId"`
|
RGID uint64 `url:"rgId" json:"rgId"`
|
||||||
|
|
||||||
// Affinity group label
|
// Affinity group label
|
||||||
// Required: true
|
// Required: true
|
||||||
AffinityLabel string `url:"affinityLabel"`
|
AffinityLabel string `url:"affinityLabel" json:"affinityLabel"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq AffinityGroupCheckStartRequest) validate() error {
|
func (crq AffinityGroupCheckStartRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type AffinityLabelRemoveRequest struct {
|
type AffinityLabelRemoveRequest struct {
|
||||||
// ID of the compute instance
|
// ID of the compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq AffinityLabelRemoveRequest) validate() error {
|
func (crq AffinityLabelRemoveRequest) validate() error {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
type AffinityLabelSetRequest struct {
|
type AffinityLabelSetRequest struct {
|
||||||
// ID of the compute instance
|
// ID of the compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// Affinity group label
|
// Affinity group label
|
||||||
// Required: true
|
// Required: true
|
||||||
AffinityLabel string `url:"affinityLabel"`
|
AffinityLabel string `url:"affinityLabel" json:"affinityLabel"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq AffinityLabelSetRequest) validate() error {
|
func (crq AffinityLabelSetRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type AffinityRelationsRequest struct {
|
type AffinityRelationsRequest struct {
|
||||||
// ID of the compute instance
|
// ID of the compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq AffinityRelationsRequest) validate() error {
|
func (crq AffinityRelationsRequest) validate() error {
|
||||||
|
|||||||
@@ -13,18 +13,18 @@ import (
|
|||||||
type AffinityRuleAddRequest struct {
|
type AffinityRuleAddRequest struct {
|
||||||
// ID of the compute instance
|
// ID of the compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// Compute or node, for whom rule applies
|
// Compute or node, for whom rule applies
|
||||||
// Required: true
|
// Required: true
|
||||||
Topology string `url:"topology"`
|
Topology string `url:"topology" json:"topology"`
|
||||||
|
|
||||||
// The degree of 'strictness' of this rule
|
// The degree of 'strictness' of this rule
|
||||||
// Should be one of:
|
// Should be one of:
|
||||||
// - RECOMMENDED
|
// - RECOMMENDED
|
||||||
// - REQUIRED
|
// - REQUIRED
|
||||||
// Required: true
|
// Required: true
|
||||||
Policy string `url:"policy"`
|
Policy string `url:"policy" json:"policy"`
|
||||||
|
|
||||||
// The comparison mode is 'value', recorded by the specified 'key'
|
// The comparison mode is 'value', recorded by the specified 'key'
|
||||||
// Should be one of:
|
// Should be one of:
|
||||||
@@ -32,15 +32,15 @@ type AffinityRuleAddRequest struct {
|
|||||||
// - EN
|
// - EN
|
||||||
// - ANY
|
// - ANY
|
||||||
// Required: true
|
// Required: true
|
||||||
Mode string `url:"mode"`
|
Mode string `url:"mode" json:"mode"`
|
||||||
|
|
||||||
// Key that are taken into account when analyzing this rule will be identified
|
// Key that are taken into account when analyzing this rule will be identified
|
||||||
// Required: true
|
// Required: true
|
||||||
Key string `url:"key"`
|
Key string `url:"key" json:"key"`
|
||||||
|
|
||||||
// Value that must match the key to be taken into account when analyzing this rule
|
// Value that must match the key to be taken into account when analyzing this rule
|
||||||
// Required: true
|
// Required: true
|
||||||
Value string `url:"value"`
|
Value string `url:"value" json:"value"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq AffinityRuleAddRequest) validate() error {
|
func (crq AffinityRuleAddRequest) validate() error {
|
||||||
|
|||||||
@@ -13,18 +13,18 @@ import (
|
|||||||
type AffinityRuleRemoveRequest struct {
|
type AffinityRuleRemoveRequest struct {
|
||||||
// ID of the compute instance
|
// ID of the compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// Compute or node, for whom rule applies
|
// Compute or node, for whom rule applies
|
||||||
// Required: true
|
// Required: true
|
||||||
Topology string `url:"topology"`
|
Topology string `url:"topology" json:"topology"`
|
||||||
|
|
||||||
// The degree of 'strictness' of this rule
|
// The degree of 'strictness' of this rule
|
||||||
// Should be one of:
|
// Should be one of:
|
||||||
// - RECOMMENDED
|
// - RECOMMENDED
|
||||||
// - REQUIRED
|
// - REQUIRED
|
||||||
// Required: true
|
// Required: true
|
||||||
Policy string `url:"policy"`
|
Policy string `url:"policy" json:"policy"`
|
||||||
|
|
||||||
// The comparison mode is 'value', recorded by the specified 'key'
|
// The comparison mode is 'value', recorded by the specified 'key'
|
||||||
// Should be one of:
|
// Should be one of:
|
||||||
@@ -32,15 +32,15 @@ type AffinityRuleRemoveRequest struct {
|
|||||||
// - EN
|
// - EN
|
||||||
// - ANY
|
// - ANY
|
||||||
// Required: true
|
// Required: true
|
||||||
Mode string `url:"mode"`
|
Mode string `url:"mode" json:"mode"`
|
||||||
|
|
||||||
// Key that are taken into account when analyzing this rule will be identified
|
// Key that are taken into account when analyzing this rule will be identified
|
||||||
// Required: true
|
// Required: true
|
||||||
Key string `url:"key"`
|
Key string `url:"key" json:"key"`
|
||||||
|
|
||||||
// Value that must match the key to be taken into account when analyzing this rule
|
// Value that must match the key to be taken into account when analyzing this rule
|
||||||
// Required: true
|
// Required: true
|
||||||
Value string `url:"value"`
|
Value string `url:"value" json:"value"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq AffinityRuleRemoveRequest) validate() error {
|
func (crq AffinityRuleRemoveRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type AffinityRulesClearRequest struct {
|
type AffinityRulesClearRequest struct {
|
||||||
// ID of the compute instance
|
// ID of the compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq AffinityRulesClearRequest) validate() error {
|
func (crq AffinityRulesClearRequest) validate() error {
|
||||||
|
|||||||
@@ -13,18 +13,18 @@ import (
|
|||||||
type AntiAffinityRuleAddRequest struct {
|
type AntiAffinityRuleAddRequest struct {
|
||||||
// ID of the compute instance
|
// ID of the compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// Compute or node, for whom rule applies
|
// Compute or node, for whom rule applies
|
||||||
// Required: true
|
// Required: true
|
||||||
Topology string `url:"topology"`
|
Topology string `url:"topology" json:"topology"`
|
||||||
|
|
||||||
// The degree of 'strictness' of this rule
|
// The degree of 'strictness' of this rule
|
||||||
// Should be one of:
|
// Should be one of:
|
||||||
// - RECOMMENDED
|
// - RECOMMENDED
|
||||||
// - REQUIRED
|
// - REQUIRED
|
||||||
// Required: true
|
// Required: true
|
||||||
Policy string `url:"policy"`
|
Policy string `url:"policy" json:"policy"`
|
||||||
|
|
||||||
// The comparison mode is 'value', recorded by the specified 'key'
|
// The comparison mode is 'value', recorded by the specified 'key'
|
||||||
// Should be one of:
|
// Should be one of:
|
||||||
@@ -32,15 +32,15 @@ type AntiAffinityRuleAddRequest struct {
|
|||||||
// - EN
|
// - EN
|
||||||
// - ANY
|
// - ANY
|
||||||
// Required: true
|
// Required: true
|
||||||
Mode string `url:"mode"`
|
Mode string `url:"mode" json:"mode"`
|
||||||
|
|
||||||
// Key that are taken into account when analyzing this rule will be identified
|
// Key that are taken into account when analyzing this rule will be identified
|
||||||
// Required: true
|
// Required: true
|
||||||
Key string `url:"key"`
|
Key string `url:"key" json:"key"`
|
||||||
|
|
||||||
// Value that must match the key to be taken into account when analyzing this rule
|
// Value that must match the key to be taken into account when analyzing this rule
|
||||||
// Required: true
|
// Required: true
|
||||||
Value string `url:"value"`
|
Value string `url:"value" json:"value"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq AntiAffinityRuleAddRequest) validate() error {
|
func (crq AntiAffinityRuleAddRequest) validate() error {
|
||||||
|
|||||||
@@ -13,18 +13,18 @@ import (
|
|||||||
type AntiAffinityRuleRemoveRequest struct {
|
type AntiAffinityRuleRemoveRequest struct {
|
||||||
// ID of the compute instance
|
// ID of the compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// Compute or node, for whom rule applies
|
// Compute or node, for whom rule applies
|
||||||
// Required: true
|
// Required: true
|
||||||
Topology string `url:"topology"`
|
Topology string `url:"topology" json:"topology"`
|
||||||
|
|
||||||
// The degree of 'strictness' of this rule
|
// The degree of 'strictness' of this rule
|
||||||
// Should be one of:
|
// Should be one of:
|
||||||
// - RECOMMENDED
|
// - RECOMMENDED
|
||||||
// - REQUIRED
|
// - REQUIRED
|
||||||
// Required: true
|
// Required: true
|
||||||
Policy string `url:"policy"`
|
Policy string `url:"policy" json:"policy"`
|
||||||
|
|
||||||
// The comparison mode is 'value', recorded by the specified 'key'
|
// The comparison mode is 'value', recorded by the specified 'key'
|
||||||
// Should be one of:
|
// Should be one of:
|
||||||
@@ -32,15 +32,15 @@ type AntiAffinityRuleRemoveRequest struct {
|
|||||||
// - EN
|
// - EN
|
||||||
// - ANY
|
// - ANY
|
||||||
// Required: true
|
// Required: true
|
||||||
Mode string `url:"mode"`
|
Mode string `url:"mode" json:"mode"`
|
||||||
|
|
||||||
// Key that are taken into account when analyzing this rule will be identified
|
// Key that are taken into account when analyzing this rule will be identified
|
||||||
// Required: true
|
// Required: true
|
||||||
Key string `url:"key"`
|
Key string `url:"key" json:"key"`
|
||||||
|
|
||||||
// Value that must match the key to be taken into account when analyzing this rule
|
// Value that must match the key to be taken into account when analyzing this rule
|
||||||
// Required: true
|
// Required: true
|
||||||
Value string `url:"value"`
|
Value string `url:"value" json:"value"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq AntiAffinityRuleRemoveRequest) validate() error {
|
func (crq AntiAffinityRuleRemoveRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type AntiAffinityRulesClearRequest struct {
|
type AntiAffinityRulesClearRequest struct {
|
||||||
// ID of the compute instance
|
// ID of the compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq AntiAffinityRulesClearRequest) validate() error {
|
func (crq AntiAffinityRulesClearRequest) validate() error {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
type AttachGPURequest struct {
|
type AttachGPURequest struct {
|
||||||
// Identifier compute
|
// Identifier compute
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// Identifier vGPU
|
// Identifier vGPU
|
||||||
// Required: true
|
// Required: true
|
||||||
VGPUID uint64 `url:"vgpuId"`
|
VGPUID uint64 `url:"vgpuId" json:"vgpuId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq AttachGPURequest) validate() error {
|
func (crq AttachGPURequest) validate() error {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
type AttachPCIDeviceRequest struct {
|
type AttachPCIDeviceRequest struct {
|
||||||
// Identifier compute
|
// Identifier compute
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// PCI device ID
|
// PCI device ID
|
||||||
// Required: true
|
// Required: true
|
||||||
DeviceID uint64 `url:"deviceId"`
|
DeviceID uint64 `url:"deviceId" json:"deviceId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq AttachPCIDeviceRequest) validate() error {
|
func (crq AttachPCIDeviceRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type AuditsRequest struct {
|
type AuditsRequest struct {
|
||||||
// ID of the compute
|
// ID of the compute
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq AuditsRequest) validate() error {
|
func (crq AuditsRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type CDEjectRequest struct {
|
type CDEjectRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq CDEjectRequest) validate() error {
|
func (crq CDEjectRequest) validate() error {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
type CDInsertRequest struct {
|
type CDInsertRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// ID of CD-ROM image
|
// ID of CD-ROM image
|
||||||
// Required: true
|
// Required: true
|
||||||
CDROMID uint64 `url:"cdromId"`
|
CDROMID uint64 `url:"cdromId" json:"cdromId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq CDInsertRequest) validate() error {
|
func (crq CDInsertRequest) validate() error {
|
||||||
|
|||||||
@@ -11,19 +11,19 @@ import (
|
|||||||
type CloneRequest struct {
|
type CloneRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// Name of the clone
|
// Name of the clone
|
||||||
// Required: true
|
// Required: true
|
||||||
Name string `url:"name"`
|
Name string `url:"name" json:"name"`
|
||||||
|
|
||||||
// Timestamp of the parent's snapshot to create clone from
|
// Timestamp of the parent's snapshot to create clone from
|
||||||
// Required: false
|
// Required: false
|
||||||
SnapshotTimestamp uint64 `url:"snapshotTimestamp"`
|
SnapshotTimestamp uint64 `url:"snapshotTimestamp" json:"snapshotTimestamp"`
|
||||||
|
|
||||||
// Name of the parent's snapshot to create clone from
|
// Name of the parent's snapshot to create clone from
|
||||||
// Required: false
|
// Required: false
|
||||||
SnapshotName string `url:"snapshotName"`
|
SnapshotName string `url:"snapshotName" json:"snapshotName"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq CloneRequest) validate() error {
|
func (crq CloneRequest) validate() error {
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ import (
|
|||||||
type CreateTemplateRequest struct {
|
type CreateTemplateRequest struct {
|
||||||
// ID of the compute to create template from
|
// ID of the compute to create template from
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// Name to assign to the template being created
|
// Name to assign to the template being created
|
||||||
// Required: true
|
// Required: true
|
||||||
Name string `url:"name"`
|
Name string `url:"name" json:"name"`
|
||||||
|
|
||||||
// Async API call
|
// Async API call
|
||||||
// For async call use CreateTemplateAsync
|
// For async call use CreateTemplateAsync
|
||||||
|
|||||||
@@ -11,15 +11,15 @@ import (
|
|||||||
type DeleteRequest struct {
|
type DeleteRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// Delete permanently
|
// Delete permanently
|
||||||
// Required: false
|
// Required: false
|
||||||
Permanently bool `url:"permanently,omitempty"`
|
Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"`
|
||||||
|
|
||||||
// Set True if you want to detach data disks (if any) from the compute before its deletion
|
// Set True if you want to detach data disks (if any) from the compute before its deletion
|
||||||
// Required: false
|
// Required: false
|
||||||
DetachDisks bool `url:"detachDisks,omitempty"`
|
DetachDisks bool `url:"detachDisks,omitempty" json:"detachDisks,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq DeleteRequest) validate() error {
|
func (crq DeleteRequest) validate() error {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
type DetachGPURequest struct {
|
type DetachGPURequest struct {
|
||||||
// Identifier compute
|
// Identifier compute
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// Identifier virtual GPU
|
// Identifier virtual GPU
|
||||||
// Required: false
|
// Required: false
|
||||||
VGPUID int64 `url:"vgpuId,omitempty"`
|
VGPUID int64 `url:"vgpuId,omitempty" json:"vgpuId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq DetachGPURequest) validate() error {
|
func (crq DetachGPURequest) validate() error {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
type DetachPCIDeviceRequest struct {
|
type DetachPCIDeviceRequest struct {
|
||||||
// Identifier compute
|
// Identifier compute
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// Pci device ID
|
// Pci device ID
|
||||||
// Required: true
|
// Required: true
|
||||||
DeviceID uint64 `url:"deviceId"`
|
DeviceID uint64 `url:"deviceId" json:"deviceId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq DetachPCIDeviceRequest) validate() error {
|
func (crq DetachPCIDeviceRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type DisableRequest struct {
|
type DisableRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq DisableRequest) validate() error {
|
func (crq DisableRequest) validate() error {
|
||||||
|
|||||||
@@ -11,40 +11,40 @@ import (
|
|||||||
type DiskAddRequest struct {
|
type DiskAddRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// Name for disk
|
// Name for disk
|
||||||
// Required: true
|
// Required: true
|
||||||
DiskName string `url:"diskName"`
|
DiskName string `url:"diskName" json:"diskName"`
|
||||||
|
|
||||||
// Disk size in GB
|
// Disk size in GB
|
||||||
// Required: true
|
// Required: true
|
||||||
Size uint64 `url:"size"`
|
Size uint64 `url:"size" json:"size"`
|
||||||
|
|
||||||
// Type of the disk
|
// Type of the disk
|
||||||
// Should be one of:
|
// Should be one of:
|
||||||
// - D
|
// - D
|
||||||
// - B
|
// - B
|
||||||
// Required: false
|
// Required: false
|
||||||
DiskType string `url:"diskType,omitempty"`
|
DiskType string `url:"diskType,omitempty" json:"diskType,omitempty"`
|
||||||
|
|
||||||
// Storage endpoint provider ID
|
// Storage endpoint provider ID
|
||||||
// By default the same with boot disk
|
// By default the same with boot disk
|
||||||
// Required: false
|
// Required: false
|
||||||
SepID uint64 `url:"sepId,omitempty"`
|
SepID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`
|
||||||
|
|
||||||
// Pool name
|
// Pool name
|
||||||
// By default will be chosen automatically
|
// By default will be chosen automatically
|
||||||
// Required: false
|
// Required: false
|
||||||
Pool string `url:"pool,omitempty"`
|
Pool string `url:"pool,omitempty" json:"pool,omitempty"`
|
||||||
|
|
||||||
// Optional description
|
// Optional description
|
||||||
// Required: false
|
// Required: false
|
||||||
Description string `url:"desc,omitempty"`
|
Description string `url:"desc,omitempty" json:"desc,omitempty"`
|
||||||
|
|
||||||
// Specify image id for create disk from template
|
// Specify image id for create disk from template
|
||||||
// Required: false
|
// Required: false
|
||||||
ImageID uint64 `url:"imageId,omitempty"`
|
ImageID uint64 `url:"imageId,omitempty" json:"imageId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq DiskAddRequest) validate() error {
|
func (crq DiskAddRequest) validate() error {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
type DiskAttachRequest struct {
|
type DiskAttachRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// ID of the disk to attach
|
// ID of the disk to attach
|
||||||
// Required: true
|
// Required: true
|
||||||
DiskID uint64 `url:"diskId"`
|
DiskID uint64 `url:"diskId" json:"diskId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq DiskAttachRequest) validate() error {
|
func (crq DiskAttachRequest) validate() error {
|
||||||
|
|||||||
@@ -11,15 +11,15 @@ import (
|
|||||||
type DiskDelRequest struct {
|
type DiskDelRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// ID of disk instance
|
// ID of disk instance
|
||||||
// Required: true
|
// Required: true
|
||||||
DiskID uint64 `url:"diskId"`
|
DiskID uint64 `url:"diskId" json:"diskId"`
|
||||||
|
|
||||||
// False if disk is to be deleted to recycle bin
|
// False if disk is to be deleted to recycle bin
|
||||||
// Required: true
|
// Required: true
|
||||||
Permanently bool `url:"permanently"`
|
Permanently bool `url:"permanently" json:"permanently"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq DiskDelRequest) validate() error {
|
func (crq DiskDelRequest) validate() error {
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import (
|
|||||||
type DiskDetachRequest struct {
|
type DiskDetachRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// ID of the disk to detach
|
// ID of the disk to detach
|
||||||
// Required: true
|
// Required: true
|
||||||
DiskID uint64 `url:"diskId"`
|
DiskID uint64 `url:"diskId" json:"diskId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq DiskDetachRequest) validate() error {
|
func (crq DiskDetachRequest) validate() error {
|
||||||
|
|||||||
@@ -11,15 +11,15 @@ import (
|
|||||||
type DiskQOSRequest struct {
|
type DiskQOSRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// ID of the disk to apply limits
|
// ID of the disk to apply limits
|
||||||
// Required: true
|
// Required: true
|
||||||
DiskID uint64 `url:"diskId"`
|
DiskID uint64 `url:"diskId" json:"diskId"`
|
||||||
|
|
||||||
// Limit IO for a certain disk total and read/write options are not allowed to be combined
|
// Limit IO for a certain disk total and read/write options are not allowed to be combined
|
||||||
// Required: true
|
// Required: true
|
||||||
Limits string `url:"limits"`
|
Limits string `url:"limits" json:"limits"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq DiskQOSRequest) validate() error {
|
func (crq DiskQOSRequest) validate() error {
|
||||||
|
|||||||
@@ -11,15 +11,15 @@ import (
|
|||||||
type DiskResizeRequest struct {
|
type DiskResizeRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// ID of the disk to resize
|
// ID of the disk to resize
|
||||||
// Required: true
|
// Required: true
|
||||||
DiskID uint64 `url:"diskId"`
|
DiskID uint64 `url:"diskId" json:"diskId"`
|
||||||
|
|
||||||
// New disk size
|
// New disk size
|
||||||
// Required: true
|
// Required: true
|
||||||
Size uint64 `url:"size"`
|
Size uint64 `url:"size" json:"size"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq DiskResizeRequest) validate() error {
|
func (crq DiskResizeRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type EnableRequest struct {
|
type EnableRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq EnableRequest) validate() error {
|
func (crq EnableRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type GetRequest struct {
|
type GetRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq GetRequest) validate() error {
|
func (crq GetRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type GetAuditsRequest struct {
|
type GetAuditsRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq GetAuditsRequest) validate() error {
|
func (crq GetAuditsRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type GetConsoleURLRequest struct {
|
type GetConsoleURLRequest struct {
|
||||||
// ID of compute instance to get console for
|
// ID of compute instance to get console for
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq GetConsoleURLRequest) validate() error {
|
func (crq GetConsoleURLRequest) validate() error {
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import (
|
|||||||
type GetLogRequest struct {
|
type GetLogRequest struct {
|
||||||
// ID of compute instance to get log for
|
// ID of compute instance to get log for
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// Path to log file
|
// Path to log file
|
||||||
// Required: true
|
// Required: true
|
||||||
Path string `url:"path"`
|
Path string `url:"path" json:"path"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq GetLogRequest) validate() error {
|
func (crq GetLogRequest) validate() error {
|
||||||
|
|||||||
@@ -10,15 +10,15 @@ import (
|
|||||||
type ListRequest struct {
|
type ListRequest struct {
|
||||||
// Include deleted computes
|
// Include deleted computes
|
||||||
// Required: false
|
// Required: false
|
||||||
IncludeDeleted bool `url:"includedeleted,omitempty"`
|
IncludeDeleted bool `url:"includedeleted,omitempty" json:"includedeleted,omitempty"`
|
||||||
|
|
||||||
// Page number
|
// Page number
|
||||||
// Required: false
|
// Required: false
|
||||||
Page uint64 `url:"page,omitempty"`
|
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
||||||
|
|
||||||
// Page size
|
// Page size
|
||||||
// Required: false
|
// Required: false
|
||||||
Size uint64 `url:"size,omitempty"`
|
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List gets list of the available computes.
|
// List gets list of the available computes.
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ import (
|
|||||||
type ListDeletedRequest struct {
|
type ListDeletedRequest struct {
|
||||||
// Page number
|
// Page number
|
||||||
// Required: false
|
// Required: false
|
||||||
Page uint64 `url:"page,omitempty"`
|
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
||||||
|
|
||||||
// Page size
|
// Page size
|
||||||
// Required: false
|
// Required: false
|
||||||
Size uint64 `url:"size,omitempty"`
|
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListDeleted gets list all deleted computes
|
// ListDeleted gets list all deleted computes
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type ListPCIDeviceRequest struct {
|
type ListPCIDeviceRequest struct {
|
||||||
// Identifier compute
|
// Identifier compute
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq ListPCIDeviceRequest) validate() error {
|
func (crq ListPCIDeviceRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type ListVGPURequest struct {
|
type ListVGPURequest struct {
|
||||||
// Identifier compute
|
// Identifier compute
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq ListVGPURequest) validate() error {
|
func (crq ListVGPURequest) validate() error {
|
||||||
|
|||||||
@@ -622,7 +622,7 @@ type ItemComputeDisk struct {
|
|||||||
SizeMax uint64 `json:"sizeMax"`
|
SizeMax uint64 `json:"sizeMax"`
|
||||||
|
|
||||||
//Size used
|
//Size used
|
||||||
SizeUsed uint64 `json:"sizeUsed"`
|
SizeUsed float64 `json:"sizeUsed"`
|
||||||
|
|
||||||
// List extend snapshots
|
// List extend snapshots
|
||||||
Snapshots SnapshotExtendList `json:"snapshots"`
|
Snapshots SnapshotExtendList `json:"snapshots"`
|
||||||
|
|||||||
@@ -11,26 +11,26 @@ import (
|
|||||||
type MoveToRGRequest struct {
|
type MoveToRGRequest struct {
|
||||||
// ID of the compute instance to move
|
// ID of the compute instance to move
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// ID of the target resource group
|
// ID of the target resource group
|
||||||
// Required: true
|
// Required: true
|
||||||
RGID uint64 `url:"rgId"`
|
RGID uint64 `url:"rgId" json:"rgId"`
|
||||||
|
|
||||||
// New name for the compute upon successful move,
|
// New name for the compute upon successful move,
|
||||||
// if name change required.
|
// if name change required.
|
||||||
// Pass empty string if no name change necessary
|
// Pass empty string if no name change necessary
|
||||||
// Required: false
|
// Required: false
|
||||||
Name string `url:"name,omitempty"`
|
Name string `url:"name,omitempty" json:"name,omitempty"`
|
||||||
|
|
||||||
// Should the compute be restarted upon successful move
|
// Should the compute be restarted upon successful move
|
||||||
// Required: false
|
// Required: false
|
||||||
Autostart bool `url:"autostart,omitempty"`
|
Autostart bool `url:"autostart,omitempty" json:"autostart,omitempty"`
|
||||||
|
|
||||||
// By default moving compute in a running state is not allowed.
|
// By default moving compute in a running state is not allowed.
|
||||||
// Set this flag to True to force stop running compute instance prior to move.
|
// Set this flag to True to force stop running compute instance prior to move.
|
||||||
// Required: false
|
// Required: false
|
||||||
ForceStop bool `url:"forceStop,omitempty"`
|
ForceStop bool `url:"forceStop,omitempty" json:"forceStop,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq MoveToRGRequest) validate() error {
|
func (crq MoveToRGRequest) validate() error {
|
||||||
|
|||||||
@@ -13,23 +13,23 @@ import (
|
|||||||
type NetAttachRequest struct {
|
type NetAttachRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// Network type
|
// Network type
|
||||||
// 'EXTNET' for connect to external network directly
|
// 'EXTNET' for connect to external network directly
|
||||||
// and 'VINS' for connect to ViNS
|
// and 'VINS' for connect to ViNS
|
||||||
// Required: true
|
// Required: true
|
||||||
NetType string `url:"netType"`
|
NetType string `url:"netType" json:"netType"`
|
||||||
|
|
||||||
// Network ID for connect to
|
// Network ID for connect to
|
||||||
// For EXTNET - external network ID
|
// For EXTNET - external network ID
|
||||||
// For VINS - VINS ID
|
// For VINS - VINS ID
|
||||||
// Required: true
|
// Required: true
|
||||||
NetID uint64 `url:"netId"`
|
NetID uint64 `url:"netId" json:"netId"`
|
||||||
|
|
||||||
// Directly required IP address for new network interface
|
// Directly required IP address for new network interface
|
||||||
// Required: true
|
// Required: true
|
||||||
IPAddr string `url:"ipAddr,omitempty"`
|
IPAddr string `url:"ipAddr,omitempty" json:"ipAddr,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq NetAttachRequest) validate() error {
|
func (crq NetAttachRequest) validate() error {
|
||||||
|
|||||||
@@ -11,15 +11,15 @@ import (
|
|||||||
type NetDetachRequest struct {
|
type NetDetachRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// IP of the network interface
|
// IP of the network interface
|
||||||
// Required: false
|
// Required: false
|
||||||
IPAddr string `url:"ipAddr,omitempty"`
|
IPAddr string `url:"ipAddr,omitempty" json:"ipAddr,omitempty"`
|
||||||
|
|
||||||
// MAC of the network interface
|
// MAC of the network interface
|
||||||
// Required: false
|
// Required: false
|
||||||
MAC string `url:"mac,omitempty"`
|
MAC string `url:"mac,omitempty" json:"mac,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq NetDetachRequest) validate() error {
|
func (crq NetDetachRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type PauseRequest struct {
|
type PauseRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq PauseRequest) validate() error {
|
func (crq PauseRequest) validate() error {
|
||||||
|
|||||||
@@ -13,24 +13,24 @@ import (
|
|||||||
type PFWAddRequest struct {
|
type PFWAddRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// External start port number for the rule
|
// External start port number for the rule
|
||||||
// Required: true
|
// Required: true
|
||||||
PublicPortStart uint64 `url:"publicPortStart"`
|
PublicPortStart uint64 `url:"publicPortStart" json:"publicPortStart"`
|
||||||
|
|
||||||
// End port number (inclusive) for the ranged rule
|
// End port number (inclusive) for the ranged rule
|
||||||
// Required: false
|
// Required: false
|
||||||
PublicPortEnd uint64 `url:"publicPortEnd,omitempty"`
|
PublicPortEnd uint64 `url:"publicPortEnd,omitempty" json:"publicPortEnd,omitempty"`
|
||||||
|
|
||||||
// Internal base port number
|
// Internal base port number
|
||||||
// Required: true
|
// Required: true
|
||||||
LocalBasePort uint64 `url:"localBasePort"`
|
LocalBasePort uint64 `url:"localBasePort" json:"localBasePort"`
|
||||||
|
|
||||||
// Network protocol
|
// Network protocol
|
||||||
// either "tcp" or "udp"
|
// either "tcp" or "udp"
|
||||||
// Required: true
|
// Required: true
|
||||||
Proto string `url:"proto"`
|
Proto string `url:"proto" json:"proto"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq PFWAddRequest) validate() error {
|
func (crq PFWAddRequest) validate() error {
|
||||||
|
|||||||
@@ -11,28 +11,28 @@ import (
|
|||||||
type PFWDelRequest struct {
|
type PFWDelRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
|
|
||||||
// ID of the rule to delete. If specified, all other arguments will be ignored
|
// ID of the rule to delete. If specified, all other arguments will be ignored
|
||||||
// Required: false
|
// Required: false
|
||||||
PFWID uint64 `url:"ruleId,omitempty"`
|
PFWID uint64 `url:"ruleId,omitempty" json:"ruleId,omitempty"`
|
||||||
|
|
||||||
// External start port number for the rule
|
// External start port number for the rule
|
||||||
// Required: false
|
// Required: false
|
||||||
PublicPortStart uint64 `url:"publicPortStart,omitempty"`
|
PublicPortStart uint64 `url:"publicPortStart,omitempty" json:"publicPortStart,omitempty"`
|
||||||
|
|
||||||
// End port number (inclusive) for the ranged rule
|
// End port number (inclusive) for the ranged rule
|
||||||
// Required: false
|
// Required: false
|
||||||
PublicPortEnd uint64 `url:"publicPortEnd,omitempty"`
|
PublicPortEnd uint64 `url:"publicPortEnd,omitempty" json:"publicPortEnd,omitempty"`
|
||||||
|
|
||||||
// Internal base port number
|
// Internal base port number
|
||||||
// Required: false
|
// Required: false
|
||||||
LocalBasePort uint64 `url:"localBasePort,omitempty"`
|
LocalBasePort uint64 `url:"localBasePort,omitempty" json:"localBasePort,omitempty"`
|
||||||
|
|
||||||
// Network protocol
|
// Network protocol
|
||||||
// either "tcp" or "udp"
|
// either "tcp" or "udp"
|
||||||
// Required: false
|
// Required: false
|
||||||
Proto string `url:"proto,omitempty"`
|
Proto string `url:"proto,omitempty" json:"proto,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq PFWDelRequest) validate() error {
|
func (crq PFWDelRequest) validate() error {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type PFWListRequest struct {
|
type PFWListRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId"`
|
ComputeID uint64 `url:"computeId" json:"computeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (crq PFWListRequest) validate() error {
|
func (crq PFWListRequest) validate() error {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user