Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ad1ec7a61 | ||
|
|
1ccc37a104 |
158
README.md
158
README.md
@@ -6,6 +6,7 @@ Dynamix SDK - это библиотека, написанная на языке
|
|||||||
|
|
||||||
- Версия 9.0.х Dynamix-SDK соответствует 4.1.0 версии платформы
|
- Версия 9.0.х Dynamix-SDK соответствует 4.1.0 версии платформы
|
||||||
- Версия 10.0.х Dynamix-SDK соответствует 4.2.0 версии платформы
|
- Версия 10.0.х Dynamix-SDK соответствует 4.2.0 версии платформы
|
||||||
|
- Версия 11.0.х Dynamix-SDK соответствует 4.3.0 версии платформы
|
||||||
|
|
||||||
## Оглавление
|
## Оглавление
|
||||||
|
|
||||||
@@ -75,7 +76,7 @@ Dynamix SDK - это библиотека, написанная на языке
|
|||||||
Выполните команду в терминале:
|
Выполните команду в терминале:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go get -u repository.basistech.ru/BASIS/dynamix-golang-sdk/v10
|
go get -u repository.basistech.ru/BASIS/dynamix-golang-sdk/v11
|
||||||
```
|
```
|
||||||
|
|
||||||
## Список API
|
## Список API
|
||||||
@@ -104,7 +105,9 @@ go get -u repository.basistech.ru/BASIS/dynamix-golang-sdk/v10
|
|||||||
- `KVMx86` - создание виртуальной машины x86;
|
- `KVMx86` - создание виртуальной машины x86;
|
||||||
- `LB` - управление балансировщиками нагрузки;
|
- `LB` - управление балансировщиками нагрузки;
|
||||||
- `Locations` - получение информации о grid площадки;
|
- `Locations` - получение информации о grid площадки;
|
||||||
|
- `Prometheus` - получение статистики prometheus;
|
||||||
- `RG` - управление ресурсными группами аккаунта;
|
- `RG` - управление ресурсными группами аккаунта;
|
||||||
|
- `SEP` - управление storage endpoint (sep);
|
||||||
- `Stack` - получение информации о вычислительных узлах;
|
- `Stack` - получение информации о вычислительных узлах;
|
||||||
- `Tasks` - получение информации о ходе выполнения асинхронных задач (например, создание кластера);
|
- `Tasks` - получение информации о ходе выполнения асинхронных задач (например, создание кластера);
|
||||||
- `VFPool` - управление пулом виртуальных сетевых функций;
|
- `VFPool` - управление пулом виртуальных сетевых функций;
|
||||||
@@ -173,7 +176,7 @@ go get -u repository.basistech.ru/BASIS/dynamix-golang-sdk/v10
|
|||||||
|
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main(){
|
func main(){
|
||||||
@@ -198,7 +201,7 @@ func main(){
|
|||||||
|
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -214,7 +217,7 @@ func main() {
|
|||||||
"appId": "<APP_ID>",
|
"appId": "<APP_ID>",
|
||||||
"appSecret": "<APP_SECRET>",
|
"appSecret": "<APP_SECRET>",
|
||||||
"ssoUrl": "https://sso.digitalenergy.online",
|
"ssoUrl": "https://sso.digitalenergy.online",
|
||||||
"Url": "https://mr4.digitalenergy.online",
|
"decortUrl": "https://mr4.digitalenergy.online",
|
||||||
"retries": 5,
|
"retries": 5,
|
||||||
"timeout": "5m",
|
"timeout": "5m",
|
||||||
"sslSkipVerify": false
|
"sslSkipVerify": false
|
||||||
@@ -227,7 +230,7 @@ func main() {
|
|||||||
appId: <APP_ID>
|
appId: <APP_ID>
|
||||||
appSecret: <APP_SECRET>
|
appSecret: <APP_SECRET>
|
||||||
ssoUrl: https://sso.digitalenergy.online
|
ssoUrl: https://sso.digitalenergy.online
|
||||||
Url: https://mr4.digitalenergy.online
|
decortUrl: https://mr4.digitalenergy.online
|
||||||
retries: 5
|
retries: 5
|
||||||
timeout: 5m
|
timeout: 5m
|
||||||
sslSkipVerify: false
|
sslSkipVerify: false
|
||||||
@@ -235,7 +238,7 @@ sslSkipVerify: false
|
|||||||
|
|
||||||
### Создание клиента
|
### Создание клиента
|
||||||
|
|
||||||
Создание клиента происходит с помощью функции-строителя `New` из основного пакета `dynamix-sdk`, для избежания проблем с именами, пакету можно присвоить алиас ``. Функция принимает конфигурацию, возвращает структуру `Client`, с помощью которой можно взаимодействовать с платформой.
|
Создание клиента происходит с помощью функции-строителя `New` из основного пакета `decort-sdk`, для избежания проблем с именами, пакету можно присвоить алиас `decort`. Функция принимает конфигурацию, возвращает структуру `DecortClient`, с помощью которой можно взаимодействовать с платформой.
|
||||||
|
|
||||||
### Пример
|
### Пример
|
||||||
|
|
||||||
@@ -243,8 +246,8 @@ sslSkipVerify: false
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10"
|
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -253,14 +256,14 @@ func main() {
|
|||||||
AppID: "<APPID>",
|
AppID: "<APPID>",
|
||||||
AppSecret: "<APPSECRET>",
|
AppSecret: "<APPSECRET>",
|
||||||
SSOURL: "https://sso.digitalenergy.online",
|
SSOURL: "https://sso.digitalenergy.online",
|
||||||
URL: "https://mr4.digitalenergy.online",
|
DecortURL: "https://mr4.digitalenergy.online",
|
||||||
Retries: 5,
|
Retries: 5,
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg.SetTimeout(5 * time.Minute)
|
cfg.SetTimeout(5 * time.Minute)
|
||||||
|
|
||||||
// Создание клиента
|
// Создание клиента
|
||||||
client := .New(cfg)
|
client := decort.New(cfg)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -288,7 +291,9 @@ func main() {
|
|||||||
- `pkg/cloudapi/kvmx86` - для `KVMX86`
|
- `pkg/cloudapi/kvmx86` - для `KVMX86`
|
||||||
- `pkg/cloudapi/lb` - для `LB`
|
- `pkg/cloudapi/lb` - для `LB`
|
||||||
- `pkg/cloudapi/locations` - для `Locations`
|
- `pkg/cloudapi/locations` - для `Locations`
|
||||||
|
- `pkg/cloudapi/prometheus` - для `Prometheus`
|
||||||
- `pkg/cloudapi/rg` - для `RG`
|
- `pkg/cloudapi/rg` - для `RG`
|
||||||
|
- `pkg/cloudapi/sep` - для `SEP`
|
||||||
- `pkg/cloudapi/stack` - для `Stack`
|
- `pkg/cloudapi/stack` - для `Stack`
|
||||||
- `pkg/cloudapi/tasks` - для `Tasks`
|
- `pkg/cloudapi/tasks` - для `Tasks`
|
||||||
- `pkg/cloudapi/vfpool` - для `VFPool`
|
- `pkg/cloudapi/vfpool` - для `VFPool`
|
||||||
@@ -421,9 +426,9 @@ type CreateRequest struct {
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10"
|
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/kvmx86"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/kvmx86"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -432,7 +437,7 @@ func main() {
|
|||||||
AppID: "<APPID>",
|
AppID: "<APPID>",
|
||||||
AppSecret: "<APPSECRET>",
|
AppSecret: "<APPSECRET>",
|
||||||
SSOURL: "https://sso.digitalenergy.online",
|
SSOURL: "https://sso.digitalenergy.online",
|
||||||
URL: "https://mr4.digitalenergy.online",
|
DecortURL: "https://mr4.digitalenergy.online",
|
||||||
Retries: 5,
|
Retries: 5,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -474,8 +479,9 @@ func main() {
|
|||||||
- `.KVMx86()` - для работы с `KVMX86`
|
- `.KVMx86()` - для работы с `KVMX86`
|
||||||
- `.LB()` - для работы с `LB`
|
- `.LB()` - для работы с `LB`
|
||||||
- `.Locations()` - для работы с `Locations`
|
- `.Locations()` - для работы с `Locations`
|
||||||
|
- `.Prometheus()` - для работы с `Prometheus`
|
||||||
- `.RG()` - для работы с `RG`
|
- `.RG()` - для работы с `RG`
|
||||||
- `.Resmon()` - для работы с `Resmon`
|
- `.SEP()` - для работы с `SEP`
|
||||||
- `.Stack()` - для работы с `Stack`
|
- `.Stack()` - для работы с `Stack`
|
||||||
- `.Tasks()` - для работы с `Tasks`
|
- `.Tasks()` - для работы с `Tasks`
|
||||||
- `.VFPool()` - для работы с `VFPool`
|
- `.VFPool()` - для работы с `VFPool`
|
||||||
@@ -536,9 +542,9 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10"
|
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/kvmx86"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/kvmx86"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -586,9 +592,9 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10"
|
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/account"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/account"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -766,9 +772,9 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10"
|
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/compute"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/compute"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -824,9 +830,9 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10"
|
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/bservice"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/bservice"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -870,7 +876,7 @@ func main() {
|
|||||||
- ToString(): строковое представление результата выполнения задачи
|
- ToString(): строковое представление результата выполнения задачи
|
||||||
- ID() и Name(): получение ID и имени созданного в результате выполнения задачи ресурса
|
- ID() и Name(): получение ID и имени созданного в результате выполнения задачи ресурса
|
||||||
- ToMaps(): получение списка карт, содержащих информацию о дисках, восстановленных в результате выполнения задачи.
|
- ToMaps(): получение списка карт, содержащих информацию о дисках, восстановленных в результате выполнения задачи.
|
||||||
Все методы оборудованы возвратом ошибок. Непустая ошибка означает, что из поля Result нельзя получить информацию, которую предоставляет метод.
|
Все методы оборудованы возвратом ошибок. Непустая ошибка означает, что из поля Result нельзя получить информацию, которую предоставляет метод.
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package main
|
package main
|
||||||
@@ -879,10 +885,10 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10"
|
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/tasks"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/tasks"
|
||||||
tasks_cb "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/tasks"
|
tasks_cb "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/tasks"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -962,7 +968,7 @@ func main() {
|
|||||||
|
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main(){
|
func main(){
|
||||||
@@ -986,7 +992,7 @@ func main(){
|
|||||||
|
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -1027,8 +1033,8 @@ sslSkipVerify: true
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10"
|
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -1055,8 +1061,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10"
|
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -1138,7 +1144,7 @@ func main() {
|
|||||||
|
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main(){
|
func main(){
|
||||||
@@ -1166,7 +1172,7 @@ func main(){
|
|||||||
|
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -1183,7 +1189,7 @@ func main() {
|
|||||||
|
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -1249,8 +1255,8 @@ func main() {
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10"
|
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -1283,8 +1289,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10"
|
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -1324,8 +1330,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10"
|
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -1363,8 +1369,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10"
|
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -1417,11 +1423,11 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10"
|
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/constants"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/constants"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/kvmx86"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/kvmx86"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -1477,13 +1483,13 @@ func main() {
|
|||||||
| BVSConfig | *BVSConfig | Нет | Конфигурация BVS |
|
| BVSConfig | *BVSConfig | Нет | Конфигурация BVS |
|
||||||
| LegacyConfig | string | Нет | Конфигурация Legacy |
|
| LegacyConfig | string | Нет | Конфигурация Legacy |
|
||||||
|
|
||||||
В универсальном клиенте можно использовать только один тип конфигурации одновременно.
|
В универсальном клиенте можно использовать только один тип конфигурации одновременно.
|
||||||
|
|
||||||
#### Пример конфигурации универсального клиента
|
#### Пример конфигурации универсального клиента
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main(){
|
func main(){
|
||||||
@@ -1516,8 +1522,8 @@ func main(){
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10"
|
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -1548,8 +1554,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10"
|
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -1589,4 +1595,36 @@ func main() {
|
|||||||
|
|
||||||
fmt.Println(res)
|
fmt.Println(res)
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Проверка соответствия версии платформы и версии dynamix
|
||||||
|
|
||||||
|
С версии v1.11.0 для каждого клиента добавлен метод `Check` для проверки соответствия decort-sdk и платформы dynamix.
|
||||||
|
В случае соответсвия decort-sdk и платформы dynamix возвращается структура, содержащая информацию о версии и актуальном билде платформы.
|
||||||
|
|
||||||
|
#### Пример выполнения запроса
|
||||||
|
|
||||||
|
```go
|
||||||
|
import (
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main(){
|
||||||
|
// Настройка конфигурации
|
||||||
|
config := config.Config{
|
||||||
|
AppID: "<APP_ID>",
|
||||||
|
AppSecret: "<APP_SECRET>",
|
||||||
|
SSOURL: "https://sso.digitalenergy.online",
|
||||||
|
DecortURL: "https://mr4.digitalenergy.online",
|
||||||
|
Retries: 5,
|
||||||
|
SSLSkipVerify: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Создание клиента
|
||||||
|
client := decort.New(config)
|
||||||
|
|
||||||
|
// Проверка соответствия версии
|
||||||
|
checkInfo, err := client.Check()
|
||||||
|
}
|
||||||
```
|
```
|
||||||
88
check.go
Normal file
88
check.go
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
package decortsdk
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/constants"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CheckInfo struct {
|
||||||
|
Version string `json:"version"`
|
||||||
|
Build uint64 `json:"build"`
|
||||||
|
}
|
||||||
|
|
||||||
|
const versionURL = "/system/info/version"
|
||||||
|
|
||||||
|
func (de DecortClient) Check() (*CheckInfo, error) {
|
||||||
|
res, err := de.DecortApiCall(context.Background(), http.MethodGet, versionURL, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := CheckInfo{}
|
||||||
|
|
||||||
|
err = json.Unmarshal([]byte(strings.Replace(strings.Trim(string(res), `"`), "\\", "", -1)), &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if v, ok := constants.VersionMap[info.Version]; ok {
|
||||||
|
if v == "-" {
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
return nil, errors.New(fmt.Sprintf("SDK don't support platform version %s, please use %s SDK version", info.Version, v))
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, errors.New(fmt.Sprintf("platform version %s isn't supported", info.Version))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (bvs BVSDecortClient) Check() (*CheckInfo, error) {
|
||||||
|
res, err := bvs.DecortApiCall(context.Background(), http.MethodGet, versionURL, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := CheckInfo{}
|
||||||
|
|
||||||
|
err = json.Unmarshal([]byte(strings.Replace(strings.Trim(string(res), `"`), "\\", "", -1)), &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if v, ok := constants.VersionMap[info.Version]; ok {
|
||||||
|
if v == "-" {
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
return nil, errors.New(fmt.Sprintf("SDK don't support platform version %s, please use %s SDK version", info.Version, v))
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, errors.New(fmt.Sprintf("platform version %s isn't supported", info.Version))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ldc LegacyDecortClient) Check() (*CheckInfo, error) {
|
||||||
|
res, err := ldc.DecortApiCall(context.Background(), http.MethodGet, versionURL, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := CheckInfo{}
|
||||||
|
|
||||||
|
err = json.Unmarshal([]byte(strings.Replace(strings.Trim(string(res), `"`), "\\", "", -1)), &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if v, ok := constants.VersionMap[info.Version]; ok {
|
||||||
|
if v == "-" {
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
return nil, errors.New(fmt.Sprintf("SDK don't support platform version %s, please use %s SDK version", info.Version, v))
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, errors.New(fmt.Sprintf("platform version %s isn't supported", info.Version))
|
||||||
|
}
|
||||||
10
client.go
10
client.go
@@ -16,11 +16,11 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/google/go-querystring/query"
|
"github.com/google/go-querystring/query"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/constants"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/constants"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DecortClient is HTTP-client for platform
|
// DecortClient is HTTP-client for platform
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/google/go-querystring/query"
|
"github.com/google/go-querystring/query"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/constants"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/constants"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BVSDecortClient is HTTP-client for platform
|
// BVSDecortClient is HTTP-client for platform
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Configuration for creating request to platform
|
// Configuration for creating request to platform
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BVSConfig struct {
|
type BVSConfig struct {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Legacy client configuration
|
// Legacy client configuration
|
||||||
|
|||||||
16
go.mod
16
go.mod
@@ -1,20 +1,20 @@
|
|||||||
module repository.basistech.ru/BASIS/dynamix-golang-sdk/v10
|
module repository.basistech.ru/BASIS/dynamix-golang-sdk/v11
|
||||||
|
|
||||||
go 1.20
|
go 1.24.0
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/go-playground/validator/v10 v10.11.2
|
github.com/go-playground/validator/v10 v10.28.0
|
||||||
github.com/google/go-querystring v1.1.0
|
github.com/google/go-querystring v1.1.0
|
||||||
gopkg.in/yaml.v3 v3.0.1
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
github.com/gabriel-vasile/mimetype v1.4.10 // indirect
|
||||||
github.com/go-playground/locales v0.14.1 // indirect
|
github.com/go-playground/locales v0.14.1 // indirect
|
||||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||||
github.com/google/go-cmp v0.5.9 // indirect
|
github.com/google/go-cmp v0.5.9 // indirect
|
||||||
github.com/kr/text v0.2.0 // indirect
|
github.com/leodido/go-urn v1.4.0 // indirect
|
||||||
github.com/leodido/go-urn v1.2.1 // indirect
|
golang.org/x/crypto v0.42.0 // indirect
|
||||||
golang.org/x/crypto v0.15.0 // indirect
|
golang.org/x/sys v0.36.0 // indirect
|
||||||
golang.org/x/sys v0.14.0 // indirect
|
golang.org/x/text v0.29.0 // indirect
|
||||||
golang.org/x/text v0.14.0 // indirect
|
|
||||||
)
|
)
|
||||||
|
|||||||
38
go.sum
38
go.sum
@@ -1,38 +1,34 @@
|
|||||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=
|
||||||
|
github.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
|
||||||
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
|
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
|
||||||
|
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
|
||||||
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
|
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
|
||||||
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
||||||
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
||||||
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
||||||
github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU=
|
github.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=
|
||||||
github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s=
|
github.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=
|
||||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
|
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
|
||||||
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
|
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
|
||||||
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
|
||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
|
||||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
|
||||||
github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=
|
|
||||||
github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
|
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI=
|
||||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8=
|
||||||
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
|
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
|
||||||
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
|
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||||
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
|
golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk=
|
||||||
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=
|
||||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
|
||||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
|||||||
@@ -12,3 +12,7 @@ var FileName = map[string]string{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var K8sValues = []string{"labels", "taints", "annotations, additionalSANs"}
|
var K8sValues = []string{"labels", "taints", "annotations, additionalSANs"}
|
||||||
|
|
||||||
|
var VersionMap = map[string]string{
|
||||||
|
"4.3.0": "-",
|
||||||
|
}
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/go-playground/validator/v10"
|
"github.com/go-playground/validator/v10"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/multierror"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/multierror"
|
||||||
)
|
)
|
||||||
|
|
||||||
// computeDriverValidator is used to validate Driver field in kvmx86 create.
|
// computeDriverValidator is used to validate Driver field in kvmx86 create.
|
||||||
@@ -27,6 +27,13 @@ func protoValidator(fe validator.FieldLevel) bool {
|
|||||||
return IsInSlice(fieldValue, protoValues)
|
return IsInSlice(fieldValue, protoValues)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// apiGroupValidator is used to validate APIGroup fields
|
||||||
|
func apiGroupValidator(fe validator.FieldLevel) bool {
|
||||||
|
fieldValue := fe.Field().String()
|
||||||
|
|
||||||
|
return IsInSlice(fieldValue, apiGroupValues)
|
||||||
|
}
|
||||||
|
|
||||||
// accessTypeValidator is used to validate AccessType fields.
|
// accessTypeValidator is used to validate AccessType fields.
|
||||||
func accessTypeValidator(fe validator.FieldLevel) bool {
|
func accessTypeValidator(fe validator.FieldLevel) bool {
|
||||||
fieldValue := fe.Field().String()
|
fieldValue := fe.Field().String()
|
||||||
@@ -393,6 +400,27 @@ func preferredCPUValidator(fe validator.FieldLevel) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// loaderTypeValidator is used to validate loaderType fields
|
||||||
|
func loaderTypeValidator(fe validator.FieldLevel) bool {
|
||||||
|
fieldValue := fe.Field().String()
|
||||||
|
|
||||||
|
return IsInSlice(fieldValue, loaderTypeValues)
|
||||||
|
}
|
||||||
|
|
||||||
|
// languageValidator is used to validate language fields
|
||||||
|
func languageValidator(fe validator.FieldLevel) bool {
|
||||||
|
fieldValue := fe.Field().String()
|
||||||
|
|
||||||
|
return IsInSlice(fieldValue, languageValues)
|
||||||
|
}
|
||||||
|
|
||||||
|
// sepTypeValidator is used to validate sepType fields
|
||||||
|
func sepTypeValidator(fe validator.FieldLevel) bool {
|
||||||
|
fieldValue := fe.Field().String()
|
||||||
|
|
||||||
|
return IsInSlice(fieldValue, sepTypeValues)
|
||||||
|
}
|
||||||
|
|
||||||
// ValidateRAM checks if request contains RAM value that is positive integer divisible by divisibility passed.
|
// ValidateRAM checks if request contains RAM value that is positive integer divisible by divisibility passed.
|
||||||
// It is recommended to pass constants.RAM_DIVISIBILITY as divisility arguement
|
// It is recommended to pass constants.RAM_DIVISIBILITY as divisility arguement
|
||||||
func ValidateRAM(r interfaces.RequestWithRAM, divisibility uint64) error {
|
func ValidateRAM(r interfaces.RequestWithRAM, divisibility uint64) error {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package validators
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/multierror"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/multierror"
|
||||||
|
|
||||||
"github.com/go-playground/validator/v10"
|
"github.com/go-playground/validator/v10"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -52,6 +52,13 @@ func errorMessage(fe validator.FieldError) string {
|
|||||||
fe.Field(),
|
fe.Field(),
|
||||||
joinValues(protoValues))
|
joinValues(protoValues))
|
||||||
|
|
||||||
|
// apiGroup Validators
|
||||||
|
case "apiGroup":
|
||||||
|
return fmt.Sprintf("%s %s must be one of the following: %s",
|
||||||
|
prefix,
|
||||||
|
fe.Field(),
|
||||||
|
joinValues(apiGroupValues))
|
||||||
|
|
||||||
// Account Validators
|
// Account Validators
|
||||||
case "accountCUType":
|
case "accountCUType":
|
||||||
return fmt.Sprintf("%s %s must be one of the following: %s",
|
return fmt.Sprintf("%s %s must be one of the following: %s",
|
||||||
@@ -308,6 +315,24 @@ func errorMessage(fe validator.FieldError) string {
|
|||||||
prefix,
|
prefix,
|
||||||
fe.Field(),
|
fe.Field(),
|
||||||
joinValues(chipsetValues))
|
joinValues(chipsetValues))
|
||||||
|
|
||||||
|
case "loaderType":
|
||||||
|
return fmt.Sprintf("%s %s must be one of the following: %s",
|
||||||
|
prefix,
|
||||||
|
fe.Field(),
|
||||||
|
joinValues(loaderTypeValues))
|
||||||
|
|
||||||
|
case "language":
|
||||||
|
return fmt.Sprintf("%s %s must be one of the following: %s",
|
||||||
|
prefix,
|
||||||
|
fe.Field(),
|
||||||
|
joinValues(languageValues))
|
||||||
|
|
||||||
|
case "sepType":
|
||||||
|
return fmt.Sprintf("%s %s must be one of the following: %s",
|
||||||
|
prefix,
|
||||||
|
fe.Field(),
|
||||||
|
joinValues(sepTypeValues))
|
||||||
}
|
}
|
||||||
|
|
||||||
return fe.Error()
|
return fe.Error()
|
||||||
|
|||||||
@@ -36,6 +36,11 @@ func registerAllValidators(validate *validator.Validate) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = validate.RegisterValidation("apiGroup", apiGroupValidator)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
err = validate.RegisterValidation("accessType", accessTypeValidator)
|
err = validate.RegisterValidation("accessType", accessTypeValidator)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -266,5 +271,20 @@ func registerAllValidators(validate *validator.Validate) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = validate.RegisterValidation("loaderType", loaderTypeValidator)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = validate.RegisterValidation("language", languageValidator)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = validate.RegisterValidation("sepType", sepTypeValidator)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package validators
|
package validators
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
apiGroupValues = []string{"cloudapi", "cloudbroker", "system"}
|
||||||
|
|
||||||
driverValues = []string{"KVM_X86"}
|
driverValues = []string{"KVM_X86"}
|
||||||
accessTypeValues = []string{"R", "RCX", "ARCXDU"}
|
accessTypeValues = []string{"R", "RCX", "ARCXDU"}
|
||||||
resTypesValues = []string{"compute", "vins", "k8s", "openshift", "lb", "flipgroup"}
|
resTypesValues = []string{"compute", "vins", "k8s", "openshift", "lb", "flipgroup"}
|
||||||
@@ -35,7 +37,7 @@ var (
|
|||||||
vinsTypeValues = []string{"DHCP", "VIP", "EXCLUDED"}
|
vinsTypeValues = []string{"DHCP", "VIP", "EXCLUDED"}
|
||||||
|
|
||||||
imageBootTypeValues = []string{"uefi", "bios"}
|
imageBootTypeValues = []string{"uefi", "bios"}
|
||||||
imageTypeValues = []string{"windows", "linux", "other"}
|
imageTypeValues = []string{"windows", "linux", "unknown"}
|
||||||
imageDriversValues = []string{"KVM_X86"}
|
imageDriversValues = []string{"KVM_X86"}
|
||||||
imageArchitectureValues = []string{"X86_64"}
|
imageArchitectureValues = []string{"X86_64"}
|
||||||
|
|
||||||
@@ -51,7 +53,7 @@ var (
|
|||||||
|
|
||||||
vmActionValues = []string{"stop", "move"}
|
vmActionValues = []string{"stop", "move"}
|
||||||
|
|
||||||
computeFeaturesValues = []string{"hugepages", "numa", "cpupin", "vfnic"}
|
computeFeaturesValues = []string{"hugepages", "numa", "cpupin", "vfnic", "dpdk", "changemac"}
|
||||||
|
|
||||||
networkInterfaceNamingValues = []string{"eth", "ens"}
|
networkInterfaceNamingValues = []string{"eth", "ens"}
|
||||||
|
|
||||||
@@ -64,6 +66,12 @@ var (
|
|||||||
eventIDxValues = []string{"on", "off", "selected by hypervisor"}
|
eventIDxValues = []string{"on", "off", "selected by hypervisor"}
|
||||||
|
|
||||||
chipsetValues = []string{"i440fx", "Q35"}
|
chipsetValues = []string{"i440fx", "Q35"}
|
||||||
|
|
||||||
|
loaderTypeValues = []string{"linux", "windows", "unknown"}
|
||||||
|
|
||||||
|
sepTypeValues = []string{"hitachi", "dorado", "tatlin", "shared", "local", "des"}
|
||||||
|
|
||||||
|
languageValues = []string{"ru", "en"}
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/google/go-querystring/query"
|
"github.com/google/go-querystring/query"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/constants"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/constants"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker"
|
||||||
)
|
)
|
||||||
|
|
||||||
// LegacyDecortClient is Legacy HTTP-client for platform
|
// LegacyDecortClient is Legacy HTTP-client for platform
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package cloudapi
|
package cloudapi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/account"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/account"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Accessing the Account method group
|
// Accessing the Account method group
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
package account
|
package account
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Structure for creating request to account
|
// Structure for creating request to account
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AddUserRequest struct to add permission to access account for a user
|
// AddUserRequest struct to add permission to access account for a user
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AuditsRequest struct to give list of account audits
|
// AuditsRequest struct to give list of account audits
|
||||||
|
|||||||
@@ -1,75 +0,0 @@
|
|||||||
package account
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"net/http"
|
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
|
||||||
)
|
|
||||||
|
|
||||||
// CreateRequest struct for creating account
|
|
||||||
type CreateRequest struct {
|
|
||||||
// Display name
|
|
||||||
// Required: true
|
|
||||||
Name string `url:"name" json:"name" validate:"required"`
|
|
||||||
|
|
||||||
// Name of the account
|
|
||||||
// Required: true
|
|
||||||
Username string `url:"username" json:"username" validate:"required"`
|
|
||||||
|
|
||||||
// Email
|
|
||||||
// Required: false
|
|
||||||
EmailAddress string `url:"emailaddress,omitempty" json:"emailaddress,omitempty" validate:"omitempty,email"`
|
|
||||||
|
|
||||||
// Max size of memory in MB
|
|
||||||
// Required: false
|
|
||||||
MaxMemoryCapacity int64 `url:"maxMemoryCapacity,omitempty" json:"maxMemoryCapacity,omitempty"`
|
|
||||||
|
|
||||||
// Max size of aggregated vdisks in GB
|
|
||||||
// Required: false
|
|
||||||
MaxVDiskCapacity int64 `url:"maxVDiskCapacity,omitempty" json:"maxVDiskCapacity,omitempty"`
|
|
||||||
|
|
||||||
// Max number of CPU cores
|
|
||||||
// Required: false
|
|
||||||
MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"`
|
|
||||||
|
|
||||||
// Max sent/received network transfer peering
|
|
||||||
// Required: false
|
|
||||||
MaxNetworkPeerTransfer int64 `url:"maxNetworkPeerTransfer,omitempty" json:"maxNetworkPeerTransfer,omitempty"`
|
|
||||||
|
|
||||||
// Max number of assigned public IPs
|
|
||||||
// Required: false
|
|
||||||
MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"`
|
|
||||||
|
|
||||||
// If true send emails when a user is granted access to resources
|
|
||||||
// Required: false
|
|
||||||
SendAccessEmails bool `url:"sendAccessEmails" json:"sendAccessEmails"`
|
|
||||||
|
|
||||||
// Limit (positive) or disable (0) GPU resources
|
|
||||||
// Required: false
|
|
||||||
GPUUnits int64 `url:"gpu_units,omitempty" json:"gpu_units,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create creates account
|
|
||||||
// Setting a cloud unit maximum to -1 or empty will not put any restrictions on the resource
|
|
||||||
func (a Account) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
|
||||||
err := validators.ValidateRequest(req)
|
|
||||||
if err != nil {
|
|
||||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
url := "/cloudapi/account/create"
|
|
||||||
|
|
||||||
res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
|
|
||||||
result, err := strconv.ParseUint(string(res), 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return result, nil
|
|
||||||
}
|
|
||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DeleteRequest struct to delete account
|
// DeleteRequest struct to delete account
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DeleteUserRequest struct to revoke access to account
|
// DeleteUserRequest struct to revoke access to account
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DisableEnableRequest struct to change status of account
|
// DisableEnableRequest struct to change status of account
|
||||||
@@ -13,6 +13,10 @@ type DisableEnableRequest struct {
|
|||||||
// ID of account
|
// ID of account
|
||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId" json:"accountId" validate:"required"`
|
AccountID uint64 `url:"accountId" json:"accountId" validate:"required"`
|
||||||
|
|
||||||
|
// Reason of disabling
|
||||||
|
// Required: false
|
||||||
|
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable disables an account
|
// Disable disables an account
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetRequest struct to get information about account
|
// GetRequest struct to get information about account
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetConsumedAccountUnitsRequest struct to calculate the currently consumed units for all cloudspaces and resource groups in the account
|
// GetConsumedAccountUnitsRequest struct to calculate the currently consumed units for all cloudspaces and resource groups in the account
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetConsumedCloudUnitsByTypeRequest struct to calculate the currently consumed cloud units of the specified type for all cloudspaces and resource groups in the account
|
// GetConsumedCloudUnitsByTypeRequest struct to calculate the currently consumed cloud units of the specified type for all cloudspaces and resource groups in the account
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetReservedAccountUnitsRequest struct to calculate the reserved units for all cloudspaces and resource groups in the account
|
// GetReservedAccountUnitsRequest struct to calculate the reserved units for all cloudspaces and resource groups in the account
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetResourceConsumptionRequest struct to get resource consumption
|
// GetResourceConsumptionRequest struct to get resource consumption
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ListRequest struct to get list of accounts
|
// ListRequest struct to get list of accounts
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ListComputesRequest struct to get a list of compute instances
|
// ListComputesRequest struct to get a list of compute instances
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ListDeletedRequest struct to get a list of deleted accounts
|
// ListDeletedRequest struct to get a list of deleted accounts
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ListDisksRequest struct to get a list of deleted disks
|
// ListDisksRequest struct to get a list of deleted disks
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ListFLIPGroupsRequest struct to get a list of FLIPGroups
|
// ListFLIPGroupsRequest struct to get a list of FLIPGroups
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ListRGRequest struct to get a list of resource groups
|
// ListRGRequest struct to get a list of resource groups
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ListTemplatesRequest struct to get a list of templates
|
// ListTemplatesRequest struct to get a list of templates
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ListVINSRequest struct to get a list of VINS
|
// ListVINSRequest struct to get a list of VINS
|
||||||
|
|||||||
@@ -62,6 +62,9 @@ type ItemAccount struct {
|
|||||||
// Deleted time
|
// Deleted time
|
||||||
DeletedTime uint64 `json:"deletedTime"`
|
DeletedTime uint64 `json:"deletedTime"`
|
||||||
|
|
||||||
|
// Description
|
||||||
|
Description string `json:"desc"`
|
||||||
|
|
||||||
// ID
|
// ID
|
||||||
ID uint64 `json:"id"`
|
ID uint64 `json:"id"`
|
||||||
|
|
||||||
@@ -197,6 +200,9 @@ type RecordAccount struct {
|
|||||||
// Created time
|
// Created time
|
||||||
CreatedTime uint64 `json:"createdTime"`
|
CreatedTime uint64 `json:"createdTime"`
|
||||||
|
|
||||||
|
// Description
|
||||||
|
Description string `json:"desc"`
|
||||||
|
|
||||||
// Deactivation time
|
// Deactivation time
|
||||||
DeactivationTime float64 `json:"deactivationTime"`
|
DeactivationTime float64 `json:"deactivationTime"`
|
||||||
|
|
||||||
@@ -512,6 +518,9 @@ type ItemRG struct {
|
|||||||
// Deleted time
|
// Deleted time
|
||||||
DeletedTime uint64 `json:"deletedTime"`
|
DeletedTime uint64 `json:"deletedTime"`
|
||||||
|
|
||||||
|
// Description
|
||||||
|
Description string `json:"desc"`
|
||||||
|
|
||||||
// Resource group ID
|
// Resource group ID
|
||||||
RGID uint64 `json:"id"`
|
RGID uint64 `json:"id"`
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RestoreRequest struct to restore a deleted account
|
// RestoreRequest struct to restore a deleted account
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package account
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
|
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// UpdateRequest struct to update account
|
// UpdateRequest struct to update account
|
||||||
@@ -14,6 +14,10 @@ type UpdateRequest struct {
|
|||||||
// Required: true
|
// Required: true
|
||||||
AccountID uint64 `url:"accountId" json:"accountId" validate:"required"`
|
AccountID uint64 `url:"accountId" json:"accountId" validate:"required"`
|
||||||
|
|
||||||
|
// Description
|
||||||
|
// Required: false
|
||||||
|
Description string `url:"desc,omitempty" json:"desc,omitempty"`
|
||||||
|
|
||||||
// Name of the account
|
// Name of the account
|
||||||
// Required: false
|
// Required: false
|
||||||
Name string `url:"name,omitempty" json:"name,omitempty"`
|
Name string `url:"name,omitempty" json:"name,omitempty"`
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// UpdateUserRequest struct to update user access rights
|
// UpdateUserRequest struct to update user access rights
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package cloudapi
|
package cloudapi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/audit"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/audit"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Accessing the Stack method group
|
// Accessing the Stack method group
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package audit
|
package audit
|
||||||
|
|
||||||
import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces"
|
import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces"
|
||||||
|
|
||||||
// Structure for creating request to audit
|
// Structure for creating request to audit
|
||||||
type Audit struct {
|
type Audit struct {
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetRequest struct to get information about account
|
// GetRequest struct to get information about account
|
||||||
type GetRequest struct {
|
type GetRequest struct {
|
||||||
// Audit GUID
|
// Audit GUID
|
||||||
// Required: true
|
// Required: true
|
||||||
AuditGuid string `url:"auditGuid" json:"auditGuid" validate:"required"`
|
AuditGuid string `url:"audit_guid" json:"audit_guid" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get gets information about audit as a RecordAudit struct
|
// Get gets information about audit as a RecordAudit struct
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package cloudapi
|
package cloudapi
|
||||||
|
|
||||||
import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/bservice"
|
import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/bservice"
|
||||||
|
|
||||||
// Accessing the BService method group
|
// Accessing the BService method group
|
||||||
func (ca *CloudAPI) BService() *bservice.BService {
|
func (ca *CloudAPI) BService() *bservice.BService {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// API Actor for managing Compute Group. This actor is a final API for endusers to manage Compute Group
|
// API Actor for managing Compute Group. This actor is a final API for endusers to manage Compute Group
|
||||||
package bservice
|
package bservice
|
||||||
|
|
||||||
import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces"
|
import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces"
|
||||||
|
|
||||||
// Structure for creating request to bservice
|
// Structure for creating request to bservice
|
||||||
type BService struct {
|
type BService struct {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CreateRequest struct for BasicService
|
// CreateRequest struct for BasicService
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DeleteRequest struct to delete basic service
|
// DeleteRequest struct to delete basic service
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DisableRequest struct for disable service
|
// DisableRequest struct for disable service
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// EnableRequest struct to disable service
|
// EnableRequest struct to disable service
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetRequest struct to get detailed information about service
|
// GetRequest struct to get detailed information about service
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GroupAddRequest struct to create new compute group within BasicService
|
// GroupAddRequest struct to create new compute group within BasicService
|
||||||
@@ -71,6 +71,10 @@ type GroupAddRequest struct {
|
|||||||
// Meta data for working group computes, format YAML "user_data": 1111
|
// Meta data for working group computes, format YAML "user_data": 1111
|
||||||
// Required: false
|
// Required: false
|
||||||
UserData string `url:"userData,omitempty" json:"userData,omitempty"`
|
UserData string `url:"userData,omitempty" json:"userData,omitempty"`
|
||||||
|
|
||||||
|
//Chipset "i440fx" or "Q35
|
||||||
|
//Required: false
|
||||||
|
Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"chipset,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetRAM returns RAM field values
|
// GetRAM returns RAM field values
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GroupComputeRemoveRequest struct to remove group compute
|
// GroupComputeRemoveRequest struct to remove group compute
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GroupGetRequest struct to get detailed information about Compute Group
|
// GroupGetRequest struct to get detailed information about Compute Group
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GroupParentAddRequest struct to add parent Compute Group relation to the specified Compute Group
|
// GroupParentAddRequest struct to add parent Compute Group relation to the specified Compute Group
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GroupParentRemoveRequest struct to remove parent Compute Group
|
// GroupParentRemoveRequest struct to remove parent Compute Group
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GroupRemoveRequest struct for destroy the specified Compute Group
|
// GroupRemoveRequest struct for destroy the specified Compute Group
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GroupResizeRequest struct to resize the group
|
// GroupResizeRequest struct to resize the group
|
||||||
@@ -22,6 +22,12 @@ type GroupResizeRequest struct {
|
|||||||
// Required: true
|
// Required: true
|
||||||
Count int64 `url:"count" json:"count" validate:"required"`
|
Count int64 `url:"count" json:"count" validate:"required"`
|
||||||
|
|
||||||
|
//Chipset for new computes, either i440fx or Q35 (i440fx by default)
|
||||||
|
//Available values : i440fx, Q35
|
||||||
|
//Default value : i440fx
|
||||||
|
//Required: true
|
||||||
|
Chipset string `url:"chipset" json:"chipset" validate:"required,chipset"`
|
||||||
|
|
||||||
// Either delta or absolute value of computes
|
// Either delta or absolute value of computes
|
||||||
// Should be one of:
|
// Should be one of:
|
||||||
// - ABSOLUTE
|
// - ABSOLUTE
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GroupStartRequest struct to start the specified Compute Group
|
// GroupStartRequest struct to start the specified Compute Group
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GroupStopRequest struct to stop the specified Compute Group
|
// GroupStopRequest struct to stop the specified Compute Group
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GroupUpdateRequest struct to update existing Compute group
|
// GroupUpdateRequest struct to update existing Compute group
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GroupUpdateExtNetRequest struct to update External Network settings
|
// GroupUpdateExtNetRequest struct to update External Network settings
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GroupUpdateVINSRequest struct to update VINS settings
|
// GroupUpdateVINSRequest struct to update VINS settings
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ListRequest struct to get list of BasicService instances
|
// ListRequest struct to get list of BasicService instances
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ListDeletedRequest struct to get list of deleted BasicService instances
|
// ListDeletedRequest struct to get list of deleted BasicService instances
|
||||||
|
|||||||
@@ -295,6 +295,9 @@ type ItemGroupCompute struct {
|
|||||||
|
|
||||||
// List of information about OS Users
|
// List of information about OS Users
|
||||||
OSUsers ListOSUsers `json:"osUsers"`
|
OSUsers ListOSUsers `json:"osUsers"`
|
||||||
|
|
||||||
|
//Chipset
|
||||||
|
Chipset string `json:"chipset"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of Group Computes
|
// List of Group Computes
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RestoreRequest struct to restore BasicService instance
|
// RestoreRequest struct to restore BasicService instance
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package bservice
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
|
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SnapshotCreateRequest struct to create snapshot
|
// SnapshotCreateRequest struct to create snapshot
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SnapshotDeleteRequest struct to delete snapshot
|
// SnapshotDeleteRequest struct to delete snapshot
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SnapshotListRequest struct to get list of existing snapshots
|
// SnapshotListRequest struct to get list of existing snapshots
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SnapshotRollbackRequest struct to rollback snapshot
|
// SnapshotRollbackRequest struct to rollback snapshot
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// StartRequest struct to start service
|
// StartRequest struct to start service
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// StopRequest struct to stop service
|
// StopRequest struct to stop service
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
package cloudapi
|
package cloudapi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Structure for creating request to CloudAPI groups
|
// Structure for creating request to CloudAPI groups
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package cloudapi
|
package cloudapi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/compute"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/compute"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Accessing the Compute method group
|
// Accessing the Compute method group
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AffinityGroupCheckStartRequest struct to check all computes with current affinity label can start
|
// AffinityGroupCheckStartRequest struct to check all computes with current affinity label can start
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AffinityLabelRemoveRequest struct to clear affinity label for compute
|
// AffinityLabelRemoveRequest struct to clear affinity label for compute
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AffinityLabelSetRequest struct to set affinity label for compute
|
// AffinityLabelSetRequest struct to set affinity label for compute
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AffinityRelationsRequest struct to get dict of computes
|
// AffinityRelationsRequest struct to get dict of computes
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AffinityRuleAddRequest struct to add affinity rule
|
// AffinityRuleAddRequest struct to add affinity rule
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AffinityRuleRemoveRequest struct to remove affinity rule
|
// AffinityRuleRemoveRequest struct to remove affinity rule
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AffinityRulesClearRequest struct to clear affinity rules
|
// AffinityRulesClearRequest struct to clear affinity rules
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AntiAffinityRuleAddRequest struct to add anti affinity rule
|
// AntiAffinityRuleAddRequest struct to add anti affinity rule
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AntiAffinityRuleRemoveRequest struct to remove anti affinity rule
|
// AntiAffinityRuleRemoveRequest struct to remove anti affinity rule
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AntiAffinityRulesClearRequest struct to clear anti affinity rules
|
// AntiAffinityRulesClearRequest struct to clear anti affinity rules
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AttachGPURequest struct to attach GPU for compute
|
// AttachGPURequest struct to attach GPU for compute
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AttachPCIDeviceRequest struct to attach PCI device
|
// AttachPCIDeviceRequest struct to attach PCI device
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AuditsRequest struct to get audit records
|
// AuditsRequest struct to get audit records
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BootDiskSetRequest struct to set boot disk for compute
|
// BootDiskSetRequest struct to set boot disk for compute
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BootOrderGetRequest struct to get boot order
|
// BootOrderGetRequest struct to get boot order
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BootOrderSetRequest struct to set boot order
|
// BootOrderSetRequest struct to set boot order
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CDEjectRequest struct to eject CD image
|
// CDEjectRequest struct to eject CD image
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CDInsertRequest struct to insert new CD image
|
// CDInsertRequest struct to insert new CD image
|
||||||
|
|||||||
@@ -5,30 +5,30 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ChangeIPRequest struct to change IP for network
|
// ChangeIPRequest struct to change IP for network
|
||||||
type ChangeIPRequest struct {
|
type ChangeIPRequest struct {
|
||||||
// ID of compute instance
|
// ID of compute instance
|
||||||
// Required: true
|
// Required: true
|
||||||
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
ComputeID uint64 `url:"compute_id" json:"compute_id" validate:"required"`
|
||||||
|
|
||||||
// Network type
|
// Network type
|
||||||
// 'EXTNET' for connect to external network directly
|
// 'EXTNET' for connect to external network directly
|
||||||
// 'VINS' for connect to ViNS
|
// 'VINS' for connect to ViNS
|
||||||
// Required: true
|
// Required: true
|
||||||
NetType string `url:"netType" json:"netType" validate:"computeNetType"`
|
NetType string `url:"net_type" json:"net_type" validate:"computeNetType"`
|
||||||
|
|
||||||
// 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" json:"netId" validate:"required"`
|
NetID uint64 `url:"net_id" json:"net_id" validate:"required"`
|
||||||
|
|
||||||
// IP address to which we will change the existing one, it must be from the same subnet
|
// IP address to which we will change the existing one, it must be from the same subnet
|
||||||
// Required: true
|
// Required: true
|
||||||
IPAddr string `url:"ipAddr" json:"ipAddr" validate:"required"`
|
IPAddr string `url:"ip_addr" json:"ip_addr" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChangeIP change reserved IP for compute instance
|
// ChangeIP change reserved IP for compute instance
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ChangeLinkStateRequest struct to change link state
|
// ChangeLinkStateRequest struct to change link state
|
||||||
|
|||||||
46
pkg/cloudapi/compute/change_mac.go
Normal file
46
pkg/cloudapi/compute/change_mac.go
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
package compute
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ChangeMACRequest struct to change MAC for network
|
||||||
|
type ChangeMACRequest struct {
|
||||||
|
// ID of compute instance
|
||||||
|
// Required: true
|
||||||
|
ComputeID uint64 `url:"compute_id" json:"compute_id" validate:"required"`
|
||||||
|
|
||||||
|
// Current mac address
|
||||||
|
// Required: true
|
||||||
|
СurrentMAC string `url:"current_mac_address" json:"current_mac_address" validate:"required"`
|
||||||
|
|
||||||
|
// the MAC address to which we will change the existing one
|
||||||
|
// Required: true
|
||||||
|
NewMAC string `url:"new_mac_address" json:"new_mac_address" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ChangeMAC change MAC for compute instance
|
||||||
|
func (c Compute) ChangeMAC(ctx context.Context, req ChangeMACRequest) (bool, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudapi/compute/changeMac"
|
||||||
|
|
||||||
|
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
result, err := strconv.ParseBool(string(res))
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return result, nil
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CloneRequest struct to clone compute instance
|
// CloneRequest struct to clone compute instance
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
package compute
|
package compute
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Structure for creating request to compute
|
// Structure for creating request to compute
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user