src.api.catacloud.caclmodel_ops

Classes

CaClModelOps(ses)

class src.api.catacloud.caclmodel_ops.CaClModelOps(ses: CaClSession)
Author:

Alberto M. Esmoris Pena

Class that supports operations on model specifications in the Catacloud platform through its API (typically defined as JSON files).

Variables:
  • pagination_size (int) – The pagination size to be used when retrieving the list of available pipelines.

  • hash_buffer_size (int) – The buffer size (in bytes) to be used when hashing the input model.

  • upload_chunk_size (int) – The chunk size (in bytes) to be used when uploading a model to the Catacloud platform.

  • download_chunk_size (int) – The chunk size (in bytes) to be used when downloading a model from the Catacloud platform.

__init__(ses: CaClSession)

Instantiate a Catacloud model operations object.

ls()

List the available models in the Catacloud platform.

Returns:

Dictionary with the contents of the answer to the request.

Return type:

dict

rm(file_id)

Remove a model from the Catacloud platform.

Parameters:

file_id (str) – The identifier of the model to be removed from the Catacloud platform.

Returns:

Dictionary with the contents of the answer to the request.

Return type:

dict

pull(file_id, out_path)

Download a model given its file id from the Catacloud platform.

Parameters:
  • file_id (str) – The identifier of the model file to download.

  • out_path (str) – The local path where the downloaded model will be written.

Returns:

Nothing at all but the model file is written to the specified local path.

Return type:

None

push(tar_path, model_description=None)

Upload a tar specifying a model to the Catacloud platform.

Parameters:
  • tar_path (str) – Path to the tar to upload.

  • model_description (str or None) – The description (optional) for the model.

Returns:

Nothing at all.

property pagination_size

Getter for pagination size