This commit is contained in:
2026-09-25 16:32:09 +03:00
parent bf932e5ef9
commit 69f056616f
33 changed files with 2074 additions and 594 deletions

View File

@@ -0,0 +1,41 @@
package compute
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/constants"
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
)
// MigrateV2CleanupRequest to clean up after a migration of a compute
type MigrateV2CleanupRequest struct {
// Original migration workflow IDs, not agent, cleanup or recovery job IDs
// Required: true
WorkflowJobID string `url:"workflow_job_id" json:"workflow_job_id" validate:"required"`
}
// MigrateV2Cleanup cleans up after a migration of a compute
func (c Compute) MigrateV2Cleanup(ctx context.Context, req MigrateV2CleanupRequest) (string, error) {
err := validators.ValidateRequest(req)
if err != nil {
return "", validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/compute/migrate_v2_cleanup"
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
if err != nil {
return "", err
}
var resp string
err = json.Unmarshal(res, &resp)
if err != nil {
return "", err
}
return resp, nil
}