| 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 by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """Helper functions for working with the Machine Provider.""" | 5 """Helper functions for working with the Machine Provider.""" |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 | 8 |
| 9 from google.appengine.ext import ndb | 9 from google.appengine.ext import ndb |
| 10 | 10 |
| 11 from components import net | 11 from components import net |
| 12 from components import utils | 12 from components import utils |
| 13 from components.datastore_utils import config | 13 from components.datastore_utils import config |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 requests: A list of rpc_messages.LeaseRequest instances. | 94 requests: A list of rpc_messages.LeaseRequest instances. |
| 95 """ | 95 """ |
| 96 logging.info('Sending batched lease_machines request') | 96 logging.info('Sending batched lease_machines request') |
| 97 return net.json_request( | 97 return net.json_request( |
| 98 '%s/_ah/api/machine_provider/v1/batched_lease' % | 98 '%s/_ah/api/machine_provider/v1/batched_lease' % |
| 99 MachineProviderConfiguration.get_instance_url(), | 99 MachineProviderConfiguration.get_instance_url(), |
| 100 method='POST', | 100 method='POST', |
| 101 payload=utils.to_json_encodable({'requests': requests}), | 101 payload=utils.to_json_encodable({'requests': requests}), |
| 102 scopes=MACHINE_PROVIDER_SCOPES, | 102 scopes=MACHINE_PROVIDER_SCOPES, |
| 103 ) | 103 ) |
| OLD | NEW |