Files
dynamix-python-sdk/src/dynamix_sdk/api/cloudapi/image/get.py
T

71 lines
1.9 KiB
Python
Raw Normal View History

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
2026-09-18 16:06:25 +07:00
class CloudapiImageGetResultModel(_base.BaseModel):
2025-07-21 20:27:59 +07:00
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]]
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
2026-06-01 20:54:15 +07:00
independent: bool
2025-06-06 08:20:45 +03:00
last_modified: int
2025-07-21 20:27:59 +07:00
link_to: int
2026-06-01 20:54:15 +07:00
links_to: list[int] | None = None
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
2026-02-11 12:20:55 +03:00
res_id: str | None
2025-06-06 08:20:45 +03:00
rescue_cd: bool
2025-07-21 20:27:59 +07:00
sep_id: int
sep_pool_name: str
2025-11-25 18:09:46 +03:00
storage_policy_id: int
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-11-25 18:09:46 +03:00
to_clean: bool
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
2026-02-11 12:20:55 +03:00
@_base.computed_field
def boot_loader_type(self) -> _nested.BootLoaderType | None:
2025-07-21 20:27:59 +07:00
if self.type in _nested.BootLoaderType._member_names_:
return _nested.BootLoaderType[self.type]
2026-02-11 12:20:55 +03:00
@_base.computed_field
def deleted_datetime(self) -> _base.datetime | None:
2025-06-06 08:20:45 +03:00
return self._get_datetime_from_timestamp(self.deleted_timestamp)
2026-09-18 16:06:25 +07:00
class CloudapiImageGetImpl(_base.APIFunctionImpl):
http_method = _base.HTTPMethod.POST
def __call__(
2025-06-06 08:20:45 +03:00
self,
*,
image_id: int,
show_all: bool = False,
) -> CloudapiImageGetResultModel:
2026-09-18 16:06:25 +07:00
raise NotImplementedError