Files
dynamix-golang-sdk/pkg/cloudbroker/compute/abort_shared_snapshot_merge.go

37 lines
972 B
Go
Raw Normal View History

2025-09-27 01:06:15 +03:00
package compute
import (
"context"
"net/http"
2026-02-20 17:30:02 +03:00
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
2025-09-27 01:06:15 +03:00
)
// 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
2026-03-13 17:20:54 +03:00
func (c Compute) AbortSharedSnapshotMerge(ctx context.Context, req AbortSharedSnapshotMergeRequest) (string, error) {
2025-09-27 01:06:15 +03:00
err := validators.ValidateRequest(req)
if err != nil {
2026-03-13 17:20:54 +03:00
return "", validators.ValidationErrors(validators.GetErrors(err))
2025-09-27 01:06:15 +03:00
}
url := "/cloudbroker/compute/abort_shared_snapshot_merge"
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
2026-03-13 17:20:54 +03:00
return "", err
2025-09-27 01:06:15 +03:00
}
2026-03-13 17:20:54 +03:00
return string(res), nil
2025-09-27 01:06:15 +03:00
}