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