Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a70efe8875 | ||
|
|
5e467118e3 | ||
|
|
da60d143b9 | ||
|
|
8d885fc061 |
No files matched your search
+25
-4
@@ -1,4 +1,4 @@
|
|||||||
## Version 13.8.0
|
## Version 13.12.0
|
||||||
|
|
||||||
Методы `Audits` в cloudapi/compute, cloudbroker/compute, cloudapi/account, cloudbroker/account, cloudapi/vins, cloudbroker/vins, cloudapi/rg и cloudbroker/rg стали deprecated и в следующих версиях будут удалены, вместо них необходимо использовать метод `List` в cloudapi/audit и cloudbroker/audit с соответствующими фильтрами
|
Методы `Audits` в cloudapi/compute, cloudbroker/compute, cloudapi/account, cloudbroker/account, cloudapi/vins, cloudbroker/vins, cloudapi/rg и cloudbroker/rg стали deprecated и в следующих версиях будут удалены, вместо них необходимо использовать метод `List` в cloudapi/audit и cloudbroker/audit с соответствующими фильтрами
|
||||||
Метод `ListNodes` в cloudbroker/image стал deprecated и в следующих версиях будет удалён
|
Метод `ListNodes` в cloudbroker/image стал deprecated и в следующих версиях будет удалён
|
||||||
@@ -10,7 +10,28 @@
|
|||||||
|
|
||||||
### Добавлено
|
### Добавлено
|
||||||
|
|
||||||
#### kvmx86
|
#### apiaccess
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-763 | Опциональное поле `BLKDiscard` в структуре `DataDisk` в структурах запроса `CreateRequest`, `CreateBlankRequest` и `MassCreateRequest` в cloudbroker/kvmx86 |
|
| BGOS-1060 | Опциональное поле `SDN` в структуру `APIsEndpoints` в cloudbroker/apiaccess |
|
||||||
|
| BGOS-1060 | Опциональные поля `Audit`, `DPDKNet`, `SecurityGroup`, `SEP`, `StoragePolicy`, `Trunk`, `VFPool` и `Zone` в структуру `CloudAPIEndpoints` в cloudbroker/apiaccess |
|
||||||
|
| BGOS-1060 | Опциональные поля `Backup`, `DPDKNet`, `SecurityGroup`, `StoragePolicy`, `Trunk`, `VFPool` и `Zone` в структуру `CloudBrokerEndpoints` в cloudbroker/apiaccess |
|
||||||
|
| BGOS-1060 | Опциональное поле `Cache` в структуру `SystemEndpoints` в cloudbroker/apiaccess |
|
||||||
|
|
||||||
|
### Удалено
|
||||||
|
|
||||||
|
#### apiaccess
|
||||||
|
| Идентификатор задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-1060 | Опциональное поле `LibCloud` из структуры `APIsEndpoints` в cloudbroker/apiaccess |
|
||||||
|
| BGOS-1060 | Опциональные поля `CloudSpace`, `ComputeCI`, `DPDK`, `Machine`, `Openshift`, `OpenshiftCI`, `PortForwarding` и `Sizes` из структуры `CloudAPIEndpoints` в cloudbroker/apiaccess |
|
||||||
|
| BGOS-1060 | Опциональные поля `CloudSpace`, `ComputeCI`, `Desnode`, `Diagnostics`, `DPDK`, `IaaS`, `Machine`, `Openshift`, `OpenshiftCI`, `Ovsnode` и `QOS` из структуры `CloudBrokerEndpoints` в cloudbroker/apiaccess |
|
||||||
|
| BGOS-1060 | Опциональные поля `AgentController`, `Alerts`, `ErrorConditionHandler`, `Job`, `Log` и `Logo` из структуры `SystemEndpoints` в cloudbroker/apiaccess |
|
||||||
|
|
||||||
|
### Исправлено
|
||||||
|
|
||||||
|
#### apiaccess
|
||||||
|
| Идентификатор задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-1060 | Ошибка при вызове метода `Update` в cloudbroker/apiaccess |
|
||||||
|
| BGOS-1060 | Исправлен тип ответа методов `Update` и `DescUpdate` в cloudbroker/apiaccess |
|
||||||
@@ -366,7 +366,7 @@ func main() {
|
|||||||
- `pkg/cloudbroker/vfpool` - для `VFPool`
|
- `pkg/cloudbroker/vfpool` - для `VFPool`
|
||||||
- `pkg/cloudbroker/vins` - для `VINS`
|
- `pkg/cloudbroker/vins` - для `VINS`
|
||||||
- `pkg/cloudbroker/zone` - для `Zone`
|
- `pkg/cloudbroker/zone` - для `Zone`
|
||||||
- **sdn**:
|
- **sdn**:
|
||||||
- `pkg/sdn/acsgroups` - для `Access groups`
|
- `pkg/sdn/acsgroups` - для `Access groups`
|
||||||
- `pkg/sdn/adrspools` - для `Address pool`
|
- `pkg/sdn/adrspools` - для `Address pool`
|
||||||
- `pkg/sdn/defsecpolicies` - для `DefaultSecurityPolicies`
|
- `pkg/sdn/defsecpolicies` - для `DefaultSecurityPolicies`
|
||||||
@@ -575,7 +575,7 @@ func main() {
|
|||||||
- `.VINS()` - для работы с `VINS`
|
- `.VINS()` - для работы с `VINS`
|
||||||
- `.Zone()` - для работы с `Zone`
|
- `.Zone()` - для работы с `Zone`
|
||||||
|
|
||||||
Доступные методы для `.SDN()`:
|
Доступные методы для `.SDN()`:
|
||||||
|
|
||||||
- `.AccessGroup()` - для работы с `Access group`
|
- `.AccessGroup()` - для работы с `Access group`
|
||||||
- `.AddressPool()` - для работы с `Addres pool`
|
- `.AddressPool()` - для работы с `Addres pool`
|
||||||
@@ -946,7 +946,7 @@ func main() {
|
|||||||
- ToString(): строковое представление результата выполнения задачи
|
- ToString(): строковое представление результата выполнения задачи
|
||||||
- ID() и Name(): получение ID и имени созданного в результате выполнения задачи ресурса
|
- ID() и Name(): получение ID и имени созданного в результате выполнения задачи ресурса
|
||||||
- ToMaps(): получение списка карт, содержащих информацию о дисках, восстановленных в результате выполнения задачи.
|
- ToMaps(): получение списка карт, содержащих информацию о дисках, восстановленных в результате выполнения задачи.
|
||||||
Все методы оборудованы возвратом ошибок. Непустая ошибка означает, что из поля Result нельзя получить информацию, которую предоставляет метод.
|
Все методы оборудованы возвратом ошибок. Непустая ошибка означает, что из поля Result нельзя получить информацию, которую предоставляет метод.
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package main
|
package main
|
||||||
@@ -1624,46 +1624,46 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/config"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/config"
|
||||||
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v13"
|
decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v13"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Настройка конфигурации
|
// Настройка конфигурации
|
||||||
legacyCfg := config.LegacyConfig{
|
legacyCfg := config.LegacyConfig{
|
||||||
Username: "<USERNAME>",
|
Username: "<USERNAME>",
|
||||||
Password: "<PASSWORD>",
|
Password: "<PASSWORD>",
|
||||||
Domain: "dynamix",
|
Domain: "dynamix",
|
||||||
DecortURL: "https://mr4.digitalenergy.online",
|
DecortURL: "https://mr4.digitalenergy.online",
|
||||||
Retries: 5,
|
Retries: 5,
|
||||||
|
}
|
||||||
|
|
||||||
|
legacyCfg.SetTimeout(5 * time.Minute)
|
||||||
|
|
||||||
|
cfg := config.UniversalConfig{
|
||||||
|
LegacyConfig: &legacyCfg,
|
||||||
}
|
}
|
||||||
|
|
||||||
legacyCfg.SetTimeout(5 * time.Minute)
|
// Создание клиента
|
||||||
|
universalClient := decort.NewUniversal(cfg)
|
||||||
|
|
||||||
cfg := config.UniversalConfig{
|
// Создание структуры запроса
|
||||||
LegacyConfig: &legacyCfg,
|
// CreateRequest - реквест на создание виртуальной машины
|
||||||
}
|
req := kvmx86.CreateRequest{
|
||||||
|
RGID: 123,
|
||||||
|
Name: "compute",
|
||||||
|
CPU: 4,
|
||||||
|
RAM: 4096,
|
||||||
|
ImageID: 321,
|
||||||
|
}
|
||||||
|
|
||||||
// Создание клиента
|
// Выполнение запроса
|
||||||
universalClient := decort.NewUniversal(cfg)
|
res, err := universalClient.CloudAPI().KVMX86().Create(context.Background(), req)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
// Создание структуры запроса
|
fmt.Println(res)
|
||||||
// CreateRequest - реквест на создание виртуальной машины
|
|
||||||
req := kvmx86.CreateRequest{
|
|
||||||
RGID: 123,
|
|
||||||
Name: "compute",
|
|
||||||
CPU: 4,
|
|
||||||
RAM: 4096,
|
|
||||||
ImageID: 321,
|
|
||||||
}
|
|
||||||
|
|
||||||
// Выполнение запроса
|
|
||||||
res, err := universalClient.CloudAPI().KVMX86().Create(context.Background(), req)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Println(res)
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package compute
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ChangeLinkStateRequest struct to change link state
|
// ChangeLinkStateRequest struct to change link state
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package pcidevice
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/serialization"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/serialization"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package account
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SetCPUAllocationParameterRequest struct for setting CPU allocation parameter
|
// SetCPUAllocationParameterRequest struct for setting CPU allocation parameter
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package apiaccess
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
@@ -20,23 +20,25 @@ type DescUpdateRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DescUpdate sets a new text description of the apiaccess group.
|
// DescUpdate sets a new text description of the apiaccess group.
|
||||||
func (a APIAccess) DescUpdate(ctx context.Context, req DescUpdateRequest) (bool, error) {
|
func (a APIAccess) DescUpdate(ctx context.Context, req DescUpdateRequest) (*ItemAPIAccess, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/apiaccess/descUpdate"
|
url := "/cloudbroker/apiaccess/descUpdate"
|
||||||
|
|
||||||
res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := strconv.ParseBool(string(res))
|
info := ItemAPIAccess{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return result, nil
|
return &info, nil
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package apiaccess
|
package apiaccess
|
||||||
|
|
||||||
|
import "encoding/json"
|
||||||
|
|
||||||
type ItemAPIAccess struct {
|
type ItemAPIAccess struct {
|
||||||
// APIs
|
// APIs
|
||||||
APIs APIsEndpoints `json:"apis"`
|
APIs APIsEndpoints `json:"apis"`
|
||||||
@@ -88,43 +90,73 @@ type APIsEndpoints struct {
|
|||||||
// CloudBroker endpoints
|
// CloudBroker endpoints
|
||||||
CloudBroker CloudBrokerEndpoints `json:"cloudbroker,omitempty"`
|
CloudBroker CloudBrokerEndpoints `json:"cloudbroker,omitempty"`
|
||||||
|
|
||||||
// LibCloud endpoints
|
// SDN endpoints
|
||||||
LibCloud LibCloudEndpoints `json:"libcloud,omitempty"`
|
SDN SDNEndpoints `json:"sdn,omitempty"`
|
||||||
|
|
||||||
// System endpoints
|
// System endpoints
|
||||||
System SystemEndpoints `json:"system,omitempty"`
|
System SystemEndpoints `json:"system,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MarshalJSON omits empty namespaces, so that "{}" is not sent in requests.
|
||||||
|
func (a APIsEndpoints) MarshalJSON() ([]byte, error) {
|
||||||
|
namespaces := []struct {
|
||||||
|
key string
|
||||||
|
value interface{}
|
||||||
|
}{
|
||||||
|
{"cloudapi", a.CloudAPI},
|
||||||
|
{"cloudbroker", a.CloudBroker},
|
||||||
|
{"sdn", a.SDN},
|
||||||
|
{"system", a.System},
|
||||||
|
}
|
||||||
|
|
||||||
|
result := make(map[string]json.RawMessage, len(namespaces))
|
||||||
|
|
||||||
|
for _, ns := range namespaces {
|
||||||
|
data, err := json.Marshal(ns.value)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if string(data) == "{}" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
result[ns.key] = data
|
||||||
|
}
|
||||||
|
|
||||||
|
return json.Marshal(result)
|
||||||
|
}
|
||||||
|
|
||||||
type CloudAPIEndpoints struct {
|
type CloudAPIEndpoints struct {
|
||||||
Account []string `json:"account,omitempty"`
|
Account []string `json:"account,omitempty"`
|
||||||
BService []string `json:"bservice,omitempty"`
|
Audit []string `json:"audit,omitempty"`
|
||||||
CloudSpace []string `json:"cloudspace,omitempty"`
|
BService []string `json:"bservice,omitempty"`
|
||||||
Compute []string `json:"compute,omitempty"`
|
Compute []string `json:"compute,omitempty"`
|
||||||
ComputeCI []string `json:"computeci,omitempty"`
|
Disks []string `json:"disks,omitempty"`
|
||||||
Disks []string `json:"disks,omitempty"`
|
DPDKNet []string `json:"dpdknet,omitempty"`
|
||||||
DPDK []string `json:"dpdk,omitempty"`
|
ExtNet []string `json:"extnet,omitempty"`
|
||||||
ExtNet []string `json:"extnet,omitempty"`
|
FLIPGroup []string `json:"flipgroup,omitempty"`
|
||||||
FLIPGroup []string `json:"flipgroup,omitempty"`
|
GPU []string `json:"gpu,omitempty"`
|
||||||
GPU []string `json:"gpu,omitempty"`
|
Image []string `json:"image,omitempty"`
|
||||||
Image []string `json:"image,omitempty"`
|
K8CI []string `json:"k8ci,omitempty"`
|
||||||
K8CI []string `json:"k8ci,omitempty"`
|
K8S []string `json:"k8s,omitempty"`
|
||||||
K8S []string `json:"k8s,omitempty"`
|
KVMX86 []string `json:"kvmx86,omitempty"`
|
||||||
KVMX86 []string `json:"kvmx86,omitempty"`
|
LB []string `json:"lb,omitempty"`
|
||||||
LB []string `json:"lb,omitempty"`
|
Loactions []string `json:"locations,omitempty"`
|
||||||
Loactions []string `json:"locations,omitempty"`
|
PCIDevice []string `json:"pcidevice,omitempty"`
|
||||||
Machine []string `json:"machine,omitempty"`
|
Prometheus []string `json:"prometheus,omitempty"`
|
||||||
Openshift []string `json:"openshift,omitempty"`
|
RG []string `json:"rg,omitempty"`
|
||||||
OpenshiftCI []string `json:"openshiftci,omitempty"`
|
SecurityGroup []string `json:"security_group,omitempty"`
|
||||||
PCIDevice []string `json:"pcidevice,omitempty"`
|
SEP []string `json:"sep,omitempty"`
|
||||||
PortForwarding []string `json:"portforwarding,omitempty"`
|
StoragePolicy []string `json:"storage_policy,omitempty"`
|
||||||
Prometheus []string `json:"prometheus,omitempty"`
|
Tasks []string `json:"tasks,omitempty"`
|
||||||
RG []string `json:"rg,omitempty"`
|
Trunk []string `json:"trunk,omitempty"`
|
||||||
Sizes []string `json:"sizes,omitempty"`
|
User []string `json:"user,omitempty"`
|
||||||
Tasks []string `json:"tasks,omitempty"`
|
VFPool []string `json:"vfpool,omitempty"`
|
||||||
User []string `json:"user,omitempty"`
|
VGPU []string `json:"vgpu,omitempty"`
|
||||||
VGPU []string `json:"vgpu,omitempty"`
|
VINS []string `json:"vins,omitempty"`
|
||||||
VINS []string `json:"vins,omitempty"`
|
Zone []string `json:"zone,omitempty"`
|
||||||
All bool `json:"ALL,omitempty"`
|
All bool `json:"ALL,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CloudBrokerEndpoints struct {
|
type CloudBrokerEndpoints struct {
|
||||||
@@ -133,74 +165,83 @@ type CloudBrokerEndpoints struct {
|
|||||||
Audit interface{} `json:"audit,omitempty"`
|
Audit interface{} `json:"audit,omitempty"`
|
||||||
AuditBeat []string `json:"auditbeat,omitempty"`
|
AuditBeat []string `json:"auditbeat,omitempty"`
|
||||||
AuditCollector []string `json:"auditcollector,omitempty"`
|
AuditCollector []string `json:"auditcollector,omitempty"`
|
||||||
|
Backup []string `json:"backup,omitempty"`
|
||||||
BackupCreator []string `json:"backupcreator,omitempty"`
|
BackupCreator []string `json:"backupcreator,omitempty"`
|
||||||
BService []string `json:"bservice,omitempty"`
|
BService []string `json:"bservice,omitempty"`
|
||||||
CloudSpace []string `json:"cloudspace,omitempty"`
|
|
||||||
Compute []string `json:"compute,omitempty"`
|
Compute []string `json:"compute,omitempty"`
|
||||||
ComputeCI []string `json:"computeci,omitempty"`
|
|
||||||
Desnode []string `json:"desnode,omitempty"`
|
|
||||||
Diagnostics []string `json:"diagnostics,omitempty"`
|
|
||||||
Disks []string `json:"disks,omitempty"`
|
Disks []string `json:"disks,omitempty"`
|
||||||
DPDK []string `json:"dpdk,omitempty"`
|
DPDKNet []string `json:"dpdknet,omitempty"`
|
||||||
Eco []string `json:"eco,omitempty"`
|
Eco []string `json:"eco,omitempty"`
|
||||||
ExtNet []string `json:"extnet,omitempty"`
|
ExtNet []string `json:"extnet,omitempty"`
|
||||||
FlIPgroup []string `json:"flipgroup,omitempty"`
|
FlIPgroup []string `json:"flipgroup,omitempty"`
|
||||||
Grid []string `json:"grid,omitempty"`
|
Grid []string `json:"grid,omitempty"`
|
||||||
Group []string `json:"group,omitempty"`
|
Group []string `json:"group,omitempty"`
|
||||||
Health []string `json:"health,omitempty"`
|
Health []string `json:"health,omitempty"`
|
||||||
IaaS []string `json:"iaas,omitempty"`
|
|
||||||
Image []string `json:"image,omitempty"`
|
Image []string `json:"image,omitempty"`
|
||||||
Job interface{} `json:"job,omitempty"`
|
Job interface{} `json:"job,omitempty"`
|
||||||
K8CI []string `json:"k8ci,omitempty"`
|
K8CI []string `json:"k8ci,omitempty"`
|
||||||
K8S []string `json:"k8s,omitempty"`
|
K8S []string `json:"k8s,omitempty"`
|
||||||
KVMX86 []string `json:"kvmx86,omitempty"`
|
KVMX86 []string `json:"kvmx86,omitempty"`
|
||||||
LB []string `json:"lb,omitempty"`
|
LB []string `json:"lb,omitempty"`
|
||||||
Machine []string `json:"machine,omitempty"`
|
|
||||||
Metering []string `json:"metering,omitempty"`
|
Metering []string `json:"metering,omitempty"`
|
||||||
Milestones []string `json:"milestones,omitempty"`
|
Milestones []string `json:"milestones,omitempty"`
|
||||||
Openshift []string `json:"openshift,omitempty"`
|
Node []string `json:"node,omitempty"`
|
||||||
OpenshiftCI []string `json:"openshiftci,omitempty"`
|
|
||||||
Ovsnode []string `json:"ovsnode,omitempty"`
|
|
||||||
PCIDevice []string `json:"pcidevice,omitempty"`
|
PCIDevice []string `json:"pcidevice,omitempty"`
|
||||||
PGPU []string `json:"pgpu,omitempty"`
|
PGPU []string `json:"pgpu,omitempty"`
|
||||||
Prometheus []string `json:"prometheus,omitempty"`
|
Prometheus []string `json:"prometheus,omitempty"`
|
||||||
QOS []string `json:"qos,omitempty"`
|
|
||||||
Resmon interface{} `json:"resmon,omitempty"`
|
Resmon interface{} `json:"resmon,omitempty"`
|
||||||
RG []string `json:"rg,omitempty"`
|
RG []string `json:"rg,omitempty"`
|
||||||
|
SecurityGroup []string `json:"security_group,omitempty"`
|
||||||
Sep []string `json:"sep,omitempty"`
|
Sep []string `json:"sep,omitempty"`
|
||||||
Node []string `json:"node,omitempty"`
|
StoragePolicy []string `json:"storage_policy,omitempty"`
|
||||||
Tasks []string `json:"tasks,omitempty"`
|
Tasks []string `json:"tasks,omitempty"`
|
||||||
TLock []string `json:"tlock,omitempty"`
|
TLock []string `json:"tlock,omitempty"`
|
||||||
|
Trunk []string `json:"trunk,omitempty"`
|
||||||
User []string `json:"user,omitempty"`
|
User []string `json:"user,omitempty"`
|
||||||
|
VFPool []string `json:"vfpool,omitempty"`
|
||||||
VGPU []string `json:"vgpu,omitempty"`
|
VGPU []string `json:"vgpu,omitempty"`
|
||||||
VINS []string `json:"vins,omitempty"`
|
VINS []string `json:"vins,omitempty"`
|
||||||
VNFDev []string `json:"vnfdev,omitempty"`
|
VNFDev []string `json:"vnfdev,omitempty"`
|
||||||
ZeroAccess []string `json:"zeroaccess,omitempty"`
|
ZeroAccess []string `json:"zeroaccess,omitempty"`
|
||||||
|
Zone []string `json:"zone,omitempty"`
|
||||||
All bool `json:"ALL,omitempty"`
|
All bool `json:"ALL,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type LibCloudEndpoints struct {
|
type SDNEndpoints struct {
|
||||||
Libvirt []string `json:"libvirt,omitempty"`
|
AccessGroup []string `json:"access_group,omitempty"`
|
||||||
All bool `json:"ALL,omitempty"`
|
AddressPool []string `json:"address_pool,omitempty"`
|
||||||
|
DefaultSecurityPolicy []string `json:"default_security_policy,omitempty"`
|
||||||
|
ExternalNetwork []string `json:"external_network,omitempty"`
|
||||||
|
FloatingIP []string `json:"floating_ip,omitempty"`
|
||||||
|
Hypervisor []string `json:"hypervisor,omitempty"`
|
||||||
|
L2ExternalNetwork []string `json:"l2_external_network,omitempty"`
|
||||||
|
LogicalPort []string `json:"logical_port,omitempty"`
|
||||||
|
NetworkObjectGroup []string `json:"network_object_group,omitempty"`
|
||||||
|
Router []string `json:"router,omitempty"`
|
||||||
|
RouterGatewayPort []string `json:"router/gateway_port,omitempty"`
|
||||||
|
RouterPolicies []string `json:"router/policies,omitempty"`
|
||||||
|
RouterRouterPort []string `json:"router/router_port,omitempty"`
|
||||||
|
RouterStaticRoute []string `json:"router/static_route,omitempty"`
|
||||||
|
SecurityPolicy []string `json:"security_policy,omitempty"`
|
||||||
|
SecurityPolicyRule []string `json:"security_policy/rule,omitempty"`
|
||||||
|
SecurityRule []string `json:"security_rule,omitempty"`
|
||||||
|
Segment []string `json:"segment,omitempty"`
|
||||||
|
Version []string `json:"version,omitempty"`
|
||||||
|
All bool `json:"ALL,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SystemEndpoints struct {
|
type SystemEndpoints struct {
|
||||||
AgentController []string `json:"agentcontroller,omitempty"`
|
Audits []string `json:"audits,omitempty"`
|
||||||
Alerts []string `json:"alerts,omitempty"`
|
Cache []string `json:"cache,omitempty"`
|
||||||
Audits []string `json:"audits,omitempty"`
|
ContentManager []string `json:"contentmanager,omitempty"`
|
||||||
ContentManager []string `json:"contentmanager,omitempty"`
|
DocGenerator []string `json:"docgenerator,omitempty"`
|
||||||
DocGenerator []string `json:"docgenerator,omitempty"`
|
EmailSender []string `json:"emailsender,omitempty"`
|
||||||
EmailSender []string `json:"emailsender,omitempty"`
|
GridManager []string `json:"gridmanager,omitempty"`
|
||||||
ErrorConditionHandler []string `json:"errorconditionhandler,omitempty"`
|
Health []string `json:"health,omitempty"`
|
||||||
GridManager []string `json:"gridmanager,omitempty"`
|
Info []string `json:"info,omitempty"`
|
||||||
Health []string `json:"health,omitempty"`
|
InfoMGR []string `json:"infomgr,omitempty"`
|
||||||
Info []string `json:"info,omitempty"`
|
Oauth []string `json:"oauth,omitempty"`
|
||||||
InfoMGR []string `json:"infomgr,omitempty"`
|
Task []string `json:"task,omitempty"`
|
||||||
Job []string `json:"job,omitempty"`
|
UserManager []string `json:"usermanager,omitempty"`
|
||||||
Log []string `json:"log,omitempty"`
|
All bool `json:"ALL,omitempty"`
|
||||||
Logo []string `json:"logo,omitempty"`
|
|
||||||
Oauth []string `json:"oauth,omitempty"`
|
|
||||||
Task []string `json:"task,omitempty"`
|
|
||||||
UserManager []string `json:"usermanager,omitempty"`
|
|
||||||
All bool `json:"ALL,omitempty"`
|
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
@@ -27,10 +26,10 @@ type wrapperUpdateRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update updates apis of apiaccess group.
|
// Update updates apis of apiaccess group.
|
||||||
func (a APIAccess) Update(ctx context.Context, req UpdateRequest) (bool, error) {
|
func (a APIAccess) Update(ctx context.Context, req UpdateRequest) (*ItemAPIAccess, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/apiaccess/update"
|
url := "/cloudbroker/apiaccess/update"
|
||||||
@@ -41,20 +40,22 @@ func (a APIAccess) Update(ctx context.Context, req UpdateRequest) (bool, error)
|
|||||||
|
|
||||||
apiJSON, err := json.Marshal(&req.APIs)
|
apiJSON, err := json.Marshal(&req.APIs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
reqWrapped.APIString = string(apiJSON)
|
reqWrapped.APIString = string(apiJSON)
|
||||||
|
|
||||||
res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped)
|
res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := strconv.ParseBool(string(res))
|
info := ItemAPIAccess{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return result, nil
|
return &info, nil
|
||||||
}
|
}
|
||||||
@@ -3,8 +3,9 @@ package compute
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ChangeLinkStateRequest struct for changing link state
|
// ChangeLinkStateRequest struct for changing link state
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package disks
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DepresentRequest struct to depresent disk from node
|
// DepresentRequest struct to depresent disk from node
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package disks
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PresentRequest struct to present disk to node
|
// PresentRequest struct to present disk to node
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package grid
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SetCPUAllocationParameterRequest for setting CPU allocation parameter
|
// SetCPUAllocationParameterRequest for setting CPU allocation parameter
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package grid
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SetCPUAllocationRatioForVMRequest for setting CPU allocation ratio for computes
|
// SetCPUAllocationRatioForVMRequest for setting CPU allocation ratio for computes
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package pcidevice
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DeleteRequest struct to deleting PCI device
|
// DeleteRequest struct to deleting PCI device
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package pcidevice
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DisableRequest struct for disabling PCI device
|
// DisableRequest struct for disabling PCI device
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package pcidevice
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// EnableRequest struct for enabling PCI device
|
// EnableRequest struct for enabling PCI device
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package pcidevice
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/serialization"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/serialization"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ type ItemResourceConsumption struct {
|
|||||||
ResourceLimits ResourceLimits `json:"resourceLimits"`
|
ResourceLimits ResourceLimits `json:"resourceLimits"`
|
||||||
|
|
||||||
// Resource group ID
|
// Resource group ID
|
||||||
RGID uint64 `json:"rgid"`
|
RGID uint64 `json:"id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ListResourceConsumption struct {
|
type ListResourceConsumption struct {
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package rg
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SetCPUAllocationParameterRequest struct for setting CPU allocation parameter
|
// SetCPUAllocationParameterRequest struct for setting CPU allocation parameter
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package rg
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SetCPUAllocationRatioRequest struct for setting CPU allocation ratio
|
// SetCPUAllocationRatioRequest struct for setting CPU allocation ratio
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package sep
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
@@ -20,23 +20,24 @@ type AddConsumerNodesRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AddConsumerNodes adds consumer nodes to SEP parameters
|
// AddConsumerNodes adds consumer nodes to SEP parameters
|
||||||
func (s SEP) AddConsumerNodes(ctx context.Context, req AddConsumerNodesRequest) (uint64, error) {
|
func (s SEP) AddConsumerNodes(ctx context.Context, req AddConsumerNodesRequest) ([]uint64, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
|
list := []uint64{}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
return list, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/sep/addConsumerNodes"
|
url := "/cloudbroker/sep/addConsumerNodes"
|
||||||
|
|
||||||
res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return list, err
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := strconv.ParseUint(string(res), 10, 64)
|
err = json.Unmarshal(res, &list)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return result, nil
|
return list, nil
|
||||||
}
|
}
|
||||||
@@ -38,7 +38,7 @@ type UpdateRequest struct {
|
|||||||
|
|
||||||
type wrapperUpdateRequest struct {
|
type wrapperUpdateRequest struct {
|
||||||
UpdateRequest
|
UpdateRequest
|
||||||
Config []string `url:"config,omitempty"`
|
Config string `url:"config,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update updates vfpool device
|
// Update updates vfpool device
|
||||||
@@ -48,21 +48,15 @@ func (v VFPool) Update(ctx context.Context, req UpdateRequest) (bool, error) {
|
|||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
var config []string
|
var config string
|
||||||
|
|
||||||
if len(req.Config) != 0 {
|
if len(req.Config) != 0 {
|
||||||
config = make([]string, 0, len(req.Config))
|
b, err := json.Marshal(req.Config)
|
||||||
|
if err != nil {
|
||||||
for c := range req.Config {
|
return false, err
|
||||||
b, err := json.Marshal(req.Config[c])
|
|
||||||
if err != nil {
|
|
||||||
return false, err
|
|
||||||
}
|
|
||||||
|
|
||||||
config = append(config, string(b))
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
config = []string{}
|
config = string(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
reqWrapped := wrapperUpdateRequest{
|
reqWrapped := wrapperUpdateRequest{
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package vgpu
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// AllocateRequest struct for allocating VGPU
|
// AllocateRequest struct for allocating VGPU
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package vgpu
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CreateRequest struct for creating VGPU
|
// CreateRequest struct for creating VGPU
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package vgpu
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DeallocateRequest struct for deallocating VGPU
|
// DeallocateRequest struct for deallocating VGPU
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package vgpu
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v13/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DestroyRequest struct for destroying VGPU
|
// DestroyRequest struct for destroying VGPU
|
||||||
|
|||||||
Reference in new issue
Block a user