214 lines
5.2 KiB
Python
214 lines
5.2 KiB
Python
from pydantic import Field
|
|||
|
|
|
||
|
|
import dynamix_sdk.base as _base
|
||
|
|
from dynamix_sdk.utils import AutoNameEnum as _AutoNameEnum
|
||
|
|
|
||
|
|
|
||
|
|
class ExecutionKind(str, _AutoNameEnum):
|
||
|
|
OFFLINE = 'offline'
|
||
|
|
|
||
|
|
|
||
|
|
class Status(str, _AutoNameEnum):
|
||
|
|
QUEUED = 'QUEUED'
|
||
|
|
VALIDATING = 'VALIDATING'
|
||
|
|
PREPARING = 'PREPARING'
|
||
|
|
MIGRATING = 'MIGRATING'
|
||
|
|
COMPLETING = 'COMPLETING'
|
||
|
|
ABORTING = 'ABORTING'
|
||
|
|
NEEDS_ATTENTION = 'NEEDS_ATTENTION'
|
||
|
|
COMPLETED = 'COMPLETED'
|
||
|
|
PARTIALLY_COMPLETED = 'PARTIALLY_COMPLETED'
|
||
|
|
ABORTED = 'ABORTED'
|
||
|
|
ERROR = 'ERROR'
|
||
|
|
RESOLVED = 'RESOLVED'
|
||
|
|
|
||
|
|
|
||
|
|
class PreviousStatus(str, _AutoNameEnum):
|
||
|
|
QUEUED = 'QUEUED'
|
||
|
|
VALIDATING = 'VALIDATING'
|
||
|
|
PREPARING = 'PREPARING'
|
||
|
|
MIGRATING = 'MIGRATING'
|
||
|
|
COMPLETING = 'COMPLETING'
|
||
|
|
ABORTING = 'ABORTING'
|
||
|
|
NEEDS_ATTENTION = 'NEEDS_ATTENTION'
|
||
|
|
COMPLETED = 'COMPLETED'
|
||
|
|
PARTIALLY_COMPLETED = 'PARTIALLY_COMPLETED'
|
||
|
|
ABORTED = 'ABORTED'
|
||
|
|
ERROR = 'ERROR'
|
||
|
|
RESOLVED = 'RESOLVED'
|
||
|
|
|
||
|
|
|
||
|
|
class State(str, _AutoNameEnum):
|
||
|
|
PLANNED = 'PLANNED'
|
||
|
|
PREPARED = 'PREPARED'
|
||
|
|
COPIED = 'COPIED'
|
||
|
|
MIGRATED = 'MIGRATED'
|
||
|
|
ROLLED_BACK = 'ROLLED_BACK'
|
||
|
|
|
||
|
|
|
||
|
|
class CopyState(str, _AutoNameEnum):
|
||
|
|
NOT_STARTED = 'NOT_STARTED'
|
||
|
|
COPYING = 'COPYING'
|
||
|
|
COPIED = 'COPIED'
|
||
|
|
STOPPED = 'STOPPED'
|
||
|
|
FAILED = 'FAILED'
|
||
|
|
UNKNOWN = 'UNKNOWN'
|
||
|
|
|
||
|
|
|
||
|
|
class Kind(str, _AutoNameEnum):
|
||
|
|
PERSISTENT = 'persistent'
|
||
|
|
STATELESS_SYSTEM = 'stateless_system'
|
||
|
|
|
||
|
|
|
||
|
|
class ItemsItemState(str, _AutoNameEnum):
|
||
|
|
WAITING = 'waiting'
|
||
|
|
COPYING = 'copying'
|
||
|
|
COPIED = 'copied'
|
||
|
|
STOPPED = 'stopped'
|
||
|
|
FAILED = 'failed'
|
||
|
|
ROLLED_BACK = 'rolled_back'
|
||
|
|
|
||
|
|
|
||
|
|
class Operation(str, _AutoNameEnum):
|
||
|
|
PREPARING = 'preparing'
|
||
|
|
COPYING = 'copying'
|
||
|
|
PIVOTING = 'pivoting'
|
||
|
|
VERIFYING = 'verifying'
|
||
|
|
|
||
|
|
|
||
|
|
class Cleanup(_base.ResultModel):
|
||
|
|
job_id: str
|
||
|
|
status: str
|
||
|
|
error: str | None
|
||
|
|
|
||
|
|
|
||
|
|
class DisksItem(_base.ResultModel):
|
||
|
|
source_disk_id: int
|
||
|
|
target_disk_id: int | None = Field(validation_alias='target_disk_id')
|
||
|
|
sep_id: int = Field(validation_alias='sep_id')
|
||
|
|
pool_name: str
|
||
|
|
storage_policy_id: int
|
||
|
|
state: State
|
||
|
|
copy_node_id: int | None
|
||
|
|
copy_state: CopyState
|
||
|
|
writer_stopped: bool
|
||
|
|
|
||
|
|
|
||
|
|
class Origin(_base.ResultModel):
|
||
|
|
type: str
|
||
|
|
correlation_id: str | None
|
||
|
|
|
||
|
|
|
||
|
|
class ItemsItem(_base.ResultModel):
|
||
|
|
kind: Kind
|
||
|
|
source_disk_id: int | None
|
||
|
|
target_disk_id: int | None = Field(validation_alias='target_disk_id')
|
||
|
|
target_dev: str | None
|
||
|
|
state: ItemsItemState | None
|
||
|
|
percent: float | None
|
||
|
|
sampled_at: float | None
|
||
|
|
bytes_per_second: float | None
|
||
|
|
processed_bytes: int | None
|
||
|
|
remaining_bytes: int | None
|
||
|
|
|
||
|
|
|
||
|
|
class Disks(_base.ResultModel):
|
||
|
|
sampled_at: float | None
|
||
|
|
percent: float | None
|
||
|
|
bytes_per_second: float | None
|
||
|
|
processed_bytes: int | None
|
||
|
|
remaining_bytes: int | None
|
||
|
|
percent_is_estimated: bool | None
|
||
|
|
disks_total: int | None
|
||
|
|
disks_completed: int | None
|
||
|
|
items: list[ItemsItem]
|
||
|
|
|
||
|
|
|
||
|
|
class Observation(_base.ResultModel):
|
||
|
|
updated_at: float
|
||
|
|
agent_job_id: str
|
||
|
|
attempt: int
|
||
|
|
operation: Operation
|
||
|
|
|
||
|
|
|
||
|
|
class Memory(_base.ResultModel):
|
||
|
|
sampled_at: float | None
|
||
|
|
percent: float | None
|
||
|
|
bytes_per_second: float | None
|
||
|
|
processed_bytes: int | None
|
||
|
|
remaining_bytes: int | None
|
||
|
|
|
||
|
|
|
||
|
|
class Progress(_base.ResultModel):
|
||
|
|
observation: Observation | None
|
||
|
|
memory: Memory | None
|
||
|
|
disks: Disks | None
|
||
|
|
|
||
|
|
|
||
|
|
class TargetsItem(_base.ResultModel):
|
||
|
|
disk_ids: list[int] | None = Field(validation_alias='disk_ids')
|
||
|
|
sep_id: int = Field(validation_alias='sep_id')
|
||
|
|
sep_type: str | None = Field(validation_alias='sep_type')
|
||
|
|
pool_name: str
|
||
|
|
storage_policy_id: int | None
|
||
|
|
|
||
|
|
|
||
|
|
class RequestedStorage(_base.ResultModel):
|
||
|
|
targets: list[TargetsItem]
|
||
|
|
auto_cleanup: bool
|
||
|
|
|
||
|
|
|
||
|
|
class Resolution(_base.ResultModel):
|
||
|
|
resolved_at: str
|
||
|
|
resolved_by: str
|
||
|
|
request_id: str
|
||
|
|
take_over_cleanup: bool
|
||
|
|
previous_status: PreviousStatus
|
||
|
|
previous_cleanup_required: bool
|
||
|
|
previous_error: str | None
|
||
|
|
|
||
|
|
|
||
|
|
class SourceDisksItem(_base.ResultModel):
|
||
|
|
disk_id: int = Field(validation_alias='disk_id')
|
||
|
|
sep_id: int = Field(validation_alias='sep_id')
|
||
|
|
sep_type: str = Field(validation_alias='sep_type')
|
||
|
|
pool_name: str
|
||
|
|
storage_policy_id: int
|
||
|
|
|
||
|
|
|
||
|
|
class CloudbrokerDisksMigrateV2GetResult(_base.ResultModel):
|
||
|
|
workflow_job_id: str
|
||
|
|
user: str | None
|
||
|
|
execution_kind: ExecutionKind
|
||
|
|
bandwidth_bytes_per_second: int | None
|
||
|
|
copy_parallelism: int | None
|
||
|
|
requested_storage: RequestedStorage | None
|
||
|
|
source_disks: list[SourceDisksItem]
|
||
|
|
disk_plan_ready: bool
|
||
|
|
disk_ids: list[int] = Field(validation_alias='disk_ids')
|
||
|
|
disk_ids_not_copied: list[int]
|
||
|
|
account_id: int | None = Field(validation_alias='account_id')
|
||
|
|
origin: Origin
|
||
|
|
status: Status
|
||
|
|
progress: Progress
|
||
|
|
migration_result_confirmed: bool
|
||
|
|
offline_commit_started: bool
|
||
|
|
disks: list[DisksItem]
|
||
|
|
error: str | None
|
||
|
|
cleanup_required: bool
|
||
|
|
cleanup: Cleanup | None
|
||
|
|
resolution: Resolution | None
|
||
|
|
created_at: str
|
||
|
|
updated_at: str
|
||
|
|
logs: list[str]
|
||
|
|
|
||
|
|
|
||
|
|
class CloudbrokerDisksMigrateV2GetImpl(_base.APIFunctionImpl):
|
||
|
|
http_method = _base.HTTPMethod.GET
|
||
|
|
|
||
|
|
def __call__(
|
||
|
|
self,
|
||
|
|
*,
|
||
|
|
workflow_job_id: str,
|
||
|
|
) -> CloudbrokerDisksMigrateV2GetResult:
|
||
|
|
raise NotImplementedError
|