Skip to main content

Get

Returns the specified job.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const GetJobRequest = cloudApi.dataproc.job_service.GetJobRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.JobServiceClient);

const result = await client.get(
GetJobRequest.fromPartial({
clusterId: "clusterId",
jobId: "jobId",
})
);
console.log(result);
})();

GetJobRequest

clusterId : string

ID of the cluster to request a job from.

jobId : string

ID of the job to return.

To get a job ID make a JobService.List request.

Job

A Data Proc job. For details about the concept, see documentation.

Status

  • STATUS_UNSPECIFIED

  • PROVISIONING

    Job is logged in the database and is waiting for the agent to run it.

  • PENDING

    Job is acquired by the agent and is in the queue for execution.

  • RUNNING

    Job is being run in the cluster.

  • ERROR

    Job failed to finish the run properly.

  • DONE

    Job is finished.

  • CANCELLED

    Job is cancelled.

  • CANCELLING

    Job is waiting for cancellation.

id : string

ID of the job. Generated at creation time.

clusterId : string

ID of the Data Proc cluster that the job belongs to.

createdAt : google.protobuf.Timestamp

Creation timestamp.

startedAt : google.protobuf.Timestamp

The time when the job was started.

finishedAt : google.protobuf.Timestamp

The time when the job was finished.

name : string

Name of the job, specified in the JobService.Create request.

createdBy : string

The id of the user who created the job

status : Status

Job status.

One of jobSpec

Specification for the job.

  • mapreduceJob : MapreduceJob

    Specification for a MapReduce job.

  • sparkJob : SparkJob

    Specification for a Spark job.

  • pysparkJob : PysparkJob

    Specification for a PySpark job.

  • hiveJob : HiveJob

    Specification for a Hive job.

applicationInfo : ApplicationInfo

Attributes of YARN application.

MapreduceJob

args : string

Optional arguments to pass to the driver.

jarFileUris : string

JAR file URIs to add to CLASSPATH of the Data Proc driver and each task.

fileUris : string

URIs of resource files to be copied to the working directory of Data Proc drivers and distributed Hadoop tasks.

archiveUris : string

URIs of archives to be extracted to the working directory of Data Proc drivers and tasks.

properties : string

Property names and values, used to configure Data Proc and MapReduce.

One of driver

  • mainJarFileUri : string

    HCFS URI of the .jar file containing the driver class.

  • mainClass : string

    The name of the driver class.

SparkJob

args : string

Optional arguments to pass to the driver.

jarFileUris : string

JAR file URIs to add to CLASSPATH of the Data Proc driver and each task.

fileUris : string

URIs of resource files to be copied to the working directory of Data Proc drivers and distributed Hadoop tasks.

archiveUris : string

URIs of archives to be extracted to the working directory of Data Proc drivers and tasks.

properties : string

Property names and values, used to configure Data Proc and Spark.

mainJarFileUri : string

The HCFS URI of the JAR file containing the main class for the job.

mainClass : string

The name of the driver class.

packages : string

List of maven coordinates of jars to include on the driver and executor classpaths.

repositories : string

List of additional remote repositories to search for the maven coordinates given with --packages.

excludePackages : string

List of groupId:artifactId, to exclude while resolving the dependencies provided in --packages to avoid dependency conflicts.

PysparkJob

args : string

Optional arguments to pass to the driver.

jarFileUris : string

JAR file URIs to add to CLASSPATH of the Data Proc driver and each task.

fileUris : string

URIs of resource files to be copied to the working directory of Data Proc drivers and distributed Hadoop tasks.

archiveUris : string

URIs of archives to be extracted to the working directory of Data Proc drivers and tasks.

properties : string

Property names and values, used to configure Data Proc and PySpark.

mainPythonFileUri : string

URI of the file with the driver code. Must be a .py file.

pythonFileUris : string

URIs of Python files to pass to the PySpark framework.

packages : string

List of maven coordinates of jars to include on the driver and executor classpaths.

repositories : string

List of additional remote repositories to search for the maven coordinates given with --packages.

excludePackages : string

List of groupId:artifactId, to exclude while resolving the dependencies provided in --packages to avoid dependency conflicts.

HiveJob

properties : string

Property names and values, used to configure Data Proc and Hive.

continueOnFailure : bool

Flag indicating whether a job should continue to run if a query fails.

scriptVariables : string

Query variables and their values.

jarFileUris : string

JAR file URIs to add to CLASSPATH of the Hive driver and each task.

One of queryType

  • queryFileUri : string

    URI of the script with all the necessary Hive queries.

  • queryList : QueryList

    List of Hive queries to be used in the job.

ApplicationInfo

id : string

ID of YARN application

applicationAttempts : ApplicationAttempt

YARN application attempts

QueryList

queries : string

List of Hive queries.

ApplicationAttempt

id : string

ID of YARN application attempt

amContainerId : string

ID of YARN Application Master container