How to use the planet.scripts.util.echo_json_response function in planet

To help you get started, we’ve selected a few planet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github planetlabs / planet-client-python / planet / scripts / v1.py View on Github external
def saved_search(search_id, sort, pretty, limit):
    '''Execute a saved search'''
    sid = read(search_id)
    cl = clientv1()
    page_size = min(limit, MAX_PAGE_SIZE)
    echo_json_response(call_and_wrap(
        cl.saved_search, sid, page_size=page_size, sort=sort
    ), limit=limit, pretty=pretty)
github planetlabs / planet-client-python / planet / scripts / v1.py View on Github external
def search_mosaics(name, bbox, rbox, limit, pretty):
    '''Get quad IDs and information for a mosaic'''
    bbox = bbox or rbox
    cl = clientv1()
    mosaic, = cl.get_mosaic_by_name(name).items_iter(1)
    response = call_and_wrap(cl.get_quads, mosaic, bbox)
    echo_json_response(response, pretty, limit)
github planetlabs / planet-client-python / planet / scripts / v1.py View on Github external
def get_collection_info(subscription_id, pretty):
    '''Get metadata for specific collection.'''
    cl = clientv1()
    sub_info = cl.get_collection_info(subscription_id)
    echo_json_response(sub_info, pretty)
github planetlabs / planet-client-python / planet / scripts / v1.py View on Github external
def cancel_order(order_id, pretty):
    '''Cancel a running order by given order ID'''
    cl = clientv1()
    echo_json_response(call_and_wrap(cl.cancel_order, order_id), pretty)
github planetlabs / planet-client-python / planet / scripts / v1.py View on Github external
def list_feeds(pretty, limit, stats):
    '''List all subscriptions user has access to.'''
    cl = clientv1()
    response = cl.list_analytic_feeds(stats)
    echo_json_response(response, pretty, limit)
github planetlabs / planet-client-python / planet / scripts / v1.py View on Github external
def create_search(pretty, **kw):
    '''Create a saved search'''
    req = search_req_from_opts(**kw)
    cl = clientv1()
    echo_json_response(call_and_wrap(cl.create_search, req), pretty)
github planetlabs / planet-client-python / planet / scripts / v1.py View on Github external
def get_order(order_id, pretty):
    '''Get order request for a given order ID'''
    cl = clientv1()
    echo_json_response(call_and_wrap(cl.get_individual_order, order_id),
                       pretty)
github planetlabs / planet-client-python / planet / scripts / v1.py View on Github external
def stats(pretty, **kw):
    '''Get search stats'''
    req = search_req_from_opts(**kw)
    cl = clientv1()
    echo_json_response(call_and_wrap(cl.stats, req), pretty)
github planetlabs / planet-client-python / planet / scripts / v1.py View on Github external
def conformance(pretty):
    '''
    Details about WFS3 conformance.
    :param pretty:
    :return:
    '''
    cl = clientv1()
    response = cl.wfs_conformance()
    echo_json_response(response, pretty)
github planetlabs / planet-client-python / planet / scripts / v1.py View on Github external
def mosaic_info(name, pretty):
    '''Get information for a specific mosaic'''
    cl = clientv1()
    echo_json_response(call_and_wrap(cl.get_mosaic_by_name, name), pretty)