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.

class chi.storage.Volume(name: str, size: int, description: str | None = None, metadata: str | None = None, volume_type: str = 'ceph-ssd')[source]

Represents an OpenStack Cinder volume

Parameters:
  • name (str) – name of the new volume.

  • size (int) – size in GiB.

  • description (str) – description of the volume.

  • metadata (str) – metadata for the volume.

  • volume_type (str) – type of the volume.

Fields:

id (str): id of the volume status (str): status of the volume

delete()[source]

Delete the volume.

get()[source]

Retrieve the volume details.

submit(idempotent: bool = False)[source]

Create the volume.

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.get_volume(ref) Volume[source]

Get a volume by its ID or name.

Parameters:

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

Returns:

The volume matching the ID or name.

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

Get a list of all available flavors.

Returns:

A list of all flavors.

chi.storage.list_volumes() List[Volume][source]

Get a list of all available volumes.

Returns:

A list of all volumes.