controller.proto 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. // Copyright (c) 2015, Google Inc.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.devtools.clouddebugger.v2;
  16. import "google/api/annotations.proto";
  17. import "google/devtools/clouddebugger/v2/data.proto";
  18. import "google/protobuf/empty.proto";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "ControllerProto";
  21. option java_package = "com.google.devtools.clouddebugger.v2";
  22. // The Controller service provides the API for orchestrating a collection of
  23. // debugger agents to perform debugging tasks. These agents are each attached
  24. // to a process of an application which may include one or more replicas.
  25. //
  26. // The debugger agents register with the Controller to identify the application
  27. // being debugged, the Debuggee. All agents that register with the same data,
  28. // represent the same Debuggee, and are assigned the same `debuggee_id`.
  29. //
  30. // The debugger agents call the Controller to retrieve the list of active
  31. // Breakpoints. Agents with the same `debuggee_id` get the same breakpoints
  32. // list. An agent that can fulfill the breakpoint request updates the
  33. // Controller with the breakpoint result. The controller selects the first
  34. // result received and discards the rest of the results.
  35. // Agents that poll again for active breakpoints will no longer have
  36. // the completed breakpoint in the list and should remove that breakpoint from
  37. // their attached process.
  38. //
  39. // The Controller service does not provide a way to retrieve the results of
  40. // a completed breakpoint. This functionality is available using the Debugger
  41. // service.
  42. service Controller2 {
  43. // Registers the debuggee with the controller service.
  44. //
  45. // All agents attached to the same application should call this method with
  46. // the same request content to get back the same stable `debuggee_id`. Agents
  47. // should call this method again whenever `google.rpc.Code.NOT_FOUND` is
  48. // returned from any controller method.
  49. //
  50. // This allows the controller service to disable the agent or recover from any
  51. // data loss. If the debuggee is disabled by the server, the response will
  52. // have `is_disabled` set to `true`.
  53. rpc RegisterDebuggee(RegisterDebuggeeRequest) returns (RegisterDebuggeeResponse) {
  54. option (google.api.http) = { post: "/v2/controller/debuggees/register" body: "*" };
  55. }
  56. // Returns the list of all active breakpoints for the debuggee.
  57. //
  58. // The breakpoint specification (location, condition, and expression
  59. // fields) is semantically immutable, although the field values may
  60. // change. For example, an agent may update the location line number
  61. // to reflect the actual line where the breakpoint was set, but this
  62. // doesn't change the breakpoint semantics.
  63. //
  64. // This means that an agent does not need to check if a breakpoint has changed
  65. // when it encounters the same breakpoint on a successive call.
  66. // Moreover, an agent should remember the breakpoints that are completed
  67. // until the controller removes them from the active list to avoid
  68. // setting those breakpoints again.
  69. rpc ListActiveBreakpoints(ListActiveBreakpointsRequest) returns (ListActiveBreakpointsResponse) {
  70. option (google.api.http) = { get: "/v2/controller/debuggees/{debuggee_id}/breakpoints" };
  71. }
  72. // Updates the breakpoint state or mutable fields.
  73. // The entire Breakpoint message must be sent back to the controller
  74. // service.
  75. //
  76. // Updates to active breakpoint fields are only allowed if the new value
  77. // does not change the breakpoint specification. Updates to the `location`,
  78. // `condition` and `expression` fields should not alter the breakpoint
  79. // semantics. These may only make changes such as canonicalizing a value
  80. // or snapping the location to the correct line of code.
  81. rpc UpdateActiveBreakpoint(UpdateActiveBreakpointRequest) returns (UpdateActiveBreakpointResponse) {
  82. option (google.api.http) = { put: "/v2/controller/debuggees/{debuggee_id}/breakpoints/{breakpoint.id}" body: "*" };
  83. }
  84. }
  85. // Request to register a debuggee.
  86. message RegisterDebuggeeRequest {
  87. // Debuggee information to register.
  88. // The fields `project`, `uniquifier`, `description` and `agent_version`
  89. // of the debuggee must be set.
  90. Debuggee debuggee = 1;
  91. }
  92. // Response for registering a debuggee.
  93. message RegisterDebuggeeResponse {
  94. // Debuggee resource.
  95. // The field `id` is guranteed to be set (in addition to the echoed fields).
  96. Debuggee debuggee = 1;
  97. }
  98. // Request to list active breakpoints.
  99. message ListActiveBreakpointsRequest {
  100. // Identifies the debuggee.
  101. string debuggee_id = 1;
  102. // A wait token that, if specified, blocks the method call until the list
  103. // of active breakpoints has changed, or a server selected timeout has
  104. // expired. The value should be set from the last returned response.
  105. string wait_token = 2;
  106. // If set to `true`, returns `google.rpc.Code.OK` status and sets the
  107. // `wait_expired` response field to `true` when the server-selected timeout
  108. // has expired (recommended).
  109. //
  110. // If set to `false`, returns `google.rpc.Code.ABORTED` status when the
  111. // server-selected timeout has expired (deprecated).
  112. bool success_on_timeout = 3;
  113. }
  114. // Response for listing active breakpoints.
  115. message ListActiveBreakpointsResponse {
  116. // List of all active breakpoints.
  117. // The fields `id` and `location` are guaranteed to be set on each breakpoint.
  118. repeated Breakpoint breakpoints = 1;
  119. // A wait token that can be used in the next method call to block until
  120. // the list of breakpoints changes.
  121. string next_wait_token = 2;
  122. // The `wait_expired` field is set to true by the server when the
  123. // request times out and the field `success_on_timeout` is set to true.
  124. bool wait_expired = 3;
  125. }
  126. // Request to update an active breakpoint.
  127. message UpdateActiveBreakpointRequest {
  128. // Identifies the debuggee being debugged.
  129. string debuggee_id = 1;
  130. // Updated breakpoint information.
  131. // The field 'id' must be set.
  132. Breakpoint breakpoint = 2;
  133. }
  134. // Response for updating an active breakpoint.
  135. // The message is defined to allow future extensions.
  136. message UpdateActiveBreakpointResponse {
  137. }