v1.16.6
v1.16.6
This commit is contained in:
82
CHANGELOG.md
82
CHANGELOG.md
@@ -1,4 +1,4 @@
|
||||
## Version 1.16.5
|
||||
## Version 1.16.6
|
||||
|
||||
|
||||
### Deprecated
|
||||
@@ -17,68 +17,82 @@
|
||||
| `rg/AccessGrant` | :heavy_check_mark: | :heavy_check_mark: |
|
||||
| `rg/AccessRevoke` | :heavy_check_mark: | :heavy_check_mark: |
|
||||
| `sep/ConfigFieldEdit` | :x: | :heavy_check_mark: |
|
||||
| `apiaccess/userList` | :x: | :heavy_check_mark: |
|
||||
|
||||
|
||||
### Добавлено
|
||||
|
||||
#### apiaccess
|
||||
| Идентификатор задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-1091 | Опциональное поле `UserID` в структуру запроса `ListRequest` в cloudbroker/apiaccess |
|
||||
|
||||
#### audit
|
||||
| Идентификатор задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-1072 | Вычисляемые поля `ResgroupID`, `AccountID`, `ComputeID`, `VINSID`, `ServiceID`, `K8SID`, `FLIPGroupID`, `LBID`, `SEPID`, `NodeIDs`, `DiskIDs` и `APITask` в структуру ответа `ItemAudit` в cloudapi/audit |
|
||||
| BGOS-1072 | Вычисляемые поля `ResgroupID`, `AccountID`, `ComputeID`, `VINSID`, `ServiceID`, `K8SID`, `FLIPGroupID`, `LBID`, `SEPID`, `NodeIDs`, `DiskIDs` и `APITask` в структуру ответа `ItemAudit` в cloudbroker/audit |
|
||||
|
||||
#### compute
|
||||
| Идентификатор задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-1069 | Вычисляемое поле `FolderID` в структуры ответа `RecordCompute` и `ItemCompute` в cloudapi/compute |
|
||||
| BGOS-1069 | Вычисляемое поле `FolderID` в структуры ответа `RecordCompute` и `InfoCompute` в cloudapi/compute |
|
||||
| BGOS-1068 | Структуры ответа `MigrationReport`, `MigrationReportItem`, `AffinityRuleAddResult` и `AntiAffinityRuleAddResult` в cloudapi/compute |
|
||||
| BGOS-1068 | Структуры ответа `MigrationReport`, `MigrationReportItem`, `AffinityRuleAddResult` и `AntiAffinityRuleAddResult` в cloudbroker/compute |
|
||||
| BGOS-1063 | Структуры запроса `MigrateV2Request`, `MigrateV2AbortRequest`, `MigrateV2CleanupRequest`, `MigrateV2GetRequest`, `MigrateV2ListRequest` и `MigrateV2ResolveRequest` и методы `MigrateV2`, `MigrateV2Abort`, `MigrateV2Cleanup`, `MigrateV2Get`, `MigrateV2List` и `MigrateV2ResolveRequest` в cloudbroker/compute |
|
||||
| BGOS-1088 | Опциональные поля `DiskID` и `VMFolderID` в структуру запроса `ListRequest` в cloudapi/audit |
|
||||
| BGOS-1088 | Опциональные поля `DiskID` и `VMFolderID` в структуру запроса `ListRequest` в cloudbroker/audit |
|
||||
|
||||
#### extnet
|
||||
| Идентификатор задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-1073 | Вычисляемое поле `AutoAssignable` в структуру ответа `ItemReservation` в cloudapi/extnet |
|
||||
| BGOS-1073 | Вычисляемые поля `AccountID` и `AutoAssignable` в структуру ответа `Excluded` в cloudapi/extnet |
|
||||
| BGOS-1073 | Вычисляемое поле `AutoAssignable` в структуру ответа `ItemReservation` в cloudbroker/extnet |
|
||||
| BGOS-1092 | Метод `EnableAsync` в cloudbroker/extnet |
|
||||
|
||||
#### grid
|
||||
#### node
|
||||
| Идентификатор задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-1074 | Вычисляемое поле `VMFoldersEnabled` в структуры ответа `RecordGrid` и `ItemGridList` в cloudbroker/grid |
|
||||
| BGOS-1065 | Структура запроса `RemoveSSHIdentityRequest` и метод `RemoveSSHIdentity` в cloudbroker/node |
|
||||
| BGOS-1101 | Вычисляемое поле `SharedLocks` в структуру ответа `ItemNode` в cloudbroker/node |
|
||||
| BGOS-1086 | Вычисляемые поля `LinkState` и `LinkSpeed` в структуру ответа `ItemNicInfo` в cloudbroker/node |
|
||||
|
||||
#### kvmx86
|
||||
#### vins
|
||||
| Идентификатор задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-1067 | Опциональное поле `PCIdevices` в структуры запросов `CreateRequest` и `CreateBlankRequest` в cloudapi/kvmx86 |
|
||||
| BGOS-1067 | Опциональное поле `PCIdevices` в структуры запросов `CreateRequest` и `CreateBlankRequest` в cloudbroker/kvmx86 |
|
||||
| BGOS-1081 | Опциональное поле `VGPUs` в структуры запросов `CreateRequest` и `CreateBlankRequest` в cloudapi/kvmx86 |
|
||||
| BGOS-1081 | Опциональное поле `VGPUs` в структуры запросов `CreateRequest` и `CreateBlankRequest` в cloudbroker/kvmx86 |
|
||||
| BGOS-1102 | Вычисляемое поле `EnableDefaultGateway` в структуры ответа `VNFsConfig` и `ItemInterface` в cloudbroker/vins |
|
||||
| BGOS-1102 | Вычисляемое поле `EnableDefaultGateway` в структуры ответа `RecordDHCPConfig` и `ItemVNFInterface` в cloudapi/vins |
|
||||
|
||||
#### user
|
||||
| Идентификатор задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-1064 | Опциональное поле `ServiceAccount` в структуру запроса `CreateRequest` в clooudbroker/user |
|
||||
| BGOS-1064 | Структура запроса `UpdateServiceAccountRequest` и метод `UpdateServiceAccount` в clooudbroker/user |
|
||||
|
||||
### Изменено
|
||||
|
||||
#### apiaccess
|
||||
| Идентификатор задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-1082 | Тип поля `APIs` с опционального на обязательный в структуре запроса `UpdateRequest` в cloudbroker/apiaccess |
|
||||
| BGOS-1091 | Тип вычисляемых полей `Account`, `APIAccess`, `AuditCollector`, `Backup`, `BackupCreator`, `BService`, `Compute`, `Disks`, `DPDKNet`, `Eco`, `ExtNet`, `FlIPgroup`, `Grid`, `Group`, `Health`, `Image`, `K8CI`, `K8S`, `KVMX86`, `LB`, `Metering`, `Milestones`, `PCIDevice`, `PGPU`, `Prometheus`, `RG`, `SecurityGroup`, `Sep`, `StoragePolicy`, `Tasks`, `TLock`, `Trunk`, `User`, `VFPool`, `VGPU`, `VINS`, `VMFolder`, `VNFDev`, `ZeroAccess` и `Zone` со `string` на `interface{}` в структуре ответа `CloudBrokerEndpoints` в cloudbroker/apiaccess |
|
||||
|
||||
#### compute
|
||||
| Идентификатор задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-1068 | Тип ответа метода `AffinityRuleAdd` с `bool` на структуру `AffinityRuleAddResult` в cloudapi/compute |
|
||||
| BGOS-1068 | Тип ответа метода `AffinityRuleAdd` с `bool` на структуру `AffinityRuleAddResult` в cloudbroker/compute |
|
||||
| BGOS-1068 | Тип ответа метода `AntiAffinityRuleAdd` с `bool` на структуру `AntiAffinityRuleAddResult` в cloudapi/compute |
|
||||
| BGOS-1068 | Тип ответа метода `AntiAffinityRuleAdd` с `bool` на структуру `AntiAffinityRuleAddResult` в cloudbroker/compute |
|
||||
| BGOS-1089 | Значение по умолчанию поля `MemoryBalloonMode` с `auto` на `none` в структуре запроса `UpdateRequest` в cloudapi/compute |
|
||||
| BGOS-1089 | Значение по умолчанию поля `MemoryBalloonMode` с `auto` на `none` в структуре запроса `UpdateRequest` в cloudbroker/compute |
|
||||
|
||||
#### kvmx86
|
||||
| Идентификатор задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-1089 | Значение по умолчанию поля `MemoryBalloonMode` с `auto` на `none` в структурах запроса `CreateRequest` и `CreateBlankRequest` в cloudapi/kvmx86 |
|
||||
| BGOS-1089 | Значение по умолчанию поля `MemoryBalloonMode` с `auto` на `none` в структурах запроса `CreateRequest`, `CreateBlankRequest` и `MassCreateRequest` в cloudbroker/kvmx86 |
|
||||
|
||||
#### sep
|
||||
| Идентификатор задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-1084 | Тэг `url` поля `AsyncMode` с `sync` на `async_mode` в структурах запроса `SharedLockStartRequest` и `SharedLockStopRequest` в cloudbroker/sep |
|
||||
|
||||
|
||||
### Исправлено
|
||||
|
||||
#### session
|
||||
| Идентификатор задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-1085 | Тип опционального поля `SID` с `uint64` на `string` в cloudbroker/session |
|
||||
| BGOS-1085 | Тэг опционального поля `SortBy` с `sortBy` на `sort_by` в cloudbroker/session |
|
||||
|
||||
### Удалено
|
||||
|
||||
#### compute
|
||||
#### node
|
||||
| Идентификатор задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-1080 | Опциональное поле `AccountID` из структуры запроса `CreateTemplateFromBlankRequest` в cloudapi/compute |
|
||||
|
||||
#### disks
|
||||
| Идентификатор задачи | Описание |
|
||||
| --- | --- |
|
||||
| BGOS-1080 | Опциональное поле `AccountID` из структуры запроса `FromPlatformDiskRequest` в cloudapi/disks |
|
||||
| BGOS-1083 | Опциональное поле `Message` из структуры запроса `EnableRequest` в cloudbroker/node |
|
||||
|
||||
@@ -16,7 +16,7 @@ type ListVINSRequest struct {
|
||||
|
||||
// Find by VINS ID
|
||||
// Required: false
|
||||
VINSID uint64 `url:"vins,omitempty" json:"vinsId,omitempty"`
|
||||
VINSID uint64 `url:"vinsId,omitempty" json:"vinsId,omitempty"`
|
||||
|
||||
// Find by name
|
||||
// Required: false
|
||||
|
||||
@@ -63,6 +63,14 @@ type ListRequest struct {
|
||||
// Required: false
|
||||
AccountID uint64 `url:"account_id,omitempty" json:"account_id,omitempty"`
|
||||
|
||||
// Find by disk id
|
||||
// Required: false
|
||||
DiskID uint64 `url:"disk_id,omitempty" json:"disk_id,omitempty"`
|
||||
|
||||
// Find by vm folder id
|
||||
// Required: false
|
||||
VMFolderID uint64 `url:"vmfolder_id,omitempty" json:"vmfolder_id,omitempty"`
|
||||
|
||||
// Find by vins id
|
||||
// Required: false
|
||||
VINSID uint64 `url:"vins_id,omitempty" json:"vins_id,omitempty"`
|
||||
@@ -92,7 +100,7 @@ type ListRequest struct {
|
||||
ExcludeAuditLines bool `url:"exclude_audit_lines,omitempty" json:"exclude_audit_lines,omitempty"`
|
||||
|
||||
// Public Session ID
|
||||
PublicSessionID string `json:"public_session_id"`
|
||||
PublicSessionID string `url:"public_session_id,omitempty" json:"public_session_id,omitempty"`
|
||||
}
|
||||
|
||||
// List gets audit records for the specified account object
|
||||
|
||||
@@ -82,7 +82,7 @@ type UpdateRequest struct {
|
||||
|
||||
// Memory balloon mode. One of ["auto","legacy","none"]
|
||||
// Required: false
|
||||
// Default: "auto"
|
||||
// Default: none
|
||||
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
|
||||
}
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ type CreateRequest struct {
|
||||
|
||||
// Memory balloon mode. One of ["auto","legacy","none"]
|
||||
// Required: false
|
||||
// Default: "auto"
|
||||
// Default: none
|
||||
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
|
||||
|
||||
// List of vGPU IDs to attach to the VM
|
||||
|
||||
@@ -136,7 +136,7 @@ type CreateBlankRequest struct {
|
||||
|
||||
// Memory balloon mode. One of ["auto","legacy","none"]
|
||||
// Required: false
|
||||
// Default: "auto"
|
||||
// Default: none
|
||||
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
|
||||
|
||||
// List of vGPU IDs to attach to the VM
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
type SetDataRequest struct {
|
||||
// Data to set to user in json format
|
||||
// Required: true
|
||||
Data string `url:"data" json:"data" validation:"required"`
|
||||
Data string `url:"data" json:"data" validate:"required"`
|
||||
}
|
||||
|
||||
// SetData sets extra user information.
|
||||
|
||||
@@ -340,6 +340,9 @@ type ItemVNFInterface struct {
|
||||
|
||||
// List of VNF IDs
|
||||
VNFs []uint64 `json:"vnfs"`
|
||||
|
||||
// Whether default gateway is enabled
|
||||
EnableDefaultGateway bool `json:"enable_default_gateway"`
|
||||
}
|
||||
|
||||
// Main information about QOS
|
||||
@@ -630,6 +633,9 @@ type RecordDHCPConfig struct {
|
||||
|
||||
// List of reservations
|
||||
Reservations ListReservations `json:"reservations"`
|
||||
|
||||
// Whether default gateway is enabled
|
||||
EnableDefaultGateway bool `json:"enable_default_gateway"`
|
||||
}
|
||||
|
||||
// List of static routes
|
||||
|
||||
@@ -38,6 +38,10 @@ type ListRequest struct {
|
||||
// Required: false
|
||||
SortBy string `url:"sort_by,omitempty" json:"sort_by,omitempty" validate:"omitempty,sortBy"`
|
||||
|
||||
// Filter by user ID
|
||||
// Required: false
|
||||
UserID string `url:"user_id,omitempty" json:"user_id,omitempty"`
|
||||
|
||||
// Page number
|
||||
// Required: false
|
||||
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
||||
|
||||
@@ -161,51 +161,51 @@ type CloudAPIEndpoints struct {
|
||||
}
|
||||
|
||||
type CloudBrokerEndpoints struct {
|
||||
Account []string `json:"account,omitempty"`
|
||||
APIAccess []string `json:"apiaccess,omitempty"`
|
||||
Account interface{} `json:"account,omitempty"`
|
||||
APIAccess interface{} `json:"apiaccess,omitempty"`
|
||||
Audit interface{} `json:"audit,omitempty"`
|
||||
AuditBeat []string `json:"auditbeat,omitempty"`
|
||||
AuditCollector []string `json:"auditcollector,omitempty"`
|
||||
Backup []string `json:"backup,omitempty"`
|
||||
BackupCreator []string `json:"backupcreator,omitempty"`
|
||||
BService []string `json:"bservice,omitempty"`
|
||||
Compute []string `json:"compute,omitempty"`
|
||||
Disks []string `json:"disks,omitempty"`
|
||||
DPDKNet []string `json:"dpdknet,omitempty"`
|
||||
Eco []string `json:"eco,omitempty"`
|
||||
ExtNet []string `json:"extnet,omitempty"`
|
||||
FlIPgroup []string `json:"flipgroup,omitempty"`
|
||||
Grid []string `json:"grid,omitempty"`
|
||||
Group []string `json:"group,omitempty"`
|
||||
Health []string `json:"health,omitempty"`
|
||||
Image []string `json:"image,omitempty"`
|
||||
AuditCollector interface{} `json:"auditcollector,omitempty"`
|
||||
Backup interface{} `json:"backup,omitempty"`
|
||||
BackupCreator interface{} `json:"backupcreator,omitempty"`
|
||||
BService interface{} `json:"bservice,omitempty"`
|
||||
Compute interface{} `json:"compute,omitempty"`
|
||||
Disks interface{} `json:"disks,omitempty"`
|
||||
DPDKNet interface{} `json:"dpdknet,omitempty"`
|
||||
Eco interface{} `json:"eco,omitempty"`
|
||||
ExtNet interface{} `json:"extnet,omitempty"`
|
||||
FlIPgroup interface{} `json:"flipgroup,omitempty"`
|
||||
Grid interface{} `json:"grid,omitempty"`
|
||||
Group interface{} `json:"group,omitempty"`
|
||||
Health interface{} `json:"health,omitempty"`
|
||||
Image interface{} `json:"image,omitempty"`
|
||||
Job interface{} `json:"job,omitempty"`
|
||||
K8CI []string `json:"k8ci,omitempty"`
|
||||
K8S []string `json:"k8s,omitempty"`
|
||||
KVMX86 []string `json:"kvmx86,omitempty"`
|
||||
LB []string `json:"lb,omitempty"`
|
||||
Metering []string `json:"metering,omitempty"`
|
||||
Milestones []string `json:"milestones,omitempty"`
|
||||
K8CI interface{} `json:"k8ci,omitempty"`
|
||||
K8S interface{} `json:"k8s,omitempty"`
|
||||
KVMX86 interface{} `json:"kvmx86,omitempty"`
|
||||
LB interface{} `json:"lb,omitempty"`
|
||||
Metering interface{} `json:"metering,omitempty"`
|
||||
Milestones interface{} `json:"milestones,omitempty"`
|
||||
Node []string `json:"node,omitempty"`
|
||||
PCIDevice []string `json:"pcidevice,omitempty"`
|
||||
PGPU []string `json:"pgpu,omitempty"`
|
||||
Prometheus []string `json:"prometheus,omitempty"`
|
||||
PCIDevice interface{} `json:"pcidevice,omitempty"`
|
||||
PGPU interface{} `json:"pgpu,omitempty"`
|
||||
Prometheus interface{} `json:"prometheus,omitempty"`
|
||||
Resmon interface{} `json:"resmon,omitempty"`
|
||||
RG []string `json:"rg,omitempty"`
|
||||
SecurityGroup []string `json:"security_group,omitempty"`
|
||||
Sep []string `json:"sep,omitempty"`
|
||||
StoragePolicy []string `json:"storage_policy,omitempty"`
|
||||
Tasks []string `json:"tasks,omitempty"`
|
||||
TLock []string `json:"tlock,omitempty"`
|
||||
Trunk []string `json:"trunk,omitempty"`
|
||||
User []string `json:"user,omitempty"`
|
||||
VFPool []string `json:"vfpool,omitempty"`
|
||||
VGPU []string `json:"vgpu,omitempty"`
|
||||
VINS []string `json:"vins,omitempty"`
|
||||
VMFolder []string `json:"vmfolder,omitempty"`
|
||||
VNFDev []string `json:"vnfdev,omitempty"`
|
||||
ZeroAccess []string `json:"zeroaccess,omitempty"`
|
||||
Zone []string `json:"zone,omitempty"`
|
||||
RG interface{} `json:"rg,omitempty"`
|
||||
SecurityGroup interface{} `json:"security_group,omitempty"`
|
||||
Sep interface{} `json:"sep,omitempty"`
|
||||
StoragePolicy interface{} `json:"storage_policy,omitempty"`
|
||||
Tasks interface{} `json:"tasks,omitempty"`
|
||||
TLock interface{} `json:"tlock,omitempty"`
|
||||
Trunk interface{} `json:"trunk,omitempty"`
|
||||
User interface{} `json:"user,omitempty"`
|
||||
VFPool interface{} `json:"vfpool,omitempty"`
|
||||
VGPU interface{} `json:"vgpu,omitempty"`
|
||||
VINS interface{} `json:"vins,omitempty"`
|
||||
VMFolder interface{} `json:"vmfolder,omitempty"`
|
||||
VNFDev interface{} `json:"vnfdev,omitempty"`
|
||||
ZeroAccess interface{} `json:"zeroaccess,omitempty"`
|
||||
Zone interface{} `json:"zone,omitempty"`
|
||||
All bool `json:"ALL,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ type UserListRequest struct {
|
||||
}
|
||||
|
||||
// UserList gets a list of users currently included in the specified group.
|
||||
//
|
||||
// Deprecated: will be removed in SDK v1.17
|
||||
func (a APIAccess) UserList(ctx context.Context, req UserListRequest) ([]string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
|
||||
@@ -63,6 +63,14 @@ type ListRequest struct {
|
||||
// Required: false
|
||||
AccountID uint64 `url:"account_id,omitempty" json:"account_id,omitempty"`
|
||||
|
||||
// Find by disk id
|
||||
// Required: false
|
||||
DiskID uint64 `url:"disk_id,omitempty" json:"disk_id,omitempty"`
|
||||
|
||||
// Find by vm folder id
|
||||
// Required: false
|
||||
VMFolderID uint64 `url:"vmfolder_id,omitempty" json:"vmfolder_id,omitempty"`
|
||||
|
||||
// Find by vins id
|
||||
// Required: false
|
||||
VINSID uint64 `url:"vins_id,omitempty" json:"vins_id,omitempty"`
|
||||
@@ -96,7 +104,7 @@ type ListRequest struct {
|
||||
ExcludeAuditLines bool `url:"exclude_audit_lines,omitempty" json:"exclude_audit_lines,omitempty"`
|
||||
|
||||
// Public Session ID
|
||||
PublicSessionID string `json:"public_session_id"`
|
||||
PublicSessionID string `url:"public_session_id,omitempty" json:"public_session_id,omitempty"`
|
||||
}
|
||||
|
||||
// List gets audit records for the specified account object
|
||||
|
||||
@@ -86,7 +86,7 @@ type UpdateRequest struct {
|
||||
|
||||
// Memory balloon mode. One of ["auto","legacy","none"]
|
||||
// Required: false
|
||||
// Default: "auto"
|
||||
// Default: none
|
||||
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package extnet
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
@@ -15,6 +16,11 @@ type EnableRequest struct {
|
||||
NetID uint64 `url:"net_id" json:"net_id" validate:"required"`
|
||||
}
|
||||
|
||||
type asyncWrapperEnableRequest struct {
|
||||
EnableRequest
|
||||
AsyncMode bool `url:"async_mode"`
|
||||
}
|
||||
|
||||
// Enable enables external networks
|
||||
func (e ExtNet) Enable(ctx context.Context, req EnableRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
@@ -24,7 +30,12 @@ func (e ExtNet) Enable(ctx context.Context, req EnableRequest) (bool, error) {
|
||||
|
||||
url := "/cloudbroker/extnet/enable"
|
||||
|
||||
res, err := e.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
aReq := asyncWrapperEnableRequest{
|
||||
EnableRequest: req,
|
||||
AsyncMode: false,
|
||||
}
|
||||
|
||||
res, err := e.client.DecortApiCall(ctx, http.MethodPost, url, aReq)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
@@ -36,3 +47,32 @@ func (e ExtNet) Enable(ctx context.Context, req EnableRequest) (bool, error) {
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// EnableAsync enables external networks in async mode
|
||||
func (e ExtNet) EnableAsync(ctx context.Context, req EnableRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/extnet/enable"
|
||||
|
||||
aReq := asyncWrapperEnableRequest{
|
||||
EnableRequest: req,
|
||||
AsyncMode: true,
|
||||
}
|
||||
|
||||
res, err := e.client.DecortApiCall(ctx, http.MethodPost, url, aReq)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
var resp string
|
||||
|
||||
err = json.Unmarshal(res, &resp)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ type CreateRequest struct {
|
||||
|
||||
// Memory balloon mode. One of ["auto","legacy","none"]
|
||||
// Required: false
|
||||
// Default: "auto"
|
||||
// Default: none
|
||||
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
|
||||
|
||||
// List of vGPU IDs to attach to the VM
|
||||
|
||||
@@ -149,7 +149,7 @@ type CreateBlankRequest struct {
|
||||
|
||||
// Memory balloon mode. One of ["auto","legacy","none"]
|
||||
// Required: false
|
||||
// Default: "auto"
|
||||
// Default: none
|
||||
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
|
||||
|
||||
// List of vGPU IDs to attach to the VM
|
||||
|
||||
@@ -195,7 +195,7 @@ type MassCreateRequest struct {
|
||||
|
||||
// Memory balloon mode. One of ["auto","legacy","none"]
|
||||
// Required: false
|
||||
// Default: "auto"
|
||||
// Default: none
|
||||
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,6 @@ type EnableRequest struct {
|
||||
// Required: true
|
||||
NID uint64 `url:"nid" json:"nid" validate:"required"`
|
||||
|
||||
// Message
|
||||
// Required: false
|
||||
Message string `url:"message,omitempty" json:"message,omitempty"`
|
||||
|
||||
// Do not check locks, iscsi-sessions or disk-present
|
||||
// Default: false
|
||||
// Required: false
|
||||
|
||||
@@ -340,6 +340,9 @@ type ItemNode struct {
|
||||
|
||||
// PCI devices attached to the node
|
||||
PCIDevices []ItemPCIDevice `json:"pci_devices"`
|
||||
|
||||
// Shared locks
|
||||
SharedLocks map[string]interface{} `json:"shared_locks"`
|
||||
}
|
||||
|
||||
type PackageInfo struct {
|
||||
@@ -429,6 +432,12 @@ type ItemNicInfo struct {
|
||||
|
||||
// VFList
|
||||
VFList []interface{} `json:"vflist"`
|
||||
|
||||
// Link state
|
||||
LinkState string `json:"linkState"`
|
||||
|
||||
// Link speed
|
||||
LinkSpeed int64 `json:"linkSpeed"`
|
||||
}
|
||||
|
||||
type ListNetAddr []ItemNetAddr
|
||||
|
||||
42
pkg/cloudbroker/node/remove_ssh_identity.go
Normal file
42
pkg/cloudbroker/node/remove_ssh_identity.go
Normal file
@@ -0,0 +1,42 @@
|
||||
package node
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// RemoveSSHIdentityRequest to remove an ssh identity from a node
|
||||
type RemoveSSHIdentityRequest struct {
|
||||
// Node ID
|
||||
// Required: true
|
||||
NodeID uint64 `url:"node_id" json:"node_id" validate:"required"`
|
||||
|
||||
// Key to remove
|
||||
// Required: true
|
||||
ClientPublicKey string `url:"client_public_key" json:"client_public_key" validate:"required"`
|
||||
}
|
||||
|
||||
// RemoveSSHIdentity removes an ssh identity from a node
|
||||
func (n Node) RemoveSSHIdentity(ctx context.Context, req RemoveSSHIdentityRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/node/remove_ssh_identity"
|
||||
|
||||
res, err := n.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
result, err := strconv.ParseBool(string(res))
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
@@ -32,7 +32,7 @@ type SharedLockStartRequest struct {
|
||||
type wrapperSharedLockStartRequest struct {
|
||||
SharedLockStartRequest
|
||||
|
||||
AsyncMode bool `url:"sync"`
|
||||
AsyncMode bool `url:"async_mode"`
|
||||
}
|
||||
|
||||
// SharedLockStart start shared locks without AsyncMode
|
||||
|
||||
@@ -27,7 +27,7 @@ type SharedLockStopRequest struct {
|
||||
type wrapperSharedLockStopRequest struct {
|
||||
SharedLockStopRequest
|
||||
|
||||
AsyncMode bool `url:"sync"`
|
||||
AsyncMode bool `url:"async_mode"`
|
||||
}
|
||||
|
||||
// SharedLockStop stop shared locks without AsyncMode
|
||||
|
||||
@@ -22,7 +22,7 @@ type ListRequest struct {
|
||||
Sub string `url:"sub,omitempty" json:"sub,omitempty"`
|
||||
|
||||
// Filter by sid from JWT
|
||||
SID uint64 `url:"sid,omitempty" json:"sid,omitempty"`
|
||||
SID string `url:"sid,omitempty" json:"sid,omitempty"`
|
||||
|
||||
// Filter sessions with login_time >= timestamp (Unix timestamp)
|
||||
TimestampAt uint64 `url:"timestamp_at,omitempty" json:"timestamp_at,omitempty"`
|
||||
@@ -48,7 +48,7 @@ type ListRequest struct {
|
||||
|
||||
// Sort by one of supported fields, format +|-(field)
|
||||
// Required: false
|
||||
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty"`
|
||||
SortBy string `url:"sort_by,omitempty" json:"sort_by,omitempty"`
|
||||
}
|
||||
|
||||
// List gets list of sessions as a ListSession struct
|
||||
|
||||
@@ -29,6 +29,11 @@ type CreateRequest struct {
|
||||
// one of: bvs, decs3o
|
||||
// Required: false
|
||||
Provider string `url:"provider,omitempty" json:"provider,omitempty" validate:"omitempty,userProvider"`
|
||||
|
||||
// Whether we create a service account
|
||||
// Default value: false
|
||||
// Required: false
|
||||
ServiceAccount interface{} `url:"serviceaccount,omitempty" json:"serviceaccount,omitempty" validate:"omitempty,isBool"`
|
||||
}
|
||||
|
||||
// Create creates a user.
|
||||
|
||||
42
pkg/cloudbroker/user/update_service_account.go
Normal file
42
pkg/cloudbroker/user/update_service_account.go
Normal file
@@ -0,0 +1,42 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// UpdateServiceAccountRequest to update ServiceAccount field
|
||||
type UpdateServiceAccountRequest struct {
|
||||
// User ID
|
||||
// Required: true
|
||||
UserID string `url:"user_id" json:"user_id" validate:"required"`
|
||||
|
||||
// Whether the account is a service account
|
||||
// Required: true
|
||||
ServiceAccount interface{} `url:"serviceaccount" json:"serviceaccount" validate:"required,isBool"`
|
||||
}
|
||||
|
||||
// UpdateServiceAccount updates ServiceAccount field
|
||||
func (u User) UpdateServiceAccount(ctx context.Context, req UpdateServiceAccountRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/user/update_service_account"
|
||||
|
||||
res, err := u.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
result, err := strconv.ParseBool(string(res))
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
@@ -184,6 +184,9 @@ type ItemInterface struct {
|
||||
|
||||
// List of VNF IDs
|
||||
VNFs []uint64 `json:"vnfs"`
|
||||
|
||||
// Whether default gateway is enabled
|
||||
EnableDefaultGateway bool `json:"enable_default_gateway"`
|
||||
}
|
||||
|
||||
// List of interfaces
|
||||
@@ -304,6 +307,9 @@ type VNFsConfig struct {
|
||||
|
||||
// List of reservations
|
||||
Reservations ListReservations `json:"reservations"`
|
||||
|
||||
// Whether default gateway is enabled
|
||||
EnableDefaultGateway bool `json:"enable_default_gateway"`
|
||||
}
|
||||
|
||||
// Primary
|
||||
|
||||
@@ -13,11 +13,11 @@ import (
|
||||
type DelACLAccessRequest struct {
|
||||
// ID of a folder
|
||||
// Required: true
|
||||
FolderID uint64 `url:"folder_id" json:"folder_id"`
|
||||
FolderID uint64 `url:"folder_id" json:"folder_id" validate:"required"`
|
||||
|
||||
// User or group name to revoke access from
|
||||
// Required: true
|
||||
User string `url:"user" json:"user"`
|
||||
User string `url:"user" json:"user" validate:"required"`
|
||||
}
|
||||
|
||||
// DeleteACLAccess deletes ACL access from a vm foler
|
||||
|
||||
@@ -938,6 +938,7 @@ func getRequestsMapCloudbroker() map[string]interface{} {
|
||||
"/restmachine/cloudbroker/node/pci_device_driver_to_vfio": node_cb.PCIDeviceDriverToVFIORequest{},
|
||||
"/restmachine/cloudbroker/node/pci_device_driver_to_kernel": node_cb.PCIDeviceDriverToKernelRequest{},
|
||||
"/restmachine/cloudbroker/node/install": node_cb.InstallRequest{},
|
||||
"/restmachine/cloudbroker/node/remove_ssh_identity": node_cb.RemoveSSHIdentityRequest{},
|
||||
|
||||
// pcidevice
|
||||
"/restmachine/cloudbroker/pcidevice/create": pcidevice_cb.CreateRequest{},
|
||||
@@ -1097,6 +1098,7 @@ func getRequestsMapCloudbroker() map[string]interface{} {
|
||||
"/restmachine/cloudbroker/user/getMatchingUsernames": user_cb.GetMatchingUsernamesRequest{},
|
||||
"/restmachine/cloudbroker/user/list": user_cb.ListRequest{},
|
||||
"/restmachine/cloudbroker/user/unblock": user_cb.UnblockRequest{},
|
||||
"/restmachine/cloudbroker/user/update_service_account": user_cb.UpdateServiceAccountRequest{},
|
||||
|
||||
// vfpool
|
||||
"/restmachine/cloudbroker/vfpool/create": vfpool_cb.CreateRequest{},
|
||||
|
||||
Reference in New Issue
Block a user