Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2015 The LUCI Authors. All rights reserved. | 1 # Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed under the Apache License, Version 2.0 | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # that can be found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """This module defines ProtoRPC types for the Swarming Server handlers.""" | 5 """This module defines ProtoRPC types for the Swarming Server handlers.""" |
| 6 | 6 |
| 7 from protorpc import message_types | 7 from protorpc import message_types |
| 8 from protorpc import messages | 8 from protorpc import messages |
| 9 | 9 |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 key = messages.StringField(1) | 41 key = messages.StringField(1) |
| 42 value = messages.StringField(2) | 42 value = messages.StringField(2) |
| 43 | 43 |
| 44 | 44 |
| 45 class StringListPair(messages.Message): | 45 class StringListPair(messages.Message): |
| 46 """Represents a mapping of string to list of strings.""" | 46 """Represents a mapping of string to list of strings.""" |
| 47 key = messages.StringField(1) | 47 key = messages.StringField(1) |
| 48 value = messages.StringField(2, repeated=True) | 48 value = messages.StringField(2, repeated=True) |
| 49 | 49 |
| 50 | 50 |
| 51 class ThreeStateBool(messages.Enum): | |
| 52 FALSE = 1 | |
| 53 TRUE = 2 | |
| 54 NONE = 3 | |
|
M-A Ruel
2016/08/09 13:57:27
def to_bool(tree_state):
if tree_state == ThreeS
kjlubick
2016/08/09 17:41:32
Done.
| |
| 55 | |
| 56 | |
| 51 ### Server related. | 57 ### Server related. |
| 52 | 58 |
| 53 | 59 |
| 54 class ServerDetails(messages.Message): | 60 class ServerDetails(messages.Message): |
| 55 """Reports the server version.""" | 61 """Reports the server version.""" |
| 56 server_version = messages.StringField(1) | 62 server_version = messages.StringField(1) |
| 57 | 63 |
| 58 | 64 |
| 59 class FileContentRequest(messages.Message): | 65 class FileContentRequest(messages.Message): |
| 60 """Content of a file.""" | 66 """Content of a file.""" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 301 ### Bot-Related Requests | 307 ### Bot-Related Requests |
| 302 | 308 |
| 303 | 309 |
| 304 class BotsRequest(messages.Message): | 310 class BotsRequest(messages.Message): |
| 305 """Information needed to request bot data.""" | 311 """Information needed to request bot data.""" |
| 306 limit = messages.IntegerField(1, default=200) | 312 limit = messages.IntegerField(1, default=200) |
| 307 cursor = messages.StringField(2) | 313 cursor = messages.StringField(2) |
| 308 # Must be a list of 'key:value' strings to filter the returned list of bots | 314 # Must be a list of 'key:value' strings to filter the returned list of bots |
| 309 # on. | 315 # on. |
| 310 dimensions = messages.StringField(3, repeated=True) | 316 dimensions = messages.StringField(3, repeated=True) |
| 317 quarantined = messages.EnumField(ThreeStateBool, 4, default='NONE') | |
| 318 is_dead = messages.EnumField(ThreeStateBool, 5, default='NONE') | |
| 311 | 319 |
| 312 | 320 |
| 313 class BotEventsRequest(messages.Message): | 321 class BotEventsRequest(messages.Message): |
| 314 """Request to get events for a bot.""" | 322 """Request to get events for a bot.""" |
| 315 limit = messages.IntegerField(1, default=200) | 323 limit = messages.IntegerField(1, default=200) |
| 316 cursor = messages.StringField(2) | 324 cursor = messages.StringField(2) |
| 317 # These should be DateTimeField but endpoints + protorpc have trouble encoding | 325 # These should be DateTimeField but endpoints + protorpc have trouble encoding |
| 318 # this message in a GET request, this is due to DateTimeField's special | 326 # this message in a GET request, this is due to DateTimeField's special |
| 319 # encoding in protorpc-1.0/protorpc/message_types.py that is bypassed when | 327 # encoding in protorpc-1.0/protorpc/message_types.py that is bypassed when |
| 320 # using endpoints-1.0/endpoints/protojson.py to add GET query parameter | 328 # using endpoints-1.0/endpoints/protojson.py to add GET query parameter |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 426 | 434 |
| 427 | 435 |
| 428 class DeletedResponse(messages.Message): | 436 class DeletedResponse(messages.Message): |
| 429 """Indicates whether a bot was deleted.""" | 437 """Indicates whether a bot was deleted.""" |
| 430 deleted = messages.BooleanField(1) | 438 deleted = messages.BooleanField(1) |
| 431 | 439 |
| 432 | 440 |
| 433 class TerminateResponse(messages.Message): | 441 class TerminateResponse(messages.Message): |
| 434 """Returns the pseudo taskid to wait for the bot to shut down.""" | 442 """Returns the pseudo taskid to wait for the bot to shut down.""" |
| 435 task_id = messages.StringField(1) | 443 task_id = messages.StringField(1) |
| OLD | NEW |