| 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 """Internal bot API handlers.""" | 5 """Internal bot API handlers.""" |
| 6 | 6 |
| 7 import base64 | 7 import base64 |
| 8 import json | 8 import json |
| 9 import logging | 9 import logging |
| 10 import re | 10 import re |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 'extra_args': request.properties.extra_args, | 543 'extra_args': request.properties.extra_args, |
| 544 'grace_period': request.properties.grace_period_secs, | 544 'grace_period': request.properties.grace_period_secs, |
| 545 'hard_timeout': request.properties.execution_timeout_secs, | 545 'hard_timeout': request.properties.execution_timeout_secs, |
| 546 'host': utils.get_versioned_hosturl(), | 546 'host': utils.get_versioned_hosturl(), |
| 547 'io_timeout': request.properties.io_timeout_secs, | 547 'io_timeout': request.properties.io_timeout_secs, |
| 548 'isolated': { | 548 'isolated': { |
| 549 'input': request.properties.inputs_ref.isolated, | 549 'input': request.properties.inputs_ref.isolated, |
| 550 'namespace': request.properties.inputs_ref.namespace, | 550 'namespace': request.properties.inputs_ref.namespace, |
| 551 'server': request.properties.inputs_ref.isolatedserver, | 551 'server': request.properties.inputs_ref.isolatedserver, |
| 552 } if request.properties.inputs_ref else None, | 552 } if request.properties.inputs_ref else None, |
| 553 'outputs': request.properties.outputs, |
| 553 'service_account': request.service_account, | 554 'service_account': request.service_account, |
| 554 'task_id': task_pack.pack_run_result_key(run_result_key), | 555 'task_id': task_pack.pack_run_result_key(run_result_key), |
| 555 }, | 556 }, |
| 556 } | 557 } |
| 557 self.send_response(utils.to_json_encodable(out)) | 558 self.send_response(utils.to_json_encodable(out)) |
| 558 | 559 |
| 559 def _cmd_sleep(self, sleep_streak, quarantined): | 560 def _cmd_sleep(self, sleep_streak, quarantined): |
| 560 out = { | 561 out = { |
| 561 'cmd': 'sleep', | 562 'cmd': 'sleep', |
| 562 'duration': task_scheduler.exponential_backoff(sleep_streak), | 563 'duration': task_scheduler.exponential_backoff(sleep_streak), |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 ('/swarming/api/v1/bot/poll', BotPollHandler), | 853 ('/swarming/api/v1/bot/poll', BotPollHandler), |
| 853 ('/swarming/api/v1/bot/server_ping', ServerPingHandler), | 854 ('/swarming/api/v1/bot/server_ping', ServerPingHandler), |
| 854 ('/swarming/api/v1/bot/task_update', BotTaskUpdateHandler), | 855 ('/swarming/api/v1/bot/task_update', BotTaskUpdateHandler), |
| 855 ('/swarming/api/v1/bot/task_update/<task_id:[a-f0-9]+>', | 856 ('/swarming/api/v1/bot/task_update/<task_id:[a-f0-9]+>', |
| 856 BotTaskUpdateHandler), | 857 BotTaskUpdateHandler), |
| 857 ('/swarming/api/v1/bot/task_error', BotTaskErrorHandler), | 858 ('/swarming/api/v1/bot/task_error', BotTaskErrorHandler), |
| 858 ('/swarming/api/v1/bot/task_error/<task_id:[a-f0-9]+>', | 859 ('/swarming/api/v1/bot/task_error/<task_id:[a-f0-9]+>', |
| 859 BotTaskErrorHandler), | 860 BotTaskErrorHandler), |
| 860 ] | 861 ] |
| 861 return [webapp2.Route(*i) for i in routes] | 862 return [webapp2.Route(*i) for i in routes] |
| OLD | NEW |