| Index: appengine/swarming/handlers_endpoints.py
|
| diff --git a/appengine/swarming/handlers_endpoints.py b/appengine/swarming/handlers_endpoints.py
|
| index 5ced064a782d16430703831503df9e22a64268ce..d3ebe6649b1f53b1443b2151f6f28970b00f842b 100644
|
| --- a/appengine/swarming/handlers_endpoints.py
|
| +++ b/appengine/swarming/handlers_endpoints.py
|
| @@ -620,7 +620,7 @@ class SwarmingBotsService(remote.Service):
|
| """
|
| logging.info('%s', request)
|
| now = utils.utcnow()
|
| - q = bot_management.BotInfo.query().order(bot_management.BotInfo.key)
|
| + q = bot_management.BotInfo.query()
|
| for d in request.dimensions:
|
| if not ':' in d:
|
| raise endpoints.BadRequestException('Invalid dimensions')
|
| @@ -628,6 +628,19 @@ class SwarmingBotsService(remote.Service):
|
| if len(parts) != 2 or any(i.strip() != i or not i for i in parts):
|
| raise endpoints.BadRequestException('Invalid dimensions')
|
| q = q.filter(bot_management.BotInfo.dimensions_flat == d)
|
| +
|
| + if request.quarantined == 'true':
|
| + q = q.filter(bot_management.BotInfo.quarantined == True)
|
| + elif request.quarantined == 'false':
|
| + q = q.filter(bot_management.BotInfo.quarantined == False)
|
| +
|
| + dt = datetime.timedelta(
|
| + seconds=config.settings().bot_death_timeout_secs)
|
| + timeout = now - dt
|
| + if request.is_dead == 'true':
|
| + q = q.filter(bot_management.BotInfo.last_seen_ts < timeout)
|
| + elif request.is_dead == 'false':
|
| + q = q.filter(bot_management.BotInfo.last_seen_ts > timeout)
|
| bots, cursor = datastore_utils.fetch_page(q, request.limit, request.cursor)
|
| return swarming_rpcs.BotList(
|
| cursor=cursor,
|
|
|