Chromium Code Reviews| Index: appengine/swarming/handlers_endpoints.py |
| diff --git a/appengine/swarming/handlers_endpoints.py b/appengine/swarming/handlers_endpoints.py |
| index 0b353a30c5ba9424b2e5d0cd2883816d5b25c396..27121119a8ae5e70f4a793b00ea0ca5eec9f5ed3 100644 |
| --- a/appengine/swarming/handlers_endpoints.py |
| +++ b/appengine/swarming/handlers_endpoints.py |
| @@ -644,7 +644,7 @@ class SwarmingBotsService(remote.Service): |
| """Counts number of bots with given dimensions.""" |
| logging.info('%s', request) |
| now = utils.utcnow() |
| - q = bot_management.BotInfo.query().order() |
| + q = bot_management.BotInfo.query() |
| for d in request.dimensions: |
| parts = d.split(':', 1) |
| if len(parts) != 2 or any(i.strip() != i or not i for i in parts): |
| @@ -665,6 +665,23 @@ class SwarmingBotsService(remote.Service): |
| busy=f_busy.get_result(), |
| now=now) |
| + @gae_ts_mon.instrument_endpoint() |
| + @auth.endpoints_method( |
| + message_types.VoidMessage, swarming_rpcs.BotsDimensions, |
| + http_method='GET') |
| + @auth.require(acl.is_privileged_user) |
| + def dimensions(self, request): |
| + """Returns the cached set of dimensions currently in use in the fleet.""" |
| + logging.info('%s', request) |
|
M-A Ruel
2016/08/05 18:41:45
not really useful since there's no request, remove
kjlubick
2016/08/05 18:51:54
Done.
|
| + dims = bot_management.DimensionAggregation.KEY.get() |
| + fd = [ |
| + swarming_rpcs.StringListPair(key=d.dimension,value=d.values) |
|
M-A Ruel
2016/08/05 18:41:45
space after ,
kjlubick
2016/08/05 18:51:54
Done.
|
| + for d in dims.dimensions |
| + ] |
| + return swarming_rpcs.BotsDimensions( |
|
M-A Ruel
2016/08/05 18:41:45
probably fits one line
kjlubick
2016/08/05 18:51:54
Done.
|
| + bots_dimensions=fd, |
| + ts=dims.ts) |
| + |
| def get_routes(): |
| return ( |