cloudos_cli.utils.details¶
Functions
|
Constructs a storage path based on the parameter kind and execution platform. |
- cloudos_cli.utils.details.get_path(param, param_kind_map, execution_platform, storage_provider, mode='parameters')[source]¶
Constructs a storage path based on the parameter kind and execution platform.
- Parameters:
param (dict) –
- A dictionary containing parameter details. Expected keys include:
’parameterKind’: Specifies the kind of parameter (e.g., ‘dataItem’, ‘globPattern’).
- For ‘dataItem’: Contains nested keys such as ‘item’, which includes:
’s3BucketName’, ‘s3ObjectKey’, ‘s3Prefix’ (for AWS Batch).
’blobStorageAccountName’, ‘blobContainerName’, ‘blobName’ (for other platforms).
- For ‘globPattern’: Contains nested keys such as ‘folder’, which includes:
’s3BucketName’, ‘s3Prefix’ (for AWS Batch).
’blobStorageAccountName’, ‘blobContainerName’, ‘blobPrefix’ (for other platforms).
param_kind_map (dict) – A mapping of parameter kinds to their corresponding keys in the param dictionary.
execution_platform (str) – The platform on which the execution is taking place. Expected values include “Batch AWS” or other non-AWS platforms.
storage_provider (str) – Either s3:// or az://
mode (str) – For “parameters” is creating the ‘*.config’ file and it adds the complete path, for “asis” leaves the constructed path as generated from the API
- Returns:
str –
For ‘dataItem’ on AWS Batch: “s3BucketName/s3ObjectKey” or “s3BucketName/s3Prefix”.
For ‘dataItem’ on other platforms: “blobStorageAccountName/blobContainerName/blobName”.
For ‘globPattern’ on AWS Batch: “s3BucketName/s3Prefix/globPattern”.
For ‘globPattern’ on other platforms: “blobStorageAccountName/blobContainerName/blobPrefix/globPattern”.
- Return type:
A constructed storage path based on the parameter kind and execution platform.