This commit is contained in:
2023-05-15 10:55:36 +03:00
parent 10e3e19892
commit b7137683ab
4 changed files with 10 additions and 8 deletions

View File

@@ -9,14 +9,14 @@ import (
)
// Request struct for disable/enable kubernetes cluster
type DisabelEnableRequest struct {
type DisableEnableRequest struct {
// Kubernetes cluster ID
// Required: true
K8SID uint64 `url:"k8sId" json:"k8sId" validate:"required"`
}
// Disable disables kubernetes cluster by ID
func (k8s K8S) Disable(ctx context.Context, req DisabelEnableRequest) (bool, error) {
func (k8s K8S) Disable(ctx context.Context, req DisableEnableRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
for _, validationError := range validators.GetErrors(err) {
@@ -40,7 +40,7 @@ func (k8s K8S) Disable(ctx context.Context, req DisabelEnableRequest) (bool, err
}
// Enable enables kubernetes cluster by ID
func (k8s K8S) Enable(ctx context.Context, req DisabelEnableRequest) (bool, error) {
func (k8s K8S) Enable(ctx context.Context, req DisableEnableRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
for _, validationError := range validators.GetErrors(err) {