v15.0.0
This commit is contained in:
39
pkg/cloudbroker/compute/delete_cpu_alignment_profile.go
Normal file
39
pkg/cloudbroker/compute/delete_cpu_alignment_profile.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/constants"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v15/internal/validators"
|
||||
)
|
||||
|
||||
// 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 := "/cloudbroker/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
|
||||
}
|
||||
Reference in New Issue
Block a user