v1.6.7
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for adding permission to access to account for a user
|
||||
// AddUserRequest struct for adding permission to access to account for a user
|
||||
type AddUserRequest struct {
|
||||
// ID of account to add to
|
||||
// Required: true
|
||||
@@ -30,9 +30,7 @@ type AddUserRequest struct {
|
||||
func (a Account) AddUser(ctx context.Context, req AddUserRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/addUser"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for give list account audits
|
||||
// AuditsRequest struct to give list of account audits
|
||||
type AuditsRequest struct {
|
||||
// ID of the account
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type AuditsRequest struct {
|
||||
func (a Account) Audits(ctx context.Context, req AuditsRequest) (ListAudits, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/audits"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for creating account
|
||||
// CreateRequest struct for creating account
|
||||
type CreateRequest struct {
|
||||
// Display name
|
||||
// Required: true
|
||||
@@ -61,9 +61,7 @@ type CreateRequest struct {
|
||||
func (a Account) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return 0, validators.ValidationError(validationError)
|
||||
}
|
||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/create"
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for delete account
|
||||
// DeleteRequest struct to delete account
|
||||
type DeleteRequest struct {
|
||||
// ID of account to delete
|
||||
// Required: true
|
||||
@@ -26,9 +26,7 @@ type DeleteRequest struct {
|
||||
func (a Account) Delete(ctx context.Context, req DeleteRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/delete"
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for delete group accounts
|
||||
// DeleteAccountsRequest struct to delete group of accounts
|
||||
type DeleteAccountsRequest struct {
|
||||
// IDs of accounts
|
||||
// Required: true
|
||||
@@ -22,13 +22,11 @@ type DeleteAccountsRequest struct {
|
||||
Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"`
|
||||
}
|
||||
|
||||
// DeleteAccounts destroy a group of accounts
|
||||
// DeleteAccounts destroys a group of accounts
|
||||
func (a Account) DeleteAccounts(ctx context.Context, req DeleteAccountsRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/deleteAccounts"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for revoke access to account
|
||||
// DeleteUserRequest struct to revoke access to account
|
||||
type DeleteUserRequest struct {
|
||||
// ID of the account
|
||||
// Required: true
|
||||
@@ -20,16 +20,14 @@ type DeleteUserRequest struct {
|
||||
|
||||
// Recursively revoke access rights from owned cloudspaces and vmachines
|
||||
// Required: false
|
||||
RecursiveDelete bool `url:"recursivedelete" json:"recursivedelete" validate:"required"`
|
||||
RecursiveDelete bool `url:"recursivedelete" json:"recursivedelete"`
|
||||
}
|
||||
|
||||
// DeleteUser revokes user access from the account
|
||||
func (a Account) DeleteUser(ctx context.Context, req DeleteUserRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/deleteUser"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for disable account
|
||||
// DisableRequest struct to disable account
|
||||
type DisableRequest struct {
|
||||
// ID of account
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type DisableRequest struct {
|
||||
func (a Account) Disable(ctx context.Context, req DisableRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/disable"
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for disable group accounts
|
||||
// DisableAccountsRequest struct to disable group of accounts
|
||||
type DisableAccountsRequest struct {
|
||||
// IDs of accounts
|
||||
// Required: true
|
||||
@@ -18,9 +18,7 @@ type DisableAccountsRequest struct {
|
||||
func (a Account) DisableAccounts(ctx context.Context, req DisableAccountsRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/disableAccounts"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for enable account
|
||||
// EnableRequest struct to enable account
|
||||
type EnableRequest struct {
|
||||
// ID of account
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type EnableRequest struct {
|
||||
func (a Account) Enable(ctx context.Context, req EnableRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/enable"
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request for enable group accounts
|
||||
// EnableAccountsRequest to enable group of accounts
|
||||
type EnableAccountsRequest struct {
|
||||
// IDs od accounts
|
||||
// Required: true
|
||||
@@ -18,9 +18,7 @@ type EnableAccountsRequest struct {
|
||||
func (a Account) EnableAccounts(ctx context.Context, req EnableAccountsRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/enableAccounts"
|
||||
|
||||
@@ -36,9 +36,7 @@ func (a Account) Get(ctx context.Context, req GetRequest) (*RecordAccount, error
|
||||
func (a Account) GetRaw(ctx context.Context, req GetRequest) ([]byte, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/get"
|
||||
|
||||
@@ -8,20 +8,18 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for getting resource consumption
|
||||
// GetResourceConsumptionRequest struct for getting resource consumption
|
||||
type GetResourceConsumptionRequest struct {
|
||||
// ID an account
|
||||
// Required: true
|
||||
AccountID uint64 `url:"accountId" json:"accountId" validate:"required"`
|
||||
}
|
||||
|
||||
// GetResourceConsumption show amount of consumed and reserved resources (cpu, ram, disk) by specific account
|
||||
// GetResourceConsumption shows amount of consumed and reserved resources (cpu, ram, disk) by specific account
|
||||
func (a Account) GetResourceConsumption(ctx context.Context, req GetResourceConsumptionRequest) (*RecordResourceConsumption, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/getResourceConsumption"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for a get list compute instances
|
||||
// ListComputesRequest struct to a get list of compute instances
|
||||
type ListComputesRequest struct {
|
||||
// ID an account
|
||||
// Required: true
|
||||
@@ -55,13 +55,11 @@ type ListComputesRequest struct {
|
||||
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
|
||||
}
|
||||
|
||||
// ListComputes gets list all compute instances under specified account, accessible by the user
|
||||
// ListComputes gets list of all compute instances under specified account, accessible by the user
|
||||
func (a Account) ListComputes(ctx context.Context, req ListComputesRequest) (*ListComputes, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/listComputes"
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// Request struct for get list deleted accounts
|
||||
// ListDeletedRequest struct to get list of deleted accounts
|
||||
type ListDeletedRequest struct {
|
||||
// Find by ID
|
||||
// Required: false
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get list deleted disks
|
||||
// ListDisksRequest struct to get list of deleted disks
|
||||
type ListDisksRequest struct {
|
||||
// ID an account
|
||||
// Required: true
|
||||
@@ -39,13 +39,11 @@ type ListDisksRequest struct {
|
||||
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
|
||||
}
|
||||
|
||||
// ListDisks gets list all currently unattached disks under specified account
|
||||
// ListDisks gets list of all currently unattached disks under specified account
|
||||
func (a Account) ListDisks(ctx context.Context, req ListDisksRequest) (*ListDisks, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/listDisks"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get list FLIPGroups
|
||||
// ListFLIPGroupsRequest struct to get list of FLIPGroups
|
||||
type ListFLIPGroupsRequest struct {
|
||||
// ID an account
|
||||
// Required: true
|
||||
@@ -47,13 +47,11 @@ type ListFLIPGroupsRequest struct {
|
||||
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
|
||||
}
|
||||
|
||||
// ListFLIPGroups gets list all FLIPGroups under specified account, accessible by the user
|
||||
// ListFLIPGroups gets list of all FLIPGroups under specified account, accessible by the user
|
||||
func (a Account) ListFLIPGroups(ctx context.Context, req ListFLIPGroupsRequest) (*ListFLIPGroups, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/listFlipGroups"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get list resource groups
|
||||
// ListRGRequest struct to get list of resource groups
|
||||
type ListRGRequest struct {
|
||||
// ID an account
|
||||
// Required: true
|
||||
@@ -43,13 +43,11 @@ type ListRGRequest struct {
|
||||
Status string `url:"status,omitempty" json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// ListRG gets list all resource groups under specified account, accessible by the user
|
||||
// ListRG gets list of all resource groups under specified account, accessible by the user
|
||||
func (a Account) ListRG(ctx context.Context, req ListRGRequest) (*ListRG, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/listRG"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get list VINS
|
||||
// ListVINSRequest struct to get list of VINS
|
||||
type ListVINSRequest struct {
|
||||
// ID an account
|
||||
// Required: true
|
||||
@@ -39,13 +39,11 @@ type ListVINSRequest struct {
|
||||
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
|
||||
}
|
||||
|
||||
// ListVINS gets list all ViNSes under specified account, accessible by the user
|
||||
// ListVINS gets list of all ViNSes under specified account, accessible by the user
|
||||
func (a Account) ListVINS(ctx context.Context, req ListVINSRequest) (*ListVINS, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/listVins"
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for restore a deleted account
|
||||
// RestoreRequest struct to restore a deleted account
|
||||
type RestoreRequest struct {
|
||||
// ID an account
|
||||
// Required: true
|
||||
@@ -22,9 +22,7 @@ type RestoreRequest struct {
|
||||
func (a Account) Restore(ctx context.Context, req RestoreRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/restore"
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// Request for setting CPU allocation parameter
|
||||
// SetCPUAllocationParameterRequest struct for setting CPU allocation parameter
|
||||
type SetCPUAllocationParameterRequest struct {
|
||||
// Account ID
|
||||
// Required: true
|
||||
@@ -24,9 +24,7 @@ type SetCPUAllocationParameterRequest struct {
|
||||
func (a Account) SetCPUAllocationParameter(ctx context.Context, req SetCPUAllocationParameterRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/setCpuAllocationParameter"
|
||||
|
||||
@@ -7,24 +7,23 @@ import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// Request for setting CPU allocation ratio
|
||||
// SetCPUAllocationRatioRequest struct for setting CPU allocation ratio
|
||||
type SetCPUAllocationRatioRequest struct {
|
||||
// Account ID
|
||||
// Required: true
|
||||
AccountID uint64 `url:"accountId" json:"accoutnId" validate:"required"`
|
||||
|
||||
// CPU allocation ratio, i.e. one pCPU = ratio*vCPU
|
||||
// Required: true
|
||||
Ratio float64 `url:"ratio" json:"ratio" validate:"required"`
|
||||
// if don't set, default value = 0
|
||||
// Required: false
|
||||
Ratio float64 `url:"ratio" json:"ratio"`
|
||||
}
|
||||
|
||||
// SetCPUAllocationRatio sets CPU allocation ratio
|
||||
func (a Account) SetCPUAllocationRatio(ctx context.Context, req SetCPUAllocationRatioRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/setCpuAllocationRatio"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for update account
|
||||
// UpdateRequest struct to update account
|
||||
type UpdateRequest struct {
|
||||
// ID of account
|
||||
// Required: true
|
||||
@@ -56,9 +56,7 @@ type UpdateRequest struct {
|
||||
func (a Account) Update(ctx context.Context, req UpdateRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/update"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for update resource types in account
|
||||
// UpdateResourceTypesRequest struct to update resource types in account
|
||||
type UpdateResourceTypesRequest struct {
|
||||
// ID of account
|
||||
// Required: true
|
||||
@@ -29,9 +29,7 @@ type UpdateResourceTypesRequest struct {
|
||||
func (a Account) UpdateResourceTypes(ctx context.Context, req UpdateResourceTypesRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/updateResourceTypes"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for update user access rights
|
||||
// UpdateUserRequest struct to update user access rights
|
||||
type UpdateUserRequest struct {
|
||||
// ID of the account
|
||||
// Required: true
|
||||
@@ -30,9 +30,7 @@ type UpdateUserRequest struct {
|
||||
func (a Account) UpdateUser(ctx context.Context, req UpdateUserRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/account/updateUser"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for finding apiaccess groups.
|
||||
// APIFindRequest struct for finding apiaccess groups.
|
||||
type APIFindRequest struct {
|
||||
// API function to find
|
||||
// Example: cloudbroker/k8s/create
|
||||
@@ -20,9 +20,7 @@ type APIFindRequest struct {
|
||||
func (a APIAccess) APIFind(ctx context.Context, req APIFindRequest) ([]uint64, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/apiFind"
|
||||
|
||||
@@ -9,7 +9,9 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for removing api from access group.
|
||||
type APIString string
|
||||
|
||||
// APIsExcludeRequest struct for removing api from access group.
|
||||
type APIsExcludeRequest struct {
|
||||
// APIAccess group ID
|
||||
// Required: true
|
||||
@@ -17,7 +19,7 @@ type APIsExcludeRequest struct {
|
||||
|
||||
// APIs to remove from APIAccess group
|
||||
// Required: true
|
||||
APIs APIsEndpoints `url:"-" json:"-" validate:"required"`
|
||||
APIs APIString `url:"-" json:"apis" validate:"required"`
|
||||
}
|
||||
|
||||
type wrapperAPIsExcludeRequest struct {
|
||||
@@ -30,9 +32,7 @@ type wrapperAPIsExcludeRequest struct {
|
||||
func (a APIAccess) APIsExclude(ctx context.Context, req APIsExcludeRequest) (*APIsEndpoints, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/apisExclude"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for adding api to access group.
|
||||
// APIsIncludeRequest struct for adding api to access group.
|
||||
type APIsIncludeRequest struct {
|
||||
// APIAccess group ID.
|
||||
// Required: true
|
||||
@@ -16,7 +16,7 @@ type APIsIncludeRequest struct {
|
||||
|
||||
// APIs to add to APIAccess group.
|
||||
// Required: true
|
||||
APIs APIsEndpoints `url:"-" json:"-" validate:"required"`
|
||||
APIs APIString `url:"-" json:"apis" validate:"required"`
|
||||
}
|
||||
|
||||
type wrapperAPIsIncludeRequest struct {
|
||||
@@ -29,9 +29,7 @@ type wrapperAPIsIncludeRequest struct {
|
||||
func (a APIAccess) APIsInclude(ctx context.Context, req APIsIncludeRequest) (*APIsEndpoints, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/apisInclude"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for copying apiaccess group.
|
||||
// CopyRequest Request for copying apiaccess group.
|
||||
type CopyRequest struct {
|
||||
// ID of the API access group to make copy from
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type CopyRequest struct {
|
||||
func (a APIAccess) Copy(ctx context.Context, req CopyRequest) (uint64, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return 0, validators.ValidationError(validationError)
|
||||
}
|
||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/copy"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for creating apiaccess group.
|
||||
// CreateRequest struct for creating apiaccess group.
|
||||
type CreateRequest struct {
|
||||
// Name of this apiaccess group.
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type CreateRequest struct {
|
||||
func (a APIAccess) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return 0, validators.ValidationError(validationError)
|
||||
}
|
||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/create"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for deleting apiaccess group.
|
||||
// DeleteRequest struct for deleting apiaccess group.
|
||||
type DeleteRequest struct {
|
||||
// APIAccess group ID.
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type DeleteRequest struct {
|
||||
func (a APIAccess) Delete(ctx context.Context, req DeleteRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/delete"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for updating apiaccess group description.
|
||||
// DescUpdateRequest struct for updating apiaccess group description.
|
||||
type DescUpdateRequest struct {
|
||||
// APIAccess group ID.
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type DescUpdateRequest struct {
|
||||
func (a APIAccess) DescUpdate(ctx context.Context, req DescUpdateRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/descUpdate"
|
||||
|
||||
@@ -36,9 +36,7 @@ func (a APIAccess) Get(ctx context.Context, req GetRequest) (*ItemAPIAccess, err
|
||||
func (a APIAccess) GetRaw(ctx context.Context, req GetRequest) ([]byte, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/get"
|
||||
|
||||
@@ -4,8 +4,6 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// ListRequest struct to get list of all non deleted apiaccess instances.
|
||||
@@ -62,13 +60,6 @@ func (a APIAccess) List(ctx context.Context, req ListRequest) (*ListAPIAccess, e
|
||||
|
||||
// ListRaw gets list of all non deleted apiaccess instances as an array of bytes
|
||||
func (a APIAccess) ListRaw(ctx context.Context, req ListRequest) ([]byte, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/list"
|
||||
|
||||
res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
|
||||
@@ -4,11 +4,9 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for getting list of all deleted apiaccess instances.
|
||||
// ListDeletedRequest struct for getting list of all deleted apiaccess instances.
|
||||
type ListDeletedRequest struct {
|
||||
// Page number.
|
||||
// Required: false
|
||||
@@ -21,13 +19,6 @@ type ListDeletedRequest struct {
|
||||
|
||||
// ListDeleted gets list of all deleted apiaccess instances.
|
||||
func (a APIAccess) ListDeleted(ctx context.Context, req ListDeletedRequest) (*ListAPIAccess, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/listDeleted"
|
||||
|
||||
info := ListAPIAccess{}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Reqeust struct for setting default apiaccess group.
|
||||
// SetDefaultRequest struct for setting default apiaccess group.
|
||||
type SetDefaultRequest struct {
|
||||
// APIAccess group ID
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type SetDefaultRequest struct {
|
||||
func (a APIAccess) SetDefault(ctx context.Context, req SetDefaultRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/setDefault"
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for subtracting.
|
||||
// SubtractRequest struct for subtracting.
|
||||
type SubtractRequest struct {
|
||||
// ID of the API access group to subtract from. This group will contain the difference.
|
||||
MinuendID uint64 `url:"minuendId" json:"minuendId" validate:"required"`
|
||||
@@ -22,9 +22,7 @@ type SubtractRequest struct {
|
||||
func (a APIAccess) Subtruct(ctx context.Context, req SubtractRequest) (*APIsEndpoints, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/subtract"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for union.
|
||||
// UnionRequest struct for union.
|
||||
type UnionRequest struct {
|
||||
// Recipient apiaccess group ID
|
||||
// Required: true
|
||||
@@ -19,14 +19,12 @@ type UnionRequest struct {
|
||||
DonorID uint64 `url:"donorId" json:"donorId" validate:"required"`
|
||||
}
|
||||
|
||||
// Combines the API list of group #1 ("recipient") and group #2 ("donor"),
|
||||
// Union combines the API list of group #1 ("recipient") and group #2 ("donor"),
|
||||
// writing the result to group #1 and avoiding duplicates in the list
|
||||
func (a APIAccess) Union(ctx context.Context, req UnionRequest) (*APIsEndpoints, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/union"
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for updating apis of apiaccess group.
|
||||
// UpdateRequest struct for updating apis of apiaccess group.
|
||||
type UpdateRequest struct {
|
||||
// APIAccess group ID
|
||||
// Required: true
|
||||
@@ -30,9 +30,7 @@ type wrapperUpdateRequest struct {
|
||||
func (a APIAccess) Update(ctx context.Context, req UpdateRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/update"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for getting a list of users currently included in the specified group.
|
||||
// UserListRequest struct for getting a list of users currently included in the specified group.
|
||||
type UserListRequest struct {
|
||||
// APIAccess group ID
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type UserListRequest struct {
|
||||
func (a APIAccess) UserList(ctx context.Context, req UserListRequest) ([]string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/apiaccess/userList"
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for creating disk backup
|
||||
// CreateDiskBackupRequest struct for creating disk backup
|
||||
type CreateDiskBackupRequest struct {
|
||||
// Compute ID
|
||||
// Required: true
|
||||
@@ -34,9 +34,7 @@ type wrapperCreateDiskBackupRequest struct {
|
||||
func (b Backup) CreateDiskBackup(ctx context.Context, req CreateDiskBackupRequest) (ListInfoBackup, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
reqWrapped := wrapperCreateDiskBackupRequest{
|
||||
@@ -65,9 +63,7 @@ func (b Backup) CreateDiskBackup(ctx context.Context, req CreateDiskBackupReques
|
||||
func (b Backup) CreateDiskBackupAsync(ctx context.Context, req CreateDiskBackupRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return "", validators.ValidationError(validationError)
|
||||
}
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
reqWrapped := wrapperCreateDiskBackupRequest{
|
||||
|
||||
@@ -17,7 +17,7 @@ type Disk struct {
|
||||
BackupPath string `url:"backupPath" json:"backupPath" validate:"required"`
|
||||
}
|
||||
|
||||
// Request struct for creating disks backup
|
||||
// CreateDisksBackupRequest struct for creating disks backup
|
||||
type CreateDisksBackupRequest struct {
|
||||
// Compute ID
|
||||
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||
@@ -36,9 +36,7 @@ type wrapperCreateDisksBackupRequest struct {
|
||||
func (b Backup) CreateDisksBackup(ctx context.Context, req CreateDisksBackupRequest) (ListInfoBackup, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
reqWrapped := wrapperCreateDisksBackupRequest{
|
||||
@@ -67,9 +65,7 @@ func (b Backup) CreateDisksBackup(ctx context.Context, req CreateDisksBackupRequ
|
||||
func (b Backup) CreateDisksBackupAsync(ctx context.Context, req CreateDisksBackupRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return "", validators.ValidationError(validationError)
|
||||
}
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
reqWrapped := wrapperCreateDisksBackupRequest{
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for deleting disk backup
|
||||
// DeleteDiskBackupRequest struct for deleting disk backup
|
||||
type DeleteDiskBackupRequest struct {
|
||||
// Backup path
|
||||
BackupPath string `url:"backupPath" json:"backupPath" validate:"required"`
|
||||
@@ -28,9 +28,7 @@ type wrapperDeleteDiskBackupRequest struct {
|
||||
func (b Backup) DeleteDiskBackup(ctx context.Context, req DeleteDiskBackupRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
reqWrapped := wrapperDeleteDiskBackupRequest{
|
||||
@@ -57,9 +55,7 @@ func (b Backup) DeleteDiskBackup(ctx context.Context, req DeleteDiskBackupReques
|
||||
func (b Backup) DeleteDiskBackupAsync(ctx context.Context, req DeleteDiskBackupRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return "", validators.ValidationError(validationError)
|
||||
}
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
reqWrapped := wrapperDeleteDiskBackupRequest{
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for getting list of backup paths
|
||||
// ListBackupPathsRequest struct for getting list of backup paths
|
||||
type ListBackupPathsRequest struct {
|
||||
// Grid ID
|
||||
GID uint64 `url:"gridId" json:"gridId" validate:"required"`
|
||||
@@ -17,9 +17,7 @@ type ListBackupPathsRequest struct {
|
||||
func (b Backup) ListBackupPaths(ctx context.Context, req ListBackupPathsRequest) ([]string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/backup/listBackupPaths"
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for restoring disk from backup
|
||||
// RestoreDiskFromBackupRequest struct for restoring disk from backup
|
||||
type RestoreDiskFromBackupRequest struct {
|
||||
// Compute ID
|
||||
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||
@@ -34,9 +34,7 @@ type wrapperRestoreDiskFromBackupRequest struct {
|
||||
func (b Backup) RestoreDiskFromBackup(ctx context.Context, req RestoreDiskFromBackupRequest) (ListInfoRestoredDisk, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
reqWrapped := wrapperRestoreDiskFromBackupRequest{
|
||||
@@ -65,9 +63,7 @@ func (b Backup) RestoreDiskFromBackup(ctx context.Context, req RestoreDiskFromBa
|
||||
func (b Backup) RestoreDiskFromBackupAsync(ctx context.Context, req RestoreDiskFromBackupRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return "", validators.ValidationError(validationError)
|
||||
}
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
reqWrapped := wrapperRestoreDiskFromBackupRequest{
|
||||
|
||||
@@ -20,7 +20,7 @@ type BackupFile struct {
|
||||
BackupFile string `url:"backupFile" json:"backupFile" validate:"required"`
|
||||
}
|
||||
|
||||
// Request struct for restoring disks from backup
|
||||
// RestoreDisksFromBackupRequest struct for restoring disks from backup
|
||||
type RestoreDisksFromBackupRequest struct {
|
||||
// Compute ID
|
||||
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||
@@ -39,9 +39,7 @@ type wrapperRestoreDisksFromBackupRequest struct {
|
||||
func (b Backup) RestoreDisksFromBackup(ctx context.Context, req RestoreDisksFromBackupRequest) (ListInfoRestoredDisk, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
reqWrapped := wrapperRestoreDisksFromBackupRequest{
|
||||
@@ -70,9 +68,7 @@ func (b Backup) RestoreDisksFromBackup(ctx context.Context, req RestoreDisksFrom
|
||||
func (b Backup) RestoreDisksFromBackupAsync(ctx context.Context, req RestoreDisksFromBackupRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return "", validators.ValidationError(validationError)
|
||||
}
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
reqWrapped := wrapperRestoreDisksFromBackupRequest{
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for check all computes with current affinity label can start
|
||||
// AffinityGroupCheckStartRequest struct to check all computes with current affinity label can start
|
||||
type AffinityGroupCheckStartRequest struct {
|
||||
// ID of the resource group
|
||||
// Required: true
|
||||
@@ -22,9 +22,7 @@ type AffinityGroupCheckStartRequest struct {
|
||||
func (c Compute) AffinityGroupCheckStart(ctx context.Context, req AffinityGroupCheckStartRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return "", validators.ValidationError(validationError)
|
||||
}
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/affinityGroupCheckStart"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for clear affinity label for compute
|
||||
// AffinityLabelRemoveRequest struct for clear affinity label for compute
|
||||
type AffinityLabelRemoveRequest struct {
|
||||
// IDs of the compute instances
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type AffinityLabelRemoveRequest struct {
|
||||
func (c Compute) AffinityLabelRemove(ctx context.Context, req AffinityLabelRemoveRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/affinityLabelRemove"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for set affinity label for compute
|
||||
// AffinityLabelSetRequest struct to set affinity label for compute
|
||||
type AffinityLabelSetRequest struct {
|
||||
// IDs of the compute instances
|
||||
ComputeIDs []uint64 `url:"computeIds" json:"computeIds" validate:"min=1"`
|
||||
@@ -18,13 +18,11 @@ type AffinityLabelSetRequest struct {
|
||||
AffinityLabel string `url:"affinityLabel" json:"affinityLabel" validate:"required"`
|
||||
}
|
||||
|
||||
// AffinityLabelSet set affinity label for compute
|
||||
// AffinityLabelSet sets affinity label for compute
|
||||
func (c Compute) AffinityLabelSet(ctx context.Context, req AffinityLabelSetRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/affinityLabelSet"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get dict of computes
|
||||
// AffinityRelationsRequest struct to get dict of computes
|
||||
type AffinityRelationsRequest struct {
|
||||
// ID of the compute instance
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type AffinityRelationsRequest struct {
|
||||
func (c Compute) AffinityRelations(ctx context.Context, req AffinityRelationsRequest) (*RecordAffinityRelations, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/affinityRelations"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for add affinity rule
|
||||
// AffinityRuleAddRequest struct to add affinity rule
|
||||
type AffinityRuleAddRequest struct {
|
||||
// IDs of the compute instances
|
||||
// Required: true
|
||||
@@ -44,13 +44,11 @@ type AffinityRuleAddRequest struct {
|
||||
Value string `url:"value" json:"value" validate:"required"`
|
||||
}
|
||||
|
||||
// AffinityRuleAdd add affinity rule
|
||||
// AffinityRuleAdd adds affinity rule
|
||||
func (c Compute) AffinityRuleAdd(ctx context.Context, req AffinityRuleAddRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/affinityRuleAdd"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for remove affinity rule
|
||||
// AffinityRuleRemoveRequest struct to remove affinity rule
|
||||
type AffinityRuleRemoveRequest struct {
|
||||
// IDs of the compute instances
|
||||
// Required: true
|
||||
@@ -46,9 +46,7 @@ type AffinityRuleRemoveRequest struct {
|
||||
func (c Compute) AffinityRuleRemove(ctx context.Context, req AffinityRuleRemoveRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/affinityRuleRemove"
|
||||
|
||||
@@ -8,20 +8,18 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for clear affinity rules
|
||||
// AffinityRulesClearRequest struct to clear affinity rules
|
||||
type AffinityRulesClearRequest struct {
|
||||
// IDs of the compute instances
|
||||
// Required: true
|
||||
ComputeIDs []uint64 `url:"computeIds" json:"computeIds" validate:"min=1"`
|
||||
}
|
||||
|
||||
// AffinityRulesClear clear affinity rules
|
||||
// AffinityRulesClear clears affinity rules
|
||||
func (c Compute) AffinityRulesClear(ctx context.Context, req AffinityRulesClearRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/affinityRulesClear"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for add anti affinity rule
|
||||
// AntiAffinityRuleAddRequest struct to add anti affinity rule
|
||||
type AntiAffinityRuleAddRequest struct {
|
||||
// IDs of the compute instances
|
||||
// Required: true
|
||||
@@ -42,13 +42,11 @@ type AntiAffinityRuleAddRequest struct {
|
||||
Value string `url:"value" json:"value" validate:"required"`
|
||||
}
|
||||
|
||||
// AntiAffinityRuleAdd add anti affinity rule
|
||||
// AntiAffinityRuleAdd adds anti affinity rule
|
||||
func (c Compute) AntiAffinityRuleAdd(ctx context.Context, req AntiAffinityRuleAddRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/antiAffinityRuleAdd"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for clear anti affinity rules
|
||||
// AntiAffinityRulesClearRequest struct to clear anti affinity rules
|
||||
type AntiAffinityRulesClearRequest struct {
|
||||
// IDs of the compute instances
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type AntiAffinityRulesClearRequest struct {
|
||||
func (c Compute) AntiAffinityRulesClear(ctx context.Context, req AntiAffinityRulesClearRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/antiAffinityRulesClear"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for remove anti affinity rule
|
||||
// AntiAffinityRuleRemoveRequest struct to remove anti affinity rule
|
||||
type AntiAffinityRuleRemoveRequest struct {
|
||||
// IDs of the compute instances
|
||||
// Required: true
|
||||
@@ -42,13 +42,11 @@ type AntiAffinityRuleRemoveRequest struct {
|
||||
Value string `url:"value" json:"value" validate:"required"`
|
||||
}
|
||||
|
||||
// AntiAffinityRuleRemove remove anti affinity rule
|
||||
// AntiAffinityRuleRemove removes anti affinity rule
|
||||
func (c Compute) AntiAffinityRuleRemove(ctx context.Context, req AntiAffinityRuleRemoveRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/antiAffinityRuleRemove"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for attach GPU for compute
|
||||
// AttachGPURequest struct to attach GPU for compute
|
||||
type AttachGPURequest struct {
|
||||
// Identifier compute
|
||||
// Required: true
|
||||
@@ -19,13 +19,11 @@ type AttachGPURequest struct {
|
||||
VGPUID uint64 `url:"vgpuId" json:"vgpuId" validate:"required"`
|
||||
}
|
||||
|
||||
// AttachGPU attach GPU for compute, returns vGPU ID on success
|
||||
// AttachGPU attaches GPU for compute, returns vGPU ID on success
|
||||
func (c Compute) AttachGPU(ctx context.Context, req AttachGPURequest) (uint64, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return 0, validators.ValidationError(validationError)
|
||||
}
|
||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/attachGpu"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for atttach PCI device
|
||||
// AttachPCIDeviceRequest struct to attach PCI device
|
||||
type AttachPCIDeviceRequest struct {
|
||||
// Identifier compute
|
||||
// Required: true
|
||||
@@ -19,13 +19,11 @@ type AttachPCIDeviceRequest struct {
|
||||
DeviceID uint64 `url:"deviceId" json:"deviceId" validate:"required"`
|
||||
}
|
||||
|
||||
// AttachPCIDevice attach PCI device
|
||||
// AttachPCIDevice attaches PCI device
|
||||
func (c Compute) AttachPCIDevice(ctx context.Context, req AttachPCIDeviceRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/attachPciDevice"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get audit records
|
||||
// AuditsRequest struct to get audit records
|
||||
type AuditsRequest struct {
|
||||
// ID of the compute
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type AuditsRequest struct {
|
||||
func (c Compute) Audits(ctx context.Context, req AuditsRequest) (ListDetailedAudits, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/audits"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get boot order
|
||||
// BootOrderGetRequest struct to get boot order
|
||||
type BootOrderGetRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type BootOrderGetRequest struct {
|
||||
func (c Compute) BootOrderGet(ctx context.Context, req BootOrderGetRequest) ([]string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/bootOrderGet"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for set boot order
|
||||
// BootOrderSetRequest struct to set boot order
|
||||
type BootOrderSetRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -27,9 +27,7 @@ type BootOrderSetRequest struct {
|
||||
func (c Compute) BootOrderSet(ctx context.Context, req BootOrderSetRequest) ([]string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/bootOrderSet"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for eject CD image
|
||||
// CDEjectRequest struct to eject CD image
|
||||
type CDEjectRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -19,13 +19,11 @@ type CDEjectRequest struct {
|
||||
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
|
||||
}
|
||||
|
||||
// CDEject eject CD image to compute's CD-ROM
|
||||
// CDEject ejects CD image to compute's CD-ROM
|
||||
func (c Compute) CDEject(ctx context.Context, req CDEjectRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/cdEject"
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for insert new CD image
|
||||
// CDInsertRequest struct to insert new CD image
|
||||
type CDInsertRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -22,13 +22,11 @@ type CDInsertRequest struct {
|
||||
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
|
||||
}
|
||||
|
||||
// CDInsert insert new CD image to compute's CD-ROM
|
||||
// CDInsert inserts new CD image to compute's CD-ROM
|
||||
func (c Compute) CDInsert(ctx context.Context, req CDInsertRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/cdInsert"
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// Request struct for changing link state
|
||||
// ChangeLinkStateRequest struct for changing link state
|
||||
type ChangeLinkStateRequest struct {
|
||||
// Compute ID
|
||||
// Required: true
|
||||
@@ -27,9 +27,7 @@ type ChangeLinkStateRequest struct {
|
||||
func (c Compute) ChangeLinkState(ctx context.Context, req ChangeLinkStateRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/changeLinkState"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for clone compute instance
|
||||
// CloneRequest struct to clone compute instance
|
||||
type CloneRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -35,9 +35,7 @@ type CloneRequest struct {
|
||||
func (c Compute) Clone(ctx context.Context, req CloneRequest) (uint64, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return 0, validators.ValidationError(validationError)
|
||||
}
|
||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/clone"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for set compute CI
|
||||
// ComputeCISetRequest struct to set compute CI
|
||||
type ComputeCISetRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type ComputeCISetRequest struct {
|
||||
func (c Compute) ComputeCISet(ctx context.Context, req ComputeCISetRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/computeciSet"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for unset compite CI
|
||||
// ComputeCIUnsetRequest struct to unset compute CI
|
||||
type ComputeCIUnsetRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type ComputeCIUnsetRequest struct {
|
||||
func (c Compute) ComputeCIUnset(ctx context.Context, req ComputeCIUnsetRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/computeciUnset"
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for create template
|
||||
// CreateTemplateRequest struct to create template
|
||||
type CreateTemplateRequest struct {
|
||||
// ID of the compute to create template from
|
||||
// Required: true
|
||||
@@ -34,9 +34,7 @@ type wrapperCreateTemplateRequest struct {
|
||||
func (c Compute) CreateTemplateAsync(ctx context.Context, req CreateTemplateRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return "", validators.ValidationError(validationError)
|
||||
}
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
reqWrapped := wrapperCreateTemplateRequest{
|
||||
@@ -60,9 +58,7 @@ func (c Compute) CreateTemplateAsync(ctx context.Context, req CreateTemplateRequ
|
||||
func (c Compute) CreateTemplate(ctx context.Context, req CreateTemplateRequest) (uint64, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return 0, validators.ValidationError(validationError)
|
||||
}
|
||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
reqWrapped := wrapperCreateTemplateRequest{
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for delete compute
|
||||
// DeleteRequest struct to delete compute
|
||||
type DeleteRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -31,9 +31,7 @@ type DeleteRequest struct {
|
||||
func (c Compute) Delete(ctx context.Context, req DeleteRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/delete"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for detach VGPU for compute
|
||||
// DetachGPURequest struct to detach VGPU for compute
|
||||
type DetachGPURequest struct {
|
||||
// Identifier compute
|
||||
// Required: true
|
||||
@@ -19,14 +19,12 @@ type DetachGPURequest struct {
|
||||
VGPUID int64 `url:"vgpuId,omitempty" json:"vgpuId,omitempty"`
|
||||
}
|
||||
|
||||
// DetachGPU detach VGPU for compute.
|
||||
// DetachGPU detaches VGPU for compute.
|
||||
// If param VGPU ID is equivalent -1, then detach all VGPU for compute
|
||||
func (c Compute) DetachGPU(ctx context.Context, req DetachGPURequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/detachGpu"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for detach PCI device
|
||||
// DetachPCIDeviceRequest struct to detach PCI device
|
||||
type DetachPCIDeviceRequest struct {
|
||||
// Identifier compute
|
||||
// Required: true
|
||||
@@ -19,13 +19,11 @@ type DetachPCIDeviceRequest struct {
|
||||
DeviceID uint64 `url:"deviceId" json:"deviceId" validate:"required"`
|
||||
}
|
||||
|
||||
// DetachPCIDevice detach PCI device
|
||||
// DetachPciDevice detaches PCI device
|
||||
func (c Compute) DetachPciDevice(ctx context.Context, req DetachPCIDeviceRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/detachPciDevice"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for disable compute
|
||||
// DisableRequest struct to disable compute
|
||||
type DisableRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type DisableRequest struct {
|
||||
func (c Compute) Disable(ctx context.Context, req DisableRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/disable"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for create and attach disk to compute
|
||||
// DiskAddRequest struct to create and attach disk to compute
|
||||
type DiskAddRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -52,9 +52,7 @@ type DiskAddRequest struct {
|
||||
func (c Compute) DiskAdd(ctx context.Context, req DiskAddRequest) (uint64, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return 0, validators.ValidationError(validationError)
|
||||
}
|
||||
return 0, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/diskAdd"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for attach disk to compute
|
||||
// DiskAttachRequest struct to attach disk to compute
|
||||
type DiskAttachRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -31,9 +31,7 @@ type DiskAttachRequest struct {
|
||||
func (c Compute) DiskAttach(ctx context.Context, req DiskAttachRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/diskAttach"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for detach and delete disk from compute
|
||||
// DiskDelRequest struct to detach and delete disk from compute
|
||||
type DiskDelRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -27,13 +27,11 @@ type DiskDelRequest struct {
|
||||
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
|
||||
}
|
||||
|
||||
// DiskDel delete disk and detach from compute
|
||||
// DiskDel deletes disk and detaches it from compute
|
||||
func (c Compute) DiskDel(ctx context.Context, req DiskDelRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/diskDel"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for detach disk from compute
|
||||
// DiskDetachRequest struct to detach disk from compute
|
||||
type DiskDetachRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -23,13 +23,11 @@ type DiskDetachRequest struct {
|
||||
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
|
||||
}
|
||||
|
||||
// DiskDetach detach disk from compute
|
||||
// DiskDetach detaches disk from compute
|
||||
func (c Compute) DiskDetach(ctx context.Context, req DiskDetachRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/diskDetach"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for change QOS of the disk
|
||||
// DiskQOSRequest struct to change QOS of the disk
|
||||
type DiskQOSRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -27,13 +27,11 @@ type DiskQOSRequest struct {
|
||||
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
|
||||
}
|
||||
|
||||
// DiskQOS change QOS of the disk
|
||||
// DiskQOS changes QOS of the disk
|
||||
func (c Compute) DiskQOS(ctx context.Context, req DiskQOSRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/diskQos"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for change disk size
|
||||
// DiskResizeRequest struct to change disk size
|
||||
type DiskResizeRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -27,13 +27,11 @@ type DiskResizeRequest struct {
|
||||
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
|
||||
}
|
||||
|
||||
// DiskResize change disk size
|
||||
// DiskResize changes disk size
|
||||
func (c Compute) DiskResize(ctx context.Context, req DiskResizeRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/diskResize"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for enable compute
|
||||
// EnableRequest struct to enable compute
|
||||
type EnableRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type EnableRequest struct {
|
||||
func (c Compute) Enable(ctx context.Context, req EnableRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/enable"
|
||||
|
||||
@@ -40,9 +40,7 @@ func (c Compute) Get(ctx context.Context, req GetRequest) (*RecordCompute, error
|
||||
func (c Compute) GetRaw(ctx context.Context, req GetRequest) ([]byte, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/get"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get compute audits
|
||||
// GetAuditsRequest struct to get compute audits
|
||||
type GetAuditsRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type GetAuditsRequest struct {
|
||||
func (c Compute) GetAudits(ctx context.Context, req GetAuditsRequest) (ListAudits, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/getAudits"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get console URL
|
||||
// GetConsoleURLRequest struct to get console URL
|
||||
type GetConsoleURLRequest struct {
|
||||
// ID of compute instance to get console for
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type GetConsoleURLRequest struct {
|
||||
func (c Compute) GetConsoleURL(ctx context.Context, req GetConsoleURLRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return "", validators.ValidationError(validationError)
|
||||
}
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/getConsoleUrl"
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get compute logs
|
||||
// GetLogRequest struct to get compute logs
|
||||
type GetLogRequest struct {
|
||||
// ID of compute instance to get log for
|
||||
// Required: true
|
||||
@@ -22,9 +22,7 @@ type GetLogRequest struct {
|
||||
func (c Compute) GetLog(ctx context.Context, req GetLogRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return "", validators.ValidationError(validationError)
|
||||
}
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/getLog"
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// Request struct for get deleted computes list
|
||||
// ListDeletedRequest struct to get deleted computes list
|
||||
type ListDeletedRequest struct {
|
||||
// Find by ID
|
||||
// Required: false
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get list PCI devices
|
||||
// ListPCIDeviceRequest struct to get list of PCI devices
|
||||
type ListPCIDeviceRequest struct {
|
||||
// Identifier compute
|
||||
// Required: true
|
||||
@@ -39,13 +39,11 @@ type ListPCIDeviceRequest struct {
|
||||
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
|
||||
}
|
||||
|
||||
// ListPCIDevice gets list PCI device
|
||||
// ListPCIDevice gets list of PCI device
|
||||
func (c Compute) ListPCIDevice(ctx context.Context, req ListPCIDeviceRequest) (*ListPCIDevices, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/listPciDevice"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get list GPU for compute
|
||||
// ListVGPURequest struct to get list of GPU for compute
|
||||
type ListVGPURequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -39,13 +39,11 @@ type ListVGPURequest struct {
|
||||
IncludeDeleted bool `url:"includedeleted,omitempty" json:"includedeleted,omitempty"`
|
||||
}
|
||||
|
||||
// ListVGPU gets list GPU for compute
|
||||
// ListVGPU gets list of GPU for compute
|
||||
func (c Compute) ListVGPU(ctx context.Context, req ListVGPURequest) (*ListVGPUs, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/listVGpu"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for delete several computes
|
||||
// MassDeleteRequest struct to delete several computes
|
||||
type MassDeleteRequest struct {
|
||||
// IDs of compute instances to delete
|
||||
// Required: true
|
||||
@@ -27,9 +27,7 @@ type MassDeleteRequest struct {
|
||||
func (c Compute) MassDelete(ctx context.Context, req MassDeleteRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/massDelete"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for reboot several computes
|
||||
// MassRebootRequest struct to reboot several computes
|
||||
type MassRebootRequest struct {
|
||||
// IDs of compute instances to reboot
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type MassRebootRequest struct {
|
||||
func (c Compute) MassReboot(ctx context.Context, req MassRebootRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/massReboot"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for repair boot disk filesystem on several computes
|
||||
// MassRepairBootFSRequest struct to repair boot disk filesystem on several computes
|
||||
type MassRepairBootFSRequest struct {
|
||||
// IDs of compute instances which boot file systems will be repaired
|
||||
// Required: true
|
||||
@@ -19,13 +19,11 @@ type MassRepairBootFSRequest struct {
|
||||
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
|
||||
}
|
||||
|
||||
// MassRepairBootFS repair boot disk filesystem on several computes
|
||||
// MassRepairBootFS repairs boot disk filesystem on several computes
|
||||
func (c Compute) MassRepairBootFS(ctx context.Context, req MassRepairBootFSRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/massRepairBootFs"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for start several computes
|
||||
// MassStartRequest struct to start several computes
|
||||
type MassStartRequest struct {
|
||||
// IDs of compute instances to start
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type MassStartRequest struct {
|
||||
func (c Compute) MassStart(ctx context.Context, req MassStartRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/massStart"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for several stop computes
|
||||
// MassStopRequest struct to stop several computes
|
||||
type MassStopRequest struct {
|
||||
// IDs of compute instances to stop
|
||||
// Required: true
|
||||
@@ -27,9 +27,7 @@ type MassStopRequest struct {
|
||||
func (c Compute) MassStop(ctx context.Context, req MassStopRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/massStop"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for migrate compute
|
||||
// MigrateRequest struct to migrate compute
|
||||
type MigrateRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -32,9 +32,7 @@ type MigrateRequest struct {
|
||||
func (c Compute) Migrate(ctx context.Context, req MigrateRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/migrate"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for migration
|
||||
// MigrateStorageRequest struct for migration
|
||||
type MigrateStorageRequest struct {
|
||||
// ID of the compute instance
|
||||
// Required: true
|
||||
@@ -38,9 +38,7 @@ type MigrateStorageRequest struct {
|
||||
func (c Compute) MigrateStorage(ctx context.Context, req MigrateStorageRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return "", validators.ValidationError(validationError)
|
||||
}
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/migrateStorage"
|
||||
|
||||
@@ -8,20 +8,18 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for abort migration
|
||||
// MigrateStorageAbortRequest struct to abort migration
|
||||
type MigrateStorageAbortRequest struct {
|
||||
// ID of the compute instance
|
||||
// Required: true
|
||||
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
|
||||
}
|
||||
|
||||
// MigrateStorageAbort abort complex compute migration job
|
||||
// MigrateStorageAbort aborts complex compute migration job
|
||||
func (c Compute) MigrateStorageAbort(ctx context.Context, req MigrateStorageAbortRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return "", validators.ValidationError(validationError)
|
||||
}
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/migrateStorageAbort"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for cleanup resources after finished migration
|
||||
// MigrateStorageCleanUpRequest struct to cleanup resources after finished migration
|
||||
type MigrateStorageCleanUpRequest struct {
|
||||
// ID of the compute instance
|
||||
// Required: true
|
||||
@@ -21,9 +21,7 @@ type MigrateStorageCleanUpRequest struct {
|
||||
func (c Compute) MigrateStorageCleanUp(ctx context.Context, req MigrateStorageCleanUpRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return "", validators.ValidationError(validationError)
|
||||
}
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/migrateStorageCleanup"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get info about migration
|
||||
// MigrateStorageInfoRequest struct to get info about migration
|
||||
type MigrateStorageInfoRequest struct {
|
||||
// ID of the compute instance
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type MigrateStorageInfoRequest struct {
|
||||
func (c Compute) MigrateStorageInfo(ctx context.Context, req MigrateStorageInfoRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return "", validators.ValidationError(validationError)
|
||||
}
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/migrateStorageInfo"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for move compute new resource group
|
||||
// MoveToRGRequest struct to move compute to new resource group
|
||||
type MoveToRGRequest struct {
|
||||
// ID of the compute instance to move
|
||||
// Required: true
|
||||
@@ -38,9 +38,7 @@ type MoveToRGRequest struct {
|
||||
func (c Compute) Validate(ctx context.Context, req MoveToRGRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/moveToRg"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for attach network
|
||||
// NetAttachRequest struct to attach network
|
||||
type NetAttachRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -35,13 +35,11 @@ type NetAttachRequest struct {
|
||||
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
|
||||
}
|
||||
|
||||
// NetAttach attach network to compute and gets info about network
|
||||
// NetAttach attaches network to compute and gets info about network
|
||||
func (c Compute) NetAttach(ctx context.Context, req NetAttachRequest) (*RecordNetAttach, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return nil, validators.ValidationError(validationError)
|
||||
}
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/netAttach"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for detach networ to compute
|
||||
// NetDetachRequest struct to detach network from compute
|
||||
type NetDetachRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -27,13 +27,11 @@ type NetDetachRequest struct {
|
||||
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
|
||||
}
|
||||
|
||||
// NetDetach detach network to compute
|
||||
// NetDetach detaches network from compute
|
||||
func (c Compute) NetDetach(ctx context.Context, req NetDetachRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/netDetach"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for update QOS
|
||||
// NetQOSRequest struct for update QOS
|
||||
type NetQOSRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -38,13 +38,11 @@ type NetQOSRequest struct {
|
||||
EgressRate uint64 `url:"egress_rate,omitempty" json:"egress_rate,omitempty"`
|
||||
}
|
||||
|
||||
// NetQOS update compute interfaces QOS
|
||||
// NetQOS updates compute interfaces QOS
|
||||
func (c Compute) NetQOS(ctx context.Context, req NetQOSRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/netQos"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for pause compute
|
||||
// PauseRequest struct to pause compute
|
||||
type PauseRequest struct {
|
||||
// ID of compute instance
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type PauseRequest struct {
|
||||
func (c Compute) Pause(ctx context.Context, req PauseRequest) (bool, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
for _, validationError := range validators.GetErrors(err) {
|
||||
return false, validators.ValidationError(validationError)
|
||||
}
|
||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/pause"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user