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,46 @@
|
||||
package compute
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
||||
)
|
||||
|
||||
// MigrateV2GetRequest to get the information about a workflow job
|
||||
type MigrateV2GetRequest struct {
|
||||
// Original migration workflow IDs
|
||||
// Required: true
|
||||
WorkflowJobID string `url:"workflow_job_id" json:"workflow_job_id" validate:"required"`
|
||||
}
|
||||
|
||||
// MigrateV2Get gets information about a workflow job as a MigrateV2Record struct
|
||||
func (c Compute) MigrateV2Get(ctx context.Context, req MigrateV2GetRequest) (*MigrateV2Record, error) {
|
||||
res, err := c.MigrateV2GetRaw(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := MigrateV2Record{}
|
||||
|
||||
err = json.Unmarshal(res, &info)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &info, nil
|
||||
}
|
||||
|
||||
// GetRaw gets information about a workflow job as an array of bytes
|
||||
func (c Compute) MigrateV2GetRaw(ctx context.Context, req MigrateV2GetRequest) ([]byte, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/compute/migrate_v2_get"
|
||||
|
||||
res, err := c.client.DecortApiCall(ctx, http.MethodGet, url, req)
|
||||
return res, err
|
||||
}
|
||||
Reference in new issue
Block a user