jobs.proto 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924
  1. // Copyright 2021 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.v1;
  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/v1;dataproc";
  24. option java_multiple_files = true;
  25. option java_outer_classname = "JobsProto";
  26. option java_package = "com.google.cloud.dataproc.v1";
  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: "/v1/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: "/v1/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: "/v1/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: "/v1/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: "/v1/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/v1/projects.regions.jobs/list)
  76. // or
  77. // [regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get).
  78. rpc CancelJob(CancelJobRequest) returns (Job) {
  79. option (google.api.http) = {
  80. post: "/v1/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: "/v1/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](https://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. message SparkJob {
  173. // Required. The specification of the main method to call to drive the job.
  174. // Specify either the jar file that contains the main class or the main class
  175. // name. To pass both a main jar and a main class in that jar, add the jar to
  176. // `CommonJob.jar_file_uris`, and then specify the main class name in
  177. // `main_class`.
  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 end a query expression
  243. // with a semicolon. Multiple queries can be specified in one
  244. // string by separating each with a semicolon. Here is an example of a
  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. // Optional. Cluster labels to identify a cluster where the job will be submitted.
  402. map<string, string> cluster_labels = 3 [(google.api.field_behavior) = OPTIONAL];
  403. }
  404. // Dataproc job status.
  405. message JobStatus {
  406. // The job state.
  407. enum State {
  408. // The job state is unknown.
  409. STATE_UNSPECIFIED = 0;
  410. // The job is pending; it has been submitted, but is not yet running.
  411. PENDING = 1;
  412. // Job has been received by the service and completed initial setup;
  413. // it will soon be submitted to the cluster.
  414. SETUP_DONE = 8;
  415. // The job is running on the cluster.
  416. RUNNING = 2;
  417. // A CancelJob request has been received, but is pending.
  418. CANCEL_PENDING = 3;
  419. // Transient in-flight resources have been canceled, and the request to
  420. // cancel the running job has been issued to the cluster.
  421. CANCEL_STARTED = 7;
  422. // The job cancellation was successful.
  423. CANCELLED = 4;
  424. // The job has completed successfully.
  425. DONE = 5;
  426. // The job has completed, but encountered an error.
  427. ERROR = 6;
  428. // Job attempt has failed. The detail field contains failure details for
  429. // this attempt.
  430. //
  431. // Applies to restartable jobs only.
  432. ATTEMPT_FAILURE = 9;
  433. }
  434. // The job substate.
  435. enum Substate {
  436. // The job substate is unknown.
  437. UNSPECIFIED = 0;
  438. // The Job is submitted to the agent.
  439. //
  440. // Applies to RUNNING state.
  441. SUBMITTED = 1;
  442. // The Job has been received and is awaiting execution (it may be waiting
  443. // for a condition to be met). See the "details" field for the reason for
  444. // the delay.
  445. //
  446. // Applies to RUNNING state.
  447. QUEUED = 2;
  448. // The agent-reported status is out of date, which may be caused by a
  449. // loss of communication between the agent and Dataproc. If the
  450. // agent does not send a timely update, the job will fail.
  451. //
  452. // Applies to RUNNING state.
  453. STALE_STATUS = 3;
  454. }
  455. // Output only. A state message specifying the overall job state.
  456. State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  457. // Optional. Output only. Job state details, such as an error
  458. // description if the state is <code>ERROR</code>.
  459. string details = 2 [
  460. (google.api.field_behavior) = OUTPUT_ONLY,
  461. (google.api.field_behavior) = OPTIONAL
  462. ];
  463. // Output only. The time when this state was entered.
  464. google.protobuf.Timestamp state_start_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  465. // Output only. Additional state information, which includes
  466. // status reported by the agent.
  467. Substate substate = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  468. }
  469. // Encapsulates the full scoping used to reference a job.
  470. message JobReference {
  471. // Optional. The ID of the Google Cloud Platform project that the job belongs to. If
  472. // specified, must match the request project ID.
  473. string project_id = 1 [(google.api.field_behavior) = OPTIONAL];
  474. // Optional. The job ID, which must be unique within the project.
  475. //
  476. // The ID must contain only letters (a-z, A-Z), numbers (0-9),
  477. // underscores (_), or hyphens (-). The maximum length is 100 characters.
  478. //
  479. // If not specified by the caller, the job ID will be provided by the server.
  480. string job_id = 2 [(google.api.field_behavior) = OPTIONAL];
  481. }
  482. // A YARN application created by a job. Application information is a subset of
  483. // <code>org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto</code>.
  484. //
  485. // **Beta Feature**: This report is available for testing purposes only. It may
  486. // be changed before final release.
  487. message YarnApplication {
  488. // The application state, corresponding to
  489. // <code>YarnProtos.YarnApplicationStateProto</code>.
  490. enum State {
  491. // Status is unspecified.
  492. STATE_UNSPECIFIED = 0;
  493. // Status is NEW.
  494. NEW = 1;
  495. // Status is NEW_SAVING.
  496. NEW_SAVING = 2;
  497. // Status is SUBMITTED.
  498. SUBMITTED = 3;
  499. // Status is ACCEPTED.
  500. ACCEPTED = 4;
  501. // Status is RUNNING.
  502. RUNNING = 5;
  503. // Status is FINISHED.
  504. FINISHED = 6;
  505. // Status is FAILED.
  506. FAILED = 7;
  507. // Status is KILLED.
  508. KILLED = 8;
  509. }
  510. // Required. The application name.
  511. string name = 1 [(google.api.field_behavior) = REQUIRED];
  512. // Required. The application state.
  513. State state = 2 [(google.api.field_behavior) = REQUIRED];
  514. // Required. The numerical progress of the application, from 1 to 100.
  515. float progress = 3 [(google.api.field_behavior) = REQUIRED];
  516. // Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or
  517. // TimelineServer that provides application-specific information. The URL uses
  518. // the internal hostname, and requires a proxy server for resolution and,
  519. // possibly, access.
  520. string tracking_url = 4 [(google.api.field_behavior) = OPTIONAL];
  521. }
  522. // A Dataproc job resource.
  523. message Job {
  524. // Optional. The fully qualified reference to the job, which can be used to
  525. // obtain the equivalent REST path of the job resource. If this property
  526. // is not specified when a job is created, the server generates a
  527. // <code>job_id</code>.
  528. JobReference reference = 1 [(google.api.field_behavior) = OPTIONAL];
  529. // Required. Job information, including how, when, and where to
  530. // run the job.
  531. JobPlacement placement = 2 [(google.api.field_behavior) = REQUIRED];
  532. // Required. The application/framework-specific portion of the job.
  533. oneof type_job {
  534. // Optional. Job is a Hadoop job.
  535. HadoopJob hadoop_job = 3 [(google.api.field_behavior) = OPTIONAL];
  536. // Optional. Job is a Spark job.
  537. SparkJob spark_job = 4 [(google.api.field_behavior) = OPTIONAL];
  538. // Optional. Job is a PySpark job.
  539. PySparkJob pyspark_job = 5 [(google.api.field_behavior) = OPTIONAL];
  540. // Optional. Job is a Hive job.
  541. HiveJob hive_job = 6 [(google.api.field_behavior) = OPTIONAL];
  542. // Optional. Job is a Pig job.
  543. PigJob pig_job = 7 [(google.api.field_behavior) = OPTIONAL];
  544. // Optional. Job is a SparkR job.
  545. SparkRJob spark_r_job = 21 [(google.api.field_behavior) = OPTIONAL];
  546. // Optional. Job is a SparkSql job.
  547. SparkSqlJob spark_sql_job = 12 [(google.api.field_behavior) = OPTIONAL];
  548. // Optional. Job is a Presto job.
  549. PrestoJob presto_job = 23 [(google.api.field_behavior) = OPTIONAL];
  550. }
  551. // Output only. The job status. Additional application-specific
  552. // status information may be contained in the <code>type_job</code>
  553. // and <code>yarn_applications</code> fields.
  554. JobStatus status = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  555. // Output only. The previous job status.
  556. repeated JobStatus status_history = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  557. // Output only. The collection of YARN applications spun up by this job.
  558. //
  559. // **Beta** Feature: This report is available for testing purposes only. It
  560. // may be changed before final release.
  561. repeated YarnApplication yarn_applications = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  562. // Output only. A URI pointing to the location of the stdout of the job's
  563. // driver program.
  564. string driver_output_resource_uri = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
  565. // Output only. If present, the location of miscellaneous control files
  566. // which may be used as part of job setup and handling. If not present,
  567. // control files may be placed in the same location as `driver_output_uri`.
  568. string driver_control_files_uri = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
  569. // Optional. The labels to associate with this job.
  570. // Label **keys** must contain 1 to 63 characters, and must conform to
  571. // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt).
  572. // Label **values** may be empty, but, if present, must contain 1 to 63
  573. // characters, and must conform to [RFC
  574. // 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be
  575. // associated with a job.
  576. map<string, string> labels = 18 [(google.api.field_behavior) = OPTIONAL];
  577. // Optional. Job scheduling configuration.
  578. JobScheduling scheduling = 20 [(google.api.field_behavior) = OPTIONAL];
  579. // Output only. A UUID that uniquely identifies a job within the project
  580. // over time. This is in contrast to a user-settable reference.job_id that
  581. // may be reused over time.
  582. string job_uuid = 22 [(google.api.field_behavior) = OUTPUT_ONLY];
  583. // Output only. Indicates whether the job is completed. If the value is `false`,
  584. // the job is still in progress. If `true`, the job is completed, and
  585. // `status.state` field will indicate if it was successful, failed,
  586. // or cancelled.
  587. bool done = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
  588. }
  589. // Job scheduling options.
  590. message JobScheduling {
  591. // Optional. Maximum number of times per hour a driver may be restarted as
  592. // a result of driver exiting with non-zero code before job is
  593. // reported failed.
  594. //
  595. // A job may be reported as thrashing if driver exits with non-zero code
  596. // 4 times within 10 minute window.
  597. //
  598. // Maximum value is 10.
  599. //
  600. // **Note:** Currently, this restartable job option is
  601. // not supported in Dataproc
  602. // [workflow
  603. // template](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template)
  604. // jobs.
  605. int32 max_failures_per_hour = 1 [(google.api.field_behavior) = OPTIONAL];
  606. // Optional. Maximum number of times in total a driver may be restarted as a result of
  607. // driver exiting with non-zero code before job is reported failed.
  608. // Maximum value is 240.
  609. //
  610. // **Note:** Currently, this restartable job option is
  611. // not supported in Dataproc
  612. // [workflow
  613. // template](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template)
  614. // jobs.
  615. int32 max_failures_total = 2 [(google.api.field_behavior) = OPTIONAL];
  616. }
  617. // A request to submit a job.
  618. message SubmitJobRequest {
  619. // Required. The ID of the Google Cloud Platform project that the job
  620. // belongs to.
  621. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  622. // Required. The Dataproc region in which to handle the request.
  623. string region = 3 [(google.api.field_behavior) = REQUIRED];
  624. // Required. The job resource.
  625. Job job = 2 [(google.api.field_behavior) = REQUIRED];
  626. // Optional. A unique id used to identify the request. If the server
  627. // receives two
  628. // [SubmitJobRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s
  629. // with the same id, then the second request will be ignored and the
  630. // first [Job][google.cloud.dataproc.v1.Job] created and stored in the backend
  631. // is returned.
  632. //
  633. // It is recommended to always set this value to a
  634. // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier).
  635. //
  636. // The id must contain only letters (a-z, A-Z), numbers (0-9),
  637. // underscores (_), and hyphens (-). The maximum length is 40 characters.
  638. string request_id = 4 [(google.api.field_behavior) = OPTIONAL];
  639. }
  640. // Job Operation metadata.
  641. message JobMetadata {
  642. // Output only. The job id.
  643. string job_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  644. // Output only. Most recent job status.
  645. JobStatus status = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  646. // Output only. Operation type.
  647. string operation_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  648. // Output only. Job submission time.
  649. google.protobuf.Timestamp start_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  650. }
  651. // A request to get the resource representation for a job in a project.
  652. message GetJobRequest {
  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 = 3 [(google.api.field_behavior) = REQUIRED];
  658. // Required. The job ID.
  659. string job_id = 2 [(google.api.field_behavior) = REQUIRED];
  660. }
  661. // A request to list jobs in a project.
  662. message ListJobsRequest {
  663. // A matcher that specifies categories of job states.
  664. enum JobStateMatcher {
  665. // Match all jobs, regardless of state.
  666. ALL = 0;
  667. // Only match jobs in non-terminal states: PENDING, RUNNING, or
  668. // CANCEL_PENDING.
  669. ACTIVE = 1;
  670. // Only match jobs in terminal states: CANCELLED, DONE, or ERROR.
  671. NON_ACTIVE = 2;
  672. }
  673. // Required. The ID of the Google Cloud Platform project that the job
  674. // belongs to.
  675. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  676. // Required. The Dataproc region in which to handle the request.
  677. string region = 6 [(google.api.field_behavior) = REQUIRED];
  678. // Optional. The number of results to return in each response.
  679. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  680. // Optional. The page token, returned by a previous call, to request the
  681. // next page of results.
  682. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  683. // Optional. If set, the returned jobs list includes only jobs that were
  684. // submitted to the named cluster.
  685. string cluster_name = 4 [(google.api.field_behavior) = OPTIONAL];
  686. // Optional. Specifies enumerated categories of jobs to list.
  687. // (default = match ALL jobs).
  688. //
  689. // If `filter` is provided, `jobStateMatcher` will be ignored.
  690. JobStateMatcher job_state_matcher = 5 [(google.api.field_behavior) = OPTIONAL];
  691. // Optional. A filter constraining the jobs to list. Filters are
  692. // case-sensitive and have the following syntax:
  693. //
  694. // [field = value] AND [field [= value]] ...
  695. //
  696. // where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label
  697. // key. **value** can be `*` to match all values.
  698. // `status.state` can be either `ACTIVE` or `NON_ACTIVE`.
  699. // Only the logical `AND` operator is supported; space-separated items are
  700. // treated as having an implicit `AND` operator.
  701. //
  702. // Example filter:
  703. //
  704. // status.state = ACTIVE AND labels.env = staging AND labels.starred = *
  705. string filter = 7 [(google.api.field_behavior) = OPTIONAL];
  706. }
  707. // A request to update a job.
  708. message UpdateJobRequest {
  709. // Required. The ID of the Google Cloud Platform project that the job
  710. // belongs to.
  711. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  712. // Required. The Dataproc region in which to handle the request.
  713. string region = 2 [(google.api.field_behavior) = REQUIRED];
  714. // Required. The job ID.
  715. string job_id = 3 [(google.api.field_behavior) = REQUIRED];
  716. // Required. The changes to the job.
  717. Job job = 4 [(google.api.field_behavior) = REQUIRED];
  718. // Required. Specifies the path, relative to <code>Job</code>, of
  719. // the field to update. For example, to update the labels of a Job the
  720. // <code>update_mask</code> parameter would be specified as
  721. // <code>labels</code>, and the `PATCH` request body would specify the new
  722. // value. <strong>Note:</strong> Currently, <code>labels</code> is the only
  723. // field that can be updated.
  724. google.protobuf.FieldMask update_mask = 5 [(google.api.field_behavior) = REQUIRED];
  725. }
  726. // A list of jobs in a project.
  727. message ListJobsResponse {
  728. // Output only. Jobs list.
  729. repeated Job jobs = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  730. // Optional. This token is included in the response if there are more results
  731. // to fetch. To fetch additional results, provide this value as the
  732. // `page_token` in a subsequent <code>ListJobsRequest</code>.
  733. string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL];
  734. }
  735. // A request to cancel a job.
  736. message CancelJobRequest {
  737. // Required. The ID of the Google Cloud Platform project that the job
  738. // belongs to.
  739. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  740. // Required. The Dataproc region in which to handle the request.
  741. string region = 3 [(google.api.field_behavior) = REQUIRED];
  742. // Required. The job ID.
  743. string job_id = 2 [(google.api.field_behavior) = REQUIRED];
  744. }
  745. // A request to delete a job.
  746. message DeleteJobRequest {
  747. // Required. The ID of the Google Cloud Platform project that the job
  748. // belongs to.
  749. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  750. // Required. The Dataproc region in which to handle the request.
  751. string region = 3 [(google.api.field_behavior) = REQUIRED];
  752. // Required. The job ID.
  753. string job_id = 2 [(google.api.field_behavior) = REQUIRED];
  754. }