Skip to content
Snippets Groups Projects
default.py 432 B
import pkg_resources

from flask import Blueprint, jsonify
from inventory_provider.routes import common

routes = Blueprint("inventory-data-default-routes", __name__)

API_VERSION = '0.1'


@routes.route("/version", methods=['GET', 'POST'])
@common.require_accepts_json
def version():
    return jsonify({
        'api': API_VERSION,
        'module':
            pkg_resources.get_distribution('inventory_provider').version
    })