This commit is contained in:
asteam
2025-09-27 01:06:15 +03:00
parent 1ccc37a104
commit cf584c8123
1175 changed files with 11022 additions and 1832 deletions

View File

@@ -0,0 +1,35 @@
package compute
import (
"context"
"net/http"
"strings"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v12/internal/validators"
)
// MigrateAbortRequest struct to abort migration
type MigrateAbortRequest struct {
// ID of the compute instance
// Required: true
ComputeID uint64 `url:"compute_id" json:"compute_id" validate:"required"`
}
// MigrateAbort aborts compute migration
func (c Compute) MigrateAbort(ctx context.Context, req MigrateAbortRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/compute/migrate_abort"
res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return "", err
}
result := strings.ReplaceAll(string(res), "\"", "")
return result, nil
}