Beispiel #1
0
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
Beispiel #2
0
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
Beispiel #3
0
def app_load(a, **kwargs):
    """
    Create an output for get_all_application call
    """
    pi = PageInfo(number_on_page=2, total=2)
    applist = [
        Application(application_name="App1"),
        Application(application_name="App2"),
        Application(application_name="App3")
    ]
    apo = ApplicationList(page_info=pi, response_list=applist)
    return apo
Beispiel #4
0
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
Beispiel #5
0
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
Beispiel #6
0
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
Beispiel #7
0
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
Beispiel #8
0
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
Beispiel #9
0
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
Beispiel #10
0
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
Beispiel #11
0
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
Beispiel #12
0
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
Beispiel #13
0
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
Beispiel #14
0
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