Compare commits

..
3 Commits
Author SHA1 Message Date
dayterr 025a1274f4 v16.6.0
v16.6.0
2026-10-02 16:42:23 +03:00
aafetisov dca445b69a v16.5.0 2026-09-28 13:41:59 +03:00
dayterr 2c7f0d29df v16.4.0
v16.4.0
2026-09-18 16:56:47 +03:00
197 changed files with 3407 additions and 313 deletions

No files matched your search

+62 -12
View File
@@ -1,9 +1,9 @@
## Version 16.3.0 ## Version 16.6.0
### Deprecated ### Deprecated
Перечисленные методы будут удалены в `v1.17` Перечисленные методы будут удалены в `v17.0.0`
| Метод | CloudAPI | CloudBroker | | Метод | CloudAPI | CloudBroker |
| --- | --- | --- | | --- | --- | --- |
@@ -17,32 +17,82 @@
| `rg/AccessGrant` | :heavy_check_mark: | :heavy_check_mark: | | `rg/AccessGrant` | :heavy_check_mark: | :heavy_check_mark: |
| `rg/AccessRevoke` | :heavy_check_mark: | :heavy_check_mark: | | `rg/AccessRevoke` | :heavy_check_mark: | :heavy_check_mark: |
| `sep/ConfigFieldEdit` | :x: | :heavy_check_mark: | | `sep/ConfigFieldEdit` | :x: | :heavy_check_mark: |
| `apiaccess/userList` | :x: | :heavy_check_mark: |
### Добавлено ### Добавлено
#### apiaccess
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1091 | Опциональное поле `UserID` в структуру запроса `ListRequest` в cloudbroker/apiaccess |
#### audit
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1088 | Опциональные поля `DiskID` и `VMFolderID` в структуру запроса `ListRequest` в cloudapi/audit |
| BGOS-1088 | Опциональные поля `DiskID` и `VMFolderID` в структуру запроса `ListRequest` в cloudbroker/audit |
#### extnet #### extnet
| Идентификатор задачи | Описание | | Идентификатор задачи | Описание |
| --- | --- | | --- | --- |
| BGOS-1034 | Методы `AsyncCreate`, `AsyncDeviceDeploy` и `AsyncSetHAMode` в cloudbroker/extnet | | BGOS-1092 | Метод `EnableAsync` в cloudbroker/extnet |
#### node
#### locations
| Идентификатор задачи | Описание | | Идентификатор задачи | Описание |
| --- | --- | | --- | --- |
| BGOS-1032 | Вычисляемое поле `VMFoldersEnabled` в структуру ответа `ItemLocation` в cloudapi/locations | | BGOS-1065 | Структура запроса `RemoveSSHIdentityRequest` и метод `RemoveSSHIdentity` в cloudbroker/node |
| BGOS-1101 | Вычисляемое поле `SharedLocks` в структуру ответа `ItemNode` в cloudbroker/node |
| BGOS-1086 | Вычисляемые поля `LinkState` и `LinkSpeed` в структуру ответа `ItemNicInfo` в cloudbroker/node |
#### vins #### vins
| Идентификатор задачи | Описание | | Идентификатор задачи | Описание |
| --- | --- | | --- | --- |
| BGOS-1033 | Методы `AsyncCreateInAccount`, `AsyncCreateInRG`, `AsyncEnable`, `AsyncVNFDevRedeploy` и `AsyncVNFDevRestart` в cloudapi/vins | | BGOS-1102 | Вычисляемое поле `EnableDefaultGateway` в структуры ответа `VNFsConfig` и `ItemInterface` в cloudbroker/vins |
| BGOS-1033 | Методы `AsyncCreateInAccount`, `AsyncCreateInRG`, `AsyncEnable`, `AsyncVNFDevRedeploy`, `AsyncVNFDevRestart` и `AsyncVNFDevStart` в cloudbroker/vins | | BGOS-1102 | Вычисляемое поле `EnableDefaultGateway` в структуры ответа `RecordDHCPConfig` и `ItemVNFInterface` в cloudapi/vins |
| BGOS-1033 | Структура запроса `DisableRequest` и метод `Disable` в cloudapi/vins |
| BGOS-1033 | Структура запроса `EnableRequest` и метод `Enable` в cloudapi/vins |
### Исправлено #### user
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1064 | Опциональное поле `ServiceAccount` в структуру запроса `CreateRequest` в clooudbroker/user |
| BGOS-1064 | Структура запроса `UpdateServiceAccountRequest` и метод `UpdateServiceAccount` в clooudbroker/user |
### Изменено
#### 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-1089 | Значение по умолчанию поля `MemoryBalloonMode` с `auto` на `none` в структуре запроса `UpdateRequest` в cloudapi/compute |
| BGOS-1089 | Значение по умолчанию поля `MemoryBalloonMode` с `auto` на `none` в структуре запроса `UpdateRequest` в cloudbroker/compute |
#### kvmx86 #### kvmx86
| Идентификатор задачи | Описание | | Идентификатор задачи | Описание |
| --- | --- | | --- | --- |
| BGOS-1040 | JSON-тэг опционального поля `AsyncMode` с `asyncMode` на `async_mode` в структуре запроса `CreateRequest` в cloudapi/kvmx86 и cloudbroker/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 |
### Удалено
#### node
| Идентификатор задачи | Описание |
| --- | --- |
| BGOS-1083 | Опциональное поле `Message` из структуры запроса `EnableRequest` в cloudbroker/node |
+5 -1
View File
@@ -126,6 +126,7 @@ go get -u repository.basistech.ru/BASIS/dynamix-golang-sdk/v16
- `Trunk` - получение информации о транковых портах; - `Trunk` - получение информации о транковых портах;
- `VFPool` - управление пулом виртуальных сетевых функций; - `VFPool` - управление пулом виртуальных сетевых функций;
- `VINS` - управление виртуальными изолированными сетями; - `VINS` - управление виртуальными изолированными сетями;
- `VMFolder` – управление директориями ВМ;
- `VGPU` - управление виртуальными графическими процессорами; - `VGPU` - управление виртуальными графическими процессорами;
- `Zone` - управление зонами. - `Zone` - управление зонами.
@@ -166,7 +167,8 @@ go get -u repository.basistech.ru/BASIS/dynamix-golang-sdk/v16
- `User` - управление пользователями (индивидуально); - `User` - управление пользователями (индивидуально);
- `VGPU` - управление виртуальными графическими процессорами; - `VGPU` - управление виртуальными графическими процессорами;
- `VFPool` - управление пулом виртуальных сетевых функций; - `VFPool` - управление пулом виртуальных сетевых функций;
- `VINS` - управление виртуальными изолированными сетями. - `VINS` - управление виртуальными изолированными сетями;
- `VMFolder` – управление директориями ВМ;
- `Zone` - управление зонами. - `Zone` - управление зонами.
### SDN ### SDN
@@ -342,6 +344,7 @@ func main() {
- `pkg/cloudapi/trunk` - для `Trunk` - `pkg/cloudapi/trunk` - для `Trunk`
- `pkg/cloudapi/vfpool` - для `VFPool` - `pkg/cloudapi/vfpool` - для `VFPool`
- `pkg/cloudapi/vins` - для `VINS` - `pkg/cloudapi/vins` - для `VINS`
- `pkg/cloudapi/vmfolder` - для `VMFolder`
- `pkg/cloudapi/vgpu` - для `VGPU` - `pkg/cloudapi/vgpu` - для `VGPU`
- `pkg/cloudapi/zone` - для `Zone` - `pkg/cloudapi/zone` - для `Zone`
- **cloudbroker**: - **cloudbroker**:
@@ -378,6 +381,7 @@ func main() {
- `pkg/cloudbroker/vgpu` - для `VGPU` - `pkg/cloudbroker/vgpu` - для `VGPU`
- `pkg/cloudbroker/vfpool` - для `VFPool` - `pkg/cloudbroker/vfpool` - для `VFPool`
- `pkg/cloudbroker/vins` - для `VINS` - `pkg/cloudbroker/vins` - для `VINS`
- `pkg/cloudbroker/vmfolder` - для `VMFolder`
- `pkg/cloudbroker/zone` - для `Zone` - `pkg/cloudbroker/zone` - для `Zone`
- **sdn**: - **sdn**:
- `pkg/sdn/acsgroups` - для `Access groups` - `pkg/sdn/acsgroups` - для `Access groups`
+1 -1
View File
@@ -16,7 +16,7 @@ type ListVINSRequest struct {
// Find by VINS ID // Find by VINS ID
// Required: false // Required: false
VINSID uint64 `url:"vins,omitempty" json:"vinsId,omitempty"` VINSID uint64 `url:"vinsId,omitempty" json:"vinsId,omitempty"`
// Find by name // Find by name
// Required: false // Required: false
+1 -1
View File
@@ -8,7 +8,7 @@ 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,
} }
+9 -1
View File
@@ -63,6 +63,14 @@ type ListRequest struct {
// Required: false // Required: false
AccountID uint64 `url:"account_id,omitempty" json:"account_id,omitempty"` 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 // Find by vins id
// Required: false // Required: false
VINSID uint64 `url:"vins_id,omitempty" json:"vins_id,omitempty"` 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"` ExcludeAuditLines bool `url:"exclude_audit_lines,omitempty" json:"exclude_audit_lines,omitempty"`
// Public Session ID // 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 // List gets audit records for the specified account object
+36
View File
@@ -88,6 +88,42 @@ type ItemAudit struct {
// TTL // TTL
TTL string `json:"_ttl"` TTL string `json:"_ttl"`
// Resource group ID
ResgroupID uint64 `json:"resgroup_id"`
// Account ID
AccountID uint64 `json:"account_id"`
// Compute ID
ComputeID uint64 `json:"compute_id"`
// VINS ID
VINSID uint64 `json:"vins_id"`
// Service ID
ServiceID uint64 `json:"service_id"`
// K8S ID
K8SID uint64 `json:"k8s_id"`
// FLIPGroup ID
FLIPGroupID uint64 `json:"flipgroup_id"`
// Load balancer ID
LBID uint64 `json:"lb_id"`
// SEP ID
SEPID uint64 `json:"sep_id"`
// Node IDs
NodeIDs []uint64 `json:"node_ids"`
// Persistent disk IDs associated with the operation
DiskIDs []uint64 `json:"disk_ids"`
// API task ID for asynchronous calls
APITask string `json:"apitask"`
} }
// List of audits // List of audits
@@ -20,7 +20,7 @@ type AbortSharedSnapshotMergeRequest struct {
type wrapperAbortSharedSnapshotMergeRequest struct { type wrapperAbortSharedSnapshotMergeRequest struct {
AbortSharedSnapshotMergeRequest AbortSharedSnapshotMergeRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode" json:"async_mode"`
} }
// AbortSharedSnapshotMerge shared snapshots merge abort // AbortSharedSnapshotMerge shared snapshots merge abort
+62 -8
View File
@@ -2,9 +2,11 @@ package compute
import ( import (
"context" "context"
"encoding/json"
"net/http" "net/http"
"strconv" "strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators" "repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
) )
@@ -40,26 +42,78 @@ type AffinityRuleAddRequest struct {
// Value that must match the key to be taken into account when analyzing this rule // Value that must match the key to be taken into account when analyzing this rule
// Required: true // Required: true
Value string `url:"value" json:"value" validate:"required"` Value string `url:"value" json:"value" validate:"required"`
// Migrate compute according to the rule
// Default: false
// Required: false
Migrate bool `url:"migrate" json:"migrate"`
}
type wrapperAffinityRuleAddRequest struct {
AffinityRuleAddRequest
AsyncMode bool `url:"async_mode" json:"async_mode"`
} }
// AffinityRuleAdd add affinity rule // AffinityRuleAdd add affinity rule
func (c Compute) AffinityRuleAdd(ctx context.Context, req AffinityRuleAddRequest) (bool, error) { func (c Compute) AffinityRuleAdd(ctx context.Context, req AffinityRuleAddRequest) (AffinityRuleAddResult, error) {
err := validators.ValidateRequest(req) err := validators.ValidateRequest(req)
if err != nil { if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err)) return AffinityRuleAddResult{}, validators.ValidationErrors(validators.GetErrors(err))
} }
url := "/cloudapi/compute/affinityRuleAdd" url := "/cloudapi/compute/affinityRuleAdd"
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req) aReq := wrapperAffinityRuleAddRequest{
if err != nil { AffinityRuleAddRequest: req,
return false, err AsyncMode: false,
} }
result, err := strconv.ParseBool(string(res)) res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
if err != nil { if err != nil {
return false, err return AffinityRuleAddResult{}, err
} }
return result, nil if !req.Migrate {
result, err := strconv.ParseBool(string(res))
return AffinityRuleAddResult{Ok: result}, err
}
var report MigrationReport
err = json.Unmarshal(res, &report)
if err != nil {
return AffinityRuleAddResult{}, err
}
return AffinityRuleAddResult{Ok: report.Applied, MigrationReport: &report}, nil
}
// AsyncAffinityRuleAdd add affinity rule in async mode
func (c Compute) AsyncAffinityRuleAdd(ctx context.Context, req AffinityRuleAddRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/compute/affinityRuleAdd"
aReq := wrapperAffinityRuleAddRequest{
AffinityRuleAddRequest: req,
AsyncMode: true,
}
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
if err != nil {
return "", err
}
var resp string
err = json.Unmarshal(res, &resp)
if err != nil {
return "", err
}
return resp, nil
} }
+62 -8
View File
@@ -2,9 +2,11 @@ package compute
import ( import (
"context" "context"
"encoding/json"
"net/http" "net/http"
"strconv" "strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators" "repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
) )
@@ -40,26 +42,78 @@ type AntiAffinityRuleAddRequest struct {
// Value that must match the key to be taken into account when analyzing this rule // Value that must match the key to be taken into account when analyzing this rule
// Required: true // Required: true
Value string `url:"value" json:"value" validate:"required"` Value string `url:"value" json:"value" validate:"required"`
// Migrate compute according to the rule
// Default: false
// Required: false
Migrate bool `url:"migrate" json:"migrate"`
}
type wrapperAntiAffinityRuleAddRequest struct {
AntiAffinityRuleAddRequest
AsyncMode bool `url:"async_mode" json:"async_mode"`
} }
// AntiAffinityRuleAdd add anti affinity rule // AntiAffinityRuleAdd add anti affinity rule
func (c Compute) AntiAffinityRuleAdd(ctx context.Context, req AntiAffinityRuleAddRequest) (bool, error) { func (c Compute) AntiAffinityRuleAdd(ctx context.Context, req AntiAffinityRuleAddRequest) (AntiAffinityRuleAddResult, error) {
err := validators.ValidateRequest(req) err := validators.ValidateRequest(req)
if err != nil { if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err)) return AntiAffinityRuleAddResult{}, validators.ValidationErrors(validators.GetErrors(err))
} }
url := "/cloudapi/compute/antiAffinityRuleAdd" url := "/cloudapi/compute/antiAffinityRuleAdd"
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req) aReq := wrapperAntiAffinityRuleAddRequest{
if err != nil { AntiAffinityRuleAddRequest: req,
return false, err AsyncMode: false,
} }
result, err := strconv.ParseBool(string(res)) res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
if err != nil { if err != nil {
return false, err return AntiAffinityRuleAddResult{}, err
} }
return result, nil if !req.Migrate {
result, err := strconv.ParseBool(string(res))
return AntiAffinityRuleAddResult{Ok: result}, err
}
var report MigrationReport
err = json.Unmarshal(res, &report)
if err != nil {
return AntiAffinityRuleAddResult{}, err
}
return AntiAffinityRuleAddResult{Ok: report.Applied, MigrationReport: &report}, nil
}
// AsyncAntiAffinityRuleAdd add anti affinity rule in async mode
func (c Compute) AsyncAntiAffinityRuleAdd(ctx context.Context, req AntiAffinityRuleAddRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/compute/antiAffinityRuleAdd"
aReq := wrapperAntiAffinityRuleAddRequest{
AntiAffinityRuleAddRequest: req,
AsyncMode: true,
}
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
if err != nil {
return "", err
}
var resp string
err = json.Unmarshal(res, &resp)
if err != nil {
return "", err
}
return resp, nil
} }
+1 -1
View File
@@ -18,7 +18,7 @@ type CDEjectRequest struct {
type wrapperCDEjectRequest struct { type wrapperCDEjectRequest struct {
CDEjectRequest CDEjectRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode" json:"async_mode"`
} }
// CDEject eject CD image to compute's CD-ROM // CDEject eject CD image to compute's CD-ROM
+1 -1
View File
@@ -22,7 +22,7 @@ type CDInsertRequest struct {
type wrapperCDInsertRequest struct { type wrapperCDInsertRequest struct {
CDInsertRequest CDInsertRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode" json:"async_mode"`
} }
// CDInsert insert new CD image to compute's CD-ROM // CDInsert insert new CD image to compute's CD-ROM
+1 -1
View File
@@ -34,7 +34,7 @@ type ChangeIPRequest struct {
type wrapperChangeIPRequest struct { type wrapperChangeIPRequest struct {
ChangeIPRequest ChangeIPRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// ChangeIP change reserved IP for compute instance // ChangeIP change reserved IP for compute instance
+1 -1
View File
@@ -27,7 +27,7 @@ type ChangeLinkStateRequest struct {
type wrapperChangeLinkStateRequest struct { type wrapperChangeLinkStateRequest struct {
ChangeLinkStateRequest ChangeLinkStateRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// ChangeLinkState changes the status link virtual of compute // ChangeLinkState changes the status link virtual of compute
+1 -1
View File
@@ -26,7 +26,7 @@ type ChangeMTURequest struct {
type wrapperChangeMTURequest struct { type wrapperChangeMTURequest struct {
ChangeMTURequest ChangeMTURequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// ChangeMTU change MTU for compute instance // ChangeMTU change MTU for compute instance
+1 -1
View File
@@ -26,7 +26,7 @@ type ChangeQoSPoliciesRequest struct {
type wrapperChangeQoSPoliciesRequest struct { type wrapperChangeQoSPoliciesRequest struct {
ChangeQoSPoliciesRequest ChangeQoSPoliciesRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// ChangeQoSPolicies change qos policies for compute // ChangeQoSPolicies change qos policies for compute
@@ -30,7 +30,7 @@ type ChangeSecGroupsRequest struct {
type wrapperChangeSecGroupsRequest struct { type wrapperChangeSecGroupsRequest struct {
ChangeSecGroupsRequest ChangeSecGroupsRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// ChangeSecGroups changes security groups for compute // ChangeSecGroups changes security groups for compute
+1 -1
View File
@@ -47,7 +47,7 @@ type CloneRequest struct {
type wrapperCloneRequest struct { type wrapperCloneRequest struct {
CloneRequest CloneRequest
AsyncMode bool `url:"asyncMode" json:"asyncMode"` AsyncMode bool `url:"async_mode" json:"async_mode"`
} }
// Clone clones compute instance // Clone clones compute instance
+1 -1
View File
@@ -22,7 +22,7 @@ type CreateTemplateRequest struct {
type wrapperCreateTemplateRequest struct { type wrapperCreateTemplateRequest struct {
CreateTemplateRequest CreateTemplateRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// CreateTemplate create template from compute instance // CreateTemplate create template from compute instance
@@ -39,10 +39,6 @@ type CreateTemplateFromBlankRequest struct {
// Required: false // Required: false
Password string `url:"password,omitempty" json:"password,omitempty"` Password string `url:"password,omitempty" json:"password,omitempty"`
// Account ID to make the image exclusive
// Required: false
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
// Pool for image create // Pool for image create
// Required: false // Required: false
PoolName string `url:"poolName,omitempty" json:"poolName,omitempty"` PoolName string `url:"poolName,omitempty" json:"poolName,omitempty"`
@@ -55,7 +51,7 @@ type CreateTemplateFromBlankRequest struct {
type wrapperCreateTemplateFromBlankRequest struct { type wrapperCreateTemplateFromBlankRequest struct {
CreateTemplateFromBlankRequest CreateTemplateFromBlankRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// CreateTemplateFromBlank creates template from boot disk of current compute in sync mode. // CreateTemplateFromBlank creates template from boot disk of current compute in sync mode.
+1 -1
View File
@@ -26,7 +26,7 @@ type DeleteRequest struct {
type wrapperDeleteRequest struct { type wrapperDeleteRequest struct {
DeleteRequest DeleteRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// Delete deletes compute // Delete deletes compute
+1 -1
View File
@@ -18,7 +18,7 @@ type DisableRequest struct {
type wrapperDisableRequest struct { type wrapperDisableRequest struct {
DisableRequest DisableRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// Disable disables compute // Disable disables compute
+1 -1
View File
@@ -60,7 +60,7 @@ type DiskAddRequest struct {
type wrapperDiskAddRequest struct { type wrapperDiskAddRequest struct {
DiskAddRequest DiskAddRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// DiskAdd creates new disk and attach to compute // DiskAdd creates new disk and attach to compute
+1 -1
View File
@@ -34,7 +34,7 @@ type DiskAttachRequest struct {
type wrapperDiskAttachRequest struct { type wrapperDiskAttachRequest struct {
DiskAttachRequest DiskAttachRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// DiskAttach attach disk to compute // DiskAttach attach disk to compute
+1 -1
View File
@@ -26,7 +26,7 @@ type DiskDelRequest struct {
type wrapperDiskDelRequest struct { type wrapperDiskDelRequest struct {
DiskDelRequest DiskDelRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// DiskDel delete disk and detach from compute // DiskDel delete disk and detach from compute
+1 -1
View File
@@ -22,7 +22,7 @@ type DiskDetachRequest struct {
type wrapperDiskDetachRequest struct { type wrapperDiskDetachRequest struct {
DiskDetachRequest DiskDetachRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// DiskDetach detach disk from compute // DiskDetach detach disk from compute
+1 -1
View File
@@ -26,7 +26,7 @@ type DiskQOSRequest struct {
type wrapperDiskQOSRequest struct { type wrapperDiskQOSRequest struct {
DiskQOSRequest DiskQOSRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// DiskQOS change QoS of the disk // DiskQOS change QoS of the disk
+1 -1
View File
@@ -26,7 +26,7 @@ type DiskResizeRequest struct {
type wrapperDiskResizeRequest struct { type wrapperDiskResizeRequest struct {
DiskResizeRequest DiskResizeRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// DiskResize change disk size // DiskResize change disk size
@@ -26,7 +26,7 @@ type DiskSwitchToReplicationRequest struct {
type wrapperDiskSwitchToReplicationRequest struct { type wrapperDiskSwitchToReplicationRequest struct {
DiskSwitchToReplicationRequest DiskSwitchToReplicationRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// DiskSwitchToReplication switches disk to it's replication // DiskSwitchToReplication switches disk to it's replication
+1 -1
View File
@@ -18,7 +18,7 @@ type GuestAgentDisableRequest struct {
type wrapperGuestAgentDisableRequest struct { type wrapperGuestAgentDisableRequest struct {
GuestAgentDisableRequest GuestAgentDisableRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// Disable guest agent at a specific compute // Disable guest agent at a specific compute
+1 -1
View File
@@ -18,7 +18,7 @@ type GuestAgentEnableRequest struct {
type wrapperGuestAgentEnableRequest struct { type wrapperGuestAgentEnableRequest struct {
GuestAgentEnableRequest GuestAgentEnableRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// Enable guest agent at a specific compute // Enable guest agent at a specific compute
+1 -1
View File
@@ -26,7 +26,7 @@ type GuestAgentExecuteRequest struct {
type wrapperGuestAgentExecuteRequest struct { type wrapperGuestAgentExecuteRequest struct {
GuestAgentExecuteRequest GuestAgentExecuteRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// Execute guest agent command // Execute guest agent command
@@ -18,7 +18,7 @@ type GuestAgentFeatureUpdateRequest struct {
type wrapperGuestAgentFeatureUpdateRequest struct { type wrapperGuestAgentFeatureUpdateRequest struct {
GuestAgentFeatureUpdateRequest GuestAgentFeatureUpdateRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// Feature update guest agent // Feature update guest agent
+8
View File
@@ -63,6 +63,14 @@ type ListRequest struct {
// Required: false // Required: false
ZoneID uint64 `url:"zone_id,omitempty" json:"zone_id,omitempty"` ZoneID uint64 `url:"zone_id,omitempty" json:"zone_id,omitempty"`
// Find by VM folder ID
// Required: false
FolderID uint64 `url:"folder_id,omitempty" json:"folder_id,omitempty"`
// Include computes from descendant folders.
// Required: false
IncludeDescendants interface{} `url:"include_descendants,omitempty" json:"include_descendants,omitempty" validate:"omitempty,isBool"`
// Page number // Page number
// Required: false // Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"` Page uint64 `url:"page,omitempty" json:"page,omitempty"`
+1 -1
View File
@@ -22,7 +22,7 @@ type MigrateToZoneRequest struct {
type wrapperMigrateToZoneRequest struct { type wrapperMigrateToZoneRequest struct {
MigrateToZoneRequest MigrateToZoneRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// MoveToRG moves compute instance to new resource group // MoveToRG moves compute instance to new resource group
+50
View File
@@ -575,6 +575,9 @@ type RecordCompute struct {
// Zone ID // Zone ID
// Required: false // Required: false
ZoneID uint64 `json:"zoneId"` ZoneID uint64 `json:"zoneId"`
// Folder ID
FolderID uint64 `json:"folder_id"`
} }
// Detailed information about ACL Access in a compute // Detailed information about ACL Access in a compute
@@ -1564,6 +1567,9 @@ type ItemCompute struct {
// Zone ID // Zone ID
ZoneID uint64 `json:"zoneId"` ZoneID uint64 `json:"zoneId"`
// Folder ID
FolderID uint64 `json:"folder_id"`
} }
// ListInfoDisks // ListInfoDisks
@@ -1743,3 +1749,47 @@ type CloneStatus struct {
// Progress percent // Progress percent
ProgressPercent int `json:"progress_percent"` ProgressPercent int `json:"progress_percent"`
} }
type MigrationReportItem struct {
// ID of the compute instance
ComputeID uint64 `json:"compute_id"`
// Per-VM action result, not workflow status
// Should be one of:
// - migrated: migration completed; the rule may still be unsatisfied
// - skipped: migration was not needed or applicable
// - not_started: submission was not attempted
// - not_completed: completion is unconfirmed; the VM may have moved
Status string `json:"status"`
// Action details, errors and final rule-placement warnings
Message string `json:"message"`
// Workflow ID for tracking, or nil if submission was not attempted.
// A non-nil ID does not confirm job acceptance
WorkflowJobID *string `json:"workflow_job_id"`
}
type MigrationReport struct {
// Rules were saved; does not confirm migration success or rule satisfaction
Applied bool `json:"applied"`
// Per-compute migration results
Migrations []MigrationReportItem `json:"migrations"`
}
type AffinityRuleAddResult struct {
// Result of the rule addition
Ok bool
// Migration report. Populated only when the request was made with Migrate=true, nil otherwise
MigrationReport *MigrationReport
}
type AntiAffinityRuleAddResult struct {
// Result of the rule addition
Ok bool
// Migration report. Populated only when the request was made with Migrate=true, nil otherwise
MigrationReport *MigrationReport
}
+1 -1
View File
@@ -37,7 +37,7 @@ type MoveToRGRequest struct {
type wrapperMoveToRGRequest struct { type wrapperMoveToRGRequest struct {
MoveToRGRequest MoveToRGRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// MoveToRG moves compute instance to new resource group // MoveToRG moves compute instance to new resource group
+1 -1
View File
@@ -96,7 +96,7 @@ type NetAttachRequest struct {
type wrapperNetAttachRequest struct { type wrapperNetAttachRequest struct {
NetAttachRequest NetAttachRequest
AsyncMode bool `url:"asyncMode" json:"asyncMode"` AsyncMode bool `url:"async_mode" json:"async_mode"`
} }
// NetAttach attaches network to compute and gets info about network // NetAttach attaches network to compute and gets info about network
+1 -1
View File
@@ -26,7 +26,7 @@ type NetDetachRequest struct {
type wrapperNetDetachRequest struct { type wrapperNetDetachRequest struct {
NetDetachRequest NetDetachRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// NetDetach detaches network from compute // NetDetach detaches network from compute
+1 -1
View File
@@ -18,7 +18,7 @@ type PauseRequest struct {
type wrapperPauseRequest struct { type wrapperPauseRequest struct {
PauseRequest PauseRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// Pause pause compute // Pause pause compute
+1 -1
View File
@@ -36,7 +36,7 @@ type PFWAddRequest struct {
type wrapperPFWAddRequest struct { type wrapperPFWAddRequest struct {
PFWAddRequest PFWAddRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// PFWAdd add port forward rule // PFWAdd add port forward rule
+1 -1
View File
@@ -39,7 +39,7 @@ type PFWDelRequest struct {
type wrapperPFWDelRequest struct { type wrapperPFWDelRequest struct {
PFWDelRequest PFWDelRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// PFWDel deletes port forward rule // PFWDel deletes port forward rule
+1 -1
View File
@@ -23,7 +23,7 @@ type PinToNodeRequest struct {
type wrapperPinToNodeRequest struct { type wrapperPinToNodeRequest struct {
PinToNodeRequest PinToNodeRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// PinToNode pin compute to current node // PinToNode pin compute to current node
+1 -1
View File
@@ -18,7 +18,7 @@ type PowerCycleRequest struct {
type wrapperPowerCycleRequest struct { type wrapperPowerCycleRequest struct {
PowerCycleRequest PowerCycleRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// PowerCycle makes force stop and start compute // PowerCycle makes force stop and start compute
+1 -1
View File
@@ -18,7 +18,7 @@ type RebootRequest struct {
type wrapperRebootRequest struct { type wrapperRebootRequest struct {
RebootRequest RebootRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// Reboot reboots compute // Reboot reboots compute
+1 -1
View File
@@ -47,7 +47,7 @@ type RedeployRequest struct {
type wrapperRedeployRequest struct { type wrapperRedeployRequest struct {
RedeployRequest RedeployRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// Redeploy redeploys compute // Redeploy redeploys compute
+1 -1
View File
@@ -18,7 +18,7 @@ type ResetRequest struct {
type wrapperResetRequest struct { type wrapperResetRequest struct {
ResetRequest ResetRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// Reset resets compute // Reset resets compute
+1 -1
View File
@@ -46,7 +46,7 @@ func (r ResizeRequest) GetRAM() map[string]uint64 {
type wrapperResizeRequest struct { type wrapperResizeRequest struct {
ResizeRequest ResizeRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// Resize resizes compute instance // Resize resizes compute instance
+1 -1
View File
@@ -18,7 +18,7 @@ type RestoreRequest struct {
type wrapperRestoreRequest struct { type wrapperRestoreRequest struct {
RestoreRequest RestoreRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// Restore restores compute from recycle bin // Restore restores compute from recycle bin
+1 -1
View File
@@ -18,7 +18,7 @@ type ResumeRequest struct {
type wrapperResumeRequest struct { type wrapperResumeRequest struct {
ResumeRequest ResumeRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// Resume resume Compute from paused state // Resume resume Compute from paused state
+1 -1
View File
@@ -29,7 +29,7 @@ type SnapshotCreateRequest struct {
type wrapperSnapshotCreateRequest struct { type wrapperSnapshotCreateRequest struct {
SnapshotCreateRequest SnapshotCreateRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// SnapshotCreate creates compute snapshot // SnapshotCreate creates compute snapshot
+1 -1
View File
@@ -21,7 +21,7 @@ type SnapshotDeleteRequest struct {
type wrapperSnapshotDeleteRequeststruct struct { type wrapperSnapshotDeleteRequeststruct struct {
SnapshotDeleteRequest SnapshotDeleteRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// SnapshotDelete deletes specified compute snapshot // SnapshotDelete deletes specified compute snapshot
+1 -1
View File
@@ -26,7 +26,7 @@ type SnapshotRollbackRequest struct {
type wrapperSnapshotRollbackRequest struct { type wrapperSnapshotRollbackRequest struct {
SnapshotRollbackRequest SnapshotRollbackRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// SnapshotRollback rollbacks specified compute snapshot // SnapshotRollback rollbacks specified compute snapshot
+1 -1
View File
@@ -22,7 +22,7 @@ type StartRequest struct {
type wrapperStartRequest struct { type wrapperStartRequest struct {
StartRequest StartRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// Start starts compute // Start starts compute
+1 -1
View File
@@ -22,7 +22,7 @@ type StopRequest struct {
type wrapperStopRequest struct { type wrapperStopRequest struct {
StopRequest StopRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// Stop stops compute // Stop stops compute
+1 -1
View File
@@ -82,7 +82,7 @@ type UpdateRequest struct {
// Memory balloon mode. One of ["auto","legacy","none"] // Memory balloon mode. One of ["auto","legacy","none"]
// Required: false // Required: false
// Default: "auto" // Default: none
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"` MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
} }
+1 -5
View File
@@ -35,10 +35,6 @@ type FromPlatformDiskRequest struct {
// Required: false // Required: false
Password string `url:"password,omitempty" json:"password,omitempty"` Password string `url:"password,omitempty" json:"password,omitempty"`
// Account ID to make the image exclusive
// Required: false
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
// Pool for image create // Pool for image create
// Required: false // Required: false
PoolName string `url:"poolName,omitempty" json:"poolName,omitempty"` PoolName string `url:"poolName,omitempty" json:"poolName,omitempty"`
@@ -54,7 +50,7 @@ type FromPlatformDiskRequest struct {
type wrapperFromPlatformDiskRequest struct { type wrapperFromPlatformDiskRequest struct {
FromPlatformDiskRequest FromPlatformDiskRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// FromPlatformDisk creates template from platform disk in sync mode. // FromPlatformDisk creates template from platform disk in sync mode.
+9
View File
@@ -93,6 +93,9 @@ type ItemReservation struct {
// Account ID // Account ID
AccountID uint64 `json:"account_id"` AccountID uint64 `json:"account_id"`
// Auto assignable
AutoAssignable bool `json:"auto_assignable"`
// ClientType // ClientType
ClientType string `json:"clientType"` ClientType string `json:"clientType"`
@@ -127,6 +130,12 @@ type VNFs struct {
} }
type Excluded struct { type Excluded struct {
// Account ID
AccountID uint64 `json:"account_id"`
// Auto assignable
AutoAssignable bool `json:"auto_assignable"`
// ClientType // ClientType
ClientType string `json:"clientType"` ClientType string `json:"clientType"`
+1 -1
View File
@@ -77,7 +77,7 @@ type CreateRequest struct {
type asyncWrapperCreateRequest struct { type asyncWrapperCreateRequest struct {
CreateRequest CreateRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// Create creates image from a media identified by URL // Create creates image from a media identified by URL
+9 -1
View File
@@ -230,6 +230,10 @@ type CreateRequest struct {
// Required: false // Required: false
PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"` PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"`
// List of PCI device IDs to attach to this VM
// Required: false
PCIdevices []uint64 `url:"pcidevices,omitempty" json:"pcidevices,omitempty"`
// Zone ID // Zone ID
// Required: false // Required: false
ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"` ZoneID uint64 `url:"zoneId,omitempty" json:"zoneId,omitempty"`
@@ -250,8 +254,12 @@ type CreateRequest struct {
// Memory balloon mode. One of ["auto","legacy","none"] // Memory balloon mode. One of ["auto","legacy","none"]
// Required: false // Required: false
// Default: "auto" // Default: none
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"` MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
// List of vGPU IDs to attach to the VM
// Required: false
VGPUs []uint64 `url:"vgpus,omitempty" json:"vgpus,omitempty"`
} }
// GetRAM returns RAM field values // GetRAM returns RAM field values
+9 -1
View File
@@ -92,6 +92,10 @@ type CreateBlankRequest struct {
// Required: false // Required: false
PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"` PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"`
// List of PCI device IDs to attach to this VM
// Required: false
PCIdevices []uint64 `url:"pcidevices,omitempty" json:"pcidevices,omitempty"`
// VM type linux, windows or unknown // VM type linux, windows or unknown
// Required: false // Required: false
LoaderType string `url:"loaderType,omitempty" json:"loaderType,omitempty" validate:"omitempty,loaderType"` LoaderType string `url:"loaderType,omitempty" json:"loaderType,omitempty" validate:"omitempty,loaderType"`
@@ -132,8 +136,12 @@ type CreateBlankRequest struct {
// Memory balloon mode. One of ["auto","legacy","none"] // Memory balloon mode. One of ["auto","legacy","none"]
// Required: false // Required: false
// Default: "auto" // Default: none
MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"` MemoryBalloonMode string `url:"memory_balloon_mode,omitempty" json:"memory_balloon_mode,omitempty" validate:"omitempty,memoryBalloonMode"`
// List of vGPU IDs to attach to the VM
// Required: false
VGPUs []uint64 `url:"vgpus,omitempty" json:"vgpus,omitempty"`
} }
// GetRAM returns RAM field values // GetRAM returns RAM field values
@@ -0,0 +1,46 @@
package stpolicy
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// GetReplicationProfileRequest struct to get replication profile
type GetReplicationProfileRequest struct {
// ID of replication profile
// Required: true
ProfileID uint64 `url:"profile_id" json:"profile_id" validate:"required"`
}
// GetReplicationProfile gets replication profile as an InfoReplicationProfile struct
func (sp StPolicy) GetReplicationProfile(ctx context.Context, req GetReplicationProfileRequest) (*InfoReplicationProfile, error) {
res, err := sp.GetReplicationProfileRaw(ctx, req)
if err != nil {
return nil, err
}
info := InfoReplicationProfile{}
err = json.Unmarshal(res, &info)
if err != nil {
return nil, err
}
return &info, nil
}
// GetReplicationProfileRaw gets replication profile as an array of bytes
func (sp StPolicy) GetReplicationProfileRaw(ctx context.Context, req GetReplicationProfileRequest) ([]byte, error) {
err := validators.ValidateRequest(req)
if err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/storage_policy/get_replication_profile"
res, err := sp.client.DecortApiCall(ctx, http.MethodGet, url, req)
return res, err
}
@@ -0,0 +1,65 @@
package stpolicy
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// ListReplicationProfileRequest struct to get list of replication profiles
type ListReplicationProfileRequest struct {
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
// Page size
// Required: false
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
// Search by replication profile ID
// Required: false
ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`
// Search by replication profile name
// Required: false
Name string `url:"name,omitempty" json:"name,omitempty"`
// Search by replication type
// Required: false
ReplicationType string `url:"replication_type,omitempty" json:"replication_type,omitempty"`
// Sort by one of supported fields, format ±<field>
// Required: false
SortBy string `url:"sort_by,omitempty" json:"sort_by,omitempty"`
}
// ListReplicationProfile gets list of replication profiles as a ListReplicationProfiles struct
func (sp StPolicy) ListReplicationProfile(ctx context.Context, req ListReplicationProfileRequest) (*ListReplicationProfiles, error) {
res, err := sp.ListReplicationProfileRaw(ctx, req)
if err != nil {
return nil, err
}
list := ListReplicationProfiles{}
err = json.Unmarshal(res, &list)
if err != nil {
return nil, err
}
return &list, nil
}
// ListReplicationProfileRaw gets list of replication profiles as an array of bytes
func (sp StPolicy) ListReplicationProfileRaw(ctx context.Context, req ListReplicationProfileRequest) ([]byte, error) {
if err := validators.ValidateRequest(req); err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/storage_policy/list_replication_profile"
res, err := sp.client.DecortApiCall(ctx, http.MethodGet, url, req)
return res, err
}
+77 -2
View File
@@ -27,9 +27,12 @@ type ItemStoragePolicy struct {
// Status of the storage policy // Status of the storage policy
Status string `json:"status"` Status string `json:"status"`
// Max IOPS for the sotrage policy // Max IOPS for the storage policy
LimitIOPS uint64 `json:"limit_iops"` LimitIOPS uint64 `json:"limit_iops"`
// ID of the replication profile
ReplicationProfileID uint64 `json:"replication_profile_id"`
// Storage policy ID // Storage policy ID
StoragePolicyID uint64 `json:"storage_policy_id"` StoragePolicyID uint64 `json:"storage_policy_id"`
@@ -56,9 +59,12 @@ type InfoStoragePolicy struct {
// Status of the storage policy // Status of the storage policy
Status string `json:"status"` Status string `json:"status"`
// Max IOPS for the sotrage policy // Max IOPS for the storage policy
LimitIOPS uint64 `json:"limit_iops"` LimitIOPS uint64 `json:"limit_iops"`
// ID of the replication profile
ReplicationProfileID uint64 `json:"replication_profile_id"`
// ID of the storage policy // ID of the storage policy
StoragePolicyID uint64 `json:"storage_policy_id"` StoragePolicyID uint64 `json:"storage_policy_id"`
@@ -89,3 +95,72 @@ type Usage struct {
// List of resource groups // List of resource groups
Resgroups []uint64 `json:"resgroups"` Resgroups []uint64 `json:"resgroups"`
} }
type ListReplicationProfiles struct {
// List
Data []ItemReplicationProfile `json:"data"`
// Entry Count
EntryCount uint64 `json:"entryCount"`
}
type ItemReplicationProfile struct {
// ID of the replication profile
ID uint64 `json:"id"`
// GUID
GUID uint64 `json:"guid"`
// Name of the replication profile
Name string `json:"name"`
// Replication types
ReplicationType []string `json:"replication_type"`
// Max copy rate
MAXCopyRate uint64 `json:"max_copy_rate"`
// List of schedules
Schedules ListSchedules `json:"schedules"`
}
type InfoReplicationProfile struct {
// ID of the replication profile
ID uint64 `json:"id"`
// GUID
GUID uint64 `json:"guid"`
// Name of the replication profile
Name string `json:"name"`
// Replication types
ReplicationType []string `json:"replication_type"`
// Max copy rate
MAXCopyRate uint64 `json:"max_copy_rate"`
// List of schedules
Schedules ListSchedules `json:"schedules"`
}
type ListSchedules []Schedule
type Schedule struct {
// Type of the schedule
Type string `json:"type"`
// Name of the schedule
Name string `json:"name"`
// Min interval
MINInterval uint64 `json:"min_interval"`
// Calendar of the schedule
Calendar Calendar `json:"calendar"`
}
type Calendar struct {
// Weekly schedule
Weekly map[string][]string `json:"weekly"`
}
+1 -1
View File
@@ -12,7 +12,7 @@ import (
type SetDataRequest struct { type SetDataRequest struct {
// Data to set to user in json format // Data to set to user in json format
// Required: true // Required: true
Data string `url:"data" json:"data" validation:"required"` Data string `url:"data" json:"data" validate:"required"`
} }
// SetData sets extra user information. // SetData sets extra user information.
+6
View File
@@ -340,6 +340,9 @@ type ItemVNFInterface struct {
// List of VNF IDs // List of VNF IDs
VNFs []uint64 `json:"vnfs"` VNFs []uint64 `json:"vnfs"`
// Whether default gateway is enabled
EnableDefaultGateway bool `json:"enable_default_gateway"`
} }
// Main information about QOS // Main information about QOS
@@ -630,6 +633,9 @@ type RecordDHCPConfig struct {
// List of reservations // List of reservations
Reservations ListReservations `json:"reservations"` Reservations ListReservations `json:"reservations"`
// Whether default gateway is enabled
EnableDefaultGateway bool `json:"enable_default_gateway"`
} }
// List of static routes // List of static routes
+10
View File
@@ -0,0 +1,10 @@
package cloudapi
import (
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/pkg/cloudapi/vmfolder"
)
// Accessing the VMFolder method group
func (ca *CloudAPI) VMFolder() *vmfolder.VMFolder {
return vmfolder.New(ca.client)
}
+47
View File
@@ -0,0 +1,47 @@
package vmfolder
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// AddACLAccessRequest adds ACL access to a vm folder
type AddACLAccessRequest struct {
// ID of a folder
// Required: true
FolderID uint64 `url:"folder_id" json:"folder_id" validate:"required"`
// User or group name to grant access
// Required: true
User string `url:"user" json:"user" validate:"required"`
// ID of a folder
// Required: true
Right string `url:"right" json:"right" validate:"required"`
}
// AddACLAccess adds ACL access to a vm folder
func (v VMFolder) AddACLAccess(ctx context.Context, req AddACLAccessRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vmfolder/add_acl_access"
res, err := v.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}
+42
View File
@@ -0,0 +1,42 @@
package vmfolder
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// ComputesMoveRequest struct to move computes to a vm folder
type ComputesMoveRequest struct {
// IDs of computes to move
// Required: true
ComputeIDs []uint64 `url:"compute_ids" json:"compute_ids" validate:"required"`
// Target vm folder ID
// Required: true
FolderID uint64 `url:"folder_id" json:"folder_id" validate:"required"`
}
// ComputesMove moves computes to a vm folder
func (v VMFolder) ComputesMove(ctx context.Context, req ComputesMoveRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vmfolder/computes_move"
res, err := v.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
}
+47
View File
@@ -0,0 +1,47 @@
package vmfolder
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// CreateRequest struct to create a vm folder
type CreateRequest struct {
// Resource Group ID
// Required: true
RGID uint64 `url:"rg_id" json:"rg_id" validate:"required"`
// Name
// Required: true
Name string `url:"name" json:"name" validate:"required"`
// Parent ID
// Required: false
ParentID uint64 `url:"parent_id,omitempty" json:"parent_id,omitempty"`
}
// Create creates a vm folder
func (v VMFolder) Create(ctx context.Context, req CreateRequest) (uint64, error) {
err := validators.ValidateRequest(req)
if err != nil {
return 0, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vmfolder/create"
res, err := v.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil {
return 0, err
}
result, err := strconv.ParseUint(string(res), 10, 64)
if err != nil {
return 0, err
}
return result, nil
}
+43
View File
@@ -0,0 +1,43 @@
package vmfolder
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// DeleteACLAccessRequest deletes ACL access from a vm folder
type DelACLAccessRequest struct {
// ID of a folder
// Required: true
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" validate:"required"`
}
// DeleteACLAccess deletes ACL access from a vm foler
func (v VMFolder) DeleteACLAccess(ctx context.Context, req DelACLAccessRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vmfolder/del_acl_access"
res, err := v.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}
+38
View File
@@ -0,0 +1,38 @@
package vmfolder
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// DeleteRequest struct to delete a VM folder
type DeleteRequest struct {
// ID of a folder to delete
// Required: true
FolderID uint64 `url:"folder_id" json:"folder_id" validate:"required"`
}
// Delete deletes a vm folder
func (v VMFolder) Delete(ctx context.Context, req DeleteRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vmfolder/delete"
res, err := v.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
}
+46
View File
@@ -0,0 +1,46 @@
package vmfolder
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// GetRequest struct to get detailed information about a vm folder
type GetRequest struct {
// ID of a folder
// Required: true
FolderID uint64 `url:"folder_id" json:"folder_id" validate:"required"`
}
// Get gets current configuration of the vm folder as a RecordVMFolder struct
func (v VMFolder) Get(ctx context.Context, req GetRequest) (*RecordVMFolder, error) {
res, err := v.GetRaw(ctx, req)
if err != nil {
return nil, err
}
info := RecordVMFolder{}
err = json.Unmarshal(res, &info)
if err != nil {
return nil, err
}
return &info, nil
}
// GetRaw gets current configuration of the vm folder as an array of bytes
func (v VMFolder) GetRaw(ctx context.Context, req GetRequest) ([]byte, error) {
err := validators.ValidateRequest(req)
if err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vmfolder/get"
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, req)
return res, err
}
+55
View File
@@ -0,0 +1,55 @@
package vmfolder
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// ListRequest struct to get list of vm folders
type ListRequest struct {
// Resource group ID
// Required: true
RGID uint64 `url:"rg_id" json:"rg_id" validate:"required"`
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
// Page size
// Required: false
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}
// List gets list of all vm folders in a resource group as a ListVMFolder struct
func (v VMFolder) List(ctx context.Context, req ListRequest) (*ListVMFolder, error) {
res, err := v.ListRaw(ctx, req)
if err != nil {
return nil, err
}
list := ListVMFolder{}
err = json.Unmarshal(res, &list)
if err != nil {
return nil, err
}
return &list, nil
}
// ListRaw gets list of all vm folders in a resource group as an array of bytes
func (v VMFolder) ListRaw(ctx context.Context, req ListRequest) ([]byte, error) {
if err := validators.ValidateRequest(req); err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vmfolder/list"
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, req)
return res, err
}
+79
View File
@@ -0,0 +1,79 @@
package vmfolder
// Detailed information about a folder
type RecordVMFolder struct {
// ID
ID uint64 `json:"id"`
// RG ID
RGID uint64 `json:"rg_id"`
// GID
GID uint64 `json:"gid"`
// Name of a folder
Name string `json:"name"`
// ACL
ACL []ACL `json:"acl"`
// Time of creation
CreatedTime uint64 `json:"created_time"`
// Parent ID
ParentID uint64 `json:"parent_id"`
// Status of a folder
Status string `json:"status"`
// Compute IDs
ComputeIDs []uint64 `json:"compute_ids"`
}
// ACL
type ACL struct {
// Explicit
Explicit bool `json:"explicit"`
// Right
Right string `json:"right"`
// Status
Status string `json:"status"`
// Type
Type string `json:"type"`
// User group ID
UserGroupID string `json:"userGroupId"`
}
// List of vm folders
type ListVMFolder struct {
// Entry count
EntryCount uint64 `json:"entryCount"`
// Data
Data []ItemVMFolder `json:"data"`
}
// Detailed information about a folder item
type ItemVMFolder struct {
// Folder ID
ID uint64 `json:"id"`
// Parent ID
ParentID uint64 `json:"parent_id"`
// Name
Name string `json:"name"`
// ACL
ACL []ACL `json:"acl"`
// Status
Status string `json:"status"`
// VM count
VMCount uint64 `json:"vm_count"`
}
+42
View File
@@ -0,0 +1,42 @@
package vmfolder
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// MoveRequest to move a vm folder to a compute
type MoveRequest struct {
// VM Folder ID
// Required: true
FolderID uint64 `url:"folder_id" json:"folder_id"`
// New parent folder ID
// Required: true
NewParentID uint64 `url:"new_parent_id" json:"new_parent_id"`
}
// Move moves a vm folder to a compute
func (v VMFolder) Move(ctx context.Context, req MoveRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vmfolder/move"
res, err := v.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
}
+42
View File
@@ -0,0 +1,42 @@
package vmfolder
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// RenameRequest struct to rename a VM folder
type RenameRequest struct {
// ID of a folder to rename
// Required: true
FolderID uint64 `url:"folder_id" json:"folder_id" validate:"required"`
// A new name
// Required: true
Name string `url:"name" json:"name" validate:"required"`
}
// Rename renames a vm folder
func (v VMFolder) Rename(ctx context.Context, req RenameRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/vmfolder/rename"
res, err := v.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
}
+17
View File
@@ -0,0 +1,17 @@
package vmfolder
import (
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/interfaces"
)
// Structure for creating request to VMFolder
type VMFolder struct {
client interfaces.Caller
}
// Builder for VMFolder endpoints
func New(client interfaces.Caller) *VMFolder {
return &VMFolder{
client,
}
}
+9 -7
View File
@@ -2,8 +2,8 @@ package apiaccess
import ( import (
"context" "context"
"encoding/json"
"net/http" "net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators" "repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
) )
@@ -20,23 +20,25 @@ type DescUpdateRequest struct {
} }
// DescUpdate sets a new text description of the apiaccess group. // DescUpdate sets a new text description of the apiaccess group.
func (a APIAccess) DescUpdate(ctx context.Context, req DescUpdateRequest) (bool, error) { func (a APIAccess) DescUpdate(ctx context.Context, req DescUpdateRequest) (*ItemAPIAccess, error) {
err := validators.ValidateRequest(req) err := validators.ValidateRequest(req)
if err != nil { if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err)) return nil, validators.ValidationErrors(validators.GetErrors(err))
} }
url := "/cloudbroker/apiaccess/descUpdate" url := "/cloudbroker/apiaccess/descUpdate"
res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, req) res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil { if err != nil {
return false, err return nil, err
} }
result, err := strconv.ParseBool(string(res)) info := ItemAPIAccess{}
err = json.Unmarshal(res, &info)
if err != nil { if err != nil {
return false, err return nil, err
} }
return result, nil return &info, nil
} }
+4
View File
@@ -38,6 +38,10 @@ type ListRequest struct {
// Required: false // Required: false
SortBy string `url:"sort_by,omitempty" json:"sort_by,omitempty" validate:"omitempty,sortBy"` 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 // Page number
// Required: false // Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"` Page uint64 `url:"page,omitempty" json:"page,omitempty"`
+140 -96
View File
@@ -1,5 +1,7 @@
package apiaccess package apiaccess
import "encoding/json"
type ItemAPIAccess struct { type ItemAPIAccess struct {
// APIs // APIs
APIs APIsEndpoints `json:"apis"` APIs APIsEndpoints `json:"apis"`
@@ -88,119 +90,161 @@ type APIsEndpoints struct {
// CloudBroker endpoints // CloudBroker endpoints
CloudBroker CloudBrokerEndpoints `json:"cloudbroker,omitempty"` CloudBroker CloudBrokerEndpoints `json:"cloudbroker,omitempty"`
// LibCloud endpoints // SDN endpoints
LibCloud LibCloudEndpoints `json:"libcloud,omitempty"` SDN SDNEndpoints `json:"sdn,omitempty"`
// System endpoints // System endpoints
System SystemEndpoints `json:"system,omitempty"` System SystemEndpoints `json:"system,omitempty"`
} }
// MarshalJSON omits empty namespaces, so that "{}" is not sent in requests.
func (a APIsEndpoints) MarshalJSON() ([]byte, error) {
namespaces := []struct {
key string
value interface{}
}{
{"cloudapi", a.CloudAPI},
{"cloudbroker", a.CloudBroker},
{"sdn", a.SDN},
{"system", a.System},
}
result := make(map[string]json.RawMessage, len(namespaces))
for _, ns := range namespaces {
data, err := json.Marshal(ns.value)
if err != nil {
return nil, err
}
if string(data) == "{}" {
continue
}
result[ns.key] = data
}
return json.Marshal(result)
}
type CloudAPIEndpoints struct { type CloudAPIEndpoints struct {
Account []string `json:"account,omitempty"` Account []string `json:"account,omitempty"`
BService []string `json:"bservice,omitempty"` Audit []string `json:"audit,omitempty"`
CloudSpace []string `json:"cloudspace,omitempty"` BService []string `json:"bservice,omitempty"`
Compute []string `json:"compute,omitempty"` Compute []string `json:"compute,omitempty"`
ComputeCI []string `json:"computeci,omitempty"` Disks []string `json:"disks,omitempty"`
Disks []string `json:"disks,omitempty"` DPDKNet []string `json:"dpdknet,omitempty"`
DPDK []string `json:"dpdk,omitempty"` ExtNet []string `json:"extnet,omitempty"`
ExtNet []string `json:"extnet,omitempty"` FLIPGroup []string `json:"flipgroup,omitempty"`
FLIPGroup []string `json:"flipgroup,omitempty"` GPU []string `json:"gpu,omitempty"`
GPU []string `json:"gpu,omitempty"` Image []string `json:"image,omitempty"`
Image []string `json:"image,omitempty"` K8CI []string `json:"k8ci,omitempty"`
K8CI []string `json:"k8ci,omitempty"` K8S []string `json:"k8s,omitempty"`
K8S []string `json:"k8s,omitempty"` KVMX86 []string `json:"kvmx86,omitempty"`
KVMX86 []string `json:"kvmx86,omitempty"` LB []string `json:"lb,omitempty"`
LB []string `json:"lb,omitempty"` Loactions []string `json:"locations,omitempty"`
Loactions []string `json:"locations,omitempty"` PCIDevice []string `json:"pcidevice,omitempty"`
Machine []string `json:"machine,omitempty"` Prometheus []string `json:"prometheus,omitempty"`
Openshift []string `json:"openshift,omitempty"` RG []string `json:"rg,omitempty"`
OpenshiftCI []string `json:"openshiftci,omitempty"` SecurityGroup []string `json:"security_group,omitempty"`
PCIDevice []string `json:"pcidevice,omitempty"` SEP []string `json:"sep,omitempty"`
PortForwarding []string `json:"portforwarding,omitempty"` StoragePolicy []string `json:"storage_policy,omitempty"`
Prometheus []string `json:"prometheus,omitempty"` Tasks []string `json:"tasks,omitempty"`
RG []string `json:"rg,omitempty"` Trunk []string `json:"trunk,omitempty"`
Sizes []string `json:"sizes,omitempty"` User []string `json:"user,omitempty"`
Tasks []string `json:"tasks,omitempty"` VFPool []string `json:"vfpool,omitempty"`
User []string `json:"user,omitempty"` VGPU []string `json:"vgpu,omitempty"`
VGPU []string `json:"vgpu,omitempty"` VINS []string `json:"vins,omitempty"`
VINS []string `json:"vins,omitempty"` VMFolder []string `json:"vmfolder,omitempty"`
All bool `json:"ALL,omitempty"` Zone []string `json:"zone,omitempty"`
All bool `json:"ALL,omitempty"`
} }
type CloudBrokerEndpoints struct { type CloudBrokerEndpoints struct {
Account []string `json:"account,omitempty"` Account interface{} `json:"account,omitempty"`
APIAccess []string `json:"apiaccess,omitempty"` APIAccess interface{} `json:"apiaccess,omitempty"`
Audit interface{} `json:"audit,omitempty"` Audit interface{} `json:"audit,omitempty"`
AuditBeat []string `json:"auditbeat,omitempty"` AuditBeat []string `json:"auditbeat,omitempty"`
AuditCollector []string `json:"auditcollector,omitempty"` AuditCollector interface{} `json:"auditcollector,omitempty"`
BackupCreator []string `json:"backupcreator,omitempty"` Backup interface{} `json:"backup,omitempty"`
BService []string `json:"bservice,omitempty"` BackupCreator interface{} `json:"backupcreator,omitempty"`
CloudSpace []string `json:"cloudspace,omitempty"` BService interface{} `json:"bservice,omitempty"`
Compute []string `json:"compute,omitempty"` Compute interface{} `json:"compute,omitempty"`
ComputeCI []string `json:"computeci,omitempty"` Disks interface{} `json:"disks,omitempty"`
Desnode []string `json:"desnode,omitempty"` DPDKNet interface{} `json:"dpdknet,omitempty"`
Diagnostics []string `json:"diagnostics,omitempty"` Eco interface{} `json:"eco,omitempty"`
Disks []string `json:"disks,omitempty"` ExtNet interface{} `json:"extnet,omitempty"`
DPDK []string `json:"dpdk,omitempty"` FlIPgroup interface{} `json:"flipgroup,omitempty"`
Eco []string `json:"eco,omitempty"` Grid interface{} `json:"grid,omitempty"`
ExtNet []string `json:"extnet,omitempty"` Group interface{} `json:"group,omitempty"`
FlIPgroup []string `json:"flipgroup,omitempty"` Health interface{} `json:"health,omitempty"`
Grid []string `json:"grid,omitempty"` Image interface{} `json:"image,omitempty"`
Group []string `json:"group,omitempty"`
Health []string `json:"health,omitempty"`
IaaS []string `json:"iaas,omitempty"`
Image []string `json:"image,omitempty"`
Job interface{} `json:"job,omitempty"` Job interface{} `json:"job,omitempty"`
K8CI []string `json:"k8ci,omitempty"` K8CI interface{} `json:"k8ci,omitempty"`
K8S []string `json:"k8s,omitempty"` K8S interface{} `json:"k8s,omitempty"`
KVMX86 []string `json:"kvmx86,omitempty"` KVMX86 interface{} `json:"kvmx86,omitempty"`
LB []string `json:"lb,omitempty"` LB interface{} `json:"lb,omitempty"`
Machine []string `json:"machine,omitempty"` Metering interface{} `json:"metering,omitempty"`
Metering []string `json:"metering,omitempty"` Milestones interface{} `json:"milestones,omitempty"`
Milestones []string `json:"milestones,omitempty"`
Openshift []string `json:"openshift,omitempty"`
OpenshiftCI []string `json:"openshiftci,omitempty"`
Ovsnode []string `json:"ovsnode,omitempty"`
PCIDevice []string `json:"pcidevice,omitempty"`
PGPU []string `json:"pgpu,omitempty"`
Prometheus []string `json:"prometheus,omitempty"`
QOS []string `json:"qos,omitempty"`
Resmon interface{} `json:"resmon,omitempty"`
RG []string `json:"rg,omitempty"`
Sep []string `json:"sep,omitempty"`
Node []string `json:"node,omitempty"` Node []string `json:"node,omitempty"`
Tasks []string `json:"tasks,omitempty"` PCIDevice interface{} `json:"pcidevice,omitempty"`
TLock []string `json:"tlock,omitempty"` PGPU interface{} `json:"pgpu,omitempty"`
User []string `json:"user,omitempty"` Prometheus interface{} `json:"prometheus,omitempty"`
VGPU []string `json:"vgpu,omitempty"` Resmon interface{} `json:"resmon,omitempty"`
VINS []string `json:"vins,omitempty"` RG interface{} `json:"rg,omitempty"`
VNFDev []string `json:"vnfdev,omitempty"` SecurityGroup interface{} `json:"security_group,omitempty"`
ZeroAccess []string `json:"zeroaccess,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"` All bool `json:"ALL,omitempty"`
} }
type LibCloudEndpoints struct { type SDNEndpoints struct {
Libvirt []string `json:"libvirt,omitempty"` AccessGroup []string `json:"access_group,omitempty"`
All bool `json:"ALL,omitempty"` AddressPool []string `json:"address_pool,omitempty"`
DefaultSecurityPolicy []string `json:"default_security_policy,omitempty"`
ExternalNetwork []string `json:"external_network,omitempty"`
FloatingIP []string `json:"floating_ip,omitempty"`
Hypervisor []string `json:"hypervisor,omitempty"`
L2ExternalNetwork []string `json:"l2_external_network,omitempty"`
LogicalPort []string `json:"logical_port,omitempty"`
NetworkObjectGroup []string `json:"network_object_group,omitempty"`
Router []string `json:"router,omitempty"`
RouterGatewayPort []string `json:"router/gateway_port,omitempty"`
RouterPolicies []string `json:"router/policies,omitempty"`
RouterRouterPort []string `json:"router/router_port,omitempty"`
RouterStaticRoute []string `json:"router/static_route,omitempty"`
SecurityPolicy []string `json:"security_policy,omitempty"`
SecurityPolicyRule []string `json:"security_policy/rule,omitempty"`
SecurityRule []string `json:"security_rule,omitempty"`
Segment []string `json:"segment,omitempty"`
Version []string `json:"version,omitempty"`
All bool `json:"ALL,omitempty"`
} }
type SystemEndpoints struct { type SystemEndpoints struct {
AgentController []string `json:"agentcontroller,omitempty"` Audits []string `json:"audits,omitempty"`
Alerts []string `json:"alerts,omitempty"` Cache []string `json:"cache,omitempty"`
Audits []string `json:"audits,omitempty"` ContentManager []string `json:"contentmanager,omitempty"`
ContentManager []string `json:"contentmanager,omitempty"` DocGenerator []string `json:"docgenerator,omitempty"`
DocGenerator []string `json:"docgenerator,omitempty"` EmailSender []string `json:"emailsender,omitempty"`
EmailSender []string `json:"emailsender,omitempty"` GridManager []string `json:"gridmanager,omitempty"`
ErrorConditionHandler []string `json:"errorconditionhandler,omitempty"` Health []string `json:"health,omitempty"`
GridManager []string `json:"gridmanager,omitempty"` Info []string `json:"info,omitempty"`
Health []string `json:"health,omitempty"` InfoWellknown []string `json:"info/wellknown,omitempty"`
Info []string `json:"info,omitempty"` InfoMGR []string `json:"infomgr,omitempty"`
InfoMGR []string `json:"infomgr,omitempty"` Oauth []string `json:"oauth,omitempty"`
Job []string `json:"job,omitempty"` Task []string `json:"task,omitempty"`
Log []string `json:"log,omitempty"` UserManager []string `json:"usermanager,omitempty"`
Logo []string `json:"logo,omitempty"` All bool `json:"ALL,omitempty"`
Oauth []string `json:"oauth,omitempty"`
Task []string `json:"task,omitempty"`
UserManager []string `json:"usermanager,omitempty"`
All bool `json:"ALL,omitempty"`
} }
+10 -9
View File
@@ -4,7 +4,6 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"net/http" "net/http"
"strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators" "repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
) )
@@ -16,7 +15,7 @@ type UpdateRequest struct {
APIAccessID uint64 `url:"apiaccess_id" json:"apiaccess_id" validate:"required"` APIAccessID uint64 `url:"apiaccess_id" json:"apiaccess_id" validate:"required"`
// APIs to remove from APIAccess group // APIs to remove from APIAccess group
// Required: false // Required: true
APIs APIsEndpoints `url:"-" json:"-"` APIs APIsEndpoints `url:"-" json:"-"`
} }
@@ -27,10 +26,10 @@ type wrapperUpdateRequest struct {
} }
// Update updates apis of apiaccess group. // Update updates apis of apiaccess group.
func (a APIAccess) Update(ctx context.Context, req UpdateRequest) (bool, error) { func (a APIAccess) Update(ctx context.Context, req UpdateRequest) (*ItemAPIAccess, error) {
err := validators.ValidateRequest(req) err := validators.ValidateRequest(req)
if err != nil { if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err)) return nil, validators.ValidationErrors(validators.GetErrors(err))
} }
url := "/cloudbroker/apiaccess/update" url := "/cloudbroker/apiaccess/update"
@@ -41,20 +40,22 @@ func (a APIAccess) Update(ctx context.Context, req UpdateRequest) (bool, error)
apiJSON, err := json.Marshal(&req.APIs) apiJSON, err := json.Marshal(&req.APIs)
if err != nil { if err != nil {
return false, err return nil, err
} }
reqWrapped.APIString = string(apiJSON) reqWrapped.APIString = string(apiJSON)
res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped) res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped)
if err != nil { if err != nil {
return false, err return nil, err
} }
result, err := strconv.ParseBool(string(res)) info := ItemAPIAccess{}
err = json.Unmarshal(res, &info)
if err != nil { if err != nil {
return false, err return nil, err
} }
return result, nil return &info, nil
} }
+2
View File
@@ -24,6 +24,8 @@ type UserListRequest struct {
} }
// UserList gets a list of users currently included in the specified group. // 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) { func (a APIAccess) UserList(ctx context.Context, req UserListRequest) ([]string, error) {
err := validators.ValidateRequest(req) err := validators.ValidateRequest(req)
if err != nil { if err != nil {
+1 -1
View File
@@ -8,7 +8,7 @@ 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,
} }
+9 -1
View File
@@ -63,6 +63,14 @@ type ListRequest struct {
// Required: false // Required: false
AccountID uint64 `url:"account_id,omitempty" json:"account_id,omitempty"` 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 // Find by vins id
// Required: false // Required: false
VINSID uint64 `url:"vins_id,omitempty" json:"vins_id,omitempty"` 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"` ExcludeAuditLines bool `url:"exclude_audit_lines,omitempty" json:"exclude_audit_lines,omitempty"`
// Public Session ID // 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 // List gets audit records for the specified account object
+36
View File
@@ -43,6 +43,42 @@ type ItemAudit struct {
// TTL // TTL
TTL string `json:"_ttl"` TTL string `json:"_ttl"`
// Resource group ID
ResgroupID uint64 `json:"resgroup_id"`
// Account ID
AccountID uint64 `json:"account_id"`
// Compute ID
ComputeID uint64 `json:"compute_id"`
// VINS ID
VINSID uint64 `json:"vins_id"`
// Service ID
ServiceID uint64 `json:"service_id"`
// K8S ID
K8SID uint64 `json:"k8s_id"`
// FLIPGroup ID
FLIPGroupID uint64 `json:"flipgroup_id"`
// Load balancer ID
LBID uint64 `json:"lb_id"`
// SEP ID
SEPID uint64 `json:"sep_id"`
// Node IDs
NodeIDs []uint64 `json:"node_ids"`
// Persistent disk IDs associated with the operation
DiskIDs []uint64 `json:"disk_ids"`
// API task ID for asynchronous calls
APITask string `json:"apitask"`
} }
// List of audits // List of audits
+1 -1
View File
@@ -31,7 +31,7 @@ type CreateDiskBackupRequest struct {
type wrapperCreateDiskBackupRequest struct { type wrapperCreateDiskBackupRequest struct {
CreateDiskBackupRequest CreateDiskBackupRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// CreateDiskBackup creates disk backup // CreateDiskBackup creates disk backup
@@ -33,7 +33,7 @@ type CreateDisksBackupRequest struct {
type wrapperCreateDisksBackupRequest struct { type wrapperCreateDisksBackupRequest struct {
CreateDisksBackupRequest CreateDisksBackupRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// CreateDisksBackup creates disks backup // CreateDisksBackup creates disks backup
+1 -1
View File
@@ -21,7 +21,7 @@ type DeleteDiskBackupRequest struct {
type wrapperDeleteDiskBackupRequest struct { type wrapperDeleteDiskBackupRequest struct {
DeleteDiskBackupRequest DeleteDiskBackupRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// DeleteDiskBackup deletes disk backup // DeleteDiskBackup deletes disk backup
@@ -30,7 +30,7 @@ type RestoreDiskFromBackupRequest struct {
type wrapperRestoreDiskFromBackupRequest struct { type wrapperRestoreDiskFromBackupRequest struct {
RestoreDiskFromBackupRequest RestoreDiskFromBackupRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// RestoreDiskFromBackup restores disk from backup // RestoreDiskFromBackup restores disk from backup
@@ -35,7 +35,7 @@ type RestoreDisksFromBackupRequest struct {
type wrapperRestoreDisksFromBackupRequest struct { type wrapperRestoreDisksFromBackupRequest struct {
RestoreDisksFromBackupRequest RestoreDisksFromBackupRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// RestoreDisksFromBackup restores disks from backup // RestoreDisksFromBackup restores disks from backup
@@ -20,7 +20,7 @@ type AbortSharedSnapshotMergeRequest struct {
type wrapperAbortSharedSnapshotMergeRequest struct { type wrapperAbortSharedSnapshotMergeRequest struct {
AbortSharedSnapshotMergeRequest AbortSharedSnapshotMergeRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// AbortSharedSnapshotMerge shared snapshots merge abort // AbortSharedSnapshotMerge shared snapshots merge abort
+62 -8
View File
@@ -2,9 +2,11 @@ package compute
import ( import (
"context" "context"
"encoding/json"
"net/http" "net/http"
"strconv" "strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators" "repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
) )
@@ -42,26 +44,78 @@ type AffinityRuleAddRequest struct {
// Value that must match the key to be taken into account when analyzing this rule // Value that must match the key to be taken into account when analyzing this rule
// Required: true // Required: true
Value string `url:"value" json:"value" validate:"required"` Value string `url:"value" json:"value" validate:"required"`
// Migrate compute according to the rule
// Default: false
// Required: false
Migrate bool `url:"migrate" json:"migrate"`
}
type wrapperAffinityRuleAddRequest struct {
AffinityRuleAddRequest
AsyncMode bool `url:"async_mode" json:"async_mode"`
} }
// AffinityRuleAdd adds affinity rule // AffinityRuleAdd adds affinity rule
func (c Compute) AffinityRuleAdd(ctx context.Context, req AffinityRuleAddRequest) (bool, error) { func (c Compute) AffinityRuleAdd(ctx context.Context, req AffinityRuleAddRequest) (AffinityRuleAddResult, error) {
err := validators.ValidateRequest(req) err := validators.ValidateRequest(req)
if err != nil { if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err)) return AffinityRuleAddResult{}, validators.ValidationErrors(validators.GetErrors(err))
} }
url := "/cloudbroker/compute/affinityRuleAdd" url := "/cloudbroker/compute/affinityRuleAdd"
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req) aReq := wrapperAffinityRuleAddRequest{
if err != nil { AffinityRuleAddRequest: req,
return false, err AsyncMode: false,
} }
result, err := strconv.ParseBool(string(res)) res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
if err != nil { if err != nil {
return false, err return AffinityRuleAddResult{}, err
} }
return result, nil if !req.Migrate {
result, err := strconv.ParseBool(string(res))
return AffinityRuleAddResult{Ok: result}, err
}
var report MigrationReport
err = json.Unmarshal(res, &report)
if err != nil {
return AffinityRuleAddResult{}, err
}
return AffinityRuleAddResult{Ok: report.Applied, MigrationReport: &report}, nil
}
// AsyncAffinityRuleAdd add affinity rule in async mode
func (c Compute) AsyncAffinityRuleAdd(ctx context.Context, req AffinityRuleAddRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/compute/affinityRuleAdd"
aReq := wrapperAffinityRuleAddRequest{
AffinityRuleAddRequest: req,
AsyncMode: true,
}
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
if err != nil {
return "", err
}
var resp string
err = json.Unmarshal(res, &resp)
if err != nil {
return "", err
}
return resp, nil
} }
@@ -2,9 +2,11 @@ package compute
import ( import (
"context" "context"
"encoding/json"
"net/http" "net/http"
"strconv" "strconv"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators" "repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
) )
@@ -40,26 +42,78 @@ type AntiAffinityRuleAddRequest struct {
// Value that must match the key to be taken into account when analyzing this rule // Value that must match the key to be taken into account when analyzing this rule
// Required: true // Required: true
Value string `url:"value" json:"value" validate:"required"` Value string `url:"value" json:"value" validate:"required"`
// Migrate compute according to the rule
// Default: false
// Required: false
Migrate bool `url:"migrate" json:"migrate"`
}
type wrapperAntiAffinityRuleAddRequest struct {
AntiAffinityRuleAddRequest
AsyncMode bool `url:"async_mode" json:"async_mode"`
} }
// AntiAffinityRuleAdd adds anti affinity rule // AntiAffinityRuleAdd adds anti affinity rule
func (c Compute) AntiAffinityRuleAdd(ctx context.Context, req AntiAffinityRuleAddRequest) (bool, error) { func (c Compute) AntiAffinityRuleAdd(ctx context.Context, req AntiAffinityRuleAddRequest) (AntiAffinityRuleAddResult, error) {
err := validators.ValidateRequest(req) err := validators.ValidateRequest(req)
if err != nil { if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err)) return AntiAffinityRuleAddResult{}, validators.ValidationErrors(validators.GetErrors(err))
} }
url := "/cloudbroker/compute/antiAffinityRuleAdd" url := "/cloudbroker/compute/antiAffinityRuleAdd"
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req) aReq := wrapperAntiAffinityRuleAddRequest{
if err != nil { AntiAffinityRuleAddRequest: req,
return false, err AsyncMode: false,
} }
result, err := strconv.ParseBool(string(res)) res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
if err != nil { if err != nil {
return false, err return AntiAffinityRuleAddResult{}, err
} }
return result, nil if !req.Migrate {
result, err := strconv.ParseBool(string(res))
return AntiAffinityRuleAddResult{Ok: result}, err
}
var report MigrationReport
err = json.Unmarshal(res, &report)
if err != nil {
return AntiAffinityRuleAddResult{}, err
}
return AntiAffinityRuleAddResult{Ok: report.Applied, MigrationReport: &report}, nil
}
// AsyncAntiAffinityRuleAdd add anti affinity rule in async mode
func (c Compute) AsyncAntiAffinityRuleAdd(ctx context.Context, req AntiAffinityRuleAddRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/compute/antiAffinityRuleAdd"
aReq := wrapperAntiAffinityRuleAddRequest{
AntiAffinityRuleAddRequest: req,
AsyncMode: true,
}
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, aReq)
if err != nil {
return "", err
}
var resp string
err = json.Unmarshal(res, &resp)
if err != nil {
return "", err
}
return resp, nil
} }
+1 -1
View File
@@ -18,7 +18,7 @@ type CDEjectRequest struct {
type wrapperCDEjectRequest struct { type wrapperCDEjectRequest struct {
CDEjectRequest CDEjectRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// CDEject ejects CD image to compute's CD-ROM // CDEject ejects CD image to compute's CD-ROM
+1 -1
View File
@@ -21,7 +21,7 @@ type CDInsertRequest struct {
type wrapperCDInsertRequest struct { type wrapperCDInsertRequest struct {
CDInsertRequest CDInsertRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// CDInsert inserts new CD image to compute's CD-ROM // CDInsert inserts new CD image to compute's CD-ROM
+1 -1
View File
@@ -34,7 +34,7 @@ type ChangeIPRequest struct {
type wrapperChangeIPRequest struct { type wrapperChangeIPRequest struct {
ChangeIPRequest ChangeIPRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// ChangeIP change reserved IP for compute instance // ChangeIP change reserved IP for compute instance
+1 -1
View File
@@ -27,7 +27,7 @@ type ChangeLinkStateRequest struct {
type wrapperChangeLinkStateRequest struct { type wrapperChangeLinkStateRequest struct {
ChangeLinkStateRequest ChangeLinkStateRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// ChangeLinkState changes the status link virtual of compute // ChangeLinkState changes the status link virtual of compute
+1 -1
View File
@@ -26,7 +26,7 @@ type ChangeMTURequest struct {
type wrapperChangeMTURequest struct { type wrapperChangeMTURequest struct {
ChangeMTURequest ChangeMTURequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// ChangeMTU change MTU for compute instance // ChangeMTU change MTU for compute instance
@@ -26,7 +26,7 @@ type ChangeQoSPoliciesRequest struct {
type wrapperChangeQoSPoliciesRequest struct { type wrapperChangeQoSPoliciesRequest struct {
ChangeQoSPoliciesRequest ChangeQoSPoliciesRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// ChangeQoSPolicies change qos policies for compute // ChangeQoSPolicies change qos policies for compute
@@ -30,7 +30,7 @@ type ChangeSecGroupsRequest struct {
type wrapperChangeSecGroupsRequest struct { type wrapperChangeSecGroupsRequest struct {
ChangeSecGroupsRequest ChangeSecGroupsRequest
AsyncMode bool `url:"asyncMode"` AsyncMode bool `url:"async_mode"`
} }
// ChangeSecGroups changes security groups for compute // ChangeSecGroups changes security groups for compute
Loaded 100 of 197 files, more files were not shown because too many files have changed in this diff. Show more