pycarol.connectors¶
-
class
pycarol.connectors.Connectors(carol)[source]¶ This class handle all APIs related to Carol connectors
Args:
carol: class: pycarol.Carol-
create(name, label=None, group_name='Others', overwrite=False)[source]¶ Create a connector
Args:
- name: ‘str’
- Connector name
- label: ‘str’
- Connector label in UI
- group_name: str default “Others”
- Connector group name in UI
- overwrite: bool default False
- Overwrite if already exists.
-
delete_by_id(mdm_id, force_deletion=True)[source]¶ Delete Connector by ID
Args:
- mdm_id: str` #TODO: Rename to connector_id
- Connector ID
- force_deletion: bool default True
- Force the deletion
Returns: None
-
delete_by_name(name, force_deletion=True)[source]¶ Delete connector by name
Args:
- name: str
- Connector name
- force_deletion: bool default True
- Force the deletion
Returns: None
-
find_by_staging(staging_name=None)[source]¶ Find connector given a staging table
Args:
- staging_name: str default None
- Staging table name
- Returns: dict
- Connector information
-
get_all(offset=0, page_size=-1, sort_order='ASC', sort_by=None, include_connectors=False, include_mappings=False, include_consumption=False, print_status=True, save_results=False, filename='connectors.json')[source]¶ Get all connectors.
Args:
- offset: int, default 0
- Offset for the response.
- page_size: int, default 1000
- Number of records in each call.
- sort_by: str default None
- Field to sort by
- sort_order: str, default ASC
- Sort Order. Possible values “ASC” and “DESC”
- include_connectors: bool default False
- Include connector information
- include_mappings: bool default False
- Include mapping information
- include_consumption: bool default False
- Include consumption information
- print_status: bool default True
- Print status of the request.
- save_results: bool default False
- If save json with the results.
- filename: str default None
- Filename to save
- Returns: dict
- Connector information
-
get_by_id(id, errors='raise')[source]¶ Get connector information using the connector name
Args:
- id: ‘str’
- Connector ID
- errors: {‘ignore’, ‘raise’}, default ‘raise’
- If ‘raise’, then invalid request will raise an exception If ‘ignore’, then invalid request will return the request response
- Returns: dict
- connector information.
-
get_by_name(name, errors='raise')[source]¶ Get connector information using the connector name
Args:
- name: ‘str’
- Connector Name
- errors: {‘ignore’, ‘raise’}, default ‘raise’
- If ‘raise’, then invalid request will raise an exception If ‘ignore’, then invalid request will return the request response
- Returns: dict
- connector information.
-
get_dm_mappings(connector_id=None, connector_name=None, staging_name=None, dm_id=None, dm_name=None, reverse_mapping=False, offset=0, page_size=1000, sort_by=None, sort_order='ASC', all_connectors=False)[source]¶ Get data models mappings information.
Args:
- connector_id: str, default None
- Connector Id
- connector_name: str, default None
- Connectot name
- staging_name: str, default None
- Staging name
- dm_id: str, default None
- Data model Id
- dm_name: str, default None
- Data model name
- reverse_mapping: bool, default False
- If to return the reverse mapping.
- offset: int, default 0
- Offset for the response.
- page_size: int, default 1000
- Number of records in each call.
- sort_by: str default None
- Field to sort by
- sort_order: str, default ASC
- Sort Order. Possible values “ASC” and “DESC”
- all_connectors: bool, default False
- It will return all the mapping for all connectors/stagings
- Returns: dict
- Mapping json definition
-
staging_to_connectors_map()[source]¶ Create a dictionary where the mapping of connectors and stagings.
- Returns: dict
- Dict
-
stats(connector_id=None, connector_name=None, all_connectors=False)[source]¶ Get connector stats
Args:
- connector_id: str, default None
- Connector Id
- connector_name: str, default None
- Connectot name
- all_connectors: bool default False
- Get from all connectors.
- Returns: dict
- Dict with the status of the connectors.
-