Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 77cbe6952b | |||
|
|
0595b5ae39 | ||
| 55fe76d12e |
73
CHANGELOG.md
73
CHANGELOG.md
@@ -1,4 +1,4 @@
|
|||||||
## Version 15.3.0
|
## Version 15.5.0
|
||||||
|
|
||||||
Методы `Audits` в cloudapi/compute, cloudbroker/compute, cloudapi/account, cloudbroker/account, cloudapi/vins, cloudbroker/vins, cloudapi/rg и cloudbroker/rg стали deprecated и будут удалены в версии 16.0, вместо них необходимо использовать метод `List` в cloudapi/audit и cloudbroker/audit с соответствующими фильтрами
|
Методы `Audits` в cloudapi/compute, cloudbroker/compute, cloudapi/account, cloudbroker/account, cloudapi/vins, cloudbroker/vins, cloudapi/rg и cloudbroker/rg стали deprecated и будут удалены в версии 16.0, вместо них необходимо использовать метод `List` в cloudapi/audit и cloudbroker/audit с соответствующими фильтрами
|
||||||
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и будут удалены в версии 16.0
|
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и будут удалены в версии 16.0
|
||||||
@@ -11,54 +11,69 @@
|
|||||||
Методы `ExecuteMaintenanceScript`, `ListEmails`, `ServicesRestart` в cloudbroker/grid стали deprecated и будут удалены в версии 16.0
|
Методы `ExecuteMaintenanceScript`, `ListEmails`, `ServicesRestart` в cloudbroker/grid стали deprecated и будут удалены в версии 16.0
|
||||||
Метод `Get` в cloudbroker/group стал deprecated и будет удален в версии 16.0
|
Метод `Get` в cloudbroker/group стал deprecated и будет удален в версии 16.0
|
||||||
|
|
||||||
Все методы группы `.SDN()` находятся в альфа-версии.
|
|
||||||
|
|
||||||
|
|
||||||
### Добавлено
|
### Добавлено
|
||||||
|
|
||||||
#### compute
|
#### compute
|
||||||
| Идентификатор задачи | Описание |
|
| Идентификатор задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-922 | Опциональное поле `EnableDefaultGateway` в структуру запроса `NetAttachRequest` в cloudapi/compute и cloudbroker/compute |
|
| BGOS-954 | Вычисляемое поле `ResizedOnline` в структуры ответа `RecordCompute` и `ItemCompute` в cloudapi/compute и cloudbroker/compute |
|
||||||
| BGOS-922 | Вычисляемое поле `EnableDefaultGateway` в структуру ответа `RecordNetAttach` в cloudapi/compute и cloudbroker/compute |
|
|
||||||
| BGOS-922 | Вычисляемое поле `EnableDefaultGateway` в структуру ответа `ItemInterface` в cloudbroker/compute |
|
|
||||||
| BGOS-922 | Вычисляемое поле `EnableDefaultGateway` в структуру ответа `ItemVNFInterface` в cloudapi/compute |
|
|
||||||
| BGOS-931 | Структура ответа `SnapRecordCompute` в cloudapi/compute |
|
|
||||||
| BGOS-936 | Вычисляемое поле `NodeID` в структуры ответа `RecordCompute` и `ItemCompute` в cloudapi/compute |
|
|
||||||
|
|
||||||
#### disks
|
#### resmon
|
||||||
| Идентификатор задачи | Описание |
|
| Идентификатор задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-924 | Вычисляемое поле `Ready` в структуру ответа `MigrateStatus` в cloudbroker/disks |
|
| BGOS-947 | Вычисляемое поле `UID` в структуру ответа `GetByNodePoint` в cloudbroker/resmon |
|
||||||
|
| BGOS-947 | Вычисляемые поля `ThreadCount`, `ModelName`, `Flags` и `MaxSupportedGeneration` в структуру ответа `CPUinfoByNode` в cloudbroker/resmon |
|
||||||
|
| BGOS-947 | Вычисляемые поля `UsedGiB` и `TotalGiB` в структуру ответа `ItemStorage` в cloudbroker/resmon |
|
||||||
|
|
||||||
#### grid
|
#### SDN logicalports
|
||||||
| Идентификатор задачи | Описание |
|
| Идентификатор задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-926 | Метод `SetResourcesLimit` и структура запроса `SetResourcesLimitRequest` в cloudbroker/grid |
|
| BGOS-951 | Вычисляемое поле `ExcludeFirewall` в структуру ответа `LogicalPort` в sdn/logicalports |
|
||||||
|
|
||||||
#### kvmx86
|
### Изменено
|
||||||
|
|
||||||
|
#### compute
|
||||||
| Идентификатор задачи | Описание |
|
| Идентификатор задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-937 | Опциональное поле `EnableDefaultGateway` в структуру `Interface` в cloudapi/kvmx86 и cloudbroker/kvmx86 |
|
| BGOS-958 | Тип возвращаемого значения с `string` на `RecordMigrateStorageInfo` в методе `MigrateStorageInfo` в cloudbroker/compute |
|
||||||
| BGOS-937 | Опциональное поле `EnableDefaultGateway` в структуру `InterfaceMassCreate` в cloudbroker/kvmx86 |
|
|
||||||
|
|
||||||
#### node
|
#### resmon
|
||||||
| Идентификатор задачи | Описание |
|
| Идентификатор задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-927 | Вычисляемые поля `ReservedCPU` и `ReservedRAM` в структуры ответа `ItemNode` и `RecordNode` в cloudbroker/node |
|
| BGOS-947 | Тип вычисляемых полей `CPUTime` и `RAMConsumedReal` с `uint64` на `float64` в структуре ответа `ComputeUsage` в cloudbroker/resmon |
|
||||||
| BGOS-928 | Метод `SetResourcesLimit` и структура запроса `SetResourcesLimitRequest` в cloudbroker/node |
|
| BGOS-947 | Тип вычисляемого поля `IsUp` с `uint64` на `bool` в структуре ответа `ComputeUsage` в cloudbroker/resmon |
|
||||||
|
| BGOS-947 | Тип вычисляемого поля `SizeMax` с `float64` на `uint64` в структуре ответа `ItemDisk` в cloudbroker/resmon |
|
||||||
|
| BGOS-947 | Тип вычисляемых полей `CPUPower`, `CPUUtil`, `TotalMem`, `ReservedMem`, `UsedMem` и `FreeMem` с `uint64` на `float64` в структуре ответа `ItemTotalByGRID` в cloudbroker/resmon |
|
||||||
|
| BGOS-947 | Тип вычисляемых полей `PCPU` и `CPUUtil` с `uint64` на `float64` в структуре ответа `NodeUsage` в cloudbroker/resmon |
|
||||||
|
|
||||||
#### vins
|
#### SDN hypervisors
|
||||||
| Идентификатор задачи | Описание |
|
| Идентификатор задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-923 | Опциональное поле `EnableDefaultGateway` в структуры запросов `CreateInAccountRequest` и `CreateInRGRequest` в cloudapi/vins и cloudbroker/vins |
|
| BGOS-956 | Тип возвращаемого значения в методе `Delete` c `bool` на `RecordVersion` в sdn/hypervisors |
|
||||||
| BGOS-923 | Опциональное поле `EnableDefaultGateway` в структуру запроса `UpdateRequest` в cloudbroker/vins |
|
|
||||||
| BGOS-923 | Вычисляемое поле `EnableDefaultGateway` в структуру ответа `RecordVINS` в cloudapi/vins и cloudbroker/vins |
|
|
||||||
| BGOS-923 | Вычисляемое поле `EnableDefaultGateway` в структуру ответа `ItemVINS` в cloudbroker/vins |
|
|
||||||
|
|
||||||
#### zone
|
#### SDN logicalports
|
||||||
| Идентификатор задачи | Описание |
|
| Идентификатор задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-929 | Вычисляемые поля `ReservedCPU` и `ReservedRAM` в структуры ответа `RecordZone` и `ItemZone` в cloudapi/zone и в cloudbroker/zone |
|
| BGOS-951 | Тип опционального поля `LogicalPortAddresses` в структуре запроса `CreateRequest` с `[]LogicalPortAddress` на `[]LogicalPortAddressRequest` в sdn/logicalports |
|
||||||
| BGOS-930 | Метод `SetResourcesLimit` и структура запроса `SetResourcesLimitRequest` в cloudbroker/zone |
|
| BGOS-951 | Тип обязательного поля `IP` в структуре запроса `LogicalPortAddressRequest` с `string` на `interface{}` в sdn/logicalports |
|
||||||
| BGOS-930 | Метод `UpdateCPUAlignmentProfile` и структура запроса `UpdateCPUAlignmentProfileRequest` в cloudbroker/zone |
|
| BGOS-951 | Тип обязательного поля `IsDiscovered` в структуре запроса `UpdateAddress` и `AddAddress` с `bool` на `interface{}` в sdn/logicalports |
|
||||||
|
| BGOS-951 | Тип опционального поля `Labels` в структуре запроса `CreateRequest` с `CreateLabels` на `*CreateLabels` в sdn/logicalports |
|
||||||
|
| BGOS-951 | Тип опционального поля `Labels` в структуре запроса `UpdateRequest` с `UpdateLabels` на `*UpdateLabels` в sdn/logicalports |
|
||||||
|
|
||||||
|
#### SDN netobjgroups
|
||||||
|
| Идентификатор задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-957 | Тип вычисляемого поля `ExternalNetworkPorts` с массива на объект в sdn/netobjgroups |
|
||||||
|
|
||||||
|
### Удалено
|
||||||
|
|
||||||
|
#### resmon
|
||||||
|
| Идентификатор задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-947 | Вычисляемые поля `NodesCPU`, `StorageCapacity` и `VCPUConsumed` из структуры ответа `ItemTotalByGRID` в cloudbroker/resmon |
|
||||||
|
| BGOS-947 | Вычисляемые поля `CapacityLimit`, `Consumed`, `Type` и `UID` из структуры ответа `ItemStorage` в cloudbroker/resmon |
|
||||||
|
|
||||||
|
#### SDN netobjgroups
|
||||||
|
| Идентификатор задачи | Описание |
|
||||||
|
| --- | --- |
|
||||||
|
| BGOS-957 | Вычисляемые поля `Comment`, `Enabled`, `IPv4` и `MAC` в структуре `ExternalNetworkPorts` в структуре ответа `RecordNetObjGroup` в sdn/netobjgroups |
|
||||||
@@ -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()
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -515,6 +515,9 @@ type RecordCompute struct {
|
|||||||
// Registered or not
|
// Registered or not
|
||||||
Registered bool `json:"registered"`
|
Registered bool `json:"registered"`
|
||||||
|
|
||||||
|
// Whether a compute has been resized online
|
||||||
|
ResizedOnline bool `json:"resizedOnline"`
|
||||||
|
|
||||||
// Resource name
|
// Resource name
|
||||||
ResName string `json:"resName"`
|
ResName string `json:"resName"`
|
||||||
|
|
||||||
@@ -1260,6 +1263,9 @@ type SnapshotExtend struct {
|
|||||||
// Label
|
// Label
|
||||||
Label string `json:"label"`
|
Label string `json:"label"`
|
||||||
|
|
||||||
|
// Pool name
|
||||||
|
PoolName string `json:"poolName"`
|
||||||
|
|
||||||
// Reference ID
|
// Reference ID
|
||||||
ReferenceID string `json:"referenceId"`
|
ReferenceID string `json:"referenceId"`
|
||||||
|
|
||||||
@@ -1497,6 +1503,9 @@ type ItemCompute struct {
|
|||||||
// Registered
|
// Registered
|
||||||
Registered bool `json:"registered"`
|
Registered bool `json:"registered"`
|
||||||
|
|
||||||
|
// Whether a compute has been resized online
|
||||||
|
ResizedOnline bool `json:"resizedOnline"`
|
||||||
|
|
||||||
// Resource name
|
// Resource name
|
||||||
ResName string `json:"resName"`
|
ResName string `json:"resName"`
|
||||||
|
|
||||||
|
|||||||
@@ -331,6 +331,10 @@ type ItemSnapshot struct {
|
|||||||
// Label
|
// Label
|
||||||
Label string `json:"label"`
|
Label string `json:"label"`
|
||||||
|
|
||||||
|
// Pool name
|
||||||
|
PoolName string `json:"poolName"`
|
||||||
|
|
||||||
|
// Reference ID
|
||||||
ReferenceID string `json:"referenceId"`
|
ReferenceID string `json:"referenceId"`
|
||||||
|
|
||||||
// Resource ID
|
// Resource ID
|
||||||
|
|||||||
@@ -76,6 +76,10 @@ type CreateRequest struct {
|
|||||||
// SDN access group id
|
// SDN access group id
|
||||||
// Required: false
|
// Required: false
|
||||||
SDNAccessGroupID string `url:"sdn_access_group_id,omitempty" json:"sdn_access_group_id,omitempty"`
|
SDNAccessGroupID string `url:"sdn_access_group_id,omitempty" json:"sdn_access_group_id,omitempty"`
|
||||||
|
|
||||||
|
// Enabling default gateway
|
||||||
|
// Required: false
|
||||||
|
EnableDefaultGateway interface{} `url:"enable_default_gateway,omitempty" json:"enable_default_gateway,omitempty" validate:"omitempty,isBool"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type StoragePolicy struct {
|
type StoragePolicy struct {
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package compute
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
||||||
)
|
)
|
||||||
@@ -16,20 +16,35 @@ type MigrateStorageInfoRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MigrateStorageInfo gets info about last (include ongoing) storage migration
|
// MigrateStorageInfo gets info about last (include ongoing) storage migration
|
||||||
func (c Compute) MigrateStorageInfo(ctx context.Context, req MigrateStorageInfoRequest) (string, error) {
|
func (c Compute) MigrateStorageInfo(ctx context.Context, req MigrateStorageInfoRequest) (*RecordMigrateStorageInfo, error) {
|
||||||
|
res, err := c.MigrateStorageInfoRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := RecordMigrateStorageInfo{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// MigrateStorageInfoRaw gets info about last (include ongoing) storage migration as an array of bytes
|
||||||
|
func (c Compute) MigrateStorageInfoRaw(ctx context.Context, req MigrateStorageInfoRequest) ([]byte, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/compute/migrateStorageInfo"
|
url := "/cloudbroker/compute/migrateStorageInfo"
|
||||||
|
|
||||||
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
result := strings.ReplaceAll(string(res), "\"", "")
|
return res, nil
|
||||||
|
|
||||||
return result, nil
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -370,6 +370,9 @@ type ItemSnapshotDetailed struct {
|
|||||||
// Label
|
// Label
|
||||||
Label string `json:"label"`
|
Label string `json:"label"`
|
||||||
|
|
||||||
|
// Pool name
|
||||||
|
PoolName string `json:"poolName"`
|
||||||
|
|
||||||
// Resource ID
|
// Resource ID
|
||||||
ResID string `json:"resId"`
|
ResID string `json:"resId"`
|
||||||
|
|
||||||
@@ -861,6 +864,9 @@ type InfoCompute struct {
|
|||||||
// Registered
|
// Registered
|
||||||
Registered bool `json:"registered"`
|
Registered bool `json:"registered"`
|
||||||
|
|
||||||
|
// Whether a compute has been resized online
|
||||||
|
ResizedOnline bool `json:"resizedOnline"`
|
||||||
|
|
||||||
// Resource name
|
// Resource name
|
||||||
ResName string `json:"resName"`
|
ResName string `json:"resName"`
|
||||||
|
|
||||||
@@ -1163,6 +1169,9 @@ type RecordCompute struct {
|
|||||||
// Registered
|
// Registered
|
||||||
Registered bool `json:"registered"`
|
Registered bool `json:"registered"`
|
||||||
|
|
||||||
|
// Whether a compute has been resized online
|
||||||
|
ResizedOnline bool `json:"resizedOnline"`
|
||||||
|
|
||||||
// Resource name
|
// Resource name
|
||||||
ResName string `json:"resName"`
|
ResName string `json:"resName"`
|
||||||
|
|
||||||
@@ -1517,6 +1526,405 @@ type MigrateStorageItem struct {
|
|||||||
TargetNodeID uint64 `json:"targetNodeId"`
|
TargetNodeID uint64 `json:"targetNodeId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Info about last (including ongoing) storage migration
|
||||||
|
type RecordMigrateStorageInfo struct {
|
||||||
|
// Migration completion status
|
||||||
|
Completed bool `json:"completed"`
|
||||||
|
|
||||||
|
// Daemon address
|
||||||
|
DaemonAddr string `json:"daemonAddr"`
|
||||||
|
|
||||||
|
// Domain name
|
||||||
|
DomainName string `json:"domainName"`
|
||||||
|
|
||||||
|
// Domain UUID
|
||||||
|
DomainUUID string `json:"domainUUID"`
|
||||||
|
|
||||||
|
// Elapsed time
|
||||||
|
ElapsedTime uint64 `json:"elapsedTime"`
|
||||||
|
|
||||||
|
// GID
|
||||||
|
GID uint64 `json:"gid"`
|
||||||
|
|
||||||
|
// GUID
|
||||||
|
GUID uint64 `json:"guid"`
|
||||||
|
|
||||||
|
// ID
|
||||||
|
ID uint64 `json:"id"`
|
||||||
|
|
||||||
|
// List interfaces
|
||||||
|
Interfaces []ItemShadowComputeInterface `json:"interfaces"`
|
||||||
|
|
||||||
|
// Log
|
||||||
|
Log []string `json:"log"`
|
||||||
|
|
||||||
|
// New disk XMLs
|
||||||
|
NewDiskXmls []string `json:"newDiskXmls"`
|
||||||
|
|
||||||
|
// New disks
|
||||||
|
NewDisks []uint64 `json:"newDisks"`
|
||||||
|
|
||||||
|
// Old disks
|
||||||
|
OldDisks []uint64 `json:"oldDisks"`
|
||||||
|
|
||||||
|
// PID
|
||||||
|
PID uint64 `json:"pid"`
|
||||||
|
|
||||||
|
// Source node ID
|
||||||
|
SourceNodeID uint64 `json:"sourceNodeId"`
|
||||||
|
|
||||||
|
// Source numa node ID
|
||||||
|
SourceNumaNodeID int64 `json:"sourceNumaNodeId"`
|
||||||
|
|
||||||
|
// Source reserved node CPUs
|
||||||
|
SourceReservedNodeCpus []uint64 `json:"sourceReservedNodeCpus"`
|
||||||
|
|
||||||
|
// Source URL
|
||||||
|
SourceURL string `json:"sourceURL"`
|
||||||
|
|
||||||
|
// Status
|
||||||
|
Status string `json:"status"`
|
||||||
|
|
||||||
|
// Target shadow compute
|
||||||
|
TargetShadowCompute ShadowCompute `json:"target_shadow_compute"`
|
||||||
|
|
||||||
|
// Target node ID
|
||||||
|
TargetNodeID uint64 `json:"targetNodeId"`
|
||||||
|
|
||||||
|
// Target URL
|
||||||
|
TargetURL string `json:"targetURL"`
|
||||||
|
|
||||||
|
// VM log directory
|
||||||
|
VMLogDir string `json:"vmlogDir"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Shadow compute created for the duration of a storage migration
|
||||||
|
type ShadowCompute struct {
|
||||||
|
// Account ID
|
||||||
|
AccountID uint64 `json:"accountId"`
|
||||||
|
|
||||||
|
// Access Control List
|
||||||
|
ACL []interface{} `json:"acl"`
|
||||||
|
|
||||||
|
// Affinity label
|
||||||
|
AffinityLabel string `json:"affinityLabel"`
|
||||||
|
|
||||||
|
// Affinity rules
|
||||||
|
AffinityRules ListShadowComputeRules `json:"affinityRules"`
|
||||||
|
|
||||||
|
// Affinity weight
|
||||||
|
AffinityWeight uint64 `json:"affinityWeight"`
|
||||||
|
|
||||||
|
// Anti affinity rules
|
||||||
|
AntiAffinityRules ListShadowComputeRules `json:"antiAffinityRules"`
|
||||||
|
|
||||||
|
// Architecture
|
||||||
|
Arch string `json:"arch"`
|
||||||
|
|
||||||
|
// Auto start when node restarted
|
||||||
|
AutoStart bool `json:"autoStart"`
|
||||||
|
|
||||||
|
// Boot image ID
|
||||||
|
BootImageID uint64 `json:"boot_image_id"`
|
||||||
|
|
||||||
|
// Boot order
|
||||||
|
BootOrder []string `json:"bootOrder"`
|
||||||
|
|
||||||
|
// Boot type
|
||||||
|
BootType string `json:"bootType"`
|
||||||
|
|
||||||
|
// Boot disk size
|
||||||
|
BootDiskSize uint64 `json:"bootdiskSize"`
|
||||||
|
|
||||||
|
// CD Image ID
|
||||||
|
CDImageID uint64 `json:"cdImageId"`
|
||||||
|
|
||||||
|
// Chipset
|
||||||
|
Chipset string `json:"chipset"`
|
||||||
|
|
||||||
|
// Clone reference
|
||||||
|
CloneReference uint64 `json:"cloneReference"`
|
||||||
|
|
||||||
|
// List clone IDs
|
||||||
|
Clones []uint64 `json:"clones"`
|
||||||
|
|
||||||
|
// Compute CI ID
|
||||||
|
ComputeCIID uint64 `json:"computeciId"`
|
||||||
|
|
||||||
|
// CPU pin
|
||||||
|
CPUPin bool `json:"cpupin"`
|
||||||
|
|
||||||
|
// Number of CPU
|
||||||
|
CPUs uint64 `json:"cpus"`
|
||||||
|
|
||||||
|
// Custom fields
|
||||||
|
CustomFields map[string]interface{} `json:"customFields"`
|
||||||
|
|
||||||
|
// Description
|
||||||
|
Description string `json:"desc"`
|
||||||
|
|
||||||
|
// Devices
|
||||||
|
Devices interface{} `json:"devices"`
|
||||||
|
|
||||||
|
// List disks
|
||||||
|
Disks []ItemShadowComputeDisk `json:"disks"`
|
||||||
|
|
||||||
|
// Driver
|
||||||
|
Driver string `json:"driver"`
|
||||||
|
|
||||||
|
// GID
|
||||||
|
GID uint64 `json:"gid"`
|
||||||
|
|
||||||
|
// GUID
|
||||||
|
GUID uint64 `json:"guid"`
|
||||||
|
|
||||||
|
// HPBacked
|
||||||
|
HPBacked bool `json:"hpBacked"`
|
||||||
|
|
||||||
|
// Hot resize
|
||||||
|
HotResize bool `json:"hotResize"`
|
||||||
|
|
||||||
|
// ID
|
||||||
|
ID uint64 `json:"id"`
|
||||||
|
|
||||||
|
// List interfaces
|
||||||
|
Interfaces []ItemShadowComputeInterface `json:"interfaces"`
|
||||||
|
|
||||||
|
// Live migration job ID
|
||||||
|
LiveMigrationJobID uint64 `json:"live_migration_job_id"`
|
||||||
|
|
||||||
|
// Loader type
|
||||||
|
LoaderType string `json:"loaderType"`
|
||||||
|
|
||||||
|
// Lock status
|
||||||
|
LockStatus string `json:"lockStatus"`
|
||||||
|
|
||||||
|
// Manager ID
|
||||||
|
ManagerID uint64 `json:"managerId"`
|
||||||
|
|
||||||
|
// Manager type
|
||||||
|
ManagerType string `json:"managerType"`
|
||||||
|
|
||||||
|
// Migration job
|
||||||
|
MigrationJob uint64 `json:"migrationjob"`
|
||||||
|
|
||||||
|
// Milestones
|
||||||
|
Milestones uint64 `json:"milestones"`
|
||||||
|
|
||||||
|
// Name
|
||||||
|
Name string `json:"name"`
|
||||||
|
|
||||||
|
// Need reboot
|
||||||
|
NeedReboot bool `json:"needReboot"`
|
||||||
|
|
||||||
|
// Network interface naming
|
||||||
|
NetworkInterfaceNaming string `json:"networkInterfaceNaming"`
|
||||||
|
|
||||||
|
// Node ID
|
||||||
|
NodeID uint64 `json:"node_id"`
|
||||||
|
|
||||||
|
// NumaAffinity
|
||||||
|
NumaAffinity string `json:"numaAffinity"`
|
||||||
|
|
||||||
|
// NumaNodeId
|
||||||
|
NumaNodeID int64 `json:"numaNodeId"`
|
||||||
|
|
||||||
|
// List OS users
|
||||||
|
OSUsers ListOSUsers `json:"osUsers"`
|
||||||
|
|
||||||
|
// Name of OS
|
||||||
|
OSVersion string `json:"os_version"`
|
||||||
|
|
||||||
|
// Pinned to node
|
||||||
|
PinnedToNode int64 `json:"pinnedToNode"`
|
||||||
|
|
||||||
|
// Preferred CPU
|
||||||
|
PreferredCPU []int64 `json:"preferredCpu"`
|
||||||
|
|
||||||
|
// Qemu guest
|
||||||
|
QemuGuest QemuQuest `json:"qemu_guest"`
|
||||||
|
|
||||||
|
// ReadOnly indicates read-only mode state
|
||||||
|
ReadOnly bool `json:"read_only"`
|
||||||
|
|
||||||
|
// Number of RAM
|
||||||
|
RAM uint64 `json:"ram"`
|
||||||
|
|
||||||
|
// Reference ID
|
||||||
|
ReferenceID string `json:"referenceId"`
|
||||||
|
|
||||||
|
// Reserved node CPUs
|
||||||
|
ReservedNodeCpus []uint64 `json:"reservedNodeCpus"`
|
||||||
|
|
||||||
|
// Resized online
|
||||||
|
ResizedOnline bool `json:"resizedOnline"`
|
||||||
|
|
||||||
|
// Resource name
|
||||||
|
ResName string `json:"resName"`
|
||||||
|
|
||||||
|
// Resource group ID
|
||||||
|
RGID uint64 `json:"rgId"`
|
||||||
|
|
||||||
|
// SnapSets
|
||||||
|
SnapSets ListShadowComputeSnapshots `json:"snapSets"`
|
||||||
|
|
||||||
|
// Stateless SEP ID
|
||||||
|
StatelessSEPID int64 `json:"statelessSepId"`
|
||||||
|
|
||||||
|
// Stateless SEP type
|
||||||
|
StatelessSEPType string `json:"statelessSepType"`
|
||||||
|
|
||||||
|
// Status
|
||||||
|
Status string `json:"status"`
|
||||||
|
|
||||||
|
// Tags
|
||||||
|
Tags map[string]interface{} `json:"tags"`
|
||||||
|
|
||||||
|
// Tech status
|
||||||
|
TechStatus string `json:"techStatus"`
|
||||||
|
|
||||||
|
// User managed
|
||||||
|
UserManaged bool `json:"userManaged"`
|
||||||
|
|
||||||
|
// Userdata
|
||||||
|
Userdata interface{} `json:"userdata"`
|
||||||
|
|
||||||
|
// List VGPU IDs
|
||||||
|
VGPUs []uint64 `json:"vgpus"`
|
||||||
|
|
||||||
|
// VNC password
|
||||||
|
VNCPassword string `json:"vncPasswd"`
|
||||||
|
|
||||||
|
// Zone ID
|
||||||
|
ZoneID uint64 `json:"zoneId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disk of a shadow compute
|
||||||
|
type ItemShadowComputeDisk struct {
|
||||||
|
// ID
|
||||||
|
ID uint64 `json:"id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Affinity/anti-affinity rule of a shadow compute
|
||||||
|
type ItemShadowComputeRule struct {
|
||||||
|
// Key
|
||||||
|
Key string `json:"key"`
|
||||||
|
|
||||||
|
// Mode
|
||||||
|
Mode string `json:"mode"`
|
||||||
|
|
||||||
|
// Policy
|
||||||
|
Policy string `json:"policy"`
|
||||||
|
|
||||||
|
// Topology
|
||||||
|
Topology string `json:"topology"`
|
||||||
|
|
||||||
|
// Value
|
||||||
|
Value string `json:"value"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// List of shadow compute affinity/anti-affinity rules
|
||||||
|
type ListShadowComputeRules []ItemShadowComputeRule
|
||||||
|
|
||||||
|
// Snapshot of a shadow compute
|
||||||
|
type ItemShadowComputeSnapshot struct {
|
||||||
|
// List of disk IDs
|
||||||
|
Disks []uint64 `json:"disks"`
|
||||||
|
|
||||||
|
// GUID
|
||||||
|
GUID string `json:"guid"`
|
||||||
|
|
||||||
|
// Label
|
||||||
|
Label string `json:"label"`
|
||||||
|
|
||||||
|
// Timestamp
|
||||||
|
Timestamp uint64 `json:"timestamp"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// List of shadow compute snapshots
|
||||||
|
type ListShadowComputeSnapshots []ItemShadowComputeSnapshot
|
||||||
|
|
||||||
|
// Network interface of a shadow compute
|
||||||
|
type ItemShadowComputeInterface struct {
|
||||||
|
// Name
|
||||||
|
Name string `json:"name"`
|
||||||
|
|
||||||
|
// Target
|
||||||
|
Target string `json:"target"`
|
||||||
|
|
||||||
|
// PCI slot
|
||||||
|
PCISlot int64 `json:"pciSlot"`
|
||||||
|
|
||||||
|
// Bus number
|
||||||
|
BusNumber int64 `json:"bus_number"`
|
||||||
|
|
||||||
|
// MAC
|
||||||
|
MAC string `json:"mac"`
|
||||||
|
|
||||||
|
// Maximum transmission unit
|
||||||
|
MTU int64 `json:"mtu"`
|
||||||
|
|
||||||
|
// Type
|
||||||
|
Type string `json:"type"`
|
||||||
|
|
||||||
|
// Connection type
|
||||||
|
ConnType string `json:"connType"`
|
||||||
|
|
||||||
|
// Connection ID
|
||||||
|
ConnID uint64 `json:"connId"`
|
||||||
|
|
||||||
|
// FLIPGroup ID
|
||||||
|
FLIPGroupID uint64 `json:"flipgroupId"`
|
||||||
|
|
||||||
|
// Network type
|
||||||
|
NetType string `json:"netType"`
|
||||||
|
|
||||||
|
// Network ID
|
||||||
|
NetID uint64 `json:"netId"`
|
||||||
|
|
||||||
|
// IP address
|
||||||
|
IPAddress string `json:"ipAddress"`
|
||||||
|
|
||||||
|
// Network mask
|
||||||
|
NetMask int64 `json:"netMask"`
|
||||||
|
|
||||||
|
// Default GW
|
||||||
|
DefGW string `json:"defGw"`
|
||||||
|
|
||||||
|
// List of VNF IDs
|
||||||
|
VNFs []uint64 `json:"vnfs"`
|
||||||
|
|
||||||
|
// QOS
|
||||||
|
QOS QOS `json:"qos"`
|
||||||
|
|
||||||
|
// Libvirt settings
|
||||||
|
LibvirtSettings LibvirtSettings `json:"libvirtSettings"`
|
||||||
|
|
||||||
|
// GUID
|
||||||
|
GUID string `json:"guid"`
|
||||||
|
|
||||||
|
// Listen SSH or not
|
||||||
|
ListenSSH bool `json:"listenSsh"`
|
||||||
|
|
||||||
|
// Enabled
|
||||||
|
Enabled bool `json:"enabled"`
|
||||||
|
|
||||||
|
// Node ID
|
||||||
|
NodeID uint64 `json:"nodeId"`
|
||||||
|
|
||||||
|
// SDN interface ID
|
||||||
|
SDNInterfaceID string `json:"sdn_interface_id"`
|
||||||
|
|
||||||
|
// List of security groups
|
||||||
|
SecGroups []uint64 `json:"security_groups"`
|
||||||
|
|
||||||
|
// Enable security groups
|
||||||
|
EnableSecGroups bool `json:"enable_secgroups"`
|
||||||
|
|
||||||
|
// Trunk tags
|
||||||
|
TrunkTags []int64 `json:"trunk_tags"`
|
||||||
|
}
|
||||||
|
|
||||||
type RecordCloneAbort struct {
|
type RecordCloneAbort struct {
|
||||||
// Disk ID
|
// Disk ID
|
||||||
DiskID uint64 `json:"disk_id"`
|
DiskID uint64 `json:"disk_id"`
|
||||||
|
|||||||
@@ -309,6 +309,9 @@ type ItemSnapshot struct {
|
|||||||
// Label
|
// Label
|
||||||
Label string `json:"label"`
|
Label string `json:"label"`
|
||||||
|
|
||||||
|
// Pool name
|
||||||
|
PoolName string `json:"poolName"`
|
||||||
|
|
||||||
// Reference ID
|
// Reference ID
|
||||||
ReferenceID string `json:"referenceId"`
|
ReferenceID string `json:"referenceId"`
|
||||||
|
|
||||||
|
|||||||
@@ -100,6 +100,12 @@ type RecordGrid struct {
|
|||||||
// Network modes
|
// Network modes
|
||||||
NetworkModes []string `json:"network_modes"`
|
NetworkModes []string `json:"network_modes"`
|
||||||
|
|
||||||
|
// Reserved CPU
|
||||||
|
ReservedCPU uint64 `json:"reserved_cpu"`
|
||||||
|
|
||||||
|
// Reserved RAM
|
||||||
|
ReservedRAM uint64 `json:"reserved_ram"`
|
||||||
|
|
||||||
// SDN support
|
// SDN support
|
||||||
SDNSupport bool `json:"sdn_support"`
|
SDNSupport bool `json:"sdn_support"`
|
||||||
|
|
||||||
@@ -139,6 +145,12 @@ type ItemGridList struct {
|
|||||||
// Network modes
|
// Network modes
|
||||||
NetworkModes []string `json:"network_modes"`
|
NetworkModes []string `json:"network_modes"`
|
||||||
|
|
||||||
|
// Reserved CPU
|
||||||
|
ReservedCPU uint64 `json:"reserved_cpu"`
|
||||||
|
|
||||||
|
// Reserved RAM
|
||||||
|
ReservedRAM uint64 `json:"reserved_ram"`
|
||||||
|
|
||||||
// SDN support
|
// SDN support
|
||||||
SDNSupport bool `json:"sdn_support"`
|
SDNSupport bool `json:"sdn_support"`
|
||||||
|
|
||||||
@@ -175,15 +187,6 @@ type RecordSettingsGrid struct {
|
|||||||
//Cleanup retention period
|
//Cleanup retention period
|
||||||
CleanupRetentionPeriod uint64 `json:"cleanupRetentionPeriod"`
|
CleanupRetentionPeriod uint64 `json:"cleanupRetentionPeriod"`
|
||||||
|
|
||||||
// CPU allocation ratio
|
|
||||||
CPUAllocationRatio uint64 `json:"cpu_allocation_ratio"`
|
|
||||||
|
|
||||||
// CPU allocation ratio for VMs
|
|
||||||
CPUAllocationRatioVM uint64 `json:"cpu_allocation_ratio_vm"`
|
|
||||||
|
|
||||||
// Custom backup path
|
|
||||||
CustomBackupPath []string `json:"custom_backup_path"`
|
|
||||||
|
|
||||||
//Docker registry
|
//Docker registry
|
||||||
DockerRegistry DockerRegistry `json:"docker_registry"`
|
DockerRegistry DockerRegistry `json:"docker_registry"`
|
||||||
|
|
||||||
@@ -214,9 +217,6 @@ type RecordSettingsGrid struct {
|
|||||||
//Net QOS
|
//Net QOS
|
||||||
NetQOS NetQOS `json:"net_qos"`
|
NetQOS NetQOS `json:"net_qos"`
|
||||||
|
|
||||||
//Networks
|
|
||||||
Networks string `json:"networks"`
|
|
||||||
|
|
||||||
// Node self stop timer uptime monitor
|
// Node self stop timer uptime monitor
|
||||||
NodeSelfStopTimerUptimeMonitor uint64 `json:"nodeSelfStopTimerUptimeMonitor"`
|
NodeSelfStopTimerUptimeMonitor uint64 `json:"nodeSelfStopTimerUptimeMonitor"`
|
||||||
|
|
||||||
|
|||||||
@@ -209,6 +209,9 @@ type ItemNode struct {
|
|||||||
// Last check
|
// Last check
|
||||||
LastCheck uint64 `json:"lastcheck"`
|
LastCheck uint64 `json:"lastcheck"`
|
||||||
|
|
||||||
|
// Machine ID
|
||||||
|
MachineID string `json:"machine_id"`
|
||||||
|
|
||||||
// Machine GUID
|
// Machine GUID
|
||||||
MachineGUID string `json:"machineguid"`
|
MachineGUID string `json:"machineguid"`
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type GetByNodeRequest struct {
|
type GetByNodeRequest struct {
|
||||||
// Node ID
|
// Node ID
|
||||||
// Required: true
|
// Required: true
|
||||||
NodeID uint64 `url:"nodeId" json:"nodeId" validate:"required"`
|
NodeID uint64 `url:"node_id" json:"node_id" validate:"required"`
|
||||||
|
|
||||||
// Start of time period - unixtime
|
// Start of time period - unixtime
|
||||||
// Required: false
|
// Required: false
|
||||||
|
|||||||
@@ -16,15 +16,15 @@ type GetByComputePoint struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ComputeUsage struct {
|
type ComputeUsage struct {
|
||||||
VCPUsConsumed uint64 `json:"vcpusConsumed"`
|
VCPUsConsumed uint64 `json:"vcpusConsumed"`
|
||||||
Storage uint64 `json:"storage"`
|
Storage uint64 `json:"storage"`
|
||||||
CPUTime uint64 `json:"cpuTime"`
|
CPUTime float64 `json:"cpuTime"`
|
||||||
ExtIPs uint64 `json:"extips"`
|
ExtIPs uint64 `json:"extips"`
|
||||||
RAMConsumed uint64 `json:"ramConsumed"`
|
RAMConsumed uint64 `json:"ramConsumed"`
|
||||||
VCPUsReserved uint64 `json:"vcpusReserved"`
|
VCPUsReserved uint64 `json:"vcpusReserved"`
|
||||||
IsUp uint64 `json:"isUp"`
|
IsUp bool `json:"isUp"`
|
||||||
RAMConsumedReal uint64 `json:"ramConsumedReal"`
|
RAMConsumedReal float64 `json:"ramConsumedReal"`
|
||||||
RAMReserved uint64 `json:"ramReserved"`
|
RAMReserved uint64 `json:"ramReserved"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ItemDisk struct {
|
type ItemDisk struct {
|
||||||
@@ -33,7 +33,7 @@ type ItemDisk struct {
|
|||||||
ResID string `json:"resId"`
|
ResID string `json:"resId"`
|
||||||
SizeUsed float64 `json:"sizeUsed"`
|
SizeUsed float64 `json:"sizeUsed"`
|
||||||
SizeAvailable float64 `json:"sizeAvailable"`
|
SizeAvailable float64 `json:"sizeAvailable"`
|
||||||
SizeMax float64 `json:"sizeMax"`
|
SizeMax uint64 `json:"sizeMax"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetByGRIDData represents an array of data points
|
// GetByGRIDData represents an array of data points
|
||||||
@@ -46,22 +46,17 @@ type GetByGRIDPoint struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ItemTotalByGRID struct {
|
type ItemTotalByGRID struct {
|
||||||
NodesCPU uint64 `json:"nodesCPU"`
|
CPUPower float64 `json:"cpuPower"`
|
||||||
StorageCapacity uint64 `json:"storageCapacity"`
|
CPUUtil float64 `json:"cpuUtil"`
|
||||||
CPUPower uint64 `json:"cpuPower"`
|
TotalMem float64 `json:"totalMem"`
|
||||||
CPUUtil uint64 `json:"cpuUtil"`
|
ReservedMem float64 `json:"reservedMem"`
|
||||||
TotalMem uint64 `json:"totalMem"`
|
UsedMem float64 `json:"usedMem"`
|
||||||
ReservedMem uint64 `json:"reservedMem"`
|
FreeMem float64 `json:"freeMem"`
|
||||||
UsedMem uint64 `json:"usedMem"`
|
|
||||||
FreeMem uint64 `json:"freeMem"`
|
|
||||||
VCPUConsumed uint64 `json:"vcpuConsumed"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type ItemStorage struct {
|
type ItemStorage struct {
|
||||||
CapacityLimit uint64 `json:"capacityLimit"`
|
UsedGiB uint64 `json:"usedGiB"`
|
||||||
Consumed uint64 `json:"consumed"`
|
TotalGiB uint64 `json:"totalGiB"`
|
||||||
Type string `json:"type"`
|
|
||||||
UID string `json:"uid"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetByNodeData represents an array of data points
|
// GetByNodeData represents an array of data points
|
||||||
@@ -72,20 +67,25 @@ type GetByNodePoint struct {
|
|||||||
CPUInfo CPUinfoByNode `json:"cpuInfo"`
|
CPUInfo CPUinfoByNode `json:"cpuInfo"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
ID uint64 `json:"id"`
|
ID uint64 `json:"id"`
|
||||||
|
UID string `json:"uid"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type NodeUsage struct {
|
type NodeUsage struct {
|
||||||
CPUPower uint64 `json:"cpuPower"`
|
CPUPower uint64 `json:"cpuPower"`
|
||||||
UsedVCPUs uint64 `json:"usedVcpus"`
|
UsedVCPUs uint64 `json:"usedVcpus"`
|
||||||
PCPU uint64 `json:"pcpu"`
|
PCPU float64 `json:"pcpu"`
|
||||||
UsedMem uint64 `json:"usedMem"`
|
UsedMem uint64 `json:"usedMem"`
|
||||||
CPUUtil uint64 `json:"cpuUtil"`
|
CPUUtil float64 `json:"cpuUtil"`
|
||||||
ReservedMem uint64 `json:"reservedMem"`
|
ReservedMem uint64 `json:"reservedMem"`
|
||||||
FreeMem uint64 `json:"freeMem"`
|
FreeMem uint64 `json:"freeMem"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CPUinfoByNode struct {
|
type CPUinfoByNode struct {
|
||||||
ClockSpeed uint64 `json:"clockSpeed"`
|
ClockSpeed uint64 `json:"clockSpeed"`
|
||||||
CoreCount uint64 `json:"coreCount"`
|
CoreCount uint64 `json:"coreCount"`
|
||||||
PhysCount uint64 `json:"physCount"`
|
PhysCount uint64 `json:"physCount"`
|
||||||
|
ThreadCount uint64 `json:"threadCount"`
|
||||||
|
ModelName string `json:"model_name"`
|
||||||
|
Flags []string `json:"flags"`
|
||||||
|
MaxSupportedGeneration string `json:"max_supported_generation"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,6 +81,10 @@ type CreateRequest struct {
|
|||||||
// SDN access group id
|
// SDN access group id
|
||||||
// Required: false
|
// Required: false
|
||||||
SDNAccessGroupID string `url:"sdn_access_group_id,omitempty" json:"sdn_access_group_id,omitempty"`
|
SDNAccessGroupID string `url:"sdn_access_group_id,omitempty" json:"sdn_access_group_id,omitempty"`
|
||||||
|
|
||||||
|
// Enabling default gateway
|
||||||
|
// Required: false
|
||||||
|
EnableDefaultGateway interface{} `url:"enable_default_gateway,omitempty" json:"enable_default_gateway,omitempty" validate:"omitempty,isBool"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type StoragePolicy struct {
|
type StoragePolicy struct {
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package hypervisors
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/constants"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/constants"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
||||||
@@ -17,27 +17,21 @@ type DeleteRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete a hypervisor
|
// Delete a hypervisor
|
||||||
func (hv Hypervisors) Delete(ctx context.Context, req DeleteRequest) (bool, error) {
|
func (hv Hypervisors) Delete(ctx context.Context, req DeleteRequest) (*RecordVersion, 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 := "/sdn/hypervisor/delete"
|
url := "/sdn/hypervisor/delete"
|
||||||
|
|
||||||
res, err := hv.client.DecortApiCallCtype(ctx, http.MethodDelete, url, constants.MIMEJSON, req)
|
res, err := hv.client.DecortApiCallCtype(ctx, http.MethodDelete, url, constants.MIMEJSON, req)
|
||||||
|
info := RecordVersion{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if string(res) == "" {
|
return &info, nil
|
||||||
return true, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
result, err := strconv.ParseBool(string(res))
|
|
||||||
if err != nil {
|
|
||||||
return false, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return result, nil
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
package hypervisors
|
package hypervisors
|
||||||
|
|
||||||
|
// Information about a version
|
||||||
|
type RecordVersion struct {
|
||||||
|
// Version ID
|
||||||
|
VersionID uint64 `json:"version_id"`
|
||||||
|
}
|
||||||
|
|
||||||
// Main information about hypervisor
|
// Main information about hypervisor
|
||||||
type RecordHypervisor struct {
|
type RecordHypervisor struct {
|
||||||
// Created at
|
// Created at
|
||||||
|
|||||||
@@ -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: true
|
|
||||||
IsDiscovered bool `url:"is_discovered" json:"is_discovered" validate:"required"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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,7 +67,7 @@ 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
|
||||||
@@ -86,7 +86,7 @@ type UpdateAddress struct {
|
|||||||
|
|
||||||
// Is discovered. True or False
|
// Is discovered. True or False
|
||||||
// Required: true
|
// Required: true
|
||||||
IsDiscovered bool `url:"is_discovered" json:"is_discovered" validate:"required"`
|
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
|
||||||
@@ -107,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: true
|
// Required: true
|
||||||
IsDiscovered bool `url:"is_discovered" json:"is_discovered" validate:"required"`
|
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"`
|
||||||
|
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ type L2ExternalNetwork struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Info about an external network port
|
// Info about an external network port
|
||||||
type ExternalNetworkPort struct {
|
type ExternalNetworkPorts struct {
|
||||||
// Access group ID
|
// Access group ID
|
||||||
AccessGroupID string `json:"access_group_id"`
|
AccessGroupID string `json:"access_group_id"`
|
||||||
|
|
||||||
@@ -192,9 +192,6 @@ type ExternalNetworkPort struct {
|
|||||||
// Bridge network name
|
// Bridge network name
|
||||||
BridgeNetworkName string `json:"bridge_network_name"`
|
BridgeNetworkName string `json:"bridge_network_name"`
|
||||||
|
|
||||||
// Comment
|
|
||||||
Comment string `json:"comment"`
|
|
||||||
|
|
||||||
// Default gateway for IPv4
|
// Default gateway for IPv4
|
||||||
DefaultGatewayIPv4 string `json:"default_gateway_ipv4"`
|
DefaultGatewayIPv4 string `json:"default_gateway_ipv4"`
|
||||||
|
|
||||||
@@ -204,9 +201,6 @@ type ExternalNetworkPort struct {
|
|||||||
// Description
|
// Description
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
|
|
||||||
// Is a logical port enabled
|
|
||||||
Enabled bool `json:"enabled"`
|
|
||||||
|
|
||||||
// Details of external network ports
|
// Details of external network ports
|
||||||
ExternalNetworkPorts ExternalNetworkPortsField `json:"external_network_ports"`
|
ExternalNetworkPorts ExternalNetworkPortsField `json:"external_network_ports"`
|
||||||
|
|
||||||
@@ -216,9 +210,6 @@ type ExternalNetworkPort struct {
|
|||||||
// ID of an external network port
|
// ID of an external network port
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
|
|
||||||
// IP v4
|
|
||||||
IPv4 string `json:"ipv4"`
|
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
Status Status `json:"status"`
|
Status Status `json:"status"`
|
||||||
|
|
||||||
@@ -239,14 +230,8 @@ type ExternalNetworkPort struct {
|
|||||||
|
|
||||||
// VLAN Tag
|
// VLAN Tag
|
||||||
VLANTag int `json:"vlan_tag"`
|
VLANTag int `json:"vlan_tag"`
|
||||||
|
|
||||||
// MAC
|
|
||||||
MAC string `json:"mac"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of external network ports
|
|
||||||
type ExternalNetworkPorts []ExternalNetworkPort
|
|
||||||
|
|
||||||
// Info about a logical port
|
// Info about a logical port
|
||||||
type LogicalPort struct {
|
type LogicalPort struct {
|
||||||
// ID
|
// ID
|
||||||
|
|||||||
Reference in New Issue
Block a user