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.

Parameters
  • carol_frompycarol.Carol pycarol.Carol instance to copy from

  • carol_topycarol.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, overwrite_schema=False)[source]

Copy Connectors, Stagings and mappings.

Parameters
  • 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_connectorbool default False Overwrite connector if it already exists. It will deleate the connector and all stagings in this connector:

  • add_to_connectorbool default False If the connector already exists, it will add to the connector.

  • change_name_dictdict If one wants to change the connector name, this dict is the mapping from the old to the new name.

  • copy_mappingbool default True Copy staging mappings.

  • overwrite_schemabool default False overwrite if the mapping already exists.

copy_data_models(dm_list=None, publish=True, overwrite=False, copy_all=False)[source]

Copy DataModels

Parameters
  • dm_listlist default None List of DataModels to copy

  • publishbool default True Publish copied DataModels

  • overwritebool default False Overwrite if already exists.

  • copy_allbool 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.

Parameters
  • named_query_list

  • copy_all

  • overwrite