| // Copyright 2016 The LUCI Authors. All rights reserved. |
| // Use of this source code is governed under the Apache License, Version 2.0 |
| // that can be found in the LICENSE file. |
| |
| syntax = "proto3"; |
| |
| option go_package = "go.chromium.org/luci/dm/api/service/v1;dm"; |
| |
| import "go.chromium.org/luci/dm/api/service/v1/graph_data.proto"; |
| |
| package dm; |
| |
| // ActivateExecutionReq allows a currently-running Execution to activate itself. |
| // Doing this allows DM to know that the Execution has started, and also enables |
| // the Execution to access other APIs like WalkGraph, AddDeps, and |
| // FinishAttempt. |
| // |
| // ActivateExecution must be called with the ExecutionID and Activation token |
| // that DM provided when the Execution was started with the distributor. |
| // |
| // If the Execution has not been activated, the Execution will be marked as |
| // 'activating' and this will return an OK code. At this point, your client |
| // may use the ExecutionToken with any RPCs that have an ExecutionAuth field. |
| // |
| // This RPC may return: |
| // * OK - The Execution is now activated. |
| // * InvalidArgmument - The request was malformed. Retrying will not help. |
| // * PermissionDenied - The provided activation token was incorrect. |
| // Retrying will not help. |
| // * AlreadyExists - The activation token was correct, but some other entity |
| // already activated this Execution. The client should cease operations. |
| // Retrying will not help. |
| // |
| // All other errors should be retried with the exact same ActivateExecutionReq |
| // data. |
| message ActivateExecutionReq { |
| // Auth is the Execution_Auth containing the Activation Token, as provided |
| // to the distributor when the Execution was created. |
| dm.Execution.Auth auth = 1; |
| |
| // ExecutionToken should be randomly generated by the machine running the |
| // execution, or by the distributor service such that if two racing Executions |
| // both attempt to Activate with the same ExecutionID and ActivationToken, the |
| // ExecutionToken will (probably) be different for them so that only one will |
| // win. |
| bytes execution_token = 2; |
| } |