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.
dynamix-golang-sdk/pkg/cloudbroker/rg/mass_enable.go

33 lines
775 B

2 months ago
package rg
import (
"context"
"net/http"
2 months ago
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
2 months ago
)
// MassEnableRequest struct to enable several resource groups
type MassEnableRequest struct {
// IDs of the resource groups
// Required: true
RGIDs []uint64 `url:"rgIds" json:"rgIds" validate:"min=1"`
}
// MassEnable start jobs to enable several resource groups
2 months ago
func (r RG) MassEnable(ctx context.Context, req MassEnableRequest) (string, error) {
2 months ago
err := validators.ValidateRequest(req)
if err != nil {
2 months ago
return "", validators.ValidationErrors(validators.GetErrors(err))
2 months ago
}
url := "/cloudbroker/rg/massEnable"
2 months ago
res, err := r.client.DecortApiCall(ctx, http.MethodPost, url, req)
2 months ago
if err != nil {
2 months ago
return "", err
2 months ago
}
2 months ago
return string(res), nil
2 months ago
}