v16.10.0
v16.10.0
This commit is contained in:
1 parent
bc8c2b40e9
commit
00994516ba
52 files changed
+2287
-98
No files matched your search
@@ -0,0 +1,52 @@
|
||||
package disks
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
// MigrateV2ResolveRequest struct to resolve a disks migration
|
||||
type MigrateV2ResolveRequest struct {
|
||||
// Migration workflow job ID
|
||||
// Required: true
|
||||
WorkflowJobID string `url:"workflow_job_id" json:"workflow_job_id" validate:"required"`
|
||||
|
||||
// Take over cleanup
|
||||
// Default: false
|
||||
// Required: false
|
||||
TakeOverCleanup interface{} `url:"take_over_cleanup,omitempty" json:"take_over_cleanup,omitempty" validate:"omitempty,isBool"`
|
||||
}
|
||||
|
||||
// MigrateV2Resolve resolves a disks migration
|
||||
func (d Disks) MigrateV2Resolve(ctx context.Context, req MigrateV2ResolveRequest) (*MigrateV2ResolveRecord, error) {
|
||||
res, err := d.MigrateV2ResolveRaw(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := MigrateV2ResolveRecord{}
|
||||
|
||||
err = json.Unmarshal(res, &info)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &info, nil
|
||||
}
|
||||
|
||||
// MigrateV2ResolveRaw resolves a disks migration and returns an array of bytes
|
||||
func (d Disks) MigrateV2ResolveRaw(ctx context.Context, req MigrateV2ResolveRequest) ([]byte, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/disks/migrate_v2_resolve"
|
||||
|
||||
res, err := d.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
||||
return res, err
|
||||
}
|
||||
Reference in new issue
Block a user