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..2cea3ae5cfe349ea27bec6b127c14e4b93dda5d2 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,21 @@ 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) |
| + dims = bot_management.DimensionAggregation.KEY.get() |
| + fd = [swarming_rpcs.StringListPair( |
|
M-A Ruel
2016/08/05 18:06:01
same about alignment.
you could probably inline i
kjlubick
2016/08/05 18:28:42
Done. No inline.
|
| + key=d.dimension, |
| + value=d.values) for d in dims.dimensions] |
| + return swarming_rpcs.BotsDimensions( |
| + bots_dimensions=fd) |
|
M-A Ruel
2016/08/05 18:06:01
add ts=dims.ts
kjlubick
2016/08/05 18:28:42
ts added to swarming_rpcs.BotsDimensions as well.
|
| + |
| def get_routes(): |
| return ( |