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,47 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/constants"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
||||
)
|
||||
|
||||
// MigrateV2AbortRequest to abort a migration of a compute
|
||||
type MigrateV2AbortRequest struct {
|
||||
// Original migration workflow IDs, not agent, cleanup or recovery job IDs
|
||||
// Required: true
|
||||
WorkflowJobIDs []string `url:"workflow_job_ids" json:"workflow_job_ids" validate:"required"`
|
||||
}
|
||||
|
||||
// MigrateV2Abort aborts a migration of a compute
|
||||
func (c Compute) MigrateV2Abort(ctx context.Context, req MigrateV2AbortRequest) (*MigrateV2AbortRecord, error) {
|
||||
res, err := c.MigrateV2AbortRaw(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := MigrateV2AbortRecord{}
|
||||
|
||||
err = json.Unmarshal(res, &info)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &info, nil
|
||||
}
|
||||
|
||||
// MigrateV2AbortRaw aborts a migration of a compute and returns an array of bytes
|
||||
func (c Compute) MigrateV2AbortRaw(ctx context.Context, req MigrateV2AbortRequest) ([]byte, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/migrate_v2_abort"
|
||||
|
||||
res, err := c.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
||||
return res, err
|
||||
}
|
||||
Reference in new issue
Block a user