v16.10.0
This commit is contained in:
aafetisov committed 2026-10-30 16:04:15 +03:00
1 parent bc8c2b40e9
commit 00994516ba
52 files changed
+2287 -98

No files matched your search

+46
View File
@@ -0,0 +1,46 @@
package disks
import (
"context"
"encoding/json"
"net/http"
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
)
// MigrateV2GetRequest struct to get information about a disks migration
type MigrateV2GetRequest struct {
// Migration workflow job ID
// Required: true
WorkflowJobID string `url:"workflow_job_id" json:"workflow_job_id" validate:"required"`
}
// MigrateV2Get gets information about a disks migration as a MigrateV2Record struct
func (d Disks) MigrateV2Get(ctx context.Context, req MigrateV2GetRequest) (*MigrateV2Record, error) {
res, err := d.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
}
// MigrateV2GetRaw gets information about a disks migration as an array of bytes
func (d Disks) MigrateV2GetRaw(ctx context.Context, req MigrateV2GetRequest) ([]byte, error) {
err := validators.ValidateRequest(req)
if err != nil {
return nil, validators.ValidationErrors(validators.GetErrors(err))
}
url := "/cloudbroker/disks/migrate_v2_get"
res, err := d.client.DecortApiCall(ctx, http.MethodGet, url, req)
return res, err
}