Skip to content

Volume

class Volume(VolumeDto)

Represents a Synodes Volume which is a shared storage volume for Sandboxes.

Attributes:

  • id StrictStr - Unique identifier for the Volume.
  • name StrictStr - Name of the Volume.
  • organization_id StrictStr - Organization ID of the Volume.
  • state StrictStr - State of the Volume.
  • created_at StrictStr - Date and time when the Volume was created.
  • updated_at StrictStr - Date and time when the Volume was last updated.
  • last_used_at StrictStr - Date and time when the Volume was last used.

AsyncVolumeService

class AsyncVolumeService()

Service for managing Synodes Volumes. Can be used to list, get, create and delete Volumes.

AsyncVolumeService.list

async def list() -> List[Volume]

List all Volumes.

Returns:

  • List[Volume] - List of all Volumes.

Example:

async with AsyncSynodes() as synodes:
volumes = await synodes.volume.list()
for volume in volumes:
print(f"{volume.name} ({volume.id})")

AsyncVolumeService.get

async def get(name: str, create: bool = False) -> Volume

Get a Volume by name.

Arguments:

  • name str - Name of the Volume to get.
  • create bool - If True, create a new Volume if it doesn’t exist.

Returns:

  • Volume - The Volume object.

Example:

async with AsyncSynodes() as synodes:
volume = await synodes.volume.get("test-volume-name", create=True)
print(f"{volume.name} ({volume.id})")

AsyncVolumeService.create

async def create(name: str) -> Volume

Create a new Volume.

Arguments:

  • name str - Name of the Volume to create.

Returns:

  • Volume - The Volume object.

Example:

async with AsyncSynodes() as synodes:
volume = await synodes.volume.create("test-volume")
print(f"{volume.name} ({volume.id}); state: {volume.state}")

AsyncVolumeService.delete

async def delete(volume: Volume) -> None

Delete a Volume.

Arguments:

  • volume Volume - Volume to delete.

Example:

async with AsyncSynodes() as synodes:
volume = await synodes.volume.get("test-volume")
await synodes.volume.delete(volume)
print("Volume deleted")