chi.storage

The chi.storage module provides methods for using the shared filesystem and object store on chameleon.

class chi.storage.Object(container: str, name: str, size: int)[source]
class chi.storage.ObjectBucket(name: str)[source]

Class representing an object store bucket

Parameters:

name (str) – name of the bucket

class chi.storage.Share(name: str, size: int, description: str | None = None, metadata: str | None = None, is_public: bool = False)[source]

Represents a manilla share

Parameters:
  • name (str) – name of new share.

  • size (int) – size in GiB.

  • description (str) – description of a share.

  • metadata (str) – metadata for the share.

  • is_public (bool) – whether to set share as public or not.

Fields:

id (str): id of the share export_locations: list of mount paths

delete()[source]

Delete the share.

extend(new_size: int)[source]

Extend the size of the specific share.

Parameters:

new_size – desired size to extend share to.

shrink(new_size: int)[source]

Shrink the size of the specific share.

Parameters:

new_size – desired size to extend share to.

submit(idempotent: bool = False)[source]

Create the share.

Parameters:

idempotent (bool, optional) – Whether to create the share only if it doesn’t already exist.

chi.storage.get_share(ref) Share[source]

Get a share by its ID or name.

Parameters:

ref (str) – The ID or name of the share.

Returns:

The share matching the ID or name.

Raises:

NotFound – If the share could not be found.

chi.storage.list_shares() List[Share][source]

Get a list of all available flavors.

Returns:

A list of all flavors.