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

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for grant access to resource group
// AccessGrantRequest struct to grant access to resource group
type AccessGrantRequest struct {
// Resource group ID
// Required: true
@@ -35,9 +35,7 @@ type AccessGrantRequest struct {
func (r RG) AccessGrant(ctx context.Context, req AccessGrantRequest) (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/rg/accessGrant"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for revoke access
// AccessRevokeRequest struct to revoke access
type AccessRevokeRequest struct {
// Resource group ID
// Required: true
@@ -27,9 +27,7 @@ type AccessRevokeRequest struct {
func (r RG) AccessRevoke(ctx context.Context, req AccessRevokeRequest) (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/rg/accessRevoke"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for get list of all computes with their relationships
// AffinityGroupComputesRequest struct to get list of all computes with their relationships
type AffinityGroupComputesRequest struct {
// Resource group ID
// Required: true
@@ -23,9 +23,7 @@ type AffinityGroupComputesRequest struct {
func (r RG) AffinityGroupComputes(ctx context.Context, req AffinityGroupComputesRequest) (ListAffinityGroupCompute, 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/rg/affinityGroupComputes"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for get list computes from affinity group
// AffinityGroupsGetRequest struct to get list of computes from affinity group
type AffinityGroupsGetRequest struct {
// Resource group ID
// Required: true
@@ -19,13 +19,11 @@ type AffinityGroupsGetRequest struct {
AffinityGroup string `url:"affinityGroup" json:"affinityGroup" validate:"required"`
}
// AffinityGroupsGet gets list computes in the specified affinity group
// AffinityGroupsGet gets list of computes in the specified affinity group
func (r RG) AffinityGroupsGet(ctx context.Context, req AffinityGroupsGetRequest) ([]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/rg/affinityGroupsGet"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for get list of affinity groups from resource group
// AffinityGroupsListRequest struct to get list of affinity groups from resource group
type AffinityGroupsListRequest struct {
// Resource group ID
// Required: true
@@ -19,9 +19,7 @@ type AffinityGroupsListRequest struct {
func (r RG) AffinityGroupsList(ctx context.Context, req AffinityGroupsListRequest) (*ListAffinityGroup, 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/rg/affinityGroupsList"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for get audit
// AuditsRequest struct to get audit
type AuditsRequest struct {
// Resource group ID
// Required: true
@@ -19,9 +19,7 @@ type AuditsRequest struct {
func (r RG) 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/rg/audits"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for create resource group
// CreateRequest struct to create resource group
type CreateRequest struct {
// Account, which will own this resource group
// Required: true
@@ -89,9 +89,7 @@ type CreateRequest struct {
func (r RG) 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/rg/create"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for delete resource group
// DeleteRequest struct to delete resource group
type DeleteRequest struct {
// Resource group ID
// Required: true
@@ -32,9 +32,7 @@ type DeleteRequest struct {
func (r RG) 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/rg/delete"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for disable resource group
// DisableRequest struct to disable resource group
type DisableRequest struct {
// Resource group ID
// Required: true
@@ -23,9 +23,7 @@ type DisableRequest struct {
func (r RG) 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/rg/disable"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for enable resource group
// EnableRequest struct to enable resource group
type EnableRequest struct {
// Resource group ID
// Required: true
@@ -23,9 +23,7 @@ type EnableRequest struct {
func (r RG) 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/rg/enable"

View File

@@ -40,9 +40,7 @@ func (r RG) Get(ctx context.Context, req GetRequest) (*RecordRG, error) {
func (r RG) 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/rg/get"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for get detailed information about resource consumption for ResGroup
// GetResourceConsumptionRequest struct to get detailed information about resource consumption for ResGroup
type GetResourceConsumptionRequest struct {
// Resource group ID
// Required: true
@@ -19,9 +19,7 @@ type GetResourceConsumptionRequest struct {
func (r RG) GetResourceConsumption(ctx context.Context, req GetResourceConsumptionRequest) (*ItemResourceConsumption, 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/rg/getResourceConsumption"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for get list of computes
// ListComputesRequest struct to get list of computes
type ListComputesRequest struct {
// Resource group ID
// Required: true
@@ -59,9 +59,7 @@ type ListComputesRequest struct {
func (r RG) 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/rg/listComputes"

View File

@@ -6,7 +6,7 @@ import (
"net/http"
)
// Request struct for get list deleted resource groups
// ListDeletedRequest struct to get list of deleted resource groups
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 load balancers
// ListLBRequest struct to get list of load balancers
type ListLBRequest struct {
// Resource group ID
// Required: true
@@ -51,13 +51,11 @@ type ListLBRequest struct {
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}
// ListLB gets list all load balancers in the specified resource group, accessible by the user
// ListLB gets list of all load balancers in the specified resource group, accessible by the user
func (r RG) ListLB(ctx context.Context, req ListLBRequest) (*ListLB, 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/rg/listLb"

View File

@@ -8,20 +8,18 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for get list port forward rules
// ListPFWRequest struct to get list of port forward rules
type ListPFWRequest struct {
// Resource group ID
// Required: true
RGID uint64 `url:"rgId" json:"rgId" validate:"required"`
}
// ListPFW gets list port forward rules for the specified resource group
// ListPFW gets list of port forward rules for the specified resource group
func (r RG) ListPFW(ctx context.Context, req ListPFWRequest) (*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/rg/listPFW"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for get list VINSes
// ListVINSRequest struct to get list of VINSes
type ListVINSRequest struct {
// Resource group ID
// Required: true
@@ -39,13 +39,11 @@ type ListVINSRequest struct {
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}
// ListVINS gets list all ViNSes under specified resource group, accessible by the user
// ListVINS gets list of all ViNSes under specified resource group, accessible by the user
func (r RG) 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/rg/listVins"

View File

@@ -7,7 +7,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for delete several resource groups
// MassDeleteRequest struct to delete several resource groups
type MassDeleteRequest struct {
// IDs of the resource groups
// Required: true
@@ -33,9 +33,7 @@ type MassDeleteRequest struct {
func (r RG) 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/rg/massDelete"

View File

@@ -7,7 +7,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for disable several resource groups
// MassDisableRequest struct to disable several resource groups
type MassDisableRequest struct {
// IDs of the resource groups
// Required: true
@@ -22,9 +22,7 @@ type MassDisableRequest struct {
func (r RG) MassDisable(ctx context.Context, req MassDisableRequest) (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/rg/massDisable"

View File

@@ -7,7 +7,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for enable several resource groups
// MassEnableRequest struct to enable several resource groups
type MassEnableRequest struct {
// IDs of the resource groups
// Required: true
@@ -22,9 +22,7 @@ type MassEnableRequest struct {
func (r RG) MassEnable(ctx context.Context, req MassEnableRequest) (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/rg/massEnable"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for restore resource group
// RestoreRequest struct to restore resource group
type RestoreRequest struct {
// Resource group ID
// Required: true
@@ -23,9 +23,7 @@ type RestoreRequest struct {
func (r RG) 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/rg/restore"

View File

@@ -7,7 +7,7 @@ import (
"strconv"
)
// Request for setting CPU allocation parameter
// SetCPUAllocationParameterRequest struct for setting CPU allocation parameter
type SetCPUAllocationParameterRequest struct {
// Resource group ID
// Required: true
@@ -24,9 +24,7 @@ type SetCPUAllocationParameterRequest struct {
func (r RG) 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/rg/setCpuAllocationParameter"

View File

@@ -7,7 +7,7 @@ import (
"strconv"
)
// Request for setting CPU allocation ratio
// SetCPUAllocationRatioRequest struct for setting CPU allocation ratio
type SetCPUAllocationRatioRequest struct {
// Resource group ID
// Required: true
@@ -22,9 +22,7 @@ type SetCPUAllocationRatioRequest struct {
func (r RG) 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/rg/setCpuAllocationRatio"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for set default network
// SetDefNetRequest struct to set default network
type SetDefNetRequest struct {
// Resource group ID
// Required: true
@@ -34,9 +34,7 @@ type SetDefNetRequest struct {
func (r RG) SetDefNet(ctx context.Context, req SetDefNetRequest) (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/rg/setDefNet"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for update resource group
// UpdateRequest struct to update resource group
type UpdateRequest struct {
// Resource group ID
// Required: true
@@ -59,9 +59,7 @@ type UpdateRequest struct {
func (r RG) 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/rg/update"

View File

@@ -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 resource group
// Required: true
@@ -26,12 +26,11 @@ type UpdateResourceTypesRequest struct {
ResTypes []string `url:"resourceTypes" json:"resourceTypes" validate:"min=1,resTypes"`
}
// UpdateResourceTypes updates resource types in account
func (r RG) 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/rg/updateResourceTypes"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for get report of resource usage
// UsageRequest struct to get report of resource usage
type UsageRequest struct {
// Resource group ID
// Required: true
@@ -23,9 +23,7 @@ type UsageRequest struct {
func (r RG) Usage(ctx context.Context, req UsageRequest) (*Reservation, 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/rg/usage"