Пример #1
0
def get_boot(mercury_id):
    """

    :param mercury_id:
    :return:
    """
    return jsonify(
        inventory_client.get_one(mercury_id, projection={
            'boot': 1,
            '_id': 0
        }))
Пример #2
0
def get_inventory(mercury_id):
    """
    Get one inventory object by mercury_id.

    :param mercury_id: Device mercury id.
    :return: Inventory object.
    """
    projection = get_projection_from_qsa()
    data = inventory_client.get_one(mercury_id, projection=projection)
    if not data:
        message = 'mercury_id {} does not exist in inventory'
        raise HTTPError(message.format(mercury_id), status_code=404)

    return jsonify(data)