Files
dynamix-golang-sdk/pkg/cloudbroker/compute/migrate_v2_list.go
T

67 lines
1.8 KiB
Go
Raw Normal View History

2026-09-28 13:20:06 +03:00
package compute
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// MigrateV2ListRequest to list migrations
type MigrateV2ListRequest struct {
// Exact APIServer migration workflow job ID
// Required: false
WorkflowJobID string `url:"workflow_job_id,omitempty" json:"workflow_job_id,omitempty"`
// Compute ID
// Required: false
ComputeID uint64 `url:"compute_id,omitempty" json:"compute_id,omitempty"`
// Exact business migration status
// Required: false
Status string `url:"status,omitempty" json:"status,omitempty"`
// Source node ID
// Required: false
SourceNodeID uint64 `url:"source_node_id,omitempty" json:"source_node_id,omitempty"`
// Target node ID
// Required: false
TargetNodeID uint64 `url:"target_node_id,omitempty" json:"target_node_id,omitempty"`
// Whether retained source disks still require cleanup
// Required: false
CleanupRequired interface{} `url:"cleanup_required,omitempty" json:"cleanup_required,omitempty" validate:"omitempty,isBool"`
// Page number
// Required: false
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
// Page size
// Required: false
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}
// MigrateV2List gets list of the jobs
func (c Compute) MigrateV2List(ctx context.Context, req MigrateV2ListRequest) (*ListMigrateV2, error) {
if err := validators.ValidateRequest(req); err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/compute/migrate_v2_list"
res, err := c.client.DecortApiCall(ctx, http.MethodGet, url, req)
if err != nil {
return nil, err
}
list := ListMigrateV2{}
err = json.Unmarshal(res, &list)
if err != nil {
return nil, err
}
return &list, nil
}