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 get audits
|
||||
// AuditsRequest struct to get audits
|
||||
type AuditsRequest struct {
|
||||
// ID of the VINS
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type AuditsRequest struct {
|
||||
func (v VINS) 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 := "/cloudapi/vins/audits"
|
||||
|
||||
@@ -20,7 +20,7 @@ type Route struct {
|
||||
Gateway string `url:"gateway" json:"gateway" validate:"required"`
|
||||
}
|
||||
|
||||
// Request struct for create VINS in account
|
||||
// CreateInAccountRequest struct to create VINS in account
|
||||
type CreateInAccountRequest struct {
|
||||
// VINS name
|
||||
// Required: true
|
||||
@@ -60,9 +60,7 @@ type wrapperCreateRequestInAcc struct {
|
||||
func (v VINS) CreateInAccount(ctx context.Context, req CreateInAccountRequest) (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
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for create VINS in resource group
|
||||
// CreateInRGRequest struct to create VINS in resource group
|
||||
type CreateInRGRequest struct {
|
||||
// VINS name
|
||||
// Required: true
|
||||
@@ -53,9 +53,7 @@ type wrapperCreateRequestInRG struct {
|
||||
func (v VINS) CreateInRG(ctx context.Context, req CreateInRGRequest) (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
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for delete VINS
|
||||
// DeleteRequest struct to delete VINS
|
||||
type DeleteRequest struct {
|
||||
// VINS ID
|
||||
// Required: true
|
||||
@@ -31,9 +31,7 @@ type DeleteRequest struct {
|
||||
func (v VINS) 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 := "/cloudapi/vins/delete"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for disable/enable VINS
|
||||
// DisableEnableRequest struct to disable/enable VINS
|
||||
type DisableEnableRequest struct {
|
||||
// VINS ID
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type DisableEnableRequest struct {
|
||||
func (v VINS) Disable(ctx context.Context, req DisableEnableRequest) (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 := "/cloudapi/vins/disable"
|
||||
@@ -44,9 +42,7 @@ func (v VINS) Disable(ctx context.Context, req DisableEnableRequest) (bool, erro
|
||||
func (v VINS) Enable(ctx context.Context, req DisableEnableRequest) (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 := "/cloudapi/vins/enable"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for connect external network
|
||||
// ExtNetConnectRequest struct to connect to external network
|
||||
type ExtNetConnectRequest struct {
|
||||
// VINS ID
|
||||
// Required: true
|
||||
@@ -27,9 +27,7 @@ type ExtNetConnectRequest struct {
|
||||
func (v VINS) ExtNetConnect(ctx context.Context, req ExtNetConnectRequest) (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 := "/cloudapi/vins/extNetConnect"
|
||||
|
||||
@@ -8,20 +8,18 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for disconnect VINS from external network
|
||||
// ExtNetDisconnectRequest struct to disconnect VINS from external network
|
||||
type ExtNetDisconnectRequest struct {
|
||||
// VINS ID
|
||||
// Required: true
|
||||
VINSID uint64 `url:"vinsId" json:"vinsId" validate:"required"`
|
||||
}
|
||||
|
||||
// ExtNetDisconnect disconnect VINS from external network
|
||||
// ExtNetDisconnect disconnects VINS from external network
|
||||
func (v VINS) ExtNetDisconnect(ctx context.Context, req ExtNetDisconnectRequest) (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 := "/cloudapi/vins/extNetDisconnect"
|
||||
|
||||
@@ -8,20 +8,18 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get list VINS external network connections
|
||||
// ExtNetListRequest struct to get list of VINS external network connections
|
||||
type ExtNetListRequest struct {
|
||||
// VINS ID
|
||||
// Required: true
|
||||
VINSID uint64 `url:"vinsId" json:"vinsId" validate:"required"`
|
||||
}
|
||||
|
||||
// ExtNetList show list of VINS external network connections
|
||||
// ExtNetList shows list of VINS external network connections
|
||||
func (v VINS) ExtNetList(ctx context.Context, req ExtNetListRequest) (*ListExtNets, 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 := "/cloudapi/vins/extNetList"
|
||||
|
||||
@@ -36,9 +36,7 @@ func (v VINS) Get(ctx context.Context, req GetRequest) (*RecordVINS, error) {
|
||||
func (v VINS) 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 := "/cloudapi/vins/get"
|
||||
|
||||
@@ -8,20 +8,18 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for DHCP IP
|
||||
// IPListRequest struct for DHCP IP
|
||||
type IPListRequest struct {
|
||||
// VINS ID
|
||||
// Required: true
|
||||
VINSID uint64 `url:"vinsId" json:"vinsId" validate:"required"`
|
||||
}
|
||||
|
||||
// IPList show DHCP IP reservations on VINS
|
||||
// IPList shows DHCP IP reservations on VINS
|
||||
func (v VINS) IPList(ctx context.Context, req IPListRequest) (*ListIPs, 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 := "/cloudapi/vins/ipList"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for IP relese
|
||||
// IPReleaseRequest struct for IP release
|
||||
type IPReleaseRequest struct {
|
||||
// VINS ID
|
||||
// Required: true
|
||||
@@ -28,9 +28,7 @@ type IPReleaseRequest struct {
|
||||
func (v VINS) IPRelese(ctx context.Context, req IPReleaseRequest) (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 := "/cloudapi/vins/ipRelease"
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for IP reserve
|
||||
// IPReserveRequest struct for IP reserve
|
||||
type IPReserveRequest struct {
|
||||
// VINS ID
|
||||
// Required: true
|
||||
@@ -42,9 +42,7 @@ type IPReserveRequest struct {
|
||||
func (v VINS) IPReserve(ctx context.Context, req IPReserveRequest) (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 := "/cloudapi/vins/ipReserve"
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// Request struct for get list of deleted VINSes
|
||||
// ListDeletedRequest struct to get list of deleted VINSes
|
||||
type ListDeletedRequest struct {
|
||||
// Find by ID
|
||||
// Required: false
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for create NAT rules
|
||||
// NATRuleAddRequest struct to create NAT rules
|
||||
type NATRuleAddRequest struct {
|
||||
// VINS ID
|
||||
// Required: true
|
||||
@@ -42,9 +42,7 @@ type NATRuleAddRequest struct {
|
||||
func (v VINS) NATRuleAdd(ctx context.Context, req NATRuleAddRequest) (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 := "/cloudapi/vins/natRuleAdd"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for delete NAT rule
|
||||
// NATRuleDelRequest struct to delete NAT rule
|
||||
type NATRuleDelRequest struct {
|
||||
// VINS ID
|
||||
// Required: true
|
||||
@@ -20,13 +20,11 @@ type NATRuleDelRequest struct {
|
||||
RuleID int64 `url:"ruleId" json:"ruleId" validate:"required"`
|
||||
}
|
||||
|
||||
// NATRuleDel delete NAT (port forwarding) rule on VINS
|
||||
// NATRuleDel deletes NAT (port forwarding) rule on VINS
|
||||
func (v VINS) NATRuleDel(ctx context.Context, req NATRuleDelRequest) (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 := "/cloudapi/vins/natRuleDel"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for get list of NAT rules
|
||||
// NATRuleListRequest struct to get list of NAT rules
|
||||
type NATRuleListRequest struct {
|
||||
// VINS ID
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type NATRuleListRequest struct {
|
||||
func (v VINS) NATRuleList(ctx context.Context, req NATRuleListRequest) (*ListNATRules, 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 := "/cloudapi/vins/natRuleList"
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for restore
|
||||
// RestoreRequest struct for restore
|
||||
type RestoreRequest struct {
|
||||
// VINS ID
|
||||
// Required: true
|
||||
@@ -19,9 +19,7 @@ type RestoreRequest struct {
|
||||
func (v VINS) 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 := "/cloudapi/vins/restore"
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// Request struct for search VINSes
|
||||
// SearchRequest struct for search VINSes
|
||||
type SearchRequest struct {
|
||||
// ID of the account to search for the ViNSes
|
||||
// Required: false
|
||||
@@ -25,7 +25,7 @@ type SearchRequest struct {
|
||||
ShowAll bool `url:"show_all,omitempty" json:"show_all,omitempty"`
|
||||
}
|
||||
|
||||
// Search search VINSes
|
||||
// Search searches VINSes
|
||||
func (v VINS) Search(ctx context.Context, req SearchRequest) (SearchListVINS, error) {
|
||||
url := "/cloudapi/vins/search"
|
||||
|
||||
|
||||
@@ -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 {
|
||||
// ViNS ID to grant access
|
||||
// Required: true
|
||||
@@ -16,20 +16,18 @@ type StaticRouteAccessGrantRequest struct {
|
||||
|
||||
// Route ID to grant access, can be found in staticRouteList
|
||||
// Required: true
|
||||
RouteId uint64 `url:"routeId" json:"routeId" validate:"required"`
|
||||
RouteId uint64 `url:"routeId" json:"routeId" validate:"required"`
|
||||
|
||||
// List of Compute IDs to grant access to this route
|
||||
// Required: false
|
||||
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 VINS) 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 := "/cloudapi/vins/staticRouteAccessGrant"
|
||||
|
||||
@@ -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 {
|
||||
// ViNS ID to revoke access
|
||||
// Required: true
|
||||
@@ -16,20 +16,18 @@ type StaticRouteAccessRevokeRequest struct {
|
||||
|
||||
// Route ID to revoke access, can be found in staticRouteList
|
||||
// Required: true
|
||||
RouteId uint64 `url:"routeId" json:"routeId" validate:"required"`
|
||||
RouteId uint64 `url:"routeId" json:"routeId" validate:"required"`
|
||||
|
||||
// List of Compute IDs to revoke access to this route
|
||||
// Required: false
|
||||
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 VINS) 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 := "/cloudapi/vins/staticRouteAccessRevoke"
|
||||
|
||||
@@ -8,7 +8,7 @@ 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 {
|
||||
// VINS ID
|
||||
// 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 VINS) 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 := "/cloudapi/vins/staticRouteAdd"
|
||||
|
||||
@@ -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 {
|
||||
// ViNS ID to remove static route from
|
||||
// Required: true
|
||||
@@ -16,16 +16,14 @@ type StaticRouteDelRequest struct {
|
||||
|
||||
// Route ID to remove, can be found in staticRouteList
|
||||
// Required: true
|
||||
RouteId uint64 `url:"routeId" json:"routeId" validate:"required"`
|
||||
RouteId uint64 `url:"routeId" json:"routeId" validate:"required"`
|
||||
}
|
||||
|
||||
// Remove static route from ViNS
|
||||
// StaticRouteDel removes static route from ViNS
|
||||
func (v VINS) 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 := "/cloudapi/vins/staticRouteDel"
|
||||
|
||||
@@ -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 {
|
||||
// ViNS ID to show list of static routes
|
||||
// Required: true
|
||||
VINSID uint64 `url:"vinsId" json:"vinsId" validate:"required"`
|
||||
}
|
||||
|
||||
// Show list of static routes for ViNS
|
||||
// StaticRouteList shows list of static routes for ViNS
|
||||
func (v VINS) 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 := "/cloudapi/vins/staticRouteList"
|
||||
|
||||
@@ -8,20 +8,18 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for redeploy VNFDevs
|
||||
// VNFDevRedeployRequest struct for redeploy VNFDevs
|
||||
type VNFDevRedeployRequest struct {
|
||||
// VINS ID
|
||||
// Required: true
|
||||
VINSID uint64 `url:"vinsId" json:"vinsId" validate:"required"`
|
||||
}
|
||||
|
||||
// VNFDevRedeploy redeploy VINS VNFDevs
|
||||
// VNFDevRedeploy redeploys VINS VNFDevs
|
||||
func (v VINS) VNFDevRedeploy(ctx context.Context, req VNFDevRedeployRequest) (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 := "/cloudapi/vins/vnfdevRedeploy"
|
||||
|
||||
@@ -8,20 +8,18 @@ import (
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for reboot VINSes primary VNF device
|
||||
// VNFDevRestartRequest struct for reboot VINSes primary VNF device
|
||||
type VNFDevRestartRequest struct {
|
||||
// VINS ID
|
||||
// Required: true
|
||||
VINSID uint64 `url:"vinsId" json:"vinsId" validate:"required"`
|
||||
}
|
||||
|
||||
// VNFDevRestart reboot VINSes primary VNF device
|
||||
// VNFDevRestart reboots VINSes primary VNF device
|
||||
func (v VINS) VNFDevRestart(ctx context.Context, req VNFDevRestartRequest) (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 := "/cloudapi/vins/vnfdevRestart"
|
||||
|
||||
Reference in New Issue
Block a user