aboutsummaryrefslogtreecommitdiff
blob: 798c90d8a0d68a415bc7f525ab9c4bf642ba3de1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import helpers
from config import render, db

class Profile(object):
    def GET(self):
        profile_count = db.select('ENV', what='PROFILE, COUNT(UUID) AS HOSTS', group='PROFILE')
        profile_data = dict()
        for t in profile_count:
            profile_data[t['PROFILE']] = {'HOSTS':t['HOSTS']}
        if helpers.is_json_request():
            helpers.serialize(profile_data)
        else:
            return render.profile(profile_data)