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.
43 lines
1.0 KiB
43 lines
1.0 KiB
package compute
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
"strconv"
|
|
|
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
|
|
)
|
|
|
|
// AbortSharedSnapshotMergeRequest struct to abort shared snapshots merge
|
|
type AbortSharedSnapshotMergeRequest struct {
|
|
// ID of the compute
|
|
// Required: true
|
|
ComputeID uint64 `url:"compute_id" json:"compute_id" validate:"required"`
|
|
|
|
// Label of the snapshot
|
|
// Required: true
|
|
Label string `url:"label" json:"label" validate:"required"`
|
|
}
|
|
|
|
// AbortSharedSnapshotMerge shared snapshots merge abort
|
|
func (c Compute) AbortSharedSnapshotMerge(ctx context.Context, req AbortSharedSnapshotMergeRequest) (bool, error) {
|
|
err := validators.ValidateRequest(req)
|
|
if err != nil {
|
|
return false, validators.ValidationErrors(validators.GetErrors(err))
|
|
}
|
|
|
|
url := "/cloudbroker/compute/abort_shared_snapshot_merge"
|
|
|
|
res, err := c.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
|
|
}
|