Exemple #1
0
def do_application_create(args, config):
    record = args.record
    application_type = Application.Type.Value(args.type)

    client = create_client(config)
    response = client.application_create(record, application_type)
    print('Response: {}'.format(response))
def do_application_create(args, config):
    record = args.record
    application_type = Application.Type.Value(args.type)

    client = create_client(config)
    response = client.application_create(record, application_type)
    print('Response: {}'.format(response))
Exemple #3
0
def do_agent_list(args, config):
    client = create_client(config)
    agents = client.agent_list()

    if agents is not None:
        fmt = '{:64} {}'
        print('AGENTS')
        print(fmt.format('PUBLIC KEY', 'NAME'))
        for agent in agents:
            print(fmt.format(agent.identifier, agent.name))
    else:
        print('No Agents Found.')
Exemple #4
0
def do_agent_list(args, config):
    client = create_client(config)
    agents = client.agent_list()

    if agents is not None:
        fmt = '{:64} {}'
        print('AGENTS')
        print(fmt.format('PUBLIC KEY', 'NAME'))
        for agent in agents:
            print(fmt.format(agent.identifier, agent.name))
    else:
        print('No Agents Found.')
Exemple #5
0
def do_agent_show(args, config):
    name = args.name

    client = create_client(config)
    agent = client.agent_get(name)

    if agent is not None:
        fmt = '{:15}: {}'
        print('AGENT')
        print(fmt.format('PUBLIC KEY', agent.identifier))
        print(fmt.format('NAME', agent.name))

    else:
        print('Agent not found: {}'.format(name))
Exemple #6
0
def do_agent_show(args, config):
    name = args.name

    client = create_client(config)
    agent = client.agent_get(name)

    if agent is not None:
        fmt = '{:15}: {}'
        print('AGENT')
        print(fmt.format('PUBLIC KEY', agent.identifier))
        print(fmt.format('NAME', agent.name))

    else:
        print('Agent not found: {}'.format(name))
Exemple #7
0
def do_record_show(args, config):
    name = args.name

    client = create_client(config)
    record = client.record_get(name)

    if record is not None:
        fmt = '{}: {}'
        print('RECORD')
        print(fmt.format('IDENTIFIER', record.identifier))
        print(fmt.format('CREATED', record.creation_time))
        print(fmt.format('OWNER', record.owners[-1].agent_identifier))
        print(fmt.format('CUSTODIAN', record.custodians[-1].agent_identifier))
        print(fmt.format('FINAL', bool(record.final)))
    else:
        print('Record not found: {}'.format(name))
Exemple #8
0
def do_record_show(args, config):
    name = args.name

    client = create_client(config)
    record = client.record_get(name)

    if record is not None:
        fmt = '{}: {}'
        print('RECORD')
        print(fmt.format('IDENTIFIER', record.identifier))
        print(fmt.format('CREATED', record.creation_time))
        print(fmt.format('OWNER', record.owners[-1].agent_identifier))
        print(fmt.format('CUSTODIAN', record.custodians[-1].agent_identifier))
        print(fmt.format('FINAL', bool(record.final)))
    else:
        print('Record not found: {}'.format(name))
Exemple #9
0
def do_record_list(args, config):
    client = create_client(config)
    records = client.record_list()

    if records is not None:
        fmt = '{:20}{:10}{:64}{:64}{}'
        print('RECORDS')
        print(fmt.format('NAME', 'CREATED', 'OWNER', 'CUSTODIAN', 'FINAL'))
        for record in records:
            print(
                fmt.format(record.identifier, record.creation_time,
                           record.owners[-1].agent_identifier,
                           record.custodians[-1].agent_identifier,
                           bool(record.final)))
    else:
        print('No Records Found.')
Exemple #10
0
def do_record_list(args, config):
    client = create_client(config)
    records = client.record_list()

    if records is not None:
        fmt = '{:20}{:10}{:64}{:64}{}'
        print('RECORDS')
        print(fmt.format('NAME', 'CREATED', 'OWNER', 'CUSTODIAN', 'FINAL'))
        for record in records:
            print(fmt.format(
                record.identifier,
                record.creation_time,
                record.owners[-1].agent_identifier,
                record.custodians[-1].agent_identifier,
                bool(record.final)))
    else:
        print('No Records Found.')
def do_application_list(args, config):
    client = create_client(config)

    applications = client.application_list()

    if applications is not None:
        fmt = '{:20}{:64} {:10}{:10}{:10}{}'
        print('APPLICATIONS')
        print(fmt.format('RECORD', 'APPLICANT',
                         'CREATED', 'TYPE', 'STATUS', 'TERMS'))
        for application in applications:
            print(fmt.format(application.record_identifier,
                             application.applicant,
                             application.creation_time,
                             Application.Type.Name(application.type),
                             Application.Status.Name(application.status),
                             application.terms))
    else:
        print('No Applications Found.')
Exemple #12
0
def do_application_list(args, config):
    client = create_client(config)

    applications = client.application_list()

    if applications is not None:
        fmt = '{:20}{:64} {:10}{:10}{:10}{}'
        print('APPLICATIONS')
        print(
            fmt.format('RECORD', 'APPLICANT', 'CREATED', 'TYPE', 'STATUS',
                       'TERMS'))
        for application in applications:
            print(
                fmt.format(application.record_identifier,
                           application.applicant, application.creation_time,
                           Application.Type.Name(application.type),
                           Application.Status.Name(application.status),
                           application.terms))
    else:
        print('No Applications Found.')
Exemple #13
0
def do_application_show(args, config):
    record = args.record
    applicant = args.applicant
    application_type = Application.Type.Value(args.type)

    client = create_client(config)
    application = client.application_get(record, applicant, application_type)

    if application is not None:
        fmt = '{:15}: {}'
        print('APPLICATION')
        print(fmt.format('RECORD', application.record_identifier))
        print(fmt.format('APPLICANT', application.applicant))
        print(fmt.format('CREATED', application.creation_time))
        print(fmt.format('TYPE', Application.Type.Name(application.type)))
        print(fmt.format('STATUS',
                         Application.Status.Name(application.status)))
        print(fmt.format('TERMS', application.terms))
    else:
        print('Application not found: {} {} {}'.format(
            record, applicant, Application.Status.Name(application_type)))
def do_application_show(args, config):
    record = args.record
    applicant = args.applicant
    application_type = Application.Type.Value(args.type)

    client = create_client(config)
    application = client.application_get(record, applicant, application_type)

    if application is not None:
        fmt = '{:15}: {}'
        print('APPLICATION')
        print(fmt.format('RECORD', application.record_identifier))
        print(fmt.format('APPLICANT', application.applicant))
        print(fmt.format('CREATED', application.creation_time))
        print(fmt.format('TYPE', Application.Type.Name(application.type)))
        print(fmt.format('STATUS',
                         Application.Status.Name(application.status)))
        print(fmt.format('TERMS', application.terms))
    else:
        print('Application not found: {} {} {}'.format(
            record,
            applicant,
            Application.Status.Name(application_type)))
Exemple #15
0
def do_agent_create(args, config):
    name = args.name

    client = create_client(config)
    response = client.agent_create(name)
    print('Response: {}'.format(response))
Exemple #16
0
def do_agent_create(args, config):
    name = args.name

    client = create_client(config)
    response = client.agent_create(name)
    print('Response: {}'.format(response))
Exemple #17
0
def do_record_create(args, config):
    identifier = args.identifier

    client = create_client(config)
    response = client.record_create(identifier)
    print('Response: {}'.format(response))
Exemple #18
0
def do_record_create(args, config):
    identifier = args.identifier

    client = create_client(config)
    response = client.record_create(identifier)
    print('Response: {}'.format(response))