def fileconnector_load(a, **kwargs): """ Create an output for get_all_file_connectors call """ pi = PageInfo(number_on_page=0, total=0) dbrpo = FileConnectorList(page_info=pi, response_list=[]) return dbrpo
def tablemeta_load(a, **kwargs): """ Create an output for get_all_table_metadata call """ if kwargs.get('ruleset_id') == 1: pi = PageInfo(number_on_page=2, total=2) tables = [ TableMetadata(table_metadata_id=1, table_name="EMP", ruleset_id=1), TableMetadata(table_metadata_id=2, table_name="DEPT", ruleset_id=1)] tablesrpo = TableMetadataList(page_info=pi, response_list=tables) else: pi = PageInfo(number_on_page=0, total=0) tablesrpo = TableMetadataList(page_info=pi, response_list=[]) return tablesrpo
def meta_load(a, **kwargs): """ Create an output for get_all_column_metadata call """ pi = PageInfo(number_on_page=2, total=2) if kwargs.get('table_metadata_id') == 1: columnfortable = [ColumnMetadata( column_metadata_id=1, table_metadata_id=1, column_name="ENAME", is_masked=True, data_type="VARCHAR2", column_length=30, is_foreign_key=True, algorithm_name="LastNameLookup", domain_name="LAST_NAME")] elif kwargs.get('table_metadata_id') == 2: columnfortable = [ColumnMetadata( column_metadata_id=1, table_metadata_id=2, column_name="DNAME", is_masked=True, data_type="VARCHAR2", column_length=66, is_index=True, algorithm_name="TestNameLookup", domain_name="TEST_NAME")] elif kwargs.get('table_metadata_id') == 101: columnfortable = [ColumnMetadata( column_metadata_id=1, table_metadata_id=101, data_type="VARCHAR2", column_length=30, column_name="ENAME", is_masked=False)] elif kwargs.get('table_metadata_id') == 102: columnfortable = [ColumnMetadata( column_metadata_id=1, table_metadata_id=102, data_type="VARCHAR2", column_length=66, column_name="DNAME", is_masked=False)] clrpo = ColumnMetadataList(page_info=pi, response_list=columnfortable) return clrpo
def fileruleset_load(a, **kwargs): """ Create an output for get_all_file_rulesets call """ pi = PageInfo(number_on_page=0, total=0) dbrpo = FileRulesetList(page_info=pi, response_list=[]) return dbrpo
def fileformat_load(a, **kwargs): """ Create an output for get_all_file_formats call """ pi = PageInfo(number_on_page=2, total=2) ff = [FileFormat(file_format_id=1, file_format_name="testformat", file_format_type="DELIMITED")] ffrpo = FileFormatList(page_info=pi, response_list=ff) return ffrpo
def dbconnector_load(a, **kwargs): """ Create an output for get_all_database_connectors call """ pi = PageInfo(number_on_page=2, total=2) dbconnector = [DatabaseConnector(database_connector_id=1, connector_name="DB connector", environment_id=1, database_type="ORACLE")] dbcpo = DatabaseConnectorList(page_info=pi, response_list=dbconnector) return dbcpo
def fileconnector_load(a, **kwargs): """ Create an output for get_all_file_connectors call """ pi = PageInfo(number_on_page=1, total=1) fileconnector = [FileConnector(file_connector_id=1, connector_name="File connector", environment_id=1, file_type="DELIMITED")] filerpo = FileConnectorList(page_info=pi, response_list=fileconnector) return filerpo
def filemeta_load(a, **kwargs): """ Create an output for get_all_file_metadata call """ pi = PageInfo(number_on_page=2, total=2) # files = [FileMetadata(file_metadata_id=2, file_name="FILE", ruleset_id=2)] filesrpo = FileMetadataList(page_info=pi, response_list=[]) return filesrpo
def job_load(a, **kwargs): """ Create an output for get_all_application call """ pi = PageInfo(number_on_page=2, total=2) joblist = [MaskingJob(masking_job_id=1, job_name="Job1", ruleset_id=1, created_by="delphix_admin", email="*****@*****.**")] jpo = MaskingJobList(page_info=pi, response_list=joblist) return jpo
def app_load(a, b, **kwargs): """ Create an output for get_all_application call """ pi = PageInfo(number_on_page=2, total=2) applist = [Application("App1"), Application("App2")] apo = ApplicationList(page_info=pi, response_list=applist) return apo
def env_load(a, **kwargs): """ Create an output for get_all_environments call """ pi = PageInfo(number_on_page=2, total=2) envlist = [Environment(environment_id=1, environment_name="Env1", application="App1", purpose="MASK")] epo = EnvironmentList(page_info=pi, response_list=envlist) return epo
def dbruleset_load(a, **kwargs): """ Create an output for get_all_database_rulesets call """ pi = PageInfo(number_on_page=2, total=2) dbruleset = [DatabaseRuleset(database_ruleset_id=1, ruleset_name="DB Ruleset1", database_connector_id=1)] dbrpo = DatabaseRulesetList(page_info=pi, response_list=dbruleset) return dbrpo
def fileruleset_load(a, **kwargs): """ Create an output for get_all_file_rulesets call """ pi = PageInfo(number_on_page=1, total=1) fileruleset = [FileRuleset(file_ruleset_id=2, ruleset_name="File Ruleset1", file_connector_id=1)] filerpo = FileRulesetList(page_info=pi, response_list=fileruleset) return filerpo
def filemeta_load(a, **kwargs): """ Create an output for get_all_file_metadata call """ if kwargs.get('ruleset_id') == 2: pi = PageInfo(number_on_page=1, total=1) files = [FileMetadata( file_metadata_id=2, file_format_id=1, file_name="FILE", ruleset_id=2)] filesrpo = FileMetadataList(page_info=pi, response_list=files) else: pi = PageInfo(number_on_page=0, total=0) filesrpo = FileMetadataList(page_info=pi, response_list=[]) return filesrpo
def execution_load(a, **kwargs): """ Create an output for get_all_executions call """ pi = PageInfo(number_on_page=2, total=2) execlist = [Execution(execution_id=1, job_id=1, status="SUCCEEDED", rows_masked=10, rows_total=10, start_time=datetime.datetime(2018, 9, 01, 01, 00, 00), end_time=datetime.datetime(2018, 9, 01, 01, 10, 00))] epo = ExecutionList(page_info=pi, response_list=execlist) return epo
def domain_load(a, **kwargs): """ Create an output for get_all_file_formats call """ pi = PageInfo(number_on_page=2, total=2) ff = [ Domain(domain_name="DOMAIN1", classification="CUSTOMER", default_algorithm_code="ALG"), Domain(domain_name="DOMAIN2", classification="CUSTOMER", default_algorithm_code="ALG") ] ffrpo = DomainList(page_info=pi, response_list=ff) return ffrpo
def filefieldmeta_load(a, **kwargs): """ Create an output for get_all_column_metadata call """ pi = PageInfo(number_on_page=1, total=1) if kwargs.get('file_format_id') == 1: columnforfile = [ FileFieldMetadata(field_name="Col1", field_position_number=1) ] clrpo = FileFieldMetadataList(page_info=pi, response_list=columnforfile) return clrpo