2026-06-05 17:30:36 +03:00
|
|
|
package compute
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"net/http"
|
|
|
|
|
"strconv"
|
|
|
|
|
|
2026-08-21 18:12:55 +04:00
|
|
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
|
|
|
|
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
2026-06-05 17:30:36 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// DeleteCPUAlignmentProfileRequest struct to delete CPU alignment profile for computes
|
|
|
|
|
type DeleteCPUAlignmentProfileRequest struct {
|
|
|
|
|
// IDs of the compute instances
|
|
|
|
|
// Required: true
|
|
|
|
|
ComputeIDs []uint64 `url:"compute_ids" json:"compute_ids" validate:"min=1"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DeleteCPUAlignmentProfile deletes CPU alignment profile for computes
|
|
|
|
|
func (c Compute) DeleteCPUAlignmentProfile(ctx context.Context, req DeleteCPUAlignmentProfileRequest) (bool, error) {
|
|
|
|
|
err := validators.ValidateRequest(req)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
url := "/cloudapi/compute/delete_cpu_alignment_profile"
|
|
|
|
|
|
|
|
|
|
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return false, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result, err := strconv.ParseBool(string(res))
|
|
|
|
|
if err != nil {
|
|
|
|
|
return false, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result, nil
|
|
|
|
|
}
|