messages.proto 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. // Copyright 2022 Google LLC
  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.dataflow.v1beta3;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/protobuf/struct.proto";
  19. import "google/protobuf/timestamp.proto";
  20. option csharp_namespace = "Google.Cloud.Dataflow.V1Beta3";
  21. option go_package = "google.golang.org/genproto/googleapis/dataflow/v1beta3;dataflow";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "MessagesProto";
  24. option java_package = "com.google.dataflow.v1beta3";
  25. option php_namespace = "Google\\Cloud\\Dataflow\\V1beta3";
  26. option ruby_package = "Google::Cloud::Dataflow::V1beta3";
  27. // The Dataflow Messages API is used for monitoring the progress of
  28. // Dataflow jobs.
  29. service MessagesV1Beta3 {
  30. option (google.api.default_host) = "dataflow.googleapis.com";
  31. option (google.api.oauth_scopes) =
  32. "https://www.googleapis.com/auth/cloud-platform,"
  33. "https://www.googleapis.com/auth/compute,"
  34. "https://www.googleapis.com/auth/compute.readonly,"
  35. "https://www.googleapis.com/auth/userinfo.email";
  36. // Request the job status.
  37. //
  38. // To request the status of a job, we recommend using
  39. // `projects.locations.jobs.messages.list` with a [regional endpoint]
  40. // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
  41. // `projects.jobs.messages.list` is not recommended, as you can only request
  42. // the status of jobs that are running in `us-central1`.
  43. rpc ListJobMessages(ListJobMessagesRequest) returns (ListJobMessagesResponse) {
  44. option (google.api.http) = {
  45. get: "/v1b3/projects/{project_id}/locations/{location}/jobs/{job_id}/messages"
  46. additional_bindings {
  47. get: "/v1b3/projects/{project_id}/jobs/{job_id}/messages"
  48. }
  49. };
  50. }
  51. }
  52. // A particular message pertaining to a Dataflow job.
  53. message JobMessage {
  54. // Deprecated.
  55. string id = 1;
  56. // The timestamp of the message.
  57. google.protobuf.Timestamp time = 2;
  58. // The text of the message.
  59. string message_text = 3;
  60. // Importance level of the message.
  61. JobMessageImportance message_importance = 4;
  62. }
  63. // Indicates the importance of the message.
  64. enum JobMessageImportance {
  65. // The message importance isn't specified, or is unknown.
  66. JOB_MESSAGE_IMPORTANCE_UNKNOWN = 0;
  67. // The message is at the 'debug' level: typically only useful for
  68. // software engineers working on the code the job is running.
  69. // Typically, Dataflow pipeline runners do not display log messages
  70. // at this level by default.
  71. JOB_MESSAGE_DEBUG = 1;
  72. // The message is at the 'detailed' level: somewhat verbose, but
  73. // potentially useful to users. Typically, Dataflow pipeline
  74. // runners do not display log messages at this level by default.
  75. // These messages are displayed by default in the Dataflow
  76. // monitoring UI.
  77. JOB_MESSAGE_DETAILED = 2;
  78. // The message is at the 'basic' level: useful for keeping
  79. // track of the execution of a Dataflow pipeline. Typically,
  80. // Dataflow pipeline runners display log messages at this level by
  81. // default, and these messages are displayed by default in the
  82. // Dataflow monitoring UI.
  83. JOB_MESSAGE_BASIC = 5;
  84. // The message is at the 'warning' level: indicating a condition
  85. // pertaining to a job which may require human intervention.
  86. // Typically, Dataflow pipeline runners display log messages at this
  87. // level by default, and these messages are displayed by default in
  88. // the Dataflow monitoring UI.
  89. JOB_MESSAGE_WARNING = 3;
  90. // The message is at the 'error' level: indicating a condition
  91. // preventing a job from succeeding. Typically, Dataflow pipeline
  92. // runners display log messages at this level by default, and these
  93. // messages are displayed by default in the Dataflow monitoring UI.
  94. JOB_MESSAGE_ERROR = 4;
  95. }
  96. // A rich message format, including a human readable string, a key for
  97. // identifying the message, and structured data associated with the message for
  98. // programmatic consumption.
  99. message StructuredMessage {
  100. // Structured data associated with this message.
  101. message Parameter {
  102. // Key or name for this parameter.
  103. string key = 1;
  104. // Value for this parameter.
  105. google.protobuf.Value value = 2;
  106. }
  107. // Human-readable version of message.
  108. string message_text = 1;
  109. // Identifier for this message type. Used by external systems to
  110. // internationalize or personalize message.
  111. string message_key = 2;
  112. // The structured data associated with this message.
  113. repeated Parameter parameters = 3;
  114. }
  115. // A structured message reporting an autoscaling decision made by the Dataflow
  116. // service.
  117. message AutoscalingEvent {
  118. // Indicates the type of autoscaling event.
  119. enum AutoscalingEventType {
  120. // Default type for the enum. Value should never be returned.
  121. TYPE_UNKNOWN = 0;
  122. // The TARGET_NUM_WORKERS_CHANGED type should be used when the target
  123. // worker pool size has changed at the start of an actuation. An event
  124. // should always be specified as TARGET_NUM_WORKERS_CHANGED if it reflects
  125. // a change in the target_num_workers.
  126. TARGET_NUM_WORKERS_CHANGED = 1;
  127. // The CURRENT_NUM_WORKERS_CHANGED type should be used when actual worker
  128. // pool size has been changed, but the target_num_workers has not changed.
  129. CURRENT_NUM_WORKERS_CHANGED = 2;
  130. // The ACTUATION_FAILURE type should be used when we want to report
  131. // an error to the user indicating why the current number of workers
  132. // in the pool could not be changed.
  133. // Displayed in the current status and history widgets.
  134. ACTUATION_FAILURE = 3;
  135. // Used when we want to report to the user a reason why we are
  136. // not currently adjusting the number of workers.
  137. // Should specify both target_num_workers, current_num_workers and a
  138. // decision_message.
  139. NO_CHANGE = 4;
  140. }
  141. // The current number of workers the job has.
  142. int64 current_num_workers = 1;
  143. // The target number of workers the worker pool wants to resize to use.
  144. int64 target_num_workers = 2;
  145. // The type of autoscaling event to report.
  146. AutoscalingEventType event_type = 3;
  147. // A message describing why the system decided to adjust the current
  148. // number of workers, why it failed, or why the system decided to
  149. // not make any changes to the number of workers.
  150. StructuredMessage description = 4;
  151. // The time this event was emitted to indicate a new target or current
  152. // num_workers value.
  153. google.protobuf.Timestamp time = 5;
  154. // A short and friendly name for the worker pool this event refers to.
  155. string worker_pool = 7;
  156. }
  157. // Request to list job messages.
  158. // Up to max_results messages will be returned in the time range specified
  159. // starting with the oldest messages first. If no time range is specified
  160. // the results with start with the oldest message.
  161. message ListJobMessagesRequest {
  162. // A project id.
  163. string project_id = 1;
  164. // The job to get messages about.
  165. string job_id = 2;
  166. // Filter to only get messages with importance >= level
  167. JobMessageImportance minimum_importance = 3;
  168. // If specified, determines the maximum number of messages to
  169. // return. If unspecified, the service may choose an appropriate
  170. // default, or may return an arbitrarily large number of results.
  171. int32 page_size = 4;
  172. // If supplied, this should be the value of next_page_token returned
  173. // by an earlier call. This will cause the next page of results to
  174. // be returned.
  175. string page_token = 5;
  176. // If specified, return only messages with timestamps >= start_time.
  177. // The default is the job creation time (i.e. beginning of messages).
  178. google.protobuf.Timestamp start_time = 6;
  179. // Return only messages with timestamps < end_time. The default is now
  180. // (i.e. return up to the latest messages available).
  181. google.protobuf.Timestamp end_time = 7;
  182. // The [regional endpoint]
  183. // (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that
  184. // contains the job specified by job_id.
  185. string location = 8;
  186. }
  187. // Response to a request to list job messages.
  188. message ListJobMessagesResponse {
  189. // Messages in ascending timestamp order.
  190. repeated JobMessage job_messages = 1;
  191. // The token to obtain the next page of results if there are more.
  192. string next_page_token = 2;
  193. // Autoscaling events in ascending timestamp order.
  194. repeated AutoscalingEvent autoscaling_events = 3;
  195. }