Files
dynamix-python-sdk/src/dynamix_sdk/api/cloudapi/disks/get.py
T
2026-10-30 17:01:06 +03:00

86 lines
2.4 KiB
Python

import dynamix_sdk.base as _base
import dynamix_sdk.api._nested as _nested
class CloudapiDisksGetResultModel(_base.ResultModel):
account_id: int
account_name: str
acl: dict
block_size: _nested.DiskBlockSize
cache_mode: _nested.DiskCacheMode
created_by: str
created_timestamp: int
crt_tracking: bool
deleted_by: str
deleted_timestamp: int
description: str
destruction_timestamp: int
device_name: str | None = None
discard: _nested.DiskDiscard
grid_id: int
id: int
image_id: int
image_ids: list[int]
independent: bool
io_tune: _nested.IOTuneAPIResultNM
milestones: int
name: str
params: str
parent_id: int
present_to: dict[str, int]
provision: _nested.DiskProvisionType
purge_timestamp: int
replication: _nested.ReplicationAPIResultNM | dict
res_id: str
res_name: str
role: str
sep_id: int
sep_pool_name: str
sep_type: _nested.SEPType
shared: bool
size_available_gb: float
size_max_gb: int
size_used_gb: float
snapshots: list[_nested.SnapshotAPIResultNM]
status: _nested.DiskStatus
storage_policy_id: int
tech_status: _nested.DiskTechStatus
to_clean: bool
updated_by: str
vm_id: int | None
vm_name: str | None
vms: dict[str, str]
vms_with_read_only: dict[str, bool]
updated_timestamp: int = 0
@_base.computed_field
def created_datetime(self) -> _base.datetime | None:
return self._get_datetime_from_timestamp(self.created_timestamp)
@_base.computed_field
def deleted_datetime(self) -> _base.datetime | None:
return self._get_datetime_from_timestamp(self.deleted_timestamp)
@_base.computed_field
def destruction_datetime(self) -> _base.datetime | None:
return self._get_datetime_from_timestamp(self.destruction_timestamp)
@_base.computed_field
def purge_datetime(self) -> _base.datetime | None:
return self._get_datetime_from_timestamp(self.purge_timestamp)
@_base.computed_field
def updated_datetime(self) -> _base.datetime | None:
return self._get_datetime_from_timestamp(self.updated_timestamp)
class CloudapiDisksGetImpl(_base.APIFunctionImpl):
http_method = _base.HTTPMethod.POST
def __call__(
self,
*,
disk_id: int,
) -> CloudapiDisksGetResultModel:
raise NotImplementedError