api.catacloud package

Submodules

api.catacloud.caclmodel_ops module

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

Bases: CaClOp

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

api.catacloud.caclop module

class api.catacloud.caclop.CaClOp(ses: CaClSession)

Bases: object

Author:

Alberto M. Esmoris Pena

Class that provides the commong logic for operations on the Catacloud platform through its API.

Variables:

ses (CaClSession.) – The session object used to launch the operations in the Catacloud platform.

__init__(ses: CaClSession)
check_status_code(status_code)

Check whether the given status code mean the operations was run successfully or not. If the operation was not successful an APIException will be thrown.

Parameters:

status_code (int) – The status code to be checked.

Returns:

Nothing at all but an exception will be raised if the status code is not a successful one.

api.catacloud.caclpcloud_ops module

class api.catacloud.caclpcloud_ops.CaClPcloudOps(ses: CaClSession)

Bases: CaClOp

Author:

Alberto M. Esmoris Pena

Class that supports operations on point clouds in the Catacloud platform through its API (typically as LAS/LAZ files).

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

  • hash_buffer_size (int) – The buffer size (in bytes) to be used when hashing a point cloud file.

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

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

__init__(ses: CaClSession)

Instantiate a Catacloud point cloud operations object.

ls()

List available point clouds in the Catacloud platform.

Returns:

Dictionary with the contents of the answer to the request.

Return type:

dict

rm(file_id)

Remove a point cloud from the Catacloud platform.

Parameters:

file_id (str) – The identifier of the point cloud 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 point cloud given its file id from the Catacloud platform.

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

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

Returns:

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

Return type:

None

push(las_path, pcloud_description=None)

Upload a LAS/LAZ file representing a point cloud to the Catacloud platform.

Parameters:
  • las_path (str) – Path to the LAS/LAZ file to upload.

  • pcloud_description (str or None) – The description (optional) for the point cloud.

Returns:

Nothing at all.

api.catacloud.caclpipeline_ops module

class api.catacloud.caclpipeline_ops.CaClPipelineOps(ses: CaClSession)

Bases: CaClOp

Author:

Alberto M. Esmoris Pena

Class that supports operations on pipeline 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.

__init__(ses: CaClSession)

Instantiate a Catacloud pipeline operations object.

ls()

List the available pipeline specifications in the Catacloud platform.

Returns:

Dictionary with the contents of the answer to the request.

Return type:

dict

rm(pipeline_id)

Remove a pipeline’s JSON specification from the Catacloud platform.

Parameters:

pipeline_id (str) – The identifier of the pipeline specification 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 pipeline specification file given its file id from the Catacloud platform.

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

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

Returns:

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

Return type:

None

push(json_path, pipeline_description=None)

Upload a JSON specifying a pipeline to the Catacloud platform.

Parameters:
  • json_path (str) – Path to the JSON to upload.

  • pipeline_description (str or None) – The description (optional) for the pipeline.

Returns:

Nothing at all.

property pagination_size

Getter for pagination size

api.catacloud.caclsession module

class api.catacloud.caclsession.CaClSession(token=None, url=None)

Bases: object

Author:

Alberto M. Esmoris Pena

Class representing a session to use the Catacloud API.

Variables:
  • token (str) – The string representing the token for the session.

  • url (str) – The string representing the API’s URL.

__init__(token=None, url=None)

Instantiate a Catacloud API session with given token.

Parameters:
  • token (str or None) – The token for the session. If it is None, then it is taken automatically from the configuration.

  • url (str or None) – The API’s URL. If it is None, then it is taken automatically from the configuration.

craft_header(header=None)

Craft a header for an HTTP request that needs to use this session.

Parameters:

header (dict or None) – The header to be crafted. If None, an empty header is initialized from scratch.

Returns:

The crafted header.

Module contents

author:

Alberto M. Esmoris Pena

The API package contains the logic to connect the framework with the catacloud API.