cowbird.handlers.impl.filesystem
Attributes
Classes
Keep the proper directory structure in sync with the platform. |
Module Contents
- cowbird.handlers.impl.filesystem.DEFAULT_PUBLIC_WORKSPACE_WPS_OUTPUTS_SUBPATH = 'public/wps_outputs'[source]
- class cowbird.handlers.impl.filesystem.FileSystem(settings: cowbird.typedefs.SettingsType, name: str, jupyterhub_user_data_dir: str, wps_outputs_dir: str, secure_data_proxy_name: str = DEFAULT_SECURE_DATA_PROXY_NAME, wps_outputs_res_name: str = DEFAULT_WPS_OUTPUTS_RES_NAME, notebooks_dir_name: str = DEFAULT_NOTEBOOKS_DIR_NAME, public_workspace_wps_outputs_subpath: str = DEFAULT_PUBLIC_WORKSPACE_WPS_OUTPUTS_SUBPATH, user_wps_outputs_dir_name: str = DEFAULT_USER_WPS_OUTPUTS_DIR_NAME, **kwargs: Any)[source]
Bases:
cowbird.handlers.handler.Handler
,cowbird.monitoring.fsmonitor.FSMonitor
Keep the proper directory structure in sync with the platform.
Create the file system instance.
- Parameters:
settings – Cowbird settings for convenience
name – Handler name
jupyterhub_user_data_dir – Path to the JupyterHub user data directory, which will be symlinked to the working directory
wps_outputs_dir – Path to the wps outputs directory
secure_data_proxy_name – Name of the secure-data-proxy service found on Magpie
wps_outputs_res_name – Name of the WPS outputs resource found on Magpie under the secure-data-proxy service
notebooks_dir_name – Name of the symlink directory found in the user workspace and which directs to the user’s notebook directory
public_workspace_wps_outputs_subpath – Subpath to the directory containing hardlinks to the public WPS outputs data
user_wps_outputs_dir_name – Name of the directory found in the user workspace and which contains the hardlinks to the user WPS outputs data
- start_wps_outputs_monitoring(monitoring: cowbird.monitoring.monitoring.Monitoring) None [source]
- static get_instance() FileSystem [source]
Return the FileSystem singleton instance from the class name used to retrieve the FSMonitor from the DB.
- _get_secure_data_proxy_file_perms(src_path: str, user_name: str) Tuple[bool, bool] [source]
Finds a route from the secure-data-proxy service that matches the resource path (or one of its parent resource) and gets the user permissions on that route.
- update_secure_data_proxy_path_perms(src_path: str, user_name: str) bool [source]
Gets a path’s permissions from the secure-data-proxy service and updates the file system permissions accordingly.
Returns a boolean to indicate if the user should have some type of access to the path or not.
- static create_hardlink_path(src_path: str, hardlink_path: str, access_allowed: bool) None [source]
Creates a hardlink path from a source file, if the user has access rights.
- _create_wps_outputs_hardlink(src_path: str, overwrite: bool = False, process_user_files: bool = True, process_public_files: bool = True) None [source]
- on_created(path: str) None [source]
Call when a new path is found.
- Parameters:
path – Absolute path of a new file/directory
- on_modified(path: str) None [source]
Called when a path is updated.
- Parameters:
path – Absolute path of a new file/directory
- _delete_wps_outputs_hardlink(src_path: str, process_user_paths: bool = True, process_public_paths: bool = True) bool [source]
Deletes the hardlink path that corresponds to the input source path.
Returns a bool to indicate if a hardlink path was deleted or not.
- on_deleted(path: str) None [source]
Called when a path is deleted.
- Parameters:
path – Absolute path of a new file/directory
- _check_if_res_from_secure_data_proxy(res_tree: List[cowbird.typedefs.JSON]) bool [source]
Checks if the resource is part of a secure-data-proxy service of type API.
- _update_permissions_on_filesystem(permission: cowbird.permissions_synchronizer.Permission) None [source]
- permission_created(permission: cowbird.permissions_synchronizer.Permission) None [source]
- permission_deleted(permission: cowbird.permissions_synchronizer.Permission) None [source]