2025-06-06 08:20:45 +03:00
|
|
|
import typing as _typing
|
|
|
|
|
|
|
|
|
|
import dynamix_sdk.base as _base
|
|
|
|
|
import dynamix_sdk.api._nested as _nested
|
2025-07-21 20:27:59 +07:00
|
|
|
from dynamix_sdk.utils import EmptyStr as _EmptyStr
|
2025-06-06 08:20:45 +03:00
|
|
|
|
|
|
|
|
|
2025-07-21 20:27:59 +07:00
|
|
|
class CloudapiImageGetResultModel(_base.BaseAPIResultModel):
|
|
|
|
|
account_id: int
|
2025-06-06 08:20:45 +03:00
|
|
|
acl: list[_typing.Any]
|
2025-07-21 20:27:59 +07:00
|
|
|
arch: str
|
|
|
|
|
boot_mode: _nested.BootMode | _EmptyStr | None
|
|
|
|
|
bootable: bool
|
2025-06-06 08:20:45 +03:00
|
|
|
cd_presented_to: dict[str, list[int]]
|
|
|
|
|
ckey: str
|
|
|
|
|
deleted_timestamp: int
|
2025-07-21 20:27:59 +07:00
|
|
|
description: str
|
|
|
|
|
drivers: list[_nested.Driver]
|
2025-06-06 08:20:45 +03:00
|
|
|
enabled: bool
|
|
|
|
|
grid_id: int
|
|
|
|
|
guid: int
|
|
|
|
|
history: list[_nested.ImageHistoryRecordAPIResultNM]
|
2025-07-21 20:27:59 +07:00
|
|
|
hot_resize: bool
|
|
|
|
|
id: int
|
2025-06-06 08:20:45 +03:00
|
|
|
last_modified: int
|
2025-07-21 20:27:59 +07:00
|
|
|
link_to: int
|
2025-06-06 08:20:45 +03:00
|
|
|
milestones: int
|
2025-07-21 20:27:59 +07:00
|
|
|
name: str
|
|
|
|
|
network_interface_naming: _nested.NetIfaceNamingTemplate
|
2025-06-06 08:20:45 +03:00
|
|
|
os_password: str | None
|
2025-07-21 20:27:59 +07:00
|
|
|
os_user_name: str | None
|
2025-06-30 15:09:41 +03:00
|
|
|
present_to: dict[str, int]
|
2025-06-06 08:20:45 +03:00
|
|
|
provider_name: str
|
|
|
|
|
purge_attempt_count: int
|
|
|
|
|
res_id: str
|
|
|
|
|
rescue_cd: bool
|
2025-07-21 20:27:59 +07:00
|
|
|
sep_id: int
|
|
|
|
|
sep_pool_name: str
|
2025-06-06 08:20:45 +03:00
|
|
|
shared_with: list[int]
|
2025-07-21 20:27:59 +07:00
|
|
|
size_gb: int
|
2025-06-06 08:20:45 +03:00
|
|
|
snapshot_id: str = ''
|
2025-07-21 20:27:59 +07:00
|
|
|
status: _nested.ImageStatus
|
2025-06-06 08:20:45 +03:00
|
|
|
tech_status: _nested.ImageTechStatus
|
2025-07-21 20:27:59 +07:00
|
|
|
type: _nested.ImageType
|
2025-06-06 08:20:45 +03:00
|
|
|
unc_path: str
|
|
|
|
|
version: str
|
|
|
|
|
vm_ci_id: int
|
|
|
|
|
|
2025-07-21 20:27:59 +07:00
|
|
|
@property
|
|
|
|
|
def boot_loader_type(self):
|
|
|
|
|
if self.type in _nested.BootLoaderType._member_names_:
|
|
|
|
|
return _nested.BootLoaderType[self.type]
|
|
|
|
|
|
2025-06-06 08:20:45 +03:00
|
|
|
@property
|
|
|
|
|
def deleted_datetime(self):
|
|
|
|
|
return self._get_datetime_from_timestamp(self.deleted_timestamp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CloudapiImageGetProtocol(_base.BasePostAPIFunctionProtocol):
|
|
|
|
|
def get(
|
|
|
|
|
self,
|
|
|
|
|
*,
|
|
|
|
|
image_id: int,
|
|
|
|
|
show_all: bool = False,
|
|
|
|
|
) -> CloudapiImageGetResultModel:
|
|
|
|
|
...
|