Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: appengine/components/components/machine_provider/utils.py

Issue 2386793002: Reimplement Machine Provider integration (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | appengine/swarming/cron.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/components/components/machine_provider/utils.py
diff --git a/appengine/components/components/machine_provider/utils.py b/appengine/components/components/machine_provider/utils.py
index f174633468263ff954d076568042d6ceb4f5140f..0753726b5f68566ef1075d18d8a51d53dad52df6 100644
--- a/appengine/components/components/machine_provider/utils.py
+++ b/appengine/components/components/machine_provider/utils.py
@@ -87,6 +87,21 @@ def delete_machine(dimensions):
)
+def lease_machine(request):
+ """Lease a machine from the Machine Provider.
+
+ Args:
+ request: An rpc_messages.LeaseRequest instance.
+ """
+ return net.json_request(
+ '%s/_ah/api/machine_provider/v1/lease' %
+ MachineProviderConfiguration.get_instance_url(),
+ method='POST',
+ payload=utils.to_json_encodable(request),
+ scopes=MACHINE_PROVIDER_SCOPES,
+ )
+
+
def lease_machines(requests):
"""Lease machines from the Machine Provider.
« no previous file with comments | « no previous file | appengine/swarming/cron.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698