Exemplo n.º 1
0
def identifier_create(args):
    """
    Create a new identifier
    """
    client = identifiers_client(config)
    args = clear_internal_args(vars(args))
    args = set_checksum_args(args)
    if args.get('locations'):
        args['location'] = args.pop('locations')
    return client.create_identifier(**args)
Exemplo n.º 2
0
def identifier_update(args):
    """
    Update the state of an identifier
    """
    client = identifiers_client(config)
    identifier_id = args.identifier
    args = clear_internal_args(vars(args))
    args = set_checksum_args(args)
    if args.get('locations'):
        args['location'] = args.pop('locations')
    return client.update_identifier(identifier_id, **args)
Exemplo n.º 3
0
def namespace_create(args):
    """
    Create a new namespace
    """
    client = identifiers_client(config)
    args = clear_internal_args(vars(args))
    # Convenience helper: If user doesn't specify a member
    # group, just use the same group as for admins.
    # This means all members will be admins.
    if 'creators' not in args:
        args['creators'] = args['admins']
    return client.create_namespace(**args)
Exemplo n.º 4
0
def namespace_update(args):
    """
    Update the properties of an existing namespace
    """
    client = identifiers_client(config)
    args = clear_internal_args(vars(args))

    # Convenience helper: If user doesn't specify a member
    # group, just use the same group as for admins.
    # This means all members will be admins.
    if 'creators' not in args:
        args['creators'] = args['admins']
    namespace_id = args.pop('namespace_id')
    return client.update_namespace(namespace_id, **args)
Exemplo n.º 5
0
def identifier_from_checksum(args):
    client = identifiers_client(config)
    return client.get_identifier_from_checksum(args.checksum, args.function)
Exemplo n.º 6
0
def identifier_display(args):
    """
    Display the state of an identifier
    """
    client = identifiers_client(config)
    return client.get_identifier(args.identifier)
Exemplo n.º 7
0
def namespace_delete(args):
    """
    Remove an existing namespace
    """
    client = identifiers_client(config)
    return client.delete_namespace(args.namespace_id)
Exemplo n.º 8
0
def namespace_display(args):
    """
    Display a namespace
    """
    client = identifiers_client(config)
    return client.get_namespace(args.namespace_id)