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 location code
|
||||
// AddRequest struct for location code
|
||||
type AddRequest struct {
|
||||
// Grid (platform) ID
|
||||
// Required: true
|
||||
@@ -27,9 +27,7 @@ type AddRequest struct {
|
||||
func (g Grid) Add(ctx context.Context, req AddRequest) (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/grid/add"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for change grid settings
|
||||
// ChangeSettingsRequest struct to change grid settings
|
||||
type ChangeSettingsRequest struct {
|
||||
// Grid (platform) ID
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type ChangeSettingsRequest struct {
|
||||
func (g Grid) ChangeSettings(ctx context.Context, req ChangeSettingsRequest) (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/grid/changeSettings"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for check virtual machine
|
||||
// CheckVMsRequest struct to check virtual machine
|
||||
type CheckVMsRequest struct {
|
||||
// Grid (platform) ID
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type CheckVMsRequest struct {
|
||||
func (g Grid) CheckVMs(ctx context.Context, req CheckVMsRequest) (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/grid/checkVMs"
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for create system space
|
||||
// CreateSystemSpaceRequest struct to create system space
|
||||
type CreateSystemSpaceRequest struct {
|
||||
// Grid (platform) ID
|
||||
// Required: true
|
||||
@@ -46,9 +46,7 @@ type CreateSystemSpaceRequest struct {
|
||||
func (g Grid) CreateSystemSpace(ctx context.Context, req CreateSystemSpaceRequest) (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/grid/createSystemSpace"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for execute script
|
||||
// ExecuteMaintenanceScriptRequest struct to execute script
|
||||
type ExecuteMaintenanceScriptRequest struct {
|
||||
// Grid (platform) ID
|
||||
// Required: true
|
||||
@@ -27,9 +27,7 @@ type ExecuteMaintenanceScriptRequest struct {
|
||||
func (g Grid) ExecuteMaintenanceScript(ctx context.Context, req ExecuteMaintenanceScriptRequest) (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/grid/executeMaintenanceScript"
|
||||
|
||||
@@ -36,9 +36,7 @@ func (g Grid) Get(ctx context.Context, req GetRequest) (*RecordGrid, error) {
|
||||
func (g Grid) 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/grid/get"
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get backup
|
||||
// GetBackupRequest struct to get backup
|
||||
type GetBackupRequest struct {
|
||||
// Grid (platform) ID
|
||||
// Required: true
|
||||
@@ -18,9 +18,7 @@ type GetBackupRequest struct {
|
||||
func (g Grid) GetBackup(ctx context.Context, req GetBackupRequest) (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/grid/getBackup"
|
||||
@@ -37,9 +35,7 @@ func (g Grid) GetBackup(ctx context.Context, req GetBackupRequest) (string, erro
|
||||
func (g Grid) GetBackupGET(ctx context.Context, req GetBackupRequest) (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/grid/getBackup"
|
||||
|
||||
@@ -7,20 +7,18 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get platform snapshot with additional diagnosis
|
||||
// GetDiagnosisRequest struct to get platform snapshot with additional diagnosis
|
||||
type GetDiagnosisRequest struct {
|
||||
// Grid (platform) ID
|
||||
// Required: true
|
||||
GID uint64 `url:"gid" json:"gid" validate:"required"`
|
||||
}
|
||||
|
||||
// GetDiagnosis get platform snapshot with additional diagnosis info like a logs, etc
|
||||
// GetDiagnosis gets platform snapshot with additional diagnosis info like a logs, etc
|
||||
func (g Grid) GetDiagnosis(ctx context.Context, req GetDiagnosisRequest) (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/grid/getDiagnosis"
|
||||
@@ -33,13 +31,11 @@ func (g Grid) GetDiagnosis(ctx context.Context, req GetDiagnosisRequest) (string
|
||||
return string(res), nil
|
||||
}
|
||||
|
||||
// GetDiagnosisGET get platform snapshot with additional diagnosis info like a logs, etc
|
||||
// GetDiagnosisGET gets platform snapshot with additional diagnosis info like a logs, etc
|
||||
func (g Grid) GetDiagnosisGET(ctx context.Context, req GetDiagnosisRequest) (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/grid/getDiagnosis"
|
||||
|
||||
@@ -8,18 +8,18 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// GetResourceConsumptionRequest struct to get resource consumption
|
||||
type GetResourceConsumptionRequest struct {
|
||||
// ID of the grid
|
||||
// Required: true
|
||||
GridID uint64 `url:"gridId" json:"gridId" validate:"required"`
|
||||
}
|
||||
|
||||
// GetResourceConsumption gets resource consumption
|
||||
func (g Grid) GetResourceConsumption(ctx context.Context, req GetResourceConsumptionRequest) (*RecordResourcesConsumption, 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/grid/getResourceConsumption"
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// Request struct for getting list of email addresses of users
|
||||
// ListEmailsRequest struct for getting list of email addresses of users
|
||||
type ListEmailsRequest struct {
|
||||
// Page number
|
||||
// Required: false
|
||||
@@ -19,7 +19,6 @@ type ListEmailsRequest struct {
|
||||
|
||||
// ListEmails returns list of email addresses of users
|
||||
func (g Grid) ListEmails(ctx context.Context, req ListEmailsRequest) (*ListEmails, error) {
|
||||
|
||||
url := "/cloudbroker/grid/listEmails"
|
||||
|
||||
res, err := g.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for purge logs
|
||||
// PurgeLogsRequest struct to purge logs
|
||||
type PurgeLogsRequest struct {
|
||||
// Grid (platform) ID
|
||||
// Required: true
|
||||
@@ -24,9 +24,7 @@ type PurgeLogsRequest struct {
|
||||
func (g Grid) PurgeLogs(ctx context.Context, req PurgeLogsRequest) (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/grid/purgeLogs"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for rename grid
|
||||
// RenameRequest struct to rename grid
|
||||
type RenameRequest struct {
|
||||
// Grid (platform) ID
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type RenameRequest struct {
|
||||
func (g Grid) Rename(ctx context.Context, req RenameRequest) (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/grid/rename"
|
||||
|
||||
@@ -8,24 +8,22 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for restart services
|
||||
// ServicesRestartRequest struct to restart services
|
||||
type ServicesRestartRequest struct {
|
||||
// Grid (platform) ID
|
||||
// Required: true
|
||||
GID uint64 `url:"gid" json:"gid" validate:"required"`
|
||||
GID uint64 `url:"gid" json:"gid" validate:"required"`
|
||||
|
||||
// Node ID
|
||||
// Required: true
|
||||
NID uint64 `url:"nid" json:"nid" validate:"required"`
|
||||
NID uint64 `url:"nid" json:"nid" validate:"required"`
|
||||
}
|
||||
|
||||
// ServicesRestart restarts decort services on the node
|
||||
func (g Grid) ServicesRestart(ctx context.Context, req ServicesRestartRequest) (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/grid/servicesRestart"
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// Request for setting CPU allocation parameter
|
||||
// SetCPUAllocationParameterRequest for setting CPU allocation parameter
|
||||
type SetCPUAllocationParameterRequest struct {
|
||||
// Grid ID
|
||||
// Required: true
|
||||
@@ -24,9 +24,7 @@ type SetCPUAllocationParameterRequest struct {
|
||||
func (g Grid) 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/grid/setCpuAllocationParameter"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for set allocation
|
||||
// SetCPUAllocationRatioRequest struct to set allocation
|
||||
type SetCPUAllocationRatioRequest struct {
|
||||
// Grid (platform) ID
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type SetCPUAllocationRatioRequest struct {
|
||||
func (g Grid) 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/grid/setCpuAllocationRatio"
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// Request for setting CPU allocation ratio for computes
|
||||
// SetCPUAllocationRatioForVMRequest for setting CPU allocation ratio for computes
|
||||
type SetCPUAllocationRatioForVMRequest struct {
|
||||
// Grid ID
|
||||
// Required: true
|
||||
@@ -18,13 +18,11 @@ type SetCPUAllocationRatioForVMRequest struct {
|
||||
Ratio float64 `url:"ratio" json:"ratio" validate:"required"`
|
||||
}
|
||||
|
||||
// SetCPUAllocationRatio sets CPU allocation ratio for computes
|
||||
// SetCPUAllocationRatioForVM sets CPU allocation ratio for computes
|
||||
func (g Grid) SetCPUAllocationRatioForVM(ctx context.Context, req SetCPUAllocationRatioForVMRequest) (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/grid/setCpuAllocationRatioForVM"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for set memory allocation
|
||||
// SetMemAllocationRatioRequest struct to set memory allocation
|
||||
type SetMemAllocationRatioRequest struct {
|
||||
// Grid (platform) ID
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type SetMemAllocationRatioRequest struct {
|
||||
func (g Grid) SetMemAllocationRatio(ctx context.Context, req SetMemAllocationRatioRequest) (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/grid/setMemAllocationRatio"
|
||||
|
||||
Reference in New Issue
Block a user