This commit is contained in:
2023-10-25 17:37:18 +03:00
parent b666789c7d
commit 4120cd2b1a
639 changed files with 2010 additions and 3224 deletions

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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{

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for add port forward rule
// PFWAddRequest struct to add port forward rule
type PFWAddRequest struct {
// ID of compute instance
// Required: true
@@ -39,13 +39,11 @@ type PFWAddRequest struct {
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
}
// PFWAdd add port forward rule
// PFWAdd adds port forward rule
func (c Compute) PFWAdd(ctx context.Context, req PFWAddRequest) (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/pfwAdd"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for delete port forward rule
// PFWDelRequest struct to delete port forward rule
type PFWDelRequest struct {
// ID of compute instance
// Required: true
@@ -42,13 +42,11 @@ type PFWDelRequest struct {
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
}
// PFWDel delete port forward rule
// PFWDel deletes port forward rule
func (c Compute) PFWDel(ctx context.Context, req PFWDelRequest) (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/pfwDel"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for get list port forwards
// PFWListRequest struct to get list of port forwards
type PFWListRequest struct {
// ID of compute instance
// Required: true
@@ -23,9 +23,7 @@ type PFWListRequest struct {
func (c Compute) PFWList(ctx context.Context, req PFWListRequest) (ListPFW, 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/pfwList"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for pin comptute to stack
// PinToStackRequest struct to pin compute to stack
type PinToStackRequest struct {
// ID of the compute instance
// Required: true
@@ -23,13 +23,11 @@ type PinToStackRequest struct {
Force bool `url:"force" json:"force"`
}
// PinToStack pin compute to current stack
// PinToStack pins compute to current stack
func (c Compute) PinToStack(ctx context.Context, req PinToStackRequest) (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/pinToStack"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for force stop and start compute
// PowerCycleRequest struct to force stop and start compute
type PowerCycleRequest struct {
// ID of compute instance
// Required: true
@@ -19,9 +19,7 @@ type PowerCycleRequest struct {
func (c Compute) PowerCycle(ctx context.Context, req PowerCycleRequest) (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/powerCycle"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for reboot compute
// RebootRequest struct to reboot compute
type RebootRequest struct {
// ID of compute instance
// Required: true
@@ -19,13 +19,11 @@ type RebootRequest struct {
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
}
// Reboot reboot compute
// Reboot reboots compute
func (c Compute) Reboot(ctx context.Context, req RebootRequest) (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/reboot"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for redeploy
// RedeployRequest struct for redeploy
type RedeployRequest struct {
// ID of compute instance
// Required: true
@@ -43,13 +43,11 @@ type RedeployRequest struct {
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
}
// Redeploy redeploy compute
// Redeploy redeploys compute
func (c Compute) Redeploy(ctx context.Context, req RedeployRequest) (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/redeploy"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for set compute registered in RT
// RegistrationRequest struct to set compute registered in RT
type RegistrationRequest struct {
// ID of the Compute
// Required: true
@@ -23,9 +23,7 @@ type RegistrationRequest struct {
func (c Compute) Registration(ctx context.Context, req RegistrationRequest) (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/registration"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for repair filesystem
// RepairBootFSRequest struct to repair filesystem
type RepairBootFSRequest struct {
// ID of compute instance
// Required: true
@@ -19,13 +19,11 @@ type RepairBootFSRequest struct {
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
}
// RepairBootFS repair compute boot disk filesystem
// RepairBootFS repairs compute boot disk filesystem
func (c Compute) RepairBootFS(ctx context.Context, req RepairBootFSRequest) (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/repairBootFs"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for reset compute
// ResetRequest struct to reset compute
type ResetRequest struct {
// ID of compute instance
// Required: true
@@ -19,13 +19,11 @@ type ResetRequest struct {
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
}
// Reset reset compute
// Reset resets compute
func (c Compute) Reset(ctx context.Context, req ResetRequest) (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/reset"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for resize compute
// ResizeRequest struct to resize compute
type ResizeRequest struct {
// ID of compute instance
// Required: true
@@ -33,13 +33,11 @@ type ResizeRequest struct {
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
}
// Resize resize compute instance
// Resize resizes compute instance
func (c Compute) Resize(ctx context.Context, req ResizeRequest) (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/resize"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for restore compute
// RestoreRequest struct to restore compute
type RestoreRequest struct {
// ID of compute instance
// Required: true
@@ -19,13 +19,11 @@ type RestoreRequest struct {
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
}
// Restore restore compute from recycle bin
// Restore restores compute from recycle bin
func (c Compute) 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/compute/restore"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for resume compute
// ResumeRequest struct to resume compute
type ResumeRequest struct {
// ID of compute instance
// Required: true
@@ -19,13 +19,11 @@ type ResumeRequest struct {
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
}
// Resume resume Compute from paused state
// Resume resumes Compute from paused state
func (c Compute) Resume(ctx context.Context, req ResumeRequest) (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/resume"

View File

@@ -7,7 +7,8 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for setting customFields values for the Compute
// SetCustomFieldsRequest struct for setting customFields values for the Compute
type SetCustomFieldsRequest struct {
// ID of the compute
// Required: true
@@ -22,9 +23,7 @@ type SetCustomFieldsRequest struct {
func (c Compute) SetCustomFields(ctx context.Context, req SetCustomFieldsRequest) (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/setCustomFields"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for create snapshot
// SnapshotCreateRequest struct to create snapshot
type SnapshotCreateRequest struct {
// ID of the compute instance to create snapshot for
// Required: true
@@ -20,13 +20,11 @@ type SnapshotCreateRequest struct {
Label string `url:"label" json:"label" validate:"required"`
}
// SnapshotCreate create compute snapshot
// SnapshotCreate creates compute snapshot
func (c Compute) SnapshotCreate(ctx context.Context, req SnapshotCreateRequest) (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/snapshotCreate"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for delete snapshot
// SnapshotDeleteRequest struct to delete snapshot
type SnapshotDeleteRequest struct {
// ID of the compute instance
// Required: true
@@ -19,13 +19,11 @@ type SnapshotDeleteRequest struct {
Label string `url:"label" json:"label" validate:"required"`
}
// SnapshotDelete delete specified compute snapshot
// SnapshotDelete deletes specified compute snapshot
func (c Compute) SnapshotDelete(ctx context.Context, req SnapshotDeleteRequest) (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/snapshotDelete"

View File

@@ -8,24 +8,22 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for evict specified disk
// SnapshotEvictDiskRequest struct to evict specified disk
type SnapshotEvictDiskRequest struct {
// ID of the compute instance
// Required: true
ComputeID uint64 `url:"computeId" json:"computeId" valdiate:"required"`
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
// ID of the disk instance
// Required: true
DiskID uint64 `url:"diskId" json:"diskId" validate:"required"`
}
// SnapshotEvictDisk evict specified disk from all snapshots of a compute instance
// SnapshotEvictDisk evicts specified disk from all snapshots of a compute instance
func (c Compute) SnapshotEvictDisk(ctx context.Context, req SnapshotEvictDiskRequest) (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/snapshotEvictDisk"

View File

@@ -8,20 +8,18 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for get list snapshots
// SnapshotListRequest struct to get list of snapshots
type SnapshotListRequest struct {
// ID of the compute instance
// Required: true
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
}
// SnapshotList gets list compute snapshots
// SnapshotList gets list of compute snapshots
func (c Compute) SnapshotList(ctx context.Context, req SnapshotListRequest) (ListSnapshots, 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/snapshotList"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for rollback
// SnapshotRollbackRequest struct for rollback
type SnapshotRollbackRequest struct {
// ID of the compute instance
// Required: true
@@ -19,13 +19,11 @@ type SnapshotRollbackRequest struct {
Label string `url:"label" json:"label" validate:"required"`
}
// SnapshotRollback rollback specified compute snapshot
// SnapshotRollback rollbacks specified compute snapshot
func (c Compute) SnapshotRollback(ctx context.Context, req SnapshotRollbackRequest) (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/snapshotRollback"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for get compute snapshot real size on storage
// SnapshotUsageRequest struct tto get compute snapshot real size on storage
type SnapshotUsageRequest struct {
// ID of the compute instance
// Required: true
@@ -20,15 +20,13 @@ type SnapshotUsageRequest struct {
Label string `url:"label,omitempty" json:"label,omitempty"`
}
// SnapshotUsage Get compute snapshot real size on storage.
// SnapshotUsage gets compute snapshot real size on storage.
// Always returns list of json objects, and first json object contains summary about all related
// snapshots.
func (c Compute) SnapshotUsage(ctx context.Context, req SnapshotUsageRequest) (ListSnapshotUsage, 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/snapshotUsage"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for start compute
// StartRequest struct to start compute
type StartRequest struct {
// ID of compute instance
// Required: true
@@ -31,9 +31,7 @@ type StartRequest struct {
func (c Compute) Start(ctx context.Context, req StartRequest) (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/start"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for stop compute
// StopRequest struct to stop compute
type StopRequest struct {
// ID of compute instance
// Required: true
@@ -27,9 +27,7 @@ type StopRequest struct {
func (c Compute) Stop(ctx context.Context, req StopRequest) (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/stop"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for add tag to compute
// TagAddRequest struct to add tag to compute
type TagAddRequest struct {
// IDs of the compute instances
// Required: true
@@ -23,13 +23,11 @@ type TagAddRequest struct {
Value string `url:"value" json:"value" validate:"required"`
}
// TagAdd add tag to compute tags dict
// TagAdd adds tag to compute tags dict
func (c Compute) TagAdd(ctx context.Context, req TagAddRequest) (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/tagAdd"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for remove tag from compute
// TagRemoveRequest struct to remove tag from compute
type TagRemoveRequest struct {
// IDs of the compute instances
// Required: true
@@ -23,9 +23,7 @@ type TagRemoveRequest struct {
func (c Compute) TagRemove(ctx context.Context, req TagRemoveRequest) (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/tagRemove"

View File

@@ -8,20 +8,18 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for unpin from stack
// UnpinFromStackRequest struct to unpin from stack
type UnpinFromStackRequest struct {
// ID of the compute instance
// Required: true
ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"`
}
// UnpinFromStack unpin compute from current stack
// UnpinFromStack unpins compute from current stack
func (c Compute) UnpinFromStack(ctx context.Context, req UnpinFromStackRequest) (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/unpinFromStack"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for update compute
// UpdateRequest struct to update compute
type UpdateRequest struct {
// ID of the compute
// Required: true
@@ -31,9 +31,7 @@ type UpdateRequest struct {
func (c Compute) 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/compute/update"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for grant access to compute
// UserGrantRequest struct to grant access to compute
type UserGrantRequest struct {
// ID of the compute instance
// Required: true
@@ -27,13 +27,11 @@ type UserGrantRequest struct {
AccessType string `url:"accesstype" json:"accesstype" validate:"accessType"`
}
// UserGrant grant user access to the compute
// UserGrant grants user access to the compute
func (c Compute) UserGrant(ctx context.Context, req UserGrantRequest) (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/userGrant"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for get list users for compute
// UserListRequest struct to get list of users for compute
type UserListRequest struct {
// ID of the compute instance
// Required: true
@@ -19,9 +19,7 @@ type UserListRequest struct {
func (c Compute) UserList(ctx context.Context, req UserListRequest) (*RecordACL, 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/userList"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for revoke user access
// UserRevokeRequest struct to revoke user access
type UserRevokeRequest struct {
// ID of the compute instance
// Required: true
@@ -23,9 +23,7 @@ type UserRevokeRequest struct {
func (c Compute) UserRevoke(ctx context.Context, req UserRevokeRequest) (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/userRevoke"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for update user access
// UserUpdateRequest struct to update user access
type UserUpdateRequest struct {
// ID of the compute instance
// Required: true
@@ -31,9 +31,7 @@ type UserUpdateRequest struct {
func (c Compute) UserUpdate(ctx context.Context, req UserUpdateRequest) (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/userUpdate"