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

Unified Diff: appengine/cr-buildbucket/api.py

Issue 1877083003: buildbucket: add retry API. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: add retry_of tag Created 4 years, 8 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/cr-buildbucket/service.py » ('j') | appengine/cr-buildbucket/service.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/cr-buildbucket/api.py
diff --git a/appengine/cr-buildbucket/api.py b/appengine/cr-buildbucket/api.py
index eb5a568456f48dd3702f476f666854726cf675ae..ddc531779b2a41a3949972de76bca6b707654db5 100644
--- a/appengine/cr-buildbucket/api.py
+++ b/appengine/cr-buildbucket/api.py
@@ -287,6 +287,29 @@ class BuildBucketApi(remote.Service):
for req, build in zip(request.builds, build_futures)]
return res
+ ################################## RETRY ##################################
+
+ class RetryRequestMessage(messages.Message):
+ client_operation_id = messages.StringField(1)
+ lease_expiration_ts = messages.IntegerField(2)
+ pubsub_callback = messages.MessageField(PubSubCallbackMessage, 3)
+
+ @buildbucket_api_method(
+ id_resource_container(RetryRequestMessage),
+ BuildResponseMessage,
+ path='builds/{id}/retry', http_method='PUT')
+ @auth.public
+ def retry(self, request):
+ """Retries an existing build."""
+ build = service.retry(
+ request.id,
+ lease_expiration_date=parse_datetime(request.lease_expiration_ts),
+ client_operation_id=request.client_operation_id,
+ pubsub_callback=pubsub_callback_from_message(request.pubsub_callback),
+ )
+ return build_to_response_message(build, include_lease_key=True)
+
+
################################## SEARCH #################################
« no previous file with comments | « no previous file | appengine/cr-buildbucket/service.py » ('j') | appengine/cr-buildbucket/service.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698