def tags(self, _request): """Returns the cached set of tags currently seen in the fleet.""" tags = task_result.TagAggregation.KEY.get() ft = [ swarming_rpcs.StringListPair(key=t.tag, value=t.values) for t in tags.tags ] return swarming_rpcs.TasksTags(tasks_tags=ft, ts=tags.ts)
def dimensions(self, _request): """Returns the cached set of dimensions currently in use in the fleet.""" dims = bot_management.DimensionAggregation.KEY.get() fd = [ swarming_rpcs.StringListPair(key=d.dimension, value=d.values) for d in dims.dimensions ] return swarming_rpcs.BotsDimensions(bots_dimensions=fd, ts=dims.ts)
def _string_list_pairs_from_dict(dictionary): return [ swarming_rpcs.StringListPair(key=k, value=v) for k, v in sorted((dictionary or {}).iteritems()) ]
def _string_list_pairs_from_dict(dictionary): # For key: values items like bot dimensions. return [ swarming_rpcs.StringListPair(key=k, value=v) for k, v in sorted((dictionary or {}).iteritems()) ]