v1.0.0
This commit is contained in:
@@ -7,11 +7,14 @@ import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// Request struct for reset config
|
||||
type ConfigResetRequest struct {
|
||||
// ID of the load balancer instance to ConfigReset
|
||||
// Required: true
|
||||
LBID uint64 `url:"lbId"`
|
||||
}
|
||||
|
||||
func (lbrq ConfigResetRequest) Validate() error {
|
||||
func (lbrq ConfigResetRequest) validate() error {
|
||||
if lbrq.LBID == 0 {
|
||||
return errors.New("validation-error: field LBID can not be empty or equal to 0")
|
||||
}
|
||||
@@ -19,8 +22,10 @@ func (lbrq ConfigResetRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ConfigReset reset current software configuration of the specified load balancer.
|
||||
// Warning: this action cannot be undone!
|
||||
func (l LB) ConfigReset(ctx context.Context, req ConfigResetRequest) (bool, error) {
|
||||
err := req.Validate()
|
||||
err := req.validate()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user