robocorp-storage
module robocorp.storage
Source: __init__.py:0
function list_assets
Source: __init__.py:45
List all the existing assets.
Returns: A list of available assets' names
function delete_asset
Source: __init__.py:54
Delete an asset by providing its name
.
This operation cannot be undone.
Args:
name
: Asset to delete
Raises:
AssetNotFound
: Asset with the given name does not exist
function get_text
Source: __init__.py:94
Return the given asset as text.
Arguments:
name
: Name of asset
Returns: Asset content as text
Raises:
AssetNotFound
: No asset defined with given name
function get_json
Source: __init__.py:110
Return the given asset as a deserialized JSON object.
Arguments:
name
: Name of asset**kwargs
: Additional parameters forjson.loads
Returns: Asset content as a Python object (dict, list etc.)
Raises:
AssetNotFound
: No asset defined with given nameJSONDecodeError
: Asset was not valid JSON
function get_file
Source: __init__.py:128
Fetch the given asset and store it in a file.
Arguments:
name
: Name of assetpath
: Destination path for downloaded fileexist_ok
: Overwrite file if it already exists
Returns: Path to created file
Raises:
AssetNotFound
: No asset defined with given nameFileExistsError
: Destination already exists
function get_bytes
Source: __init__.py:153
Return the given asset as bytes.
Arguments:
name
: Name of asset
Returns: Asset content as bytes
Raises:
AssetNotFound
: No asset defined with given name
function set_text
Source: __init__.py:184
Create or update an asset to contain the given string.
Arguments:
name
: Name of assettext
: Text content for assetwait
: Wait for asset to update
function set_json
Source: __init__.py:197
Create or update an asset to contain the given object, serialized as JSON.
Arguments:
name
: Name of assetvalue
: Value for asset, e.g. dict or listwait
: Wait for asset to update**kwargs
: Additional arguments forjson.dumps
function set_file
Source: __init__.py:211
Create or update an asset to contain the contents of the given file.
Arguments:
name
: Name of assetpath
: Path to filecontent_type
: Content type (or mimetype) of file, detected automatically from file extension if not definedwait
: Wait for asset to update
function set_bytes
Source: __init__.py:241
Create or update an asset to contain the given bytes.
Arguments:
name
: Name of assetdata
: Raw contentcontent_type
: Content type (or mimetype) of assetwait
: Wait for asset to update
exception AssetNotFound
Source: _client.py:30
No asset with given name/id found.
exception AssetUploadFailed
Source: _client.py:34
There was an unexpected error while uploading an asset.