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
// AccessAddRequest struct to grant access
type AccessAddRequest struct {
// ID of external network
// Required: true
@@ -19,13 +19,11 @@ type AccessAddRequest struct {
AccountID uint64 `url:"accountId" json:"accountId" validate:"required"`
}
// AccessAdd grant access to external network for account ID
// AccessAdd grants access to external network for account ID
func (e ExtNet) AccessAdd(ctx context.Context, req AccessAddRequest) ([]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/extnet/accessAdd"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for remove access
// AccessRemoveRequest struct to remove access
type AccessRemoveRequest struct {
// ID of external network
// Required: true
@@ -19,13 +19,11 @@ type AccessRemoveRequest struct {
AccountID uint64 `url:"accountId" json:"accountId" validate:"required"`
}
// AccessRemove remove access from external network for account ID
// AccessRemove removes access from external network for account ID
func (e ExtNet) AccessRemove(ctx context.Context, req AccessRemoveRequest) ([]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/extnet/accessRemove"

View File

@@ -20,7 +20,7 @@ type Route struct {
Gateway string `url:"gateway" json:"gateway" validate:"required"`
}
// Request struct for create external network
// CreateRequest struct to create external network
type CreateRequest struct {
// External network name
// Required: true
@@ -97,9 +97,7 @@ type wrapperCreateRequest struct {
func (e ExtNet) 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))
}
var routes []string

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for update QOS
// DefaultQOSUpdateRequest struct for update QOS
type DefaultQOSUpdateRequest struct {
// ID of external network
// Required: true
@@ -31,9 +31,7 @@ type DefaultQOSUpdateRequest struct {
func (e ExtNet) DefaultQOSUpdate(ctx context.Context, req DefaultQOSUpdateRequest) (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/extnet/defaultQosUpdate"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for destroy
// DestroyRequest struct for destroy
type DestroyRequest struct {
// ID of external network
// Required: true
@@ -19,9 +19,7 @@ type DestroyRequest struct {
func (e ExtNet) Destroy(ctx context.Context, req DestroyRequest) (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/extnet/destroy"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for deploy network device
// DeviceDeployRequest struct to deploy network device
type DeviceDeployRequest struct {
// ID of external network
// Required: true
@@ -19,9 +19,7 @@ type DeviceDeployRequest struct {
func (e ExtNet) DeviceDeploy(ctx context.Context, req DeviceDeployRequest) (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/extnet/deviceDeploy"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for migrate VNF
// DeviceMigrateRequest struct for migrate VNF
type DeviceMigrateRequest struct {
// ID of external network
// Required: true
@@ -18,13 +18,11 @@ type DeviceMigrateRequest struct {
StackID uint64 `url:"stackId" json:"stackId" validate:"required"`
}
// DeviceMigrate migrate external network VNF device
// DeviceMigrate migrates external network VNF device
func (e ExtNet) DeviceMigrate(ctx context.Context, req DeviceMigrateRequest) (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/extnet/deviceMigrate"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for remove network device
// DeviceRemoveRequest struct to remove network device
type DeviceRemoveRequest struct {
// ID of external network
// Required: true
@@ -19,9 +19,7 @@ type DeviceRemoveRequest struct {
func (e ExtNet) DeviceRemove(ctx context.Context, req DeviceRemoveRequest) (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/extnet/deviceRemove"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for restart VNF device
// DeviceRestartRequest struct for restart VNF device
type DeviceRestartRequest struct {
// ID of external network
// Required: true
@@ -19,9 +19,7 @@ type DeviceRestartRequest struct {
func (e ExtNet) DeviceRestart(ctx context.Context, req DeviceRestartRequest) (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/extnet/deviceRestart"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for disable external network
// DisableRequest struct to disable external network
type DisableRequest struct {
// ID of external network
// Required: true
@@ -19,9 +19,7 @@ type DisableRequest struct {
func (e ExtNet) 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/extnet/disable"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for set new DNS
// DNSApplyRequest struct to set new DNS
type DNSApplyRequest struct {
// ID of external network
// Required: true
@@ -23,9 +23,7 @@ type DNSApplyRequest struct {
func (e ExtNet) DNSApply(ctx context.Context, req DNSApplyRequest) (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/extnet/dnsApply"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for enable external network
// EnableRequest struct to enable external network
type EnableRequest struct {
// ID of external network
// Required: true
@@ -19,9 +19,7 @@ type EnableRequest struct {
func (e ExtNet) 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/extnet/enable"

View File

@@ -36,9 +36,7 @@ func (e ExtNet) Get(ctx context.Context, req GetRequest) (*RecordExtNet, error)
func (e ExtNet) 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/extnet/get"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for exclude list IPs
// IPsExcludeRequest struct to exclude list of IPs
type IPsExcludeRequest struct {
// ID of external network
// Required: true
@@ -19,13 +19,11 @@ type IPsExcludeRequest struct {
IPs []string `url:"ips" json:"ips" validate:"min=1"`
}
// IPsExclude exclude list IPs from external network pool
// IPsExclude excludes list of IPs from external network pool
func (e ExtNet) IPsExclude(ctx context.Context, req IPsExcludeRequest) (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/extnet/ipsExclude"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for exclude range of IPs
// IPsExcludeRangeRequest struct to exclude range of IPs
type IPsExcludeRangeRequest struct {
// ID of external network
// Required: true
@@ -23,13 +23,11 @@ type IPsExcludeRangeRequest struct {
IPEnd string `url:"ip_end" json:"ip_end" validate:"required"`
}
// IPsExcludeRange exclude range of IPs from external network pool
// IPsExcludeRange excludes range of IPs from external network pool
func (e ExtNet) IPsExcludeRange(ctx context.Context, req IPsExcludeRangeRequest) (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/extnet/ipsExcludeRange"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for include list IPs
// IPsIncludeRequest struct to include list of IPs
type IPsIncludeRequest struct {
// ID of external network
// Required: true
@@ -19,13 +19,11 @@ type IPsIncludeRequest struct {
IPs []string `url:"ips" json:"ips" validate:"min=1"`
}
// IPsInclude include list IPs to external network pool
// IPsInclude includes list of IPs to external network pool
func (e ExtNet) IPsInclude(ctx context.Context, req IPsIncludeRequest) (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/extnet/ipsInclude"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for include range of IPs
// IPsIncludeRangeRequest struct to include range of IPs
type IPsIncludeRangeRequest struct {
// ID of external network
// Required: true
@@ -23,13 +23,11 @@ type IPsIncludeRangeRequest struct {
IPEnd string `url:"ip_end" json:"ip_end" validate:"required"`
}
// IPsIncludeRange include range of IPs to external network pool
// IPsIncludeRange includes range of IPs to external network pool
func (e ExtNet) IPsIncludeRange(ctx context.Context, req IPsIncludeRangeRequest) (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/extnet/ipsIncludeRange"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for set new NTP
// NTPApplyRequest struct for set new NTP
type NTPApplyRequest struct {
// ID of external network
// Required: true
@@ -23,9 +23,7 @@ type NTPApplyRequest struct {
func (e ExtNet) NTPApply(ctx context.Context, req NTPApplyRequest) (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/extnet/ntpApply"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for set external network as default
// SetDefaultRequest struct to set external network as default
type SetDefaultRequest struct {
// ID of external network
// Required: true
@@ -19,9 +19,7 @@ type SetDefaultRequest struct {
func (e ExtNet) SetDefault(ctx context.Context, req SetDefaultRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
for _, validationError := range validators.GetErrors(err) {
return false, validators.ValidationError(validationError)
}
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/extnet/setDefault"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for grant access to static route to Compute/ViNS
// StaticRouteAccessGrantRequest struct to grant access to static route to Compute/ViNS
type StaticRouteAccessGrantRequest struct {
// ExtNet ID to grant access
// Required: true
@@ -23,13 +23,11 @@ type StaticRouteAccessGrantRequest struct {
ComputeIds []uint64 `url:"computeIds,omitempty" json:"computeIds,omitempty"`
}
// Grant access to static route to Compute/ViNS
// StaticRouteAccessGrant grants access to static route to Compute/ViNS
func (v ExtNet) StaticRouteAccessGrant(ctx context.Context, req StaticRouteAccessGrantRequest) (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/extnet/staticRouteAccessGrant"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for revoke access to static route to Compute/ViNS
// StaticRouteAccessRevokeRequest struct to revoke access to static route to Compute/ViNS
type StaticRouteAccessRevokeRequest struct {
// ExtNet ID to revoke access
// Required: true
@@ -23,13 +23,11 @@ type StaticRouteAccessRevokeRequest struct {
ComputeIds []uint64 `url:"computeIds,omitempty" json:"computeIds,omitempty"`
}
// Revoke access to static route to Compute/ViNS
// StaticRouteAccessRevoke revokes access to static route to Compute/ViNS
func (v ExtNet) StaticRouteAccessRevoke(ctx context.Context, req StaticRouteAccessRevokeRequest) (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/extnet/staticRouteAccessRevoke"

View File

@@ -8,11 +8,11 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for add static route
// StaticRouteAddRequest struct to add static route
type StaticRouteAddRequest struct {
// ExtNet ID to add static route
// Required: true
ExtNetId uint64 `url:"extnetId" json:"extnetId" validate:"required"`
ExtNetId uint64 `url:"extnetId" json:"extnetId" validate:"required"`
// Destination network
// Required: true
@@ -31,13 +31,11 @@ type StaticRouteAddRequest struct {
ComputeIds []uint64 `url:"computeIds,omitempty" json:"computeIds,omitempty"`
}
// StaticRouteAdd add new static route to ViNS
// StaticRouteAdd adds new static route to ViNS
func (v ExtNet) StaticRouteAdd(ctx context.Context, req StaticRouteAddRequest) (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/extnet/staticRouteAdd"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for remove static route from ViNS
// StaticRouteDelRequest struct to remove static route from ViNS
type StaticRouteDelRequest struct {
// ExtNet ID to remove static route from
// Required: true
@@ -19,13 +19,11 @@ type StaticRouteDelRequest struct {
RouteId uint64 `url:"routeId" json:"routeId" validate:"required"`
}
// Remove static route from ViNS
// StaticRouteDel removes static route from ViNS
func (v ExtNet) StaticRouteDel(ctx context.Context, req StaticRouteDelRequest) (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/extnet/staticRouteDel"

View File

@@ -8,20 +8,18 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for static route list
// StaticRouteListRequest struct for static route list
type StaticRouteListRequest struct {
// ExtNet ID to show list of static routes
// Required: true
ExtNetID uint64 `url:"extnetId" json:"extnetId" validate:"required"`
}
// Show list of static routes for ViNS
// StaticRouteList shows list of static routes for ViNS
func (v ExtNet) StaticRouteList(ctx context.Context, req StaticRouteListRequest) (*ListStaticRoutes, 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/extnet/staticRouteList"

View File

@@ -8,7 +8,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// Request struct for update external network
// UpdateRequest struct to update external network
type UpdateRequest struct {
// ID of external network
// Required: true
@@ -27,9 +27,7 @@ type UpdateRequest struct {
func (e ExtNet) 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/extnet/update"