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 grant access to SEP
|
||||
// AccessGrantRequest struct to grant access to SEP
|
||||
type AccessGrantRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
@@ -20,13 +20,11 @@ type AccessGrantRequest struct {
|
||||
AccountID uint64 `url:"account_id" json:"account_id" validate:"required"`
|
||||
}
|
||||
|
||||
// AccessGrant grant access to SEP
|
||||
// AccessGrant grants access to SEP
|
||||
func (s SEP) 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/sep/accessGrant"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for grant access to pool SEP
|
||||
// AccessGrantToPoolRequest struct to grant access to pool SEP
|
||||
type AccessGrantToPoolRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
@@ -27,13 +27,11 @@ type AccessGrantToPoolRequest struct {
|
||||
RGID uint64 `url:"resgroup_id,omitempty" json:"resgroup_id,omitempty"`
|
||||
}
|
||||
|
||||
// AccessGrantToPool grant access to pool SEP
|
||||
// AccessGrantToPool grants access to pool SEP
|
||||
func (s SEP) AccessGrantToPool(ctx context.Context, req AccessGrantToPoolRequest) (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/sep/accessGrantToPool"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for revoke access to SEP
|
||||
// AccessRevokeRequest struct to revoke access to SEP
|
||||
type AccessRevokeRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
@@ -19,13 +19,11 @@ type AccessRevokeRequest struct {
|
||||
AccountID uint64 `url:"account_id" json:"account_id" validate:"required"`
|
||||
}
|
||||
|
||||
// AccessRevoke revoke access to SEP
|
||||
// AccessRevoke revokes access to SEP
|
||||
func (s SEP) 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/sep/accessRevoke"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for revoke access to pool SEP
|
||||
// AccessRevokeToPoolRequest struct to revoke access to pool SEP
|
||||
type AccessRevokeToPoolRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
@@ -27,13 +27,11 @@ type AccessRevokeToPoolRequest struct {
|
||||
RGID uint64 `url:"resgroup_id,omitempty" json:"resgroup_id,omitempty"`
|
||||
}
|
||||
|
||||
// AccessRevokeToPool revoke access to pool SEP
|
||||
// AccessRevokeToPool revokes access to pool SEP
|
||||
func (s SEP) AccessRevokeToPool(ctx context.Context, req AccessRevokeToPoolRequest) (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/sep/accessRevokeToPool"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for add consumer nodes
|
||||
// AddConsumerNodesRequest struct to add consumer nodes
|
||||
type AddConsumerNodesRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
@@ -19,13 +19,11 @@ type AddConsumerNodesRequest struct {
|
||||
ConsumerNIDs []uint64 `url:"consumer_nids" json:"consumer_nids" validate:"min=1"`
|
||||
}
|
||||
|
||||
// AddConsumerNodes add consumer nodes to SEP parameters
|
||||
// AddConsumerNodes adds consumer nodes to SEP parameters
|
||||
func (s SEP) AddConsumerNodes(ctx context.Context, req AddConsumerNodesRequest) (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/sep/addConsumerNodes"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for add provider nodes
|
||||
// AddProviderNodesRequest struct to add provider nodes
|
||||
type AddProviderNodesRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
@@ -19,13 +19,11 @@ type AddProviderNodesRequest struct {
|
||||
ProviderNIDs []uint64 `url:"provider_nids" json:"provider_nids" validate:"min=1"`
|
||||
}
|
||||
|
||||
// AddProviderNodes add provider nodes to SEP parameters
|
||||
// AddProviderNodes adds provider nodes to SEP parameters
|
||||
func (s SEP) AddProviderNodes(ctx context.Context, req AddProviderNodesRequest) (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/sep/addProviderNodes"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for edit config fields
|
||||
// ConfigFieldEditRequest struct to edit config fields
|
||||
type ConfigFieldEditRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
@@ -33,13 +33,11 @@ type ConfigFieldEditRequest struct {
|
||||
FieldType string `url:"field_type" json:"field_type" validate:"sepFieldType"`
|
||||
}
|
||||
|
||||
// ConfigFieldEdit edit SEP config field value
|
||||
// ConfigFieldEdit edits SEP config field value
|
||||
func (s SEP) ConfigFieldEdit(ctx context.Context, req ConfigFieldEditRequest) (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/sep/configFieldEdit"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for insert config
|
||||
// ConfigInsertRequest struct to insert config
|
||||
type ConfigInsertRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
@@ -19,13 +19,11 @@ type ConfigInsertRequest struct {
|
||||
Config string `url:"config" json:"config" validate:"required"`
|
||||
}
|
||||
|
||||
// ConfigInsert insert config to SEP
|
||||
// ConfigInsert inserts config to SEP
|
||||
func (s SEP) ConfigInsert(ctx context.Context, req ConfigInsertRequest) (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/sep/configInsert"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for validate config
|
||||
// ConfigValidateRequest struct to validate config
|
||||
type ConfigValidateRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
@@ -19,13 +19,11 @@ type ConfigValidateRequest struct {
|
||||
Config string `url:"config" json:"config" validate:"required"`
|
||||
}
|
||||
|
||||
// ConfigValidate verify config for the SEP
|
||||
// ConfigValidate verifies config for the SEP
|
||||
func (s SEP) ConfigValidate(ctx context.Context, req ConfigValidateRequest) (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/sep/configValidate"
|
||||
|
||||
@@ -8,20 +8,18 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get consumption info
|
||||
// ConsumptionRequest struct to get consumption info
|
||||
type ConsumptionRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
|
||||
}
|
||||
|
||||
// Consumption get SEP consumption info
|
||||
// Consumption gets SEP consumption info
|
||||
func (s SEP) Consumption(ctx context.Context, req ConsumptionRequest) (*RecordConsumption, 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/sep/consumption"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for create SEP object
|
||||
// CreateRequest struct to create SEP object
|
||||
type CreateRequest struct {
|
||||
// Grid ID
|
||||
// Required: true
|
||||
@@ -47,9 +47,7 @@ type CreateRequest struct {
|
||||
func (s SEP) 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/sep/create"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for decommission
|
||||
// DecommissionRequest struct for decommission
|
||||
type DecommissionRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type DecommissionRequest struct {
|
||||
func (s SEP) Decommission(ctx context.Context, req DecommissionRequest) (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/sep/decommission"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for exclude consumer nodes
|
||||
// DelConsumerNodesRequest struct to exclude consumer nodes
|
||||
type DelConsumerNodesRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
@@ -19,13 +19,11 @@ type DelConsumerNodesRequest struct {
|
||||
ConsumerNIDs []uint64 `url:"consumer_nids" json:"consumer_nids" validate:"min=1"`
|
||||
}
|
||||
|
||||
// DelConsumerNodes exclude consumer nodes from SEP parameters
|
||||
// DelConsumerNodes excludes consumer nodes from SEP parameters
|
||||
func (s SEP) DelConsumerNodes(ctx context.Context, req DelConsumerNodesRequest) (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/sep/delConsumerNodes"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for delete SEP
|
||||
// DeleteRequest struct to delete SEP
|
||||
type DeleteRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type DeleteRequest struct {
|
||||
func (s SEP) 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/sep/delete"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for disable SEP
|
||||
// DisableRequest struct to disable SEP
|
||||
type DisableRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type DisableRequest struct {
|
||||
func (s SEP) 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/sep/disable"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get list of disk IDs
|
||||
// DiskListRequest struct to get list of disk IDs
|
||||
type DiskListRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
@@ -19,13 +19,11 @@ type DiskListRequest struct {
|
||||
PoolName string `url:"pool_name,omitempty" json:"pool_name,omitempty"`
|
||||
}
|
||||
|
||||
// DiskList get list of disk IDs, who use this SEP and pool (if provided)
|
||||
// DiskList gets list of disk IDs, who use this SEP and pool (if provided)
|
||||
func (s SEP) DiskList(ctx context.Context, req DiskListRequest) ([]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/sep/diskList"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for enable SEP
|
||||
// EnableRequest struct to enable SEP
|
||||
type EnableRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type EnableRequest struct {
|
||||
func (s SEP) 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/sep/enable"
|
||||
|
||||
@@ -36,9 +36,7 @@ func (s SEP) Get(ctx context.Context, req GetRequest) (*RecordSEP, error) {
|
||||
func (s SEP) 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/sep/get"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get SEP config
|
||||
// GetConfigRequest struct to get SEP config
|
||||
type GetConfigRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type GetConfigRequest struct {
|
||||
func (s SEP) GetConfig(ctx context.Context, req GetConfigRequest) (*SEPConfig, 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/sep/getConfig"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get SEP pool config by name
|
||||
// GetPoolRequest struct to get SEP pool config by name
|
||||
type GetPoolRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
@@ -23,9 +23,7 @@ type GetPoolRequest struct {
|
||||
func (s SEP) GetPool(ctx context.Context, req GetPoolRequest) (*RecordPool, 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/sep/getPool"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for update capacity limits
|
||||
// UpdateCapacityLimitRequest struct to update capacity limits
|
||||
type UpdateCapacityLimitRequest struct {
|
||||
// Storage endpoint provider ID
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type UpdateCapacityLimitRequest struct {
|
||||
func (s SEP) UpdateCapacityLimit(ctx context.Context, req UpdateCapacityLimitRequest) (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/sep/updateCapacityLimit"
|
||||
|
||||
Reference in New Issue
Block a user