jobs.proto 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903
  1. // Copyright 2020 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.cloud.dataproc.v1beta2;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/longrunning/operations.proto";
  20. import "google/protobuf/empty.proto";
  21. import "google/protobuf/field_mask.proto";
  22. import "google/protobuf/timestamp.proto";
  23. option go_package = "google.golang.org/genproto/googleapis/cloud/dataproc/v1beta2;dataproc";
  24. option java_multiple_files = true;
  25. option java_outer_classname = "JobsProto";
  26. option java_package = "com.google.cloud.dataproc.v1beta2";
  27. // The JobController provides methods to manage jobs.
  28. service JobController {
  29. option (google.api.default_host) = "dataproc.googleapis.com";
  30. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  31. // Submits a job to a cluster.
  32. rpc SubmitJob(SubmitJobRequest) returns (Job) {
  33. option (google.api.http) = {
  34. post: "/v1beta2/projects/{project_id}/regions/{region}/jobs:submit"
  35. body: "*"
  36. };
  37. option (google.api.method_signature) = "project_id, region, job";
  38. }
  39. // Submits job to a cluster.
  40. rpc SubmitJobAsOperation(SubmitJobRequest) returns (google.longrunning.Operation) {
  41. option (google.api.http) = {
  42. post: "/v1beta2/projects/{project_id}/regions/{region}/jobs:submitAsOperation"
  43. body: "*"
  44. };
  45. option (google.api.method_signature) = "project_id, region, job";
  46. option (google.longrunning.operation_info) = {
  47. response_type: "Job"
  48. metadata_type: "JobMetadata"
  49. };
  50. }
  51. // Gets the resource representation for a job in a project.
  52. rpc GetJob(GetJobRequest) returns (Job) {
  53. option (google.api.http) = {
  54. get: "/v1beta2/projects/{project_id}/regions/{region}/jobs/{job_id}"
  55. };
  56. option (google.api.method_signature) = "project_id, region, job_id";
  57. }
  58. // Lists regions/{region}/jobs in a project.
  59. rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) {
  60. option (google.api.http) = {
  61. get: "/v1beta2/projects/{project_id}/regions/{region}/jobs"
  62. };
  63. option (google.api.method_signature) = "project_id, region";
  64. option (google.api.method_signature) = "project_id, region, filter";
  65. }
  66. // Updates a job in a project.
  67. rpc UpdateJob(UpdateJobRequest) returns (Job) {
  68. option (google.api.http) = {
  69. patch: "/v1beta2/projects/{project_id}/regions/{region}/jobs/{job_id}"
  70. body: "job"
  71. };
  72. }
  73. // Starts a job cancellation request. To access the job resource
  74. // after cancellation, call
  75. // [regions/{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1beta2/projects.regions.jobs/list)
  76. // or
  77. // [regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1beta2/projects.regions.jobs/get).
  78. rpc CancelJob(CancelJobRequest) returns (Job) {
  79. option (google.api.http) = {
  80. post: "/v1beta2/projects/{project_id}/regions/{region}/jobs/{job_id}:cancel"
  81. body: "*"
  82. };
  83. option (google.api.method_signature) = "project_id, region, job_id";
  84. }
  85. // Deletes the job from the project. If the job is active, the delete fails,
  86. // and the response returns `FAILED_PRECONDITION`.
  87. rpc DeleteJob(DeleteJobRequest) returns (google.protobuf.Empty) {
  88. option (google.api.http) = {
  89. delete: "/v1beta2/projects/{project_id}/regions/{region}/jobs/{job_id}"
  90. };
  91. option (google.api.method_signature) = "project_id, region, job_id";
  92. }
  93. }
  94. // The runtime logging config of the job.
  95. message LoggingConfig {
  96. // The Log4j level for job execution. When running an
  97. // [Apache Hive](http://hive.apache.org/) job, Cloud
  98. // Dataproc configures the Hive client to an equivalent verbosity level.
  99. enum Level {
  100. // Level is unspecified. Use default level for log4j.
  101. LEVEL_UNSPECIFIED = 0;
  102. // Use ALL level for log4j.
  103. ALL = 1;
  104. // Use TRACE level for log4j.
  105. TRACE = 2;
  106. // Use DEBUG level for log4j.
  107. DEBUG = 3;
  108. // Use INFO level for log4j.
  109. INFO = 4;
  110. // Use WARN level for log4j.
  111. WARN = 5;
  112. // Use ERROR level for log4j.
  113. ERROR = 6;
  114. // Use FATAL level for log4j.
  115. FATAL = 7;
  116. // Turn off log4j.
  117. OFF = 8;
  118. }
  119. // The per-package log levels for the driver. This may include
  120. // "root" package name to configure rootLogger.
  121. // Examples:
  122. // 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG'
  123. map<string, Level> driver_log_levels = 2;
  124. }
  125. // A Dataproc job for running
  126. // [Apache Hadoop
  127. // MapReduce](https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html)
  128. // jobs on [Apache Hadoop
  129. // YARN](https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html).
  130. message HadoopJob {
  131. // Required. Indicates the location of the driver's main class. Specify
  132. // either the jar file that contains the main class or the main class name.
  133. // To specify both, add the jar file to `jar_file_uris`, and then specify
  134. // the main class name in this property.
  135. oneof driver {
  136. // The HCFS URI of the jar file containing the main class.
  137. // Examples:
  138. // 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar'
  139. // 'hdfs:/tmp/test-samples/custom-wordcount.jar'
  140. // 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar'
  141. string main_jar_file_uri = 1;
  142. // The name of the driver's main class. The jar file containing the class
  143. // must be in the default CLASSPATH or specified in `jar_file_uris`.
  144. string main_class = 2;
  145. }
  146. // Optional. The arguments to pass to the driver. Do not
  147. // include arguments, such as `-libjars` or `-Dfoo=bar`, that can be set as
  148. // job properties, since a collision may occur that causes an incorrect job
  149. // submission.
  150. repeated string args = 3 [(google.api.field_behavior) = OPTIONAL];
  151. // Optional. Jar file URIs to add to the CLASSPATHs of the
  152. // Hadoop driver and tasks.
  153. repeated string jar_file_uris = 4 [(google.api.field_behavior) = OPTIONAL];
  154. // Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied
  155. // to the working directory of Hadoop drivers and distributed tasks. Useful
  156. // for naively parallel tasks.
  157. repeated string file_uris = 5 [(google.api.field_behavior) = OPTIONAL];
  158. // Optional. HCFS URIs of archives to be extracted in the working directory of
  159. // Hadoop drivers and tasks. Supported file types:
  160. // .jar, .tar, .tar.gz, .tgz, or .zip.
  161. repeated string archive_uris = 6 [(google.api.field_behavior) = OPTIONAL];
  162. // Optional. A mapping of property names to values, used to configure Hadoop.
  163. // Properties that conflict with values set by the Dataproc API may be
  164. // overwritten. Can include properties set in /etc/hadoop/conf/*-site and
  165. // classes in user code.
  166. map<string, string> properties = 7 [(google.api.field_behavior) = OPTIONAL];
  167. // Optional. The runtime log config for job execution.
  168. LoggingConfig logging_config = 8 [(google.api.field_behavior) = OPTIONAL];
  169. }
  170. // A Dataproc job for running [Apache Spark](http://spark.apache.org/)
  171. // applications on YARN.
  172. // The specification of the main method to call to drive the job.
  173. // Specify either the jar file that contains the main class or the main class
  174. // name. To pass both a main jar and a main class in that jar, add the jar to
  175. // `CommonJob.jar_file_uris`, and then specify the main class name in
  176. // `main_class`.
  177. message SparkJob {
  178. oneof driver {
  179. // The HCFS URI of the jar file that contains the main class.
  180. string main_jar_file_uri = 1;
  181. // The name of the driver's main class. The jar file that contains the class
  182. // must be in the default CLASSPATH or specified in `jar_file_uris`.
  183. string main_class = 2;
  184. }
  185. // Optional. The arguments to pass to the driver. Do not include arguments,
  186. // such as `--conf`, that can be set as job properties, since a collision may
  187. // occur that causes an incorrect job submission.
  188. repeated string args = 3 [(google.api.field_behavior) = OPTIONAL];
  189. // Optional. HCFS URIs of jar files to add to the CLASSPATHs of the
  190. // Spark driver and tasks.
  191. repeated string jar_file_uris = 4 [(google.api.field_behavior) = OPTIONAL];
  192. // Optional. HCFS URIs of files to be placed in the working directory of
  193. // each executor. Useful for naively parallel tasks.
  194. repeated string file_uris = 5 [(google.api.field_behavior) = OPTIONAL];
  195. // Optional. HCFS URIs of archives to be extracted into the working directory
  196. // of each executor. Supported file types:
  197. // .jar, .tar, .tar.gz, .tgz, and .zip.
  198. repeated string archive_uris = 6 [(google.api.field_behavior) = OPTIONAL];
  199. // Optional. A mapping of property names to values, used to configure Spark.
  200. // Properties that conflict with values set by the Dataproc API may be
  201. // overwritten. Can include properties set in
  202. // /etc/spark/conf/spark-defaults.conf and classes in user code.
  203. map<string, string> properties = 7 [(google.api.field_behavior) = OPTIONAL];
  204. // Optional. The runtime log config for job execution.
  205. LoggingConfig logging_config = 8 [(google.api.field_behavior) = OPTIONAL];
  206. }
  207. // A Dataproc job for running
  208. // [Apache
  209. // PySpark](https://spark.apache.org/docs/0.9.0/python-programming-guide.html)
  210. // applications on YARN.
  211. message PySparkJob {
  212. // Required. The HCFS URI of the main Python file to use as the driver. Must
  213. // be a .py file.
  214. string main_python_file_uri = 1 [(google.api.field_behavior) = REQUIRED];
  215. // Optional. The arguments to pass to the driver. Do not include arguments,
  216. // such as `--conf`, that can be set as job properties, since a collision may
  217. // occur that causes an incorrect job submission.
  218. repeated string args = 2 [(google.api.field_behavior) = OPTIONAL];
  219. // Optional. HCFS file URIs of Python files to pass to the PySpark
  220. // framework. Supported file types: .py, .egg, and .zip.
  221. repeated string python_file_uris = 3 [(google.api.field_behavior) = OPTIONAL];
  222. // Optional. HCFS URIs of jar files to add to the CLASSPATHs of the
  223. // Python driver and tasks.
  224. repeated string jar_file_uris = 4 [(google.api.field_behavior) = OPTIONAL];
  225. // Optional. HCFS URIs of files to be placed in the working directory of
  226. // each executor. Useful for naively parallel tasks.
  227. repeated string file_uris = 5 [(google.api.field_behavior) = OPTIONAL];
  228. // Optional. HCFS URIs of archives to be extracted into the working directory
  229. // of each executor. Supported file types:
  230. // .jar, .tar, .tar.gz, .tgz, and .zip.
  231. repeated string archive_uris = 6 [(google.api.field_behavior) = OPTIONAL];
  232. // Optional. A mapping of property names to values, used to configure PySpark.
  233. // Properties that conflict with values set by the Dataproc API may be
  234. // overwritten. Can include properties set in
  235. // /etc/spark/conf/spark-defaults.conf and classes in user code.
  236. map<string, string> properties = 7 [(google.api.field_behavior) = OPTIONAL];
  237. // Optional. The runtime log config for job execution.
  238. LoggingConfig logging_config = 8 [(google.api.field_behavior) = OPTIONAL];
  239. }
  240. // A list of queries to run on a cluster.
  241. message QueryList {
  242. // Required. The queries to execute. You do not need to terminate a query
  243. // with a semicolon. Multiple queries can be specified in one string
  244. // by separating each with a semicolon. Here is an example of an Cloud
  245. // Dataproc API snippet that uses a QueryList to specify a HiveJob:
  246. //
  247. // "hiveJob": {
  248. // "queryList": {
  249. // "queries": [
  250. // "query1",
  251. // "query2",
  252. // "query3;query4",
  253. // ]
  254. // }
  255. // }
  256. repeated string queries = 1 [(google.api.field_behavior) = REQUIRED];
  257. }
  258. // A Dataproc job for running [Apache Hive](https://hive.apache.org/)
  259. // queries on YARN.
  260. message HiveJob {
  261. // Required. The sequence of Hive queries to execute, specified as either
  262. // an HCFS file URI or a list of queries.
  263. oneof queries {
  264. // The HCFS URI of the script that contains Hive queries.
  265. string query_file_uri = 1;
  266. // A list of queries.
  267. QueryList query_list = 2;
  268. }
  269. // Optional. Whether to continue executing queries if a query fails.
  270. // The default value is `false`. Setting to `true` can be useful when
  271. // executing independent parallel queries.
  272. bool continue_on_failure = 3 [(google.api.field_behavior) = OPTIONAL];
  273. // Optional. Mapping of query variable names to values (equivalent to the
  274. // Hive command: `SET name="value";`).
  275. map<string, string> script_variables = 4 [(google.api.field_behavior) = OPTIONAL];
  276. // Optional. A mapping of property names and values, used to configure Hive.
  277. // Properties that conflict with values set by the Dataproc API may be
  278. // overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml,
  279. // /etc/hive/conf/hive-site.xml, and classes in user code.
  280. map<string, string> properties = 5 [(google.api.field_behavior) = OPTIONAL];
  281. // Optional. HCFS URIs of jar files to add to the CLASSPATH of the
  282. // Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes
  283. // and UDFs.
  284. repeated string jar_file_uris = 6 [(google.api.field_behavior) = OPTIONAL];
  285. }
  286. // A Dataproc job for running [Apache Spark
  287. // SQL](http://spark.apache.org/sql/) queries.
  288. message SparkSqlJob {
  289. // Required. The sequence of Spark SQL queries to execute, specified as
  290. // either an HCFS file URI or as a list of queries.
  291. oneof queries {
  292. // The HCFS URI of the script that contains SQL queries.
  293. string query_file_uri = 1;
  294. // A list of queries.
  295. QueryList query_list = 2;
  296. }
  297. // Optional. Mapping of query variable names to values (equivalent to the
  298. // Spark SQL command: SET `name="value";`).
  299. map<string, string> script_variables = 3 [(google.api.field_behavior) = OPTIONAL];
  300. // Optional. A mapping of property names to values, used to configure
  301. // Spark SQL's SparkConf. Properties that conflict with values set by the
  302. // Dataproc API may be overwritten.
  303. map<string, string> properties = 4 [(google.api.field_behavior) = OPTIONAL];
  304. // Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH.
  305. repeated string jar_file_uris = 56 [(google.api.field_behavior) = OPTIONAL];
  306. // Optional. The runtime log config for job execution.
  307. LoggingConfig logging_config = 6 [(google.api.field_behavior) = OPTIONAL];
  308. }
  309. // A Dataproc job for running [Apache Pig](https://pig.apache.org/)
  310. // queries on YARN.
  311. message PigJob {
  312. // Required. The sequence of Pig queries to execute, specified as an HCFS
  313. // file URI or a list of queries.
  314. oneof queries {
  315. // The HCFS URI of the script that contains the Pig queries.
  316. string query_file_uri = 1;
  317. // A list of queries.
  318. QueryList query_list = 2;
  319. }
  320. // Optional. Whether to continue executing queries if a query fails.
  321. // The default value is `false`. Setting to `true` can be useful when
  322. // executing independent parallel queries.
  323. bool continue_on_failure = 3 [(google.api.field_behavior) = OPTIONAL];
  324. // Optional. Mapping of query variable names to values (equivalent to the Pig
  325. // command: `name=[value]`).
  326. map<string, string> script_variables = 4 [(google.api.field_behavior) = OPTIONAL];
  327. // Optional. A mapping of property names to values, used to configure Pig.
  328. // Properties that conflict with values set by the Dataproc API may be
  329. // overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml,
  330. // /etc/pig/conf/pig.properties, and classes in user code.
  331. map<string, string> properties = 5 [(google.api.field_behavior) = OPTIONAL];
  332. // Optional. HCFS URIs of jar files to add to the CLASSPATH of
  333. // the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
  334. repeated string jar_file_uris = 6 [(google.api.field_behavior) = OPTIONAL];
  335. // Optional. The runtime log config for job execution.
  336. LoggingConfig logging_config = 7 [(google.api.field_behavior) = OPTIONAL];
  337. }
  338. // A Dataproc job for running
  339. // [Apache SparkR](https://spark.apache.org/docs/latest/sparkr.html)
  340. // applications on YARN.
  341. message SparkRJob {
  342. // Required. The HCFS URI of the main R file to use as the driver.
  343. // Must be a .R file.
  344. string main_r_file_uri = 1 [(google.api.field_behavior) = REQUIRED];
  345. // Optional. The arguments to pass to the driver. Do not include arguments,
  346. // such as `--conf`, that can be set as job properties, since a collision may
  347. // occur that causes an incorrect job submission.
  348. repeated string args = 2 [(google.api.field_behavior) = OPTIONAL];
  349. // Optional. HCFS URIs of files to be placed in the working directory of
  350. // each executor. Useful for naively parallel tasks.
  351. repeated string file_uris = 3 [(google.api.field_behavior) = OPTIONAL];
  352. // Optional. HCFS URIs of archives to be extracted into the working directory
  353. // of each executor. Supported file types:
  354. // .jar, .tar, .tar.gz, .tgz, and .zip.
  355. repeated string archive_uris = 4 [(google.api.field_behavior) = OPTIONAL];
  356. // Optional. A mapping of property names to values, used to configure SparkR.
  357. // Properties that conflict with values set by the Dataproc API may be
  358. // overwritten. Can include properties set in
  359. // /etc/spark/conf/spark-defaults.conf and classes in user code.
  360. map<string, string> properties = 5 [(google.api.field_behavior) = OPTIONAL];
  361. // Optional. The runtime log config for job execution.
  362. LoggingConfig logging_config = 6 [(google.api.field_behavior) = OPTIONAL];
  363. }
  364. // A Dataproc job for running [Presto](https://prestosql.io/) queries.
  365. // **IMPORTANT**: The [Dataproc Presto Optional
  366. // Component](https://cloud.google.com/dataproc/docs/concepts/components/presto)
  367. // must be enabled when the cluster is created to submit a Presto job to the
  368. // cluster.
  369. message PrestoJob {
  370. // Required. The sequence of Presto queries to execute, specified as
  371. // either an HCFS file URI or as a list of queries.
  372. oneof queries {
  373. // The HCFS URI of the script that contains SQL queries.
  374. string query_file_uri = 1;
  375. // A list of queries.
  376. QueryList query_list = 2;
  377. }
  378. // Optional. Whether to continue executing queries if a query fails.
  379. // The default value is `false`. Setting to `true` can be useful when
  380. // executing independent parallel queries.
  381. bool continue_on_failure = 3 [(google.api.field_behavior) = OPTIONAL];
  382. // Optional. The format in which query output will be displayed. See the
  383. // Presto documentation for supported output formats
  384. string output_format = 4 [(google.api.field_behavior) = OPTIONAL];
  385. // Optional. Presto client tags to attach to this query
  386. repeated string client_tags = 5 [(google.api.field_behavior) = OPTIONAL];
  387. // Optional. A mapping of property names to values. Used to set Presto
  388. // [session properties](https://prestodb.io/docs/current/sql/set-session.html)
  389. // Equivalent to using the --session flag in the Presto CLI
  390. map<string, string> properties = 6 [(google.api.field_behavior) = OPTIONAL];
  391. // Optional. The runtime log config for job execution.
  392. LoggingConfig logging_config = 7 [(google.api.field_behavior) = OPTIONAL];
  393. }
  394. // Dataproc job config.
  395. message JobPlacement {
  396. // Required. The name of the cluster where the job will be submitted.
  397. string cluster_name = 1 [(google.api.field_behavior) = REQUIRED];
  398. // Output only. A cluster UUID generated by the Dataproc service when
  399. // the job is submitted.
  400. string cluster_uuid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  401. }
  402. // Dataproc job status.
  403. message JobStatus {
  404. // The job state.
  405. enum State {
  406. // The job state is unknown.
  407. STATE_UNSPECIFIED = 0;
  408. // The job is pending; it has been submitted, but is not yet running.
  409. PENDING = 1;
  410. // Job has been received by the service and completed initial setup;
  411. // it will soon be submitted to the cluster.
  412. SETUP_DONE = 8;
  413. // The job is running on the cluster.
  414. RUNNING = 2;
  415. // A CancelJob request has been received, but is pending.
  416. CANCEL_PENDING = 3;
  417. // Transient in-flight resources have been canceled, and the request to
  418. // cancel the running job has been issued to the cluster.
  419. CANCEL_STARTED = 7;
  420. // The job cancellation was successful.
  421. CANCELLED = 4;
  422. // The job has completed successfully.
  423. DONE = 5;
  424. // The job has completed, but encountered an error.
  425. ERROR = 6;
  426. // Job attempt has failed. The detail field contains failure details for
  427. // this attempt.
  428. //
  429. // Applies to restartable jobs only.
  430. ATTEMPT_FAILURE = 9;
  431. }
  432. // The job substate.
  433. enum Substate {
  434. // The job substate is unknown.
  435. UNSPECIFIED = 0;
  436. // The Job is submitted to the agent.
  437. //
  438. // Applies to RUNNING state.
  439. SUBMITTED = 1;
  440. // The Job has been received and is awaiting execution (it may be waiting
  441. // for a condition to be met). See the "details" field for the reason for
  442. // the delay.
  443. //
  444. // Applies to RUNNING state.
  445. QUEUED = 2;
  446. // The agent-reported status is out of date, which may be caused by a
  447. // loss of communication between the agent and Dataproc. If the
  448. // agent does not send a timely update, the job will fail.
  449. //
  450. // Applies to RUNNING state.
  451. STALE_STATUS = 3;
  452. }
  453. // Output only. A state message specifying the overall job state.
  454. State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  455. // Output only. Optional Job state details, such as an error
  456. // description if the state is <code>ERROR</code>.
  457. string details = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  458. // Output only. The time when this state was entered.
  459. google.protobuf.Timestamp state_start_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  460. // Output only. Additional state information, which includes
  461. // status reported by the agent.
  462. Substate substate = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  463. }
  464. // Encapsulates the full scoping used to reference a job.
  465. message JobReference {
  466. // Optional. The ID of the Google Cloud Platform project that the job belongs to. If
  467. // specified, must match the request project ID.
  468. string project_id = 1 [(google.api.field_behavior) = OPTIONAL];
  469. // Optional. The job ID, which must be unique within the project.
  470. // The ID must contain only letters (a-z, A-Z), numbers (0-9),
  471. // underscores (_), or hyphens (-). The maximum length is 100 characters.
  472. //
  473. // If not specified by the caller, the job ID will be provided by the server.
  474. string job_id = 2 [(google.api.field_behavior) = OPTIONAL];
  475. }
  476. // A YARN application created by a job. Application information is a subset of
  477. // <code>org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto</code>.
  478. //
  479. // **Beta Feature**: This report is available for testing purposes only. It may
  480. // be changed before final release.
  481. message YarnApplication {
  482. // The application state, corresponding to
  483. // <code>YarnProtos.YarnApplicationStateProto</code>.
  484. enum State {
  485. // Status is unspecified.
  486. STATE_UNSPECIFIED = 0;
  487. // Status is NEW.
  488. NEW = 1;
  489. // Status is NEW_SAVING.
  490. NEW_SAVING = 2;
  491. // Status is SUBMITTED.
  492. SUBMITTED = 3;
  493. // Status is ACCEPTED.
  494. ACCEPTED = 4;
  495. // Status is RUNNING.
  496. RUNNING = 5;
  497. // Status is FINISHED.
  498. FINISHED = 6;
  499. // Status is FAILED.
  500. FAILED = 7;
  501. // Status is KILLED.
  502. KILLED = 8;
  503. }
  504. // Output only. The application name.
  505. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  506. // Output only. The application state.
  507. State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  508. // Output only. The numerical progress of the application, from 1 to 100.
  509. float progress = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  510. // Output only. The HTTP URL of the ApplicationMaster, HistoryServer, or
  511. // TimelineServer that provides application-specific information. The URL uses
  512. // the internal hostname, and requires a proxy server for resolution and,
  513. // possibly, access.
  514. string tracking_url = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  515. }
  516. // A Dataproc job resource.
  517. message Job {
  518. // Optional. The fully qualified reference to the job, which can be used to
  519. // obtain the equivalent REST path of the job resource. If this property
  520. // is not specified when a job is created, the server generates a
  521. // <code>job_id</code>.
  522. JobReference reference = 1 [(google.api.field_behavior) = OPTIONAL];
  523. // Required. Job information, including how, when, and where to
  524. // run the job.
  525. JobPlacement placement = 2 [(google.api.field_behavior) = REQUIRED];
  526. // Required. The application/framework-specific portion of the job.
  527. oneof type_job {
  528. // Optional. Job is a Hadoop job.
  529. HadoopJob hadoop_job = 3 [(google.api.field_behavior) = OPTIONAL];
  530. // Optional. Job is a Spark job.
  531. SparkJob spark_job = 4 [(google.api.field_behavior) = OPTIONAL];
  532. // Optional. Job is a PySpark job.
  533. PySparkJob pyspark_job = 5 [(google.api.field_behavior) = OPTIONAL];
  534. // Optional. Job is a Hive job.
  535. HiveJob hive_job = 6 [(google.api.field_behavior) = OPTIONAL];
  536. // Optional. Job is a Pig job.
  537. PigJob pig_job = 7 [(google.api.field_behavior) = OPTIONAL];
  538. // Optional. Job is a SparkR job.
  539. SparkRJob spark_r_job = 21 [(google.api.field_behavior) = OPTIONAL];
  540. // Optional. Job is a SparkSql job.
  541. SparkSqlJob spark_sql_job = 12 [(google.api.field_behavior) = OPTIONAL];
  542. // Optional. Job is a Presto job.
  543. PrestoJob presto_job = 23 [(google.api.field_behavior) = OPTIONAL];
  544. }
  545. // Output only. The job status. Additional application-specific
  546. // status information may be contained in the <code>type_job</code>
  547. // and <code>yarn_applications</code> fields.
  548. JobStatus status = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  549. // Output only. The previous job status.
  550. repeated JobStatus status_history = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  551. // Output only. The collection of YARN applications spun up by this job.
  552. //
  553. // **Beta** Feature: This report is available for testing purposes only. It
  554. // may be changed before final release.
  555. repeated YarnApplication yarn_applications = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  556. // Output only. The email address of the user submitting the job. For jobs
  557. // submitted on the cluster, the address is <code>username@hostname</code>.
  558. string submitted_by = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  559. // Output only. A URI pointing to the location of the stdout of the job's
  560. // driver program.
  561. string driver_output_resource_uri = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
  562. // Output only. If present, the location of miscellaneous control files
  563. // which may be used as part of job setup and handling. If not present,
  564. // control files may be placed in the same location as `driver_output_uri`.
  565. string driver_control_files_uri = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
  566. // Optional. The labels to associate with this job.
  567. // Label **keys** must contain 1 to 63 characters, and must conform to
  568. // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
  569. // Label **values** may be empty, but, if present, must contain 1 to 63
  570. // characters, and must conform to [RFC
  571. // 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
  572. // associated with a job.
  573. map<string, string> labels = 18 [(google.api.field_behavior) = OPTIONAL];
  574. // Optional. Job scheduling configuration.
  575. JobScheduling scheduling = 20 [(google.api.field_behavior) = OPTIONAL];
  576. // Output only. A UUID that uniquely identifies a job within the project
  577. // over time. This is in contrast to a user-settable reference.job_id that
  578. // may be reused over time.
  579. string job_uuid = 22 [(google.api.field_behavior) = OUTPUT_ONLY];
  580. // Output only. Indicates whether the job is completed. If the value is `false`,
  581. // the job is still in progress. If `true`, the job is completed, and
  582. // `status.state` field will indicate if it was successful, failed,
  583. // or cancelled.
  584. bool done = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
  585. }
  586. // Job scheduling options.
  587. message JobScheduling {
  588. // Optional. Maximum number of times per hour a driver may be restarted as
  589. // a result of driver terminating with non-zero code before job is
  590. // reported failed.
  591. //
  592. // A job may be reported as thrashing if driver exits with non-zero code
  593. // 4 times within 10 minute window.
  594. //
  595. // Maximum value is 10.
  596. int32 max_failures_per_hour = 1 [(google.api.field_behavior) = OPTIONAL];
  597. }
  598. // Job Operation metadata.
  599. message JobMetadata {
  600. // Output only. The job id.
  601. string job_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  602. // Output only. Most recent job status.
  603. JobStatus status = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  604. // Output only. Operation type.
  605. string operation_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  606. // Output only. Job submission time.
  607. google.protobuf.Timestamp start_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  608. }
  609. // A request to submit a job.
  610. message SubmitJobRequest {
  611. // Required. The ID of the Google Cloud Platform project that the job
  612. // belongs to.
  613. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  614. // Required. The Dataproc region in which to handle the request.
  615. string region = 3 [(google.api.field_behavior) = REQUIRED];
  616. // Required. The job resource.
  617. Job job = 2 [(google.api.field_behavior) = REQUIRED];
  618. // Optional. A unique id used to identify the request. If the server
  619. // receives two [SubmitJobRequest][google.cloud.dataproc.v1beta2.SubmitJobRequest] requests with the same
  620. // id, then the second request will be ignored and the
  621. // first [Job][google.cloud.dataproc.v1beta2.Job] created and stored in the backend
  622. // is returned.
  623. //
  624. // It is recommended to always set this value to a
  625. // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
  626. //
  627. // The id must contain only letters (a-z, A-Z), numbers (0-9),
  628. // underscores (_), and hyphens (-). The maximum length is 40 characters.
  629. string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
  630. }
  631. // A request to get the resource representation for a job in a project.
  632. message GetJobRequest {
  633. // Required. The ID of the Google Cloud Platform project that the job
  634. // belongs to.
  635. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  636. // Required. The Dataproc region in which to handle the request.
  637. string region = 3 [(google.api.field_behavior) = REQUIRED];
  638. // Required. The job ID.
  639. string job_id = 2 [(google.api.field_behavior) = REQUIRED];
  640. }
  641. // A request to list jobs in a project.
  642. message ListJobsRequest {
  643. // A matcher that specifies categories of job states.
  644. enum JobStateMatcher {
  645. // Match all jobs, regardless of state.
  646. ALL = 0;
  647. // Only match jobs in non-terminal states: PENDING, RUNNING, or
  648. // CANCEL_PENDING.
  649. ACTIVE = 1;
  650. // Only match jobs in terminal states: CANCELLED, DONE, or ERROR.
  651. NON_ACTIVE = 2;
  652. }
  653. // Required. The ID of the Google Cloud Platform project that the job
  654. // belongs to.
  655. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  656. // Required. The Dataproc region in which to handle the request.
  657. string region = 6 [(google.api.field_behavior) = REQUIRED];
  658. // Optional. The number of results to return in each response.
  659. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  660. // Optional. The page token, returned by a previous call, to request the
  661. // next page of results.
  662. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  663. // Optional. If set, the returned jobs list includes only jobs that were
  664. // submitted to the named cluster.
  665. string cluster_name = 4 [(google.api.field_behavior) = OPTIONAL];
  666. // Optional. Specifies enumerated categories of jobs to list.
  667. // (default = match ALL jobs).
  668. //
  669. // If `filter` is provided, `jobStateMatcher` will be ignored.
  670. JobStateMatcher job_state_matcher = 5 [(google.api.field_behavior) = OPTIONAL];
  671. // Optional. A filter constraining the jobs to list. Filters are
  672. // case-sensitive and have the following syntax:
  673. //
  674. // [field = value] AND [field [= value]] ...
  675. //
  676. // where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label
  677. // key. **value** can be `*` to match all values.
  678. // `status.state` can be either `ACTIVE` or `NON_ACTIVE`.
  679. // Only the logical `AND` operator is supported; space-separated items are
  680. // treated as having an implicit `AND` operator.
  681. //
  682. // Example filter:
  683. //
  684. // status.state = ACTIVE AND labels.env = staging AND labels.starred = *
  685. string filter = 7 [(google.api.field_behavior) = OPTIONAL];
  686. }
  687. // A request to update a job.
  688. message UpdateJobRequest {
  689. // Required. The ID of the Google Cloud Platform project that the job
  690. // belongs to.
  691. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  692. // Required. The Dataproc region in which to handle the request.
  693. string region = 2 [(google.api.field_behavior) = REQUIRED];
  694. // Required. The job ID.
  695. string job_id = 3 [(google.api.field_behavior) = REQUIRED];
  696. // Required. The changes to the job.
  697. Job job = 4 [(google.api.field_behavior) = REQUIRED];
  698. // Required. Specifies the path, relative to <code>Job</code>, of
  699. // the field to update. For example, to update the labels of a Job the
  700. // <code>update_mask</code> parameter would be specified as
  701. // <code>labels</code>, and the `PATCH` request body would specify the new
  702. // value. <strong>Note:</strong> Currently, <code>labels</code> is the only
  703. // field that can be updated.
  704. google.protobuf.FieldMask update_mask = 5 [(google.api.field_behavior) = REQUIRED];
  705. }
  706. // A list of jobs in a project.
  707. message ListJobsResponse {
  708. // Output only. Jobs list.
  709. repeated Job jobs = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  710. // Optional. This token is included in the response if there are more results
  711. // to fetch. To fetch additional results, provide this value as the
  712. // `page_token` in a subsequent <code>ListJobsRequest</code>.
  713. string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL];
  714. }
  715. // A request to cancel a job.
  716. message CancelJobRequest {
  717. // Required. The ID of the Google Cloud Platform project that the job
  718. // belongs to.
  719. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  720. // Required. The Dataproc region in which to handle the request.
  721. string region = 3 [(google.api.field_behavior) = REQUIRED];
  722. // Required. The job ID.
  723. string job_id = 2 [(google.api.field_behavior) = REQUIRED];
  724. }
  725. // A request to delete a job.
  726. message DeleteJobRequest {
  727. // Required. The ID of the Google Cloud Platform project that the job
  728. // belongs to.
  729. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  730. // Required. The Dataproc region in which to handle the request.
  731. string region = 3 [(google.api.field_behavior) = REQUIRED];
  732. // Required. The job ID.
  733. string job_id = 2 [(google.api.field_behavior) = REQUIRED];
  734. }