v16.5.0
This commit is contained in:
1 parent
2c7f0d29df
commit
dca445b69a
29 files changed
+1005
-131
No files matched your search
@@ -0,0 +1,67 @@
|
||||
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
|
||||
}
|
||||
Reference in new issue
Block a user