---
title: "POST /v1/projects/{projectId}/regions/{region}/jobs:submit"
method: POST
path: "/v1/projects/{projectId}/regions/{region}/jobs:submit"
tags: ["projects"]
---

# POST /v1/projects/{projectId}/regions/{region}/jobs:submit

`POST /v1/projects/{projectId}/regions/{region}/jobs:submit`

Submits a job to a cluster.

## Path parameters

- `projectId` string, required
- `region` string, required

## Request body

- SubmitJobRequest — A request to submit a job.
  - `job` Job — A Dataproc job resource.
    - `jobUuid` string — Output only. A UUID that uniquely identifies a job within the project over time. This is in contrast to a user-settable reference.job_id that might be reused over time.
    - `status` JobStatus — Dataproc job status.
      - `state` 'STATE_UNSPECIFIED' | 'PENDING' | 'SETUP_DONE' | 'RUNNING' | 'CANCEL_PENDING' | 'CANCEL_STARTED' | 'CANCELLED' | 'DONE' | 'ERROR' | 'ATTEMPT_FAILURE' — Output only. A state message specifying the overall job state.
      - `details` string — Optional. Output only. Job state details, such as an error description if the state is ERROR.
      - `stateStartTime` string, google-datetime — Output only. The time when this state was entered.
      - `substate` 'UNSPECIFIED' | 'SUBMITTED' | 'QUEUED' | 'STALE_STATUS' — Output only. Additional state information, which includes status reported by the agent.
    - `driverSchedulingConfig` DriverSchedulingConfig — Driver scheduling configuration.
      - `memoryMb` integer — Required. The amount of memory in MB the driver is requesting.
      - `vcores` integer — Required. The number of vCPUs the driver is requesting.
    - `prestoJob` PrestoJob — A Dataproc job for running Presto (https://prestosql.io/) queries. IMPORTANT: The Dataproc Presto Optional Component (https://cloud.google.com/dataproc/docs/concepts/components/presto) must be enabled when the cluster is created to submit a Presto job to the cluster.
      - `loggingConfig` LoggingConfig — The runtime logging config of the job.
        - `driverLogLevels` object — The per-package log levels for the driver. This can include "root" package name to configure rootLogger. Examples: - 'com.google = FATAL' - 'root = INFO' - 'org.apache = DEBUG'
      - `queryList` QueryList — A list of queries to run on a cluster.
        - `queries` string[] — Required. The queries to execute. You do not need to end a query expression with a semicolon. Multiple queries can be specified in one string by separating each with a semicolon. Here is an example of a Dataproc API snippet that uses a QueryList to specify a HiveJob: "hiveJob": { "queryList": { "queries": [ "query1", "query2", "query3;query4", ] } }
      - `outputFormat` string — Optional. The format in which query output will be displayed. See the Presto documentation for supported output formats
      - `properties` object — Optional. A mapping of property names to values. Used to set Presto session properties (https://prestodb.io/docs/current/sql/set-session.html) Equivalent to using the --session flag in the Presto CLI
      - `queryFileUri` string — The HCFS URI of the script that contains SQL queries.
      - `clientTags` string[] — Optional. Presto client tags to attach to this query
      - `continueOnFailure` boolean — Optional. Whether to continue executing queries if a query fails. The default value is false. Setting to true can be useful when executing independent parallel queries.
    - `driverControlFilesUri` string — Output only. If present, the location of miscellaneous control files which can be used as part of job setup and handling. If not present, control files might be placed in the same location as driver_output_uri.
    - `yarnApplications` YarnApplication[] — Output only. The collection of YARN applications spun up by this job.Beta Feature: This report is available for testing purposes only. It might be changed before final release.
      - `vcoreSeconds` string, int64 — Optional. The cumulative CPU time consumed by the application for a job, measured in vcore-seconds.
      - `state` 'STATE_UNSPECIFIED' | 'NEW' | 'NEW_SAVING' | 'SUBMITTED' | 'ACCEPTED' | 'RUNNING' | 'FINISHED' | 'FAILED' | 'KILLED' — Required. The application state.
      - `progress` number, float — Required. The numerical progress of the application, from 1 to 100.
      - `memoryMbSeconds` string, int64 — Optional. The cumulative memory usage of the application for a job, measured in mb-seconds.
      - `trackingUrl` string — Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or TimelineServer that provides application-specific information. The URL uses the internal hostname, and requires a proxy server for resolution and, possibly, access.
      - `name` string — Required. The application name.
    - `sparkRJob` SparkRJob — A Dataproc job for running Apache SparkR (https://spark.apache.org/docs/latest/sparkr.html) applications on YARN.
      - `fileUris` string[] — Optional. HCFS URIs of files to be placed in the working directory of each executor. Useful for naively parallel tasks.
      - `args` string[] — Optional. The arguments to pass to the driver. Do not include arguments, such as --conf, that can be set as job properties, since a collision may occur that causes an incorrect job submission.
      - `properties` object — Optional. A mapping of property names to values, used to configure SparkR. Properties that conflict with values set by the Dataproc API might be overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code.
      - `loggingConfig` LoggingConfig — The runtime logging config of the job.
        - `driverLogLevels` object — The per-package log levels for the driver. This can include "root" package name to configure rootLogger. Examples: - 'com.google = FATAL' - 'root = INFO' - 'org.apache = DEBUG'
      - `mainRFileUri` string — Required. The HCFS URI of the main R file to use as the driver. Must be a .R file.
      - `archiveUris` string[] — Optional. HCFS URIs of archives to be extracted into the working directory of each executor. Supported file types: .jar, .tar, .tar.gz, .tgz, and .zip.
    - `hadoopJob` HadoopJob — A Dataproc job for running Apache Hadoop MapReduce (https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html) jobs on Apache Hadoop YARN (https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html).
      - `mainClass` string — The name of the driver's main class. The jar file containing the class must be in the default CLASSPATH or specified in jar_file_uris.
      - `args` string[] — Optional. The arguments to pass to the driver. Do not include arguments, such as -libjars or -Dfoo=bar, that can be set as job properties, since a collision might occur that causes an incorrect job submission.
      - `fileUris` string[] — Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied to the working directory of Hadoop drivers and distributed tasks. Useful for naively parallel tasks.
      - `archiveUris` string[] — Optional. HCFS URIs of archives to be extracted in the working directory of Hadoop drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, or .zip.
      - `loggingConfig` LoggingConfig — The runtime logging config of the job.
        - `driverLogLevels` object — The per-package log levels for the driver. This can include "root" package name to configure rootLogger. Examples: - 'com.google = FATAL' - 'root = INFO' - 'org.apache = DEBUG'
      - `mainJarFileUri` string — The HCFS URI of the jar file containing the main class. Examples: 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' 'hdfs:/tmp/test-samples/custom-wordcount.jar' 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar'
      - `jarFileUris` string[] — Optional. Jar file URIs to add to the CLASSPATHs of the Hadoop driver and tasks.
      - `properties` object — Optional. A mapping of property names to values, used to configure Hadoop. Properties that conflict with values set by the Dataproc API might be overwritten. Can include properties set in /etc/hadoop/conf/*-site and classes in user code.
    - `flinkJob` FlinkJob — A Dataproc job for running Apache Flink applications on YARN.
      - `mainClass` string — The name of the driver's main class. The jar file that contains the class must be in the default CLASSPATH or specified in jarFileUris.
      - `args` string[] — Optional. The arguments to pass to the driver. Do not include arguments, such as --conf, that can be set as job properties, since a collision might occur that causes an incorrect job submission.
      - `savepointUri` string — Optional. HCFS URI of the savepoint, which contains the last saved progress for starting the current job.
      - `loggingConfig` LoggingConfig — The runtime logging config of the job.
        - `driverLogLevels` object — The per-package log levels for the driver. This can include "root" package name to configure rootLogger. Examples: - 'com.google = FATAL' - 'root = INFO' - 'org.apache = DEBUG'
      - `mainJarFileUri` string — The HCFS URI of the jar file that contains the main class.
      - `jarFileUris` string[] — Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Flink driver and tasks.
      - `properties` object — Optional. A mapping of property names to values, used to configure Flink. Properties that conflict with values set by the Dataproc API might be overwritten. Can include properties set in /etc/flink/conf/flink-defaults.conf and classes in user code.
    - `reference` JobReference — Encapsulates the full scoping used to reference a job.
      - `jobId` string — Optional. The job ID, which must be unique within the project.The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or hyphens (-). The maximum length is 100 characters.If not specified by the caller, the job ID will be provided by the server.
      - `projectId` string — Optional. The ID of the Google Cloud Platform project that the job belongs to. If specified, must match the request project ID.
    - `scheduling` JobScheduling — Job scheduling options.
      - `maxFailuresPerHour` integer — Optional. Maximum number of times per hour a driver can be restarted as a result of driver exiting with non-zero code before job is reported failed.A job might be reported as thrashing if the driver exits with a non-zero code four times within a 10-minute window.Maximum value is 10.Note: This restartable job option is not supported in Dataproc workflow templates (https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template).
      - `maxFailuresTotal` integer — Optional. Maximum total number of times a driver can be restarted as a result of the driver exiting with a non-zero code. After the maximum number is reached, the job will be reported as failed.Maximum value is 240.Note: Currently, this restartable job option is not supported in Dataproc workflow templates (https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template).
    - `hiveJob` HiveJob — A Dataproc job for running Apache Hive (https://hive.apache.org/) queries on YARN.
      - `queryList` QueryList — A list of queries to run on a cluster.
        - `queries` string[] — Required. The queries to execute. You do not need to end a query expression with a semicolon. Multiple queries can be specified in one string by separating each with a semicolon. Here is an example of a Dataproc API snippet that uses a QueryList to specify a HiveJob: "hiveJob": { "queryList": { "queries": [ "query1", "query2", "query3;query4", ] } }
      - `properties` object — Optional. A mapping of property names and values, used to configure Hive. Properties that conflict with values set by the Dataproc API might be overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, /etc/hive/conf/hive-site.xml, and classes in user code.
      - `jarFileUris` string[] — Optional. HCFS URIs of jar files to add to the CLASSPATH of the Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes and UDFs.
      - `queryFileUri` string — The HCFS URI of the script that contains Hive queries.
      - `scriptVariables` object — Optional. Mapping of query variable names to values (equivalent to the Hive command: SET name="value";).
      - `continueOnFailure` boolean — Optional. Whether to continue executing queries if a query fails. The default value is false. Setting to true can be useful when executing independent parallel queries.
    - `sparkJob` SparkJob — A Dataproc job for running Apache Spark (https://spark.apache.org/) applications on YARN.
      - `mainClass` string — The name of the driver's main class. The jar file that contains the class must be in the default CLASSPATH or specified in SparkJob.jar_file_uris.
      - `args` string[] — Optional. The arguments to pass to the driver. Do not include arguments, such as --conf, that can be set as job properties, since a collision may occur that causes an incorrect job submission.
      - `fileUris` string[] — Optional. HCFS URIs of files to be placed in the working directory of each executor. Useful for naively parallel tasks.
      - `archiveUris` string[] — Optional. HCFS URIs of archives to be extracted into the working directory of each executor. Supported file types: .jar, .tar, .tar.gz, .tgz, and .zip.
      - `loggingConfig` LoggingConfig — The runtime logging config of the job.
        - `driverLogLevels` object — The per-package log levels for the driver. This can include "root" package name to configure rootLogger. Examples: - 'com.google = FATAL' - 'root = INFO' - 'org.apache = DEBUG'
      - `mainJarFileUri` string — The HCFS URI of the jar file that contains the main class.
      - `jarFileUris` string[] — Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Spark driver and tasks.
      - `properties` object — Optional. A mapping of property names to values, used to configure Spark. Properties that conflict with values set by the Dataproc API might be overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code.
    - `statusHistory` JobStatus[] — Output only. The previous job status.
      - `state` 'STATE_UNSPECIFIED' | 'PENDING' | 'SETUP_DONE' | 'RUNNING' | 'CANCEL_PENDING' | 'CANCEL_STARTED' | 'CANCELLED' | 'DONE' | 'ERROR' | 'ATTEMPT_FAILURE' — Output only. A state message specifying the overall job state.
      - `details` string — Optional. Output only. Job state details, such as an error description if the state is ERROR.
      - `stateStartTime` string, google-datetime — Output only. The time when this state was entered.
      - `substate` 'UNSPECIFIED' | 'SUBMITTED' | 'QUEUED' | 'STALE_STATUS' — Output only. Additional state information, which includes status reported by the agent.
    - `labels` object — Optional. The labels to associate with this job. Label keys must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). Label values can be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a job.
    - `trinoJob` TrinoJob — A Dataproc job for running Trino (https://trino.io/) queries. IMPORTANT: The Dataproc Trino Optional Component (https://cloud.google.com/dataproc/docs/concepts/components/trino) must be enabled when the cluster is created to submit a Trino job to the cluster.
      - `queryList` QueryList — A list of queries to run on a cluster.
        - `queries` string[] — Required. The queries to execute. You do not need to end a query expression with a semicolon. Multiple queries can be specified in one string by separating each with a semicolon. Here is an example of a Dataproc API snippet that uses a QueryList to specify a HiveJob: "hiveJob": { "queryList": { "queries": [ "query1", "query2", "query3;query4", ] } }
      - `outputFormat` string — Optional. The format in which query output will be displayed. See the Trino documentation for supported output formats
      - `properties` object — Optional. A mapping of property names to values. Used to set Trino session properties (https://trino.io/docs/current/sql/set-session.html) Equivalent to using the --session flag in the Trino CLI
      - `loggingConfig` LoggingConfig — The runtime logging config of the job.
        - `driverLogLevels` object — The per-package log levels for the driver. This can include "root" package name to configure rootLogger. Examples: - 'com.google = FATAL' - 'root = INFO' - 'org.apache = DEBUG'
      - `continueOnFailure` boolean — Optional. Whether to continue executing queries if a query fails. The default value is false. Setting to true can be useful when executing independent parallel queries.
      - `queryFileUri` string — The HCFS URI of the script that contains SQL queries.
      - `clientTags` string[] — Optional. Trino client tags to attach to this query
    - `pysparkJob` PySparkJob — A Dataproc job for running Apache PySpark (https://spark.apache.org/docs/latest/api/python/index.html#pyspark-overview) applications on YARN.
      - `jarFileUris` string[] — Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Python driver and tasks.
      - `properties` object — Optional. A mapping of property names to values, used to configure PySpark. Properties that conflict with values set by the Dataproc API might be overwritten. Can include properties set in /etc/spark/conf/spark-defaults.conf and classes in user code.
      - `loggingConfig` LoggingConfig — The runtime logging config of the job.
        - `driverLogLevels` object — The per-package log levels for the driver. This can include "root" package name to configure rootLogger. Examples: - 'com.google = FATAL' - 'root = INFO' - 'org.apache = DEBUG'
      - `pythonFileUris` string[] — Optional. HCFS file URIs of Python files to pass to the PySpark framework. Supported file types: .py, .egg, and .zip.
      - `archiveUris` string[] — Optional. HCFS URIs of archives to be extracted into the working directory of each executor. Supported file types: .jar, .tar, .tar.gz, .tgz, and .zip.Note: Spark applications must be deployed in cluster mode (https://spark.apache.org/docs/latest/cluster-overview.html) for correct environment propagation.
      - `fileUris` string[] — Optional. HCFS URIs of files to be placed in the working directory of each executor. Useful for naively parallel tasks.
      - `mainPythonFileUri` string — Required. The HCFS URI of the main Python file to use as the driver. Must be a .py file.
      - `args` string[] — Optional. The arguments to pass to the driver. Do not include arguments, such as --conf, that can be set as job properties, since a collision may occur that causes an incorrect job submission.
    - `pigJob` PigJob — A Dataproc job for running Apache Pig (https://pig.apache.org/) queries on YARN.
      - `scriptVariables` object — Optional. Mapping of query variable names to values (equivalent to the Pig command: name=[value]).
      - `continueOnFailure` boolean — Optional. Whether to continue executing queries if a query fails. The default value is false. Setting to true can be useful when executing independent parallel queries.
      - `queryFileUri` string — The HCFS URI of the script that contains the Pig queries.
      - `loggingConfig` LoggingConfig — The runtime logging config of the job.
        - `driverLogLevels` object — The per-package log levels for the driver. This can include "root" package name to configure rootLogger. Examples: - 'com.google = FATAL' - 'root = INFO' - 'org.apache = DEBUG'
      - `queryList` QueryList — A list of queries to run on a cluster.
        - `queries` string[] — Required. The queries to execute. You do not need to end a query expression with a semicolon. Multiple queries can be specified in one string by separating each with a semicolon. Here is an example of a Dataproc API snippet that uses a QueryList to specify a HiveJob: "hiveJob": { "queryList": { "queries": [ "query1", "query2", "query3;query4", ] } }
      - `properties` object — Optional. A mapping of property names to values, used to configure Pig. Properties that conflict with values set by the Dataproc API might be overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, /etc/pig/conf/pig.properties, and classes in user code.
      - `jarFileUris` string[] — Optional. HCFS URIs of jar files to add to the CLASSPATH of the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
    - `placement` JobPlacement — Dataproc job config.
      - `clusterUuid` string — Output only. A cluster UUID generated by the Dataproc service when the job is submitted.
      - `clusterName` string — Required. The name of the cluster where the job will be submitted.
      - `clusterLabels` object — Optional. Cluster labels to identify a cluster where the job will be submitted.
    - `done` boolean — Output only. Indicates whether the job is completed. If the value is false, the job is still in progress. If true, the job is completed, and status.state field will indicate if it was successful, failed, or cancelled.
    - `driverOutputResourceUri` string — Output only. A URI pointing to the location of the stdout of the job's driver program.
    - `sparkSqlJob` SparkSqlJob — A Dataproc job for running Apache Spark SQL (https://spark.apache.org/sql/) queries.
      - `loggingConfig` LoggingConfig — The runtime logging config of the job.
        - `driverLogLevels` object — The per-package log levels for the driver. This can include "root" package name to configure rootLogger. Examples: - 'com.google = FATAL' - 'root = INFO' - 'org.apache = DEBUG'
      - `queryList` QueryList — A list of queries to run on a cluster.
        - `queries` string[] — Required. The queries to execute. You do not need to end a query expression with a semicolon. Multiple queries can be specified in one string by separating each with a semicolon. Here is an example of a Dataproc API snippet that uses a QueryList to specify a HiveJob: "hiveJob": { "queryList": { "queries": [ "query1", "query2", "query3;query4", ] } }
      - `properties` object — Optional. A mapping of property names to values, used to configure Spark SQL's SparkConf. Properties that conflict with values set by the Dataproc API might be overwritten.
      - `jarFileUris` string[] — Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH.
      - `queryFileUri` string — The HCFS URI of the script that contains SQL queries.
      - `scriptVariables` object — Optional. Mapping of query variable names to values (equivalent to the Spark SQL command: SET name="value";).
  - `requestId` string — Optional. A unique id used to identify the request. If the server receives two SubmitJobRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s with the same id, then the second request will be ignored and the first Job created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/dataproc.md) · [All operations](https://skmtc.net/google/apis/dataproc/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/dataproc/revisions/15847ccbcf7d/schema)
