Esempio n. 1
0
def list_xfile_datasources(datasources):
    if not len(datasources):
        print("No datasources registered.")
        return
    print('datasources:')
    for src in datasources:
        print('%s%s:' % (tab(1), src.name))
        print('%sclass: %s' % (tab(2), src.classname))
Esempio n. 2
0
def list_quasr_templates(templates):
    if not len(templates):
        print('No templates registered.')
        return

    print('templates:')
    for t in templates:
        print('%s%s:' % (tab(1), t.name))
        for line in t.text.split('\n'):
            print(tab(2) + line)
Esempio n. 3
0
def list_ngst_targets(targets):
    if not len(targets):
        print('No targets registered.')
        return

    print('ingest_targets:')
    for t in targets:
        print('%s%s:' % (tab(1), t.name))
        print('%sdatastore: %s' % (tab(2), t.datastore_alias))
        print('%scheckpoint_interval: %s' % (tab(2), t.checkpoint_interval))
Esempio n. 4
0
def list_xfile_maps(maps):
    if not len(maps):
        print("No maps registered.")
        return

    print('maps:')
    for mapspec in maps:
        print('%s%s:' % (tab(1), mapspec.name))
        for field in mapspec.fields:
            print('%s- %s:' % (tab(2), field.name))
            for param in field.parameters:
                print('%s%s: %s' % (tab(3), param.name, param.value))
Esempio n. 5
0
def list_ngst_datastores(datastores):
    if not len(datastores):
        print('No datastores registered.')
        return

    print('datastores:')
    for ds in datastores:
        print('%s%s:' % (tab(1), ds.alias))
        print('%sclass: %s' % (tab(2), ds.classname))
        print(tab(2) + 'init_params:')
        for param in ds.init_params:
            print('%s- name: %s' % (tab(3), param.name))
            print('%s  value: %s' % (tab(3), param.value))
Esempio n. 6
0
def list_service_objects(service_objects):
    if not len(service_objects):
        print('No service objects registered.')
        return

    print('service_objects:')
    for so in service_objects:
        print('%s%s:' % (tab(1), so.alias))
        print('%sclass: %s' % (tab(2), so.classname))
        print('%sinit_params:' % tab(2))
        for p in so.init_params:
            print('%s- name: %s' % (tab(3), p.name))
            print('%s  value: %s' % (tab(3), p.value))
Esempio n. 7
0
def list_j2sqlgen_defaults(defaults_spec):
    if not len(defaults_spec.settings):
        print('No settings registered.')
        return

    print('defaults:')
    for key in defaults_spec.settings:
        param = defaults_spec.settings[key]
        print('%s%s: %s' % (tab(1), key, param.value))

    print('\n')
    print(tab(1) + 'column_type_map:')
    for k, v in defaults_spec.column_type_map.items():  # this is a dictionary
        print('%s%s: %s' % (tab(2), k, v))
Esempio n. 8
0
def list_quasr_jobs(jobs):
    if not len(jobs):
        print("No jobs registered.")
        return

    print('jobs:')
    for job in jobs:
        print('%s%s:' % (tab(1), job.name))
        print(tab(2) + 'input slots:')
        for slot in job.inputs:
            print('%s%s (%s)' % (tab(3), slot.name, slot.datatype))
        print('\n')
        print(tab(2) + 'output slots:')
        for slot in job.outputs:
            print('%s%s (%s)' % (tab(3), slot.name, slot.datatype))
        print('\n')
Esempio n. 9
0
def list_globals(global_settings):
    if not len(global_settings):
        print('No globals registered.')
        return

    print('globals:')
    for gs in global_settings:
        print('%s%s: %s' % (tab(1), gs.name, gs.value))
Esempio n. 10
0
def list_j2sqlgen_tables(tablemap_specs):
    print('tables:')
    for spec in tablemap_specs:
        print('%s%s:' % (tab(1), spec.table_name))
        if spec.rename_to:
            print(tab(2) + 'rename_to: ' + spec.rename_to)

        if len(spec.column_settings.keys()):
            print(tab(2) + 'column_settings:')
            for key, settings in spec.column_settings.items():
                print(tab(3) + key + ':')
                # the value of <settings> is a dictionary
                for name, value in settings.items():
                    print('%s%s: %s' % (tab(4), name, value))

        if len(spec.column_rename_map.keys()):
            print(tab(2) + 'column_name_map:')
            for key, value in spec.column_rename_map.items():
                print('%s%s: %s' % (tab(3), key, str(value)))

        print('\n')