Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f61319c21b | |||
| fe413c7182 | |||
|
|
3e2edf53a5 |
26
CHANGELOG.md
26
CHANGELOG.md
@@ -1,4 +1,4 @@
|
|||||||
## Version 14.10.0
|
## Version 1.14.13
|
||||||
|
|
||||||
Методы `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 с соответствующими фильтрами
|
||||||
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и в следующих версиях будут удалены
|
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и в следующих версиях будут удалены
|
||||||
@@ -7,9 +7,25 @@
|
|||||||
|
|
||||||
Все методы группы `.SDN()` находятся в альфа-версии.
|
Все методы группы `.SDN()` находятся в альфа-версии.
|
||||||
|
|
||||||
### Удалено
|
|
||||||
|
|
||||||
#### resource_optimizer
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
### Добавлено
|
||||||
|
|
||||||
|
#### sdn logicalports
|
||||||
|
| Идентификатор задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-855 | Группа методов `resource_optimizer` |
|
| BGOS-967 | Вычисляемое поле `ExcludeFirewall` в структуру ответа `LogicalPort` в sdn/logicalports |
|
||||||
|
|
||||||
|
|
||||||
|
### Изменено
|
||||||
|
|
||||||
|
#### sdn logicalports
|
||||||
|
| Идентификатор задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-967 | Тип опционального поля `LogicalPortAddresses` в структуре запроса `CreateRequest` с `[]LogicalPortAddress` на `[]LogicalPortAddressRequest` в sdn/logicalports |
|
||||||
|
| BGOS-967 | Тип обязательного поля `IP` в структуре запроса `LogicalPortAddressRequest` с `string` на `interface{}` в sdn/logicalports |
|
||||||
|
| BGOS-967 | Тип поля `IsDiscovered` c опционального на обязательное в структурах запросов `UpdateAddress` и `AddAddress` в sdn/logicalports |
|
||||||
|
| BGOS-967 | Тип обязательного поля `IsDiscovered` в структуре запроса `UpdateAddress` и `AddAddress` с `bool` на `interface{}` в sdn/logicalports |
|
||||||
|
| BGOS-967 | Тип опционального поля `Labels` в структуре запроса `CreateRequest` с `CreateLabels` на `*CreateLabels` в sdn/logicalports |
|
||||||
|
| BGOS-967 | Тип опционального поля `Labels` в структуре запроса `UpdateRequest` с `UpdateLabels` на `*UpdateLabels` в sdn/logicalports |
|
||||||
|
|
||||||
|
|||||||
@@ -350,6 +350,10 @@ func isBoolTypeValidator(fe validator.FieldLevel) bool {
|
|||||||
return fe.Field().CanConvert(reflect.TypeOf(true))
|
return fe.Field().CanConvert(reflect.TypeOf(true))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isStringTypeValidator(fe validator.FieldLevel) bool {
|
||||||
|
return fe.Field().Kind() == reflect.String
|
||||||
|
}
|
||||||
|
|
||||||
func urlValidartor(fl validator.FieldLevel) bool {
|
func urlValidartor(fl validator.FieldLevel) bool {
|
||||||
fieldValues := fl.Field().String()
|
fieldValues := fl.Field().String()
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package validators
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/multierror"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/multierror"
|
||||||
|
|
||||||
"github.com/go-playground/validator/v10"
|
"github.com/go-playground/validator/v10"
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ func errorMessage(fe validator.FieldError) string {
|
|||||||
return fmt.Sprintf("%s %s: unexpected E-Mail format", prefix, fe.Field())
|
return fmt.Sprintf("%s %s: unexpected E-Mail format", prefix, fe.Field())
|
||||||
case "isBool":
|
case "isBool":
|
||||||
return fmt.Sprintf("%s %s: must be bool type", prefix, fe.Field())
|
return fmt.Sprintf("%s %s: must be bool type", prefix, fe.Field())
|
||||||
|
case "isString":
|
||||||
|
return fmt.Sprintf("%s %s: must be string type", prefix, fe.Field())
|
||||||
|
|
||||||
case "accessType":
|
case "accessType":
|
||||||
return fmt.Sprintf("%s %s must be one of the following: %s",
|
return fmt.Sprintf("%s %s must be one of the following: %s",
|
||||||
|
|||||||
@@ -231,6 +231,11 @@ func registerAllValidators(validate *validator.Validate) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = validate.RegisterValidation("isString", isStringTypeValidator)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
err = validate.RegisterValidation("url", urlValidartor)
|
err = validate.RegisterValidation("url", urlValidartor)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ type Audit struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Builder for audit endpoint
|
// Builder for audit endpoint
|
||||||
func New(client interfaces.Caller) *Audit{
|
func New(client interfaces.Caller) *Audit {
|
||||||
return &Audit{
|
return &Audit{
|
||||||
client: client,
|
client: client,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package compute
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ChangeLinkStateRequest struct to change link state
|
// ChangeLinkStateRequest struct to change link state
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ type RedeployRequest struct {
|
|||||||
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||||
|
|
||||||
// Storage policy id of compute. The rules of the specified storage policy will be used.
|
// Storage policy id of compute. The rules of the specified storage policy will be used.
|
||||||
// Required: true
|
// Required: false
|
||||||
StoragePolicyID uint64 `url:"storage_policy_id,omitempty" json:"storage_policy_id,omitempty"`
|
StoragePolicyID uint64 `url:"storage_policy_id,omitempty" json:"storage_policy_id,omitempty"`
|
||||||
|
|
||||||
// ID of the new OS image, if image change is required
|
// ID of the new OS image, if image change is required
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package pcidevice
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/serialization"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/serialization"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package account
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SetCPUAllocationParameterRequest struct for setting CPU allocation parameter
|
// SetCPUAllocationParameterRequest struct for setting CPU allocation parameter
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ type Audit struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Builder for audit endpoint
|
// Builder for audit endpoint
|
||||||
func New(client interfaces.Caller) *Audit{
|
func New(client interfaces.Caller) *Audit {
|
||||||
return &Audit{
|
return &Audit{
|
||||||
client: client,
|
client: client,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package compute
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ChangeLinkStateRequest struct for changing link state
|
// ChangeLinkStateRequest struct for changing link state
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ type RedeployRequest struct {
|
|||||||
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
|
OSVersion string `url:"os_version,omitempty" json:"os_version,omitempty"`
|
||||||
|
|
||||||
// Storage policy id of compute. The rules of the specified storage policy will be used.
|
// Storage policy id of compute. The rules of the specified storage policy will be used.
|
||||||
// Required: true
|
// Required: false
|
||||||
StoragePolicyID uint64 `url:"storage_policy_id,omitempty" json:"storage_policy_id,omitempty"`
|
StoragePolicyID uint64 `url:"storage_policy_id,omitempty" json:"storage_policy_id,omitempty"`
|
||||||
|
|
||||||
// New size for the boot disk in GB, if boot disk size change is required
|
// New size for the boot disk in GB, if boot disk size change is required
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package disks
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/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/v14/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/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/v14/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/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/v14/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SetCPUAllocationRatioForVMRequest for setting CPU allocation ratio for computes
|
// SetCPUAllocationRatioForVMRequest for setting CPU allocation ratio for computes
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ type AccessAddRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add accountId to sharedWith access list for k8ci.
|
// Add accountId to sharedWith access list for k8ci.
|
||||||
func (k K8CI) AccessAdd (ctx context.Context, req AccessAddRequest) (string, error) {
|
func (k K8CI) AccessAdd(ctx context.Context, req AccessAddRequest) (string, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ type AccessRemoveRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove accountId from sharedWith access list for k8ci.
|
// Remove accountId from sharedWith access list for k8ci.
|
||||||
func (k K8CI) AccessRemove (ctx context.Context, req AccessRemoveRequest) (string, error) {
|
func (k K8CI) AccessRemove(ctx context.Context, req AccessRemoveRequest) (string, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package pcidevice
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/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/v14/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/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/v14/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/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/v14/internal/serialization"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/serialization"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ package rg
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/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/v14/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/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/v14/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/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/v14/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/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/v14/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/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/v14/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/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/v14/internal/validators"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DestroyRequest struct for destroying VGPU
|
// DestroyRequest struct for destroying VGPU
|
||||||
|
|||||||
@@ -55,34 +55,35 @@ type CreateRequest struct {
|
|||||||
|
|
||||||
// Logical port addresses
|
// Logical port addresses
|
||||||
// Required: false
|
// Required: false
|
||||||
LogicalPortAddresses []LogicalPortAddress `url:"logical_port_addresses,omitempty" json:"logical_port_addresses,omitempty" validate:"dive"`
|
LogicalPortAddresses []LogicalPortAddressRequest `url:"logical_port_addresses,omitempty" json:"logical_port_addresses,omitempty" validate:"dive"`
|
||||||
|
|
||||||
// Labels
|
// Labels
|
||||||
// Required: false
|
// Required: false
|
||||||
Labels CreateLabels `url:"labels,omitempty" json:"labels,omitempty"`
|
Labels *CreateLabels `url:"labels,omitempty" json:"labels"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// LogicalPortAddressRequest struct representing logical port address
|
// LogicalPortAddressRequest struct representing logical port address
|
||||||
type LogicalPortAddressRequest struct {
|
type LogicalPortAddressRequest struct {
|
||||||
// IP address
|
// IP address. IPv4 or IPv6 address of the logical port
|
||||||
|
// If nil (allowed only when IsPrimary is true), the system will automatically generate a valid address
|
||||||
// Required: true
|
// Required: true
|
||||||
IP string `url:"ip" json:"ip" validate:"required"`
|
IP interface{} `url:"ip" json:"ip" validate:"omitempty,isString"`
|
||||||
|
|
||||||
// IP type
|
// IP type
|
||||||
// Required: true
|
// Required: true
|
||||||
IPType string `url:"ip_type" json:"ip_type" validate:"required,oneof=IPv4 IPv6"`
|
IPType string `url:"ip_type" json:"ip_type" validate:"required,oneof=IPv4 IPv6"`
|
||||||
|
|
||||||
// Is primary. True or False
|
// Is primary
|
||||||
// Required: true
|
// Required: true
|
||||||
IsPrimary interface{} `url:"is_primary" json:"is_primary" validate:"required,isBool"`
|
IsPrimary interface{} `url:"is_primary" json:"is_primary" validate:"required,isBool"`
|
||||||
|
|
||||||
|
// Is discovered
|
||||||
|
// Required: true
|
||||||
|
IsDiscovered interface{} `url:"is_discovered" json:"is_discovered" validate:"required,isBool"`
|
||||||
|
|
||||||
// MAC address
|
// MAC address
|
||||||
// Required: false
|
// Required: false
|
||||||
MAC string `url:"mac,omitempty" json:"mac,omitempty"`
|
MAC string `url:"mac,omitempty" json:"mac,omitempty"`
|
||||||
|
|
||||||
// Is discovered. True or False
|
|
||||||
// Required: false
|
|
||||||
IsDiscovered interface{} `url:"is_discovered,omitempty" json:"is_discovered,omitempty" validate:"omitempty,isBool"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create creates a logical port
|
// Create creates a logical port
|
||||||
|
|||||||
@@ -34,6 +34,9 @@ type LogicalPort struct {
|
|||||||
// Enabled
|
// Enabled
|
||||||
Enabled bool `json:"enabled"`
|
Enabled bool `json:"enabled"`
|
||||||
|
|
||||||
|
// Exclude firewall information
|
||||||
|
ExcludeFirewall ExcludeFirewall `json:"exclude_firewall"`
|
||||||
|
|
||||||
// External network ID
|
// External network ID
|
||||||
ExternalNetworkID string `json:"external_network_id"`
|
ExternalNetworkID string `json:"external_network_id"`
|
||||||
|
|
||||||
@@ -162,6 +165,18 @@ type MigrationStatus struct {
|
|||||||
VersionID uint64 `json:"version_id"`
|
VersionID uint64 `json:"version_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ExcludeFirewall information
|
||||||
|
type ExcludeFirewall struct {
|
||||||
|
// Exclusion reason
|
||||||
|
ExclusionReason string `json:"exclusion_reason"`
|
||||||
|
|
||||||
|
// Whether logical port addresses are excluded from firewall
|
||||||
|
LogicalPortAddressesExcluded bool `json:"logical_port_addresses_excluded"`
|
||||||
|
|
||||||
|
// Whether logical port is excluded from firewall
|
||||||
|
LogicalPortExcluded bool `json:"logical_port_excluded"`
|
||||||
|
}
|
||||||
|
|
||||||
// Labels information
|
// Labels information
|
||||||
type Labels struct {
|
type Labels struct {
|
||||||
// VM ID
|
// VM ID
|
||||||
|
|||||||
@@ -67,11 +67,15 @@ type UpdateRequest struct {
|
|||||||
|
|
||||||
// Labels
|
// Labels
|
||||||
// Required: false
|
// Required: false
|
||||||
Labels UpdateLabels `url:"labels,omitempty" json:"labels,omitempty"`
|
Labels *UpdateLabels `url:"labels,omitempty" json:"labels"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateAddress struct representing update address
|
// UpdateAddress struct representing update address
|
||||||
type UpdateAddress struct {
|
type UpdateAddress struct {
|
||||||
|
// ID of the address
|
||||||
|
// Required: true
|
||||||
|
ID string `url:"id" json:"id" validate:"required"`
|
||||||
|
|
||||||
// IP address
|
// IP address
|
||||||
// Required: true
|
// Required: true
|
||||||
IP string `url:"ip" json:"ip" validate:"required"`
|
IP string `url:"ip" json:"ip" validate:"required"`
|
||||||
@@ -81,8 +85,8 @@ type UpdateAddress struct {
|
|||||||
IPType string `url:"ip_type" json:"ip_type" validate:"required,oneof=IPv4 IPv6"`
|
IPType string `url:"ip_type" json:"ip_type" validate:"required,oneof=IPv4 IPv6"`
|
||||||
|
|
||||||
// Is discovered. True or False
|
// Is discovered. True or False
|
||||||
// Required: false
|
// Required: true
|
||||||
IsDiscovered interface{} `url:"is_discovered,omitempty" json:"is_discovered,omitempty" validate:"omitempty,isBool"`
|
IsDiscovered interface{} `url:"is_discovered" json:"is_discovered" validate:"required,isBool"`
|
||||||
|
|
||||||
// Is primary. True or False
|
// Is primary. True or False
|
||||||
// Required: true
|
// Required: true
|
||||||
@@ -103,11 +107,11 @@ type AddAddress struct {
|
|||||||
// Required: true
|
// Required: true
|
||||||
IPType string `url:"ip_type" json:"ip_type" validate:"required,oneof=IPv4 IPv6"`
|
IPType string `url:"ip_type" json:"ip_type" validate:"required,oneof=IPv4 IPv6"`
|
||||||
|
|
||||||
// Is discovered. True or False
|
// Is discovered
|
||||||
// Required: false
|
// Required: true
|
||||||
IsDiscovered interface{} `url:"is_discovered,omitempty" json:"is_discovered,omitempty" validate:"omitempty,isBool"`
|
IsDiscovered interface{} `url:"is_discovered" json:"is_discovered" validate:"required,isBool"`
|
||||||
|
|
||||||
// Is primary. True or False
|
// Is primary
|
||||||
// Required: true
|
// Required: true
|
||||||
IsPrimary interface{} `url:"is_primary" json:"is_primary" validate:"required,isBool"`
|
IsPrimary interface{} `url:"is_primary" json:"is_primary" validate:"required,isBool"`
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user