NGPIris.hcp package

Submodules

NGPIris.hcp.exceptions module

exception NGPIris.hcp.exceptions.BucketNotFound[source]

Bases: Exception

exception NGPIris.hcp.exceptions.NoBucketMounted[source]

Bases: Exception

exception NGPIris.hcp.exceptions.VPNConnectionError[source]

Bases: Exception

NGPIris.hcp.hcp module

class NGPIris.hcp.hcp.HCPHandler(credentials_path: str, use_ssl: bool = False, proxy_path: str = '', custom_config_path: str = '')[source]

Bases: object

delete_folder(**kwargs: ~typing.~P) T
delete_object(**kwargs: ~typing.~P) T
delete_objects(**kwargs: ~typing.~P) T
download_file(**kwargs: ~typing.~P) T
get_bucket_acl(**kwargs: ~typing.~P) T
get_object(**kwargs: ~typing.~P) T
get_object_acl(**kwargs: ~typing.~P) T
get_response(path_extension: str = '') dict[source]

Make a request to the HCP in order to use the builtin MAPI

Parameters:

path_extension (str, optional) – Extension for the base request URL, defaults to the empty string

Returns:

The response as a dictionary

Return type:

dict

list_buckets() list[str][source]

List all available buckets at endpoint.

Returns:

A list of buckets

Return type:

list[str]

list_objects(**kwargs: ~typing.~P) T
modify_bucket_acl(**kwargs: ~typing.~P) T
modify_object_acl(**kwargs: ~typing.~P) T
modify_single_bucket_acl(**kwargs: ~typing.~P) T
modify_single_object_acl(**kwargs: ~typing.~P) T
mount_bucket(bucket_name: str) None[source]

Mount bucket that is to be used. This method needs to executed in order for most of the other methods to work. It mainly concerns operations with download and upload.

Parameters:

bucket_name (str) – The name of the bucket to be mounted

object_exists(**kwargs: ~typing.~P) T
search_objects_in_bucket(**kwargs: ~typing.~P) T
test_connection(bucket_name: str = '') dict[source]

Test the connection to the mounted bucket or another bucket which is supplied as the argument bucket_name.

Parameters:

bucket_name (str, optional) – The name of the bucket to be mounted. Defaults to the empty string

Raises:
  • RuntimeError – If no bucket is selected

  • VPNConnectionError – If there is no VPN connection

  • BucketNotFound – If no bucket of that name was found

  • Exception – Other exceptions

Returns:

A dictionary of the response

Return type:

dict

upload_file(**kwargs: ~typing.~P) T
upload_folder(**kwargs: ~typing.~P) T

NGPIris.hcp.helpers module

NGPIris.hcp.helpers.check_mounted(method: Callable[[P], T]) Callable[[P], T][source]
NGPIris.hcp.helpers.create_access_control_policy(user_ID_permissions: dict[str, str]) dict[source]
NGPIris.hcp.helpers.raise_path_error(path: str)[source]

NGPIris.hcp.statistics module

class NGPIris.hcp.statistics.HCPStatistics(credentials_path: str, use_ssl: bool = False, proxy_path: str = '', custom_config_path: str = '')[source]

Bases: HCPHandler

get_namespace_permissions() dict[source]
get_namespace_settings() dict[source]
get_namespace_statistics() dict[source]

Module contents