blob: 3a91baa2c3468fcfc84b5dd45aeadb65835ff29b [file] [log] [blame]
Alex Klein54e38e32019-06-21 14:54:17 -06001# -*- coding: utf-8 -*-
2# Copyright 2019 The Chromium OS Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6"""API information controller."""
7
8from __future__ import print_function
9
10from chromite.api import router as router_lib
11
Alex Klein104b0672019-06-28 15:43:00 -060012# API version number.
13# The major version MUST be updated on breaking changes.
14VERSION_MAJOR = 1
15# The minor and bug versions are not currently utilized, but put in place
16# to simplify future requirements.
17VERSION_MINOR = 0
18VERSION_BUG = 0
19
Alex Klein54e38e32019-06-21 14:54:17 -060020
21def GetMethods(_input_proto, output_proto):
22 """List all of the registered methods."""
23 router = router_lib.GetRouter()
24 for method in router.ListMethods():
25 output_proto.methods.add().method = method
Alex Klein104b0672019-06-28 15:43:00 -060026
27
28def GetVersion(_input_proto, output_proto):
29 """Get the Build API major version number."""
30 output_proto.version.major = VERSION_MAJOR
31 output_proto.version.minor = VERSION_MINOR
32 output_proto.version.bug = VERSION_BUG