You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
decort-golang-sdk/pkg/cloudapi/lb/frontend_bind_delete.go

44 lines
1.1 KiB

package lb
import (
"context"
"net/http"
"strings"
3 years ago
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
2 years ago
// FrontendBindDeleteRequest struct to delete bind
type FrontendBindDeleteRequest struct {
3 years ago
// ID of the load balancer instance to FrontendBindDelete
// Required: true
3 years ago
LBID uint64 `url:"lbId" json:"lbId" validate:"required"`
3 years ago
// Name of the frontend to delete
// Required: true
3 years ago
FrontendName string `url:"frontendName" json:"frontendName" validate:"required"`
3 years ago
// Name of the binding to delete
// Required: true
3 years ago
BindingName string `url:"bindingName" json:"bindingName" validate:"required"`
}
3 years ago
// FrontendBindDelete deletes binding from the specified load balancer frontend
func (l LB) FrontendBindDelete(ctx context.Context, req FrontendBindDeleteRequest) (string, error) {
3 years ago
err := validators.ValidateRequest(req)
if err != nil {
2 years ago
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudapi/lb/frontendBindDelete"
res, err := l.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return "", err
}
3 years ago
result := strings.ReplaceAll(string(res), "\"", "")
return result, nil
}