54 lines
1.3 KiB
Python
54 lines
1.3 KiB
Python
from pydantic import Field
|
|||
|
|
|
||
|
|
import dynamix_sdk.base as _base
|
||
|
|
from dynamix_sdk.utils import AutoNameEnum as _AutoNameEnum
|
||
|
|
|
||
|
|
|
||
|
|
class Status(str, _AutoNameEnum):
|
||
|
|
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 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 CloudbrokerDisksMigrateV2ResolveResult(_base.ResultModel):
|
||
|
|
workflow_job_id: str
|
||
|
|
disk_ids: list[int] = Field(validation_alias='disk_ids')
|
||
|
|
status: Status
|
||
|
|
cleanup_required: bool
|
||
|
|
resolution: Resolution
|
||
|
|
message: str
|
||
|
|
|
||
|
|
|
||
|
|
class CloudbrokerDisksMigrateV2ResolveImpl(_base.APIFunctionImpl):
|
||
|
|
http_method = _base.HTTPMethod.POST
|
||
|
|
|
||
|
|
def __call__(
|
||
|
|
self,
|
||
|
|
*,
|
||
|
|
workflow_job_id: str,
|
||
|
|
take_over_cleanup: bool = False,
|
||
|
|
) -> CloudbrokerDisksMigrateV2ResolveResult:
|
||
|
|
raise NotImplementedError
|