Disks API Reference¶
Disks¶
- class apolo_sdk.Disks¶
Persistent disks subsystems. Disks can be passed as mounted volumes into a running job.
- async list(cluster_name: str | None = None) AsyncContextManager[AsyncIterator[Disk]] [source]¶
List user’s disks, async iterator. Yields
Disk
instances.- Parameters:
cluster_name (str) – cluster to list disks. Default is current cluster.
- async create(storage: int, life_span: Optional[datetime.timedelta], name: Optional[str], cluster_name: str | None = None, org_name: str | None = None) Disk [source]¶
Create a disk with capacity of storage bytes.
- Parameters:
storage (int) – storage capacity in bytes.
life_span (Optional[datetime.timedelta]) – Duration of no usage after which disk will be deleted.
None
means no limit.name (Optional[str]) – Name of the disk. Should be unique among all user’s disk.
cluster_name (str) – cluster to create a disk. Default is current cluster.
org_name (str) – org to create a disk. Default is current org.
- Returns:
Newly created disk info (
Disk
)
Disk¶
- class apolo_sdk.Disk¶
Read-only
dataclass
for describing persistent disk instance.- used_bytes¶
The amount of used bytes on disk,
int
orNone
if this information is not available. Note that this field is updated periodically, so it can contain incorrect data.
- status¶
Current disk status,
Disk.Status
.
Disk.Status¶
- class Disk.Status[source]¶
Enumeration that describes disk status.
Can be one of the following values:
- PENDING¶
Disk is still creating. It can be attached to job, but job will not start until disk is created.
- READY¶
Disk is created and ready to use.
- BROKEN¶
Disk is broken and cannot be used anymore. Can happen if underneath storage device was destroyed.