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,80 @@
|
||||
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"
|
||||
)
|
||||
|
||||
// MigrateV2Target describes a target storage for a group of disks
|
||||
type MigrateV2Target struct {
|
||||
// IDs of detached disks to migrate
|
||||
// Required: true
|
||||
DiskIDs []uint64 `url:"disk_ids" json:"disk_ids" validate:"required,min=1,max=100,unique,dive,required"`
|
||||
|
||||
// SEP ID
|
||||
// Required: true
|
||||
SEPID uint64 `url:"sep_id" json:"sep_id" validate:"required"`
|
||||
|
||||
// Name of a pool
|
||||
// Required: true
|
||||
PoolName string `url:"pool_name" json:"pool_name" validate:"required"`
|
||||
|
||||
// Storage policy ID
|
||||
// Required: false
|
||||
StoragePolicyID uint64 `url:"storage_policy_id,omitempty" json:"storage_policy_id,omitempty"`
|
||||
}
|
||||
|
||||
// MigrateV2Storage describes a destination for disks
|
||||
type MigrateV2Storage struct {
|
||||
// Targets for migration
|
||||
// Required: true
|
||||
Targets []MigrateV2Target `url:"targets" json:"targets" validate:"required,min=1,dive"`
|
||||
|
||||
// Whether a separate source-disk cleanup job should be started after full success
|
||||
// Default: true
|
||||
// Required: false
|
||||
AutoCleanup interface{} `url:"auto_cleanup,omitempty" json:"auto_cleanup,omitempty" validate:"omitempty,isBool"`
|
||||
}
|
||||
|
||||
// MigrateV2Request struct to start an offline migration of a group of detached disks
|
||||
type MigrateV2Request struct {
|
||||
// Bandwidth limit in bytes per second
|
||||
// Required: false
|
||||
BandwidthBytesPerSecond uint64 `url:"bandwidth_bytes_per_second,omitempty" json:"bandwidth_bytes_per_second,omitempty"`
|
||||
|
||||
// Number of simultaneous copies
|
||||
// Required: false
|
||||
CopyParallelism uint64 `url:"copy_parallelism,omitempty" json:"copy_parallelism,omitempty"`
|
||||
|
||||
// Destination for disks
|
||||
// Required: true
|
||||
Storage MigrateV2Storage `url:"storage" json:"storage"`
|
||||
}
|
||||
|
||||
// MigrateV2 starts an offline migration of a group of detached disks and returns workflow job ID
|
||||
func (d Disks) MigrateV2(ctx context.Context, req MigrateV2Request) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/disks/migrate_v2"
|
||||
|
||||
res, err := d.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
var resp string
|
||||
|
||||
err = json.Unmarshal(res, &resp)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
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"
|
||||
)
|
||||
|
||||
// MigrateV2AbortRequest struct to abort disks migrations
|
||||
type MigrateV2AbortRequest struct {
|
||||
// Migration workflow job IDs
|
||||
// Required: true
|
||||
WorkflowJobIDs []string `url:"workflow_job_ids" json:"workflow_job_ids" validate:"required,min=1,max=100,unique,dive,required"`
|
||||
}
|
||||
|
||||
// MigrateV2Abort aborts disks migrations
|
||||
func (d Disks) MigrateV2Abort(ctx context.Context, req MigrateV2AbortRequest) (*MigrateV2AbortRecord, error) {
|
||||
res, err := d.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 disks migrations and returns an array of bytes
|
||||
func (d Disks) MigrateV2AbortRaw(ctx context.Context, req MigrateV2AbortRequest) ([]byte, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/disks/migrate_v2_abort"
|
||||
|
||||
res, err := d.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
||||
return res, err
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
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"
|
||||
)
|
||||
|
||||
// MigrateV2CleanupRequest struct to clean up source disks after a disks migration
|
||||
type MigrateV2CleanupRequest struct {
|
||||
// Migration workflow job ID
|
||||
// Required: true
|
||||
WorkflowJobID string `url:"workflow_job_id" json:"workflow_job_id" validate:"required"`
|
||||
}
|
||||
|
||||
// MigrateV2Cleanup cleans up source disks after a disks migration and returns cleanup job ID
|
||||
func (d Disks) MigrateV2Cleanup(ctx context.Context, req MigrateV2CleanupRequest) (string, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/disks/migrate_v2_cleanup"
|
||||
|
||||
res, err := d.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
var resp string
|
||||
|
||||
err = json.Unmarshal(res, &resp)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package disks
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v16/internal/validators"
|
||||
)
|
||||
|
||||
// MigrateV2ListRequest struct to get list of disks migrations
|
||||
type MigrateV2ListRequest struct {
|
||||
// Migration workflow job ID
|
||||
// Required: false
|
||||
WorkflowJobID string `url:"workflow_job_id,omitempty" json:"workflow_job_id,omitempty"`
|
||||
|
||||
// Disk ID
|
||||
// Required: false
|
||||
DiskID uint64 `url:"disk_id,omitempty" json:"disk_id,omitempty"`
|
||||
|
||||
// Account ID
|
||||
// Required: false
|
||||
AccountID uint64 `url:"account_id,omitempty" json:"account_id,omitempty"`
|
||||
|
||||
// User name
|
||||
// Required: false
|
||||
User string `url:"user,omitempty" json:"user,omitempty"`
|
||||
|
||||
// User match mode
|
||||
// Should be one of:
|
||||
// - exact
|
||||
// - prefix
|
||||
// Default: exact
|
||||
// Required: false
|
||||
UserMatch string `url:"user_match,omitempty" json:"user_match,omitempty" validate:"omitempty,migrateV2UserMatch"`
|
||||
|
||||
// Find migrations without user
|
||||
// Required: false
|
||||
UserIsNull interface{} `url:"user_is_null,omitempty" json:"user_is_null,omitempty" validate:"omitempty,isBool"`
|
||||
|
||||
// Migration status
|
||||
// Should be one of:
|
||||
// - QUEUED
|
||||
// - VALIDATING
|
||||
// - PREPARING
|
||||
// - MIGRATING
|
||||
// - COMPLETING
|
||||
// - ABORTING
|
||||
// - NEEDS_ATTENTION
|
||||
// - COMPLETED
|
||||
// - PARTIALLY_COMPLETED
|
||||
// - ABORTED
|
||||
// - ERROR
|
||||
// - RESOLVED
|
||||
// Required: false
|
||||
Status string `url:"status,omitempty" json:"status,omitempty" validate:"omitempty,migrateV2Status"`
|
||||
|
||||
// Whether retained source disks still require cleanup
|
||||
// Required: false
|
||||
CleanupRequired interface{} `url:"cleanup_required,omitempty" json:"cleanup_required,omitempty" validate:"omitempty,isBool"`
|
||||
|
||||
// Page number
|
||||
// Default: 1
|
||||
// Required: false
|
||||
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
||||
|
||||
// Page size
|
||||
// Default: 100
|
||||
// Required: false
|
||||
Size uint64 `url:"size,omitempty" json:"size,omitempty" validate:"omitempty,max=500"`
|
||||
}
|
||||
|
||||
// MigrateV2List gets list of disks migrations as a ListMigrateV2 struct
|
||||
func (d Disks) MigrateV2List(ctx context.Context, req MigrateV2ListRequest) (*ListMigrateV2, error) {
|
||||
res, err := d.MigrateV2ListRaw(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
list := ListMigrateV2{}
|
||||
|
||||
err = json.Unmarshal(res, &list)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &list, nil
|
||||
}
|
||||
|
||||
// MigrateV2ListRaw gets list of disks migrations as an array of bytes
|
||||
func (d Disks) MigrateV2ListRaw(ctx context.Context, req MigrateV2ListRequest) ([]byte, error) {
|
||||
err := validators.ValidateRequest(req)
|
||||
if err != nil {
|
||||
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||
}
|
||||
|
||||
url := "/cloudbroker/disks/migrate_v2_list"
|
||||
|
||||
res, err := d.client.DecortApiCall(ctx, http.MethodGet, url, req)
|
||||
return res, err
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -205,21 +205,51 @@ type InfoDisk struct {
|
||||
}
|
||||
|
||||
type ItemReplication struct {
|
||||
// Bandwidth
|
||||
Bandwidth uint64 `json:"bandwidth"`
|
||||
|
||||
// CopyRate
|
||||
CopyRate uint64 `json:"copy_rate"`
|
||||
|
||||
// DiskID
|
||||
DiskID uint64 `json:"diskId"`
|
||||
|
||||
// LastSync
|
||||
LastSync uint64 `json:"last_sync"`
|
||||
|
||||
// PairID
|
||||
PairID string `json:"pair_id"`
|
||||
|
||||
// PoolID
|
||||
PoolID string `json:"poolId"`
|
||||
|
||||
// ProfileID
|
||||
ProfileID uint64 `json:"profile_id"`
|
||||
|
||||
// Role
|
||||
Role string `json:"role"`
|
||||
|
||||
// ScheduleID
|
||||
ScheduleID uint64 `json:"schedule_id"`
|
||||
|
||||
// ScheduleName
|
||||
ScheduleName string `json:"schedule_name"`
|
||||
|
||||
// SelfVolumeID
|
||||
SelfVolumeID string `json:"selfVolumeId"`
|
||||
|
||||
// Status
|
||||
Status string `json:"status"`
|
||||
|
||||
// StorageID
|
||||
StorageID string `json:"storageId"`
|
||||
|
||||
// Target
|
||||
Target string `json:"target"`
|
||||
|
||||
// Type
|
||||
Type string `json:"type"`
|
||||
|
||||
// VolumeID
|
||||
VolumeID string `json:"volumeId"`
|
||||
}
|
||||
@@ -353,3 +383,432 @@ type MigrateStatus struct {
|
||||
// Operation status
|
||||
Ready bool `json:"ready"`
|
||||
}
|
||||
|
||||
// MigrateV2SourceDisk describes a source disk of a migration
|
||||
type MigrateV2SourceDisk struct {
|
||||
// Disk ID
|
||||
DiskID uint64 `json:"disk_id"`
|
||||
|
||||
// SEP ID
|
||||
SEPID uint64 `json:"sep_id"`
|
||||
|
||||
// SEP type
|
||||
SEPType string `json:"sep_type"`
|
||||
|
||||
// Pool name
|
||||
PoolName string `json:"pool_name"`
|
||||
|
||||
// Storage policy ID
|
||||
StoragePolicyID uint64 `json:"storage_policy_id"`
|
||||
}
|
||||
|
||||
// MigrateV2RequestedTarget describes a requested target of a migration
|
||||
type MigrateV2RequestedTarget struct {
|
||||
// Disk IDs
|
||||
DiskIDs []uint64 `json:"disk_ids"`
|
||||
|
||||
// SEP ID
|
||||
SEPID uint64 `json:"sep_id"`
|
||||
|
||||
// SEP type
|
||||
SEPType string `json:"sep_type"`
|
||||
|
||||
// Pool name
|
||||
PoolName string `json:"pool_name"`
|
||||
|
||||
// Storage policy ID
|
||||
StoragePolicyID uint64 `json:"storage_policy_id"`
|
||||
}
|
||||
|
||||
// MigrateV2RequestedStorage describes a requested storage of a migration
|
||||
type MigrateV2RequestedStorage struct {
|
||||
// Targets
|
||||
Targets []MigrateV2RequestedTarget `json:"targets"`
|
||||
|
||||
// Auto cleanup
|
||||
AutoCleanup bool `json:"auto_cleanup"`
|
||||
}
|
||||
|
||||
// MigrateV2Origin describes an origin of a migration
|
||||
type MigrateV2Origin struct {
|
||||
// Type
|
||||
Type string `json:"type"`
|
||||
|
||||
// Correlation ID
|
||||
CorrelationID string `json:"correlation_id"`
|
||||
}
|
||||
|
||||
// MigrateV2Observation describes an observation of a migration progress
|
||||
type MigrateV2Observation struct {
|
||||
// Updated at
|
||||
UpdatedAt float64 `json:"updated_at"`
|
||||
|
||||
// Agent job ID
|
||||
AgentJobID string `json:"agent_job_id"`
|
||||
|
||||
// Attempt
|
||||
Attempt uint64 `json:"attempt"`
|
||||
|
||||
// Operation
|
||||
Operation string `json:"operation"`
|
||||
}
|
||||
|
||||
// MigrateV2Memory describes a memory progress of a migration
|
||||
type MigrateV2Memory struct {
|
||||
// Sampled at
|
||||
SampledAt float64 `json:"sampled_at"`
|
||||
|
||||
// Percent
|
||||
Percent float64 `json:"percent"`
|
||||
|
||||
// Bytes per second
|
||||
BytesPerSecond float64 `json:"bytes_per_second"`
|
||||
|
||||
// Processed bytes
|
||||
ProcessedBytes uint64 `json:"processed_bytes"`
|
||||
|
||||
// Remaining bytes
|
||||
RemainingBytes uint64 `json:"remaining_bytes"`
|
||||
}
|
||||
|
||||
// MigrateV2ProgressItem describes a progress of a disk copy
|
||||
type MigrateV2ProgressItem struct {
|
||||
// Kind
|
||||
Kind string `json:"kind"`
|
||||
|
||||
// Source disk ID
|
||||
SourceDiskID uint64 `json:"source_disk_id"`
|
||||
|
||||
// Target disk ID
|
||||
TargetDiskID uint64 `json:"target_disk_id"`
|
||||
|
||||
// Target dev
|
||||
TargetDev string `json:"target_dev"`
|
||||
|
||||
// State
|
||||
State string `json:"state"`
|
||||
|
||||
// Sampled at
|
||||
SampledAt float64 `json:"sampled_at"`
|
||||
|
||||
// Percent
|
||||
Percent float64 `json:"percent"`
|
||||
|
||||
// Bytes per second
|
||||
BytesPerSecond float64 `json:"bytes_per_second"`
|
||||
|
||||
// Processed bytes
|
||||
ProcessedBytes uint64 `json:"processed_bytes"`
|
||||
|
||||
// Remaining bytes
|
||||
RemainingBytes uint64 `json:"remaining_bytes"`
|
||||
}
|
||||
|
||||
// MigrateV2ProgressDisks describes a disks progress of a migration
|
||||
type MigrateV2ProgressDisks struct {
|
||||
// Sampled at
|
||||
SampledAt float64 `json:"sampled_at"`
|
||||
|
||||
// Percent
|
||||
Percent float64 `json:"percent"`
|
||||
|
||||
// Bytes per second
|
||||
BytesPerSecond float64 `json:"bytes_per_second"`
|
||||
|
||||
// Processed bytes
|
||||
ProcessedBytes uint64 `json:"processed_bytes"`
|
||||
|
||||
// Remaining bytes
|
||||
RemainingBytes uint64 `json:"remaining_bytes"`
|
||||
|
||||
// Percent is estimated
|
||||
PercentIsEstimated bool `json:"percent_is_estimated"`
|
||||
|
||||
// Disks total
|
||||
DisksTotal uint64 `json:"disks_total"`
|
||||
|
||||
// Disks completed
|
||||
DisksCompleted uint64 `json:"disks_completed"`
|
||||
|
||||
// Items
|
||||
Items []MigrateV2ProgressItem `json:"items"`
|
||||
}
|
||||
|
||||
// MigrateV2Progress describes a progress of a migration
|
||||
type MigrateV2Progress struct {
|
||||
// Observation
|
||||
Observation MigrateV2Observation `json:"observation"`
|
||||
|
||||
// Memory
|
||||
Memory MigrateV2Memory `json:"memory"`
|
||||
|
||||
// Disks
|
||||
Disks MigrateV2ProgressDisks `json:"disks"`
|
||||
}
|
||||
|
||||
// MigrateV2Disk describes a disk of a migration
|
||||
type MigrateV2Disk struct {
|
||||
// Source disk ID
|
||||
SourceDiskID uint64 `json:"source_disk_id"`
|
||||
|
||||
// Target disk ID
|
||||
TargetDiskID uint64 `json:"target_disk_id"`
|
||||
|
||||
// SEP ID
|
||||
SEPID uint64 `json:"sep_id"`
|
||||
|
||||
// Pool name
|
||||
PoolName string `json:"pool_name"`
|
||||
|
||||
// Storage policy ID
|
||||
StoragePolicyID uint64 `json:"storage_policy_id"`
|
||||
|
||||
// State
|
||||
State string `json:"state"`
|
||||
|
||||
// Copy node ID
|
||||
CopyNodeID uint64 `json:"copy_node_id"`
|
||||
|
||||
// Copy state
|
||||
CopyState string `json:"copy_state"`
|
||||
|
||||
// Writer stopped
|
||||
WriterStopped bool `json:"writer_stopped"`
|
||||
}
|
||||
|
||||
// MigrateV2CleanupInfo describes a cleanup of a migration
|
||||
type MigrateV2CleanupInfo struct {
|
||||
// Job ID
|
||||
JobID string `json:"job_id"`
|
||||
|
||||
// Status
|
||||
Status string `json:"status"`
|
||||
|
||||
// Error
|
||||
Error string `json:"error"`
|
||||
}
|
||||
|
||||
// MigrateV2Resolution describes a resolution of a migration
|
||||
type MigrateV2Resolution struct {
|
||||
// Resolved at
|
||||
ResolvedAt string `json:"resolved_at"`
|
||||
|
||||
// Resolved by
|
||||
ResolvedBy string `json:"resolved_by"`
|
||||
|
||||
// Request ID
|
||||
RequestID string `json:"request_id"`
|
||||
|
||||
// Take over cleanup
|
||||
TakeOverCleanup bool `json:"take_over_cleanup"`
|
||||
|
||||
// Previous status
|
||||
PreviousStatus string `json:"previous_status"`
|
||||
|
||||
// Previous cleanup required
|
||||
PreviousCleanupRequired bool `json:"previous_cleanup_required"`
|
||||
|
||||
// Previous error
|
||||
PreviousError string `json:"previous_error"`
|
||||
}
|
||||
|
||||
// MigrateV2Item describes a disks migration in a list
|
||||
type MigrateV2Item struct {
|
||||
// Workflow job ID
|
||||
WorkflowJobID string `json:"workflow_job_id"`
|
||||
|
||||
// User
|
||||
User string `json:"user"`
|
||||
|
||||
// Execution kind
|
||||
ExecutionKind string `json:"execution_kind"`
|
||||
|
||||
// Bandwidth bytes per second
|
||||
BandwidthBytesPerSecond uint64 `json:"bandwidth_bytes_per_second"`
|
||||
|
||||
// Copy parallelism
|
||||
CopyParallelism uint64 `json:"copy_parallelism"`
|
||||
|
||||
// Source disks
|
||||
SourceDisks []MigrateV2SourceDisk `json:"source_disks"`
|
||||
|
||||
// Requested storage
|
||||
RequestedStorage MigrateV2RequestedStorage `json:"requested_storage"`
|
||||
|
||||
// Disk plan ready
|
||||
DiskPlanReady bool `json:"disk_plan_ready"`
|
||||
|
||||
// Disk IDs
|
||||
DiskIDs []uint64 `json:"disk_ids"`
|
||||
|
||||
// Disk IDs not copied
|
||||
DiskIDsNotCopied []uint64 `json:"disk_ids_not_copied"`
|
||||
|
||||
// Account ID
|
||||
AccountID uint64 `json:"account_id"`
|
||||
|
||||
// Origin
|
||||
Origin MigrateV2Origin `json:"origin"`
|
||||
|
||||
// Status
|
||||
Status string `json:"status"`
|
||||
|
||||
// Progress
|
||||
Progress MigrateV2Progress `json:"progress"`
|
||||
|
||||
// Migration result confirmed
|
||||
MigrationResultConfirmed bool `json:"migration_result_confirmed"`
|
||||
|
||||
// Offline commit started
|
||||
OfflineCommitStarted bool `json:"offline_commit_started"`
|
||||
|
||||
// Disks
|
||||
Disks []MigrateV2Disk `json:"disks"`
|
||||
|
||||
// Error
|
||||
Error string `json:"error"`
|
||||
|
||||
// Cleanup required
|
||||
CleanupRequired bool `json:"cleanup_required"`
|
||||
|
||||
// Cleanup
|
||||
Cleanup MigrateV2CleanupInfo `json:"cleanup"`
|
||||
|
||||
// Resolution
|
||||
Resolution MigrateV2Resolution `json:"resolution"`
|
||||
|
||||
// Created at
|
||||
CreatedAt string `json:"created_at"`
|
||||
|
||||
// Updated at
|
||||
UpdatedAt string `json:"updated_at"`
|
||||
}
|
||||
|
||||
// ListMigrateV2 is a list of disks migrations
|
||||
type ListMigrateV2 struct {
|
||||
// Entry count
|
||||
EntryCount uint64 `json:"entry_count"`
|
||||
|
||||
// Data
|
||||
Data []MigrateV2Item `json:"data"`
|
||||
}
|
||||
|
||||
// MigrateV2Record describes detailed information about a disks migration
|
||||
type MigrateV2Record struct {
|
||||
// Workflow job ID
|
||||
WorkflowJobID string `json:"workflow_job_id"`
|
||||
|
||||
// User
|
||||
User string `json:"user"`
|
||||
|
||||
// Execution kind
|
||||
ExecutionKind string `json:"execution_kind"`
|
||||
|
||||
// Bandwidth bytes per second
|
||||
BandwidthBytesPerSecond uint64 `json:"bandwidth_bytes_per_second"`
|
||||
|
||||
// Copy parallelism
|
||||
CopyParallelism uint64 `json:"copy_parallelism"`
|
||||
|
||||
// Source disks
|
||||
SourceDisks []MigrateV2SourceDisk `json:"source_disks"`
|
||||
|
||||
// Requested storage
|
||||
RequestedStorage MigrateV2RequestedStorage `json:"requested_storage"`
|
||||
|
||||
// Disk plan ready
|
||||
DiskPlanReady bool `json:"disk_plan_ready"`
|
||||
|
||||
// Disk IDs
|
||||
DiskIDs []uint64 `json:"disk_ids"`
|
||||
|
||||
// Disk IDs not copied
|
||||
DiskIDsNotCopied []uint64 `json:"disk_ids_not_copied"`
|
||||
|
||||
// Account ID
|
||||
AccountID uint64 `json:"account_id"`
|
||||
|
||||
// Origin
|
||||
Origin MigrateV2Origin `json:"origin"`
|
||||
|
||||
// Status
|
||||
Status string `json:"status"`
|
||||
|
||||
// Progress
|
||||
Progress MigrateV2Progress `json:"progress"`
|
||||
|
||||
// Migration result confirmed
|
||||
MigrationResultConfirmed bool `json:"migration_result_confirmed"`
|
||||
|
||||
// Offline commit started
|
||||
OfflineCommitStarted bool `json:"offline_commit_started"`
|
||||
|
||||
// Disks
|
||||
Disks []MigrateV2Disk `json:"disks"`
|
||||
|
||||
// Error
|
||||
Error string `json:"error"`
|
||||
|
||||
// Cleanup required
|
||||
CleanupRequired bool `json:"cleanup_required"`
|
||||
|
||||
// Cleanup
|
||||
Cleanup MigrateV2CleanupInfo `json:"cleanup"`
|
||||
|
||||
// Resolution
|
||||
Resolution MigrateV2Resolution `json:"resolution"`
|
||||
|
||||
// Created at
|
||||
CreatedAt string `json:"created_at"`
|
||||
|
||||
// Updated at
|
||||
UpdatedAt string `json:"updated_at"`
|
||||
|
||||
// Logs
|
||||
Logs []string `json:"logs"`
|
||||
}
|
||||
|
||||
// MigrateV2AbortResult describes a result of a migration abort
|
||||
type MigrateV2AbortResult struct {
|
||||
// Workflow job ID
|
||||
WorkflowJobID string `json:"workflow_job_id"`
|
||||
|
||||
// Disk IDs
|
||||
DiskIDs []uint64 `json:"disk_ids"`
|
||||
|
||||
// Status
|
||||
Status string `json:"status"`
|
||||
|
||||
// Job ID
|
||||
JobID string `json:"job_id"`
|
||||
|
||||
// Message
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
// MigrateV2AbortRecord describes results of migrations abort
|
||||
type MigrateV2AbortRecord struct {
|
||||
// Results
|
||||
Results []MigrateV2AbortResult `json:"results"`
|
||||
}
|
||||
|
||||
// MigrateV2ResolveRecord describes a result of a migration resolve
|
||||
type MigrateV2ResolveRecord struct {
|
||||
// Workflow job ID
|
||||
WorkflowJobID string `json:"workflow_job_id"`
|
||||
|
||||
// Disk IDs
|
||||
DiskIDs []uint64 `json:"disk_ids"`
|
||||
|
||||
// Status
|
||||
Status string `json:"status"`
|
||||
|
||||
// Cleanup required
|
||||
CleanupRequired bool `json:"cleanup_required"`
|
||||
|
||||
// Resolution
|
||||
Resolution MigrateV2Resolution `json:"resolution"`
|
||||
|
||||
// Message
|
||||
Message string `json:"message"`
|
||||
}
|
||||
Reference in new issue
Block a user