kite/kite/api/v1/controllers/controller.py

38 lines
1.3 KiB
Python

# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import pecan
from kite.api.v1.controllers import group as group_controller
from kite.api.v1.controllers import key as key_controller
from kite.api.v1.controllers import ticket as ticket_controller
class Controller(object):
"""Version 1 API controller root."""
@staticmethod
def version_info():
return {'status': 'stable',
'id': 'v1.0',
'links': [{
'href': '%s/v1/' % pecan.request.host_url,
'rel': 'self'}]}
groups = group_controller.GroupController()
keys = key_controller.KeyController()
tickets = ticket_controller.TicketController()
@pecan.expose('json')
def index(self):
return {'version': self.version_info()}