pycarol.apps
Carol app funtionalities.
- class pycarol.apps.Apps(carol: Carol)[source]
Carol App instance.
- Parameters
carol – Carol() instance
- all(entity_space: str = 'PRODUCTION', page_size: int = 50, offset: int = 0, sort_order: str = 'ASC', sort_by: Optional[str] = None) Dict[source]
Get all app information in this environment.
- Parameters
entity_space –
Space to get the app from. Possible values:
PRODUCTION: For production.
WORKING: For Draft apps.
offset – Offset for pagination. Only used when scrollable=False.
page_size – Number of records downloaded in each pagination. The maximum value is 1000.
sort_order – Sort ascending (‘ASC’) vs. descending (‘DESC’).
sort_by – Name to sort by.
- Returns
All apps json definition
- Raises
NotMapAsCallResponseException if call_api return is not a dict. –
- build_docker_git(git_token: str, app_name: Optional[str] = None) List[source]
Build all images listed in the manifest definition.
- Parameters
git_token – Git token to be used to pull the files.
app_name – Carol app name. It will overwrite the app name used in Carol() initialization.
- Returns
List of task ids.
- download_app(app_version: str, app_name: Optional[str] = None, carolappname: Optional[str] = None, carolappversion: Optional[str] = None, file_path: str = 'carol.zip', extract: bool = False) None[source]
Download App artifacts.
- Parameters
app_name – Carol app name. It will overwrite the app name used in Carol() initialization.
app_version – App Version
carolappname – App Name. Deprecated. Use app_name
carolappversion – App Version. Deprecated. Use app_version
file_path – Path to save the zip file.
extract – Either extract the zip files or not.
- Raises
ValueError when app_version is not set. –
- edit_manifest(manifest: Dict, app_name: Optional[str] = None) Dict[source]
Edit manifest file.
- Parameters
manifest – Dictionary with the manifest
app_name – Carol app name. It will overwrite the app name used in Carol() initialization.
- Returns
Carol API response.
- Raises
NotMapAsCallResponseException if call_api return is not a dict. –
- get_app_details(app_name: Optional[str] = None, entity_space: str = 'PRODUCTION') Dict[source]
Find all information about an app.
This will fetch information about connector groups, AI process, descriptions, data models, etc.
- Parameters
app_name – App name to change the settings.
entity_space – WORKING or PRODUCTION
- Returns
Carol response.
- Raises
Exception if carol.app_name or parameter app_name are both None. –
NotMapAsCallResponseException if call_api return is not a dict. –
- get_by_id(app_id: str, entity_space: str = 'PRODUCTION') Dict[source]
Get app information by ID.
- Parameters
app_id – App id.
entity_space –
Space to get the app information from. Possible values
PRODUCTION: For production.
WORKING: For Draft apps.
- Returns
App info json definition.
- Raises
NotMapAsCallResponseException if call_api return is not a dict. –
- get_by_name(app_name: str, entity_space: str = 'PRODUCTION') Dict[source]
Get app information by app name.
- Parameters
app_name – App name.
entity_space –
Space to get the app information from. Possible values
PRODUCTION: For production.
WORKING: For Draft apps.
- Returns
App info json definition.
- Raises
NotMapAsCallResponseException if call_api return is not a dict. –
- get_git_process(app_name: Optional[str] = None) List[Dict][source]
Get Git processes defined in the manifest file.
- Parameters
app_name – Carol app name. It will overwrite the app name used in Carol() initialization.
- Returns
List of Dicts.
- Raises
NotListAsCallResponseException if call_api return is not a list. –
- get_manifest(app_name: Optional[str] = None) Dict[source]
Get manifest file.
- Parameters
app_name – Carol app name. It will overwrite the app name used in Carol() initialization.
- Returns
Manifest file.
- Raises
NotMapAsCallResponseException if call_api return is not a dict. –
- get_processes_info(app_name: Optional[str] = None, entity_space: str = 'WORKING', check_all_spaces: bool = True) Dict[source]
Get app processes information.
- Parameters
app_name – App name to change the settings.
entity_space – WORKING or PRODUCTION
check_all_spaces – Check all spaces.
- Returns
Process informations
- Raises
Exception if carol.app_name or parameter app_name are both None. –
NotMapAsCallResponseException if call_api return is not a dict. –
- get_settings(app_name: Optional[str] = None, app_id: Optional[str] = None, entity_space: str = 'PRODUCTION', check_all_spaces: bool = False) Dict[source]
Get settings from app.
Settings are the settings available in Carol’s UI.
- Parameters
app_name – App name, if None will get from app_id.
app_id – App id. Either app_name or app_id must be set.
entity_space –
Space to get the app settings from. Possible values
PRODUCTION: For production.
WORKING: For Draft apps.
check_all_spaces – Check all entity spaces.
- Returns
Settings.
- Raises
Exception if carol.app_name or parameter app_name are both None. –
NotMapAsCallResponseException if call_api return is not a dict. –
- get_subscribable_carol_apps() List[source]
Find all available apps to install in this env.
- Returns
list of apps.
- Raises
NotMapAsCallResponseException if call_api return is not a dict. –
- install_carol_app(app_name: Optional[str] = None, app_version: Optional[str] = None, connector_group: Optional[str] = None, publish: bool = True) Optional[Dict][source]
Install a carol app in an env.
- Parameters
app_name – App name to change the settings.
app_version – App version to install. If not specified, it will install the most recent.
connector_group – Connector Group to install.
publish – If publish the update.
- Returns
Carol task.
- Raises
NotMapAsCallResponseException if call_api return is not a dict. –
- start_app_process(process_name: str, app_name: Optional[str] = None) Dict[source]
Start a carol process by process name.
- Parameters
process_name – Process name.
app_name – App name to change the settings.
- Returns
task information.
- Raises
Exception if carol.app_name or parameter app_name are both None. –
NotMapAsCallResponseException if call_api return is not a dict. –
- update_setting_values(settings: Dict, app_name: Optional[str] = None) Dict[source]
Change Settings values in Carol.
- Parameters
settings – dict with settings: {“param1”: “value1”, “param2”: “value2”}
app_name – App name to change the settings.
- Returns
Carol Response.
- Raises
ValueError if settings type is not a dictionary. –
NotMapAsCallResponseException if call_api return is not a dict. –
- upload_file(filepath: str, app_name: Optional[str] = None) Dict[source]
Upload the app artifacts.
- Parameters
filepath – Folder path with artifacts (manifest.json or site)
app_name – App name
- Returns
Carol response.
- Raises
Exception if carol.app_name or parameter app_name are both None. –
NotMapAsCallResponseException if call_api return is not a dict. –