This commit is contained in:
2026-03-27 17:29:52 +03:00
parent 444a33dc7e
commit 9258a1574b
25 changed files with 570 additions and 44 deletions

View File

@@ -0,0 +1,38 @@
package resource_optimizer
import (
"context"
"net/http"
"strconv"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// DRSStopRequest struct to stop DRS
type DRSStopRequest struct {
// ID of the zone
// Required: true
ZoneID uint64 `url:"zone_id" json:"zone_id" validate:"required"`
}
// DRSStop stops DRS in the specified zone
func (ro ResourceOptimizer) DRSStop(ctx context.Context, req DRSStopRequest) (bool, error) {
err := validators.ValidateRequest(req)
if err != nil {
return false, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/resource_optimizer/drs_stop"
res, err := ro.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return false, err
}
result, err := strconv.ParseBool(string(res))
if err != nil {
return false, err
}
return result, nil
}