示例#1
0
def list_tiers(ctx):
    """
    List tiers
    """
    return query_backend.run(**ctx.obj['blueprint'],
                             cwd=os.getcwd(),
                             query_name='list_tiers')
示例#2
0
def list_components(ctx):
    """
    List components
    """
    return query_backend.run(**ctx.obj['blueprint'],
                             cwd=os.getcwd(),
                             query_name='list_components')
示例#3
0
def list_occurrences(ctx, **query_params):
    """
    List occurrences
    """
    return query_backend.run(**ctx.obj['blueprint'],
                             cwd=os.getcwd(),
                             query_name='list_occurrences',
                             query_params=query_params)
示例#4
0
def get(ctx, query_text):
    """
    JMESPath query
    """
    result = query_backend.run(**ctx.obj['blueprint'],
                               cwd=os.getcwd(),
                               query_text=query_text)
    click.echo(json.dumps(result, indent=4))
示例#5
0
def describe_occurrence_resources(ctx):
    """
    Describes occurrence resources
    """
    result = query_backend.run(**ctx.obj['blueprint'],
                               cwd=os.getcwd(),
                               query_name='describe_occurrence_resources',
                               query_params=ctx.obj['query_params'])
    click.echo(json.dumps(result, indent=4))
示例#6
0
def describe_occurrence_attributes(ctx):
    """
    Describes occurrence attributes
    """
    result = query_backend.run(**ctx.obj['blueprint'],
                               cwd=os.getcwd(),
                               query_name='describe_occurrence_attributes',
                               query_params=ctx.obj['query_params'])
    return result
示例#7
0
def describe_occurrence_get(ctx, query_text):
    """
    JMESPath subquery on the described occurrence data
    """
    result = query_backend.run(**ctx.obj['blueprint'],
                               cwd=os.getcwd(),
                               query_name='describe_occurrence',
                               query_params=ctx.obj['query_params'],
                               sub_query_text=query_text)
    click.echo(json.dumps(result, indent=4))
示例#8
0
def describe_occurrence(ctx, **query_params):
    """
    Describes occurrence
    """
    if ctx.invoked_subcommand is not None:
        ctx.obj['query_params'] = query_params
        return
    result = query_backend.run(**ctx.obj['blueprint'],
                               cwd=os.getcwd(),
                               query_name='describe_occurrence',
                               query_params=query_params)
    click.echo(json.dumps(result, indent=4))