pycarol.tools.clone_tenant

Allow to copy DataModels, NamedQueries, Connectors, Staging and mappingns from one tenant to another.

class pycarol.tools.clone_tenant.CloneTenant(carol_from, carol_to)[source]

Clone entities from one tenant to a second tenant.

Args:

carol_from: pycarol.Carol
pycarol.Carol instance to copy from
carol_to: pycarol.Carol
pycarol.Carol instance to copy to
copy_connectors(conectors_map, map_type='name', overwrite_connector=False, add_to_connector=True, change_name_dict=None, copy_mapping=True, overwrite_schema=False)[source]

Copy Connectors, Stagings and mappings.

Args:

conectors_map: dict

dictionary mapping the connector and stagings to be copied. If map_type = name

dictionary of {connector_name_1 : [staging_name_1, staging_name_2, staging_name_3 …],
connector_name_2 : [staging_name_1, staging_name_2, staging_name_3 …] }
If map_type = connector_id
dictionary of {connector_id_1 : [staging_name_1, staging_name_2, staging_name_3 …],
connector_id_2 : [staging_name_1, staging_name_2, staging_name_3 …] }
map_type: ‘str’ default name
Type of mapping. Possible values: name and connector_id
overwrite_connector: bool default False
Overwrite connector if it already exists. It will deleate the connector and all stagings in this connector:
add_to_connector: bool default False
If the connector already exists, it will add to the connector.
change_name_dict: dict
If one wants to change the connector name, this dict is the mapping from the old to the new name.
copy_mapping: bool default True
Copy staging mappings.
overwrite_schema: bool default False
overwrite if the mapping already exists.
copy_data_models(dm_list=None, publish=True, overwrite=False, copy_all=False)[source]

Copy DataModels

Args:

dm_list: list default None
List of DataModels to copy
publish: bool default True
Publish copied DataModels
overwrite: bool default False
Overwrite if already exists.
copy_all: bool default False
Copy all DataModels. If no list passes, use this to copy all DataModels.
copy_named_query(named_query_list=None, copy_all=False, overwrite=False)[source]

Copy named queries.

Args:
named_query_list: copy_all: overwrite: