Class v1.JobControllerClient (5.5.0)

The JobController provides methods to manage jobs. v1

Package

@google-cloud/dataproc

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of JobControllerClient.

Parameters
NameDescription
opts ClientOptions
gaxInstance typeof gax | typeof fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new JobControllerClient({fallback: true}, gax); ```

Properties

apiEndpoint

get apiEndpoint(): string;

The DNS address for this API service.

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

iamClient

iamClient: IamClient;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

jobControllerStub

jobControllerStub?: Promise<{
        [name: string]: Function;
    }>;

operationsClient

operationsClient: gax.OperationsClient;

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

static get servicePath(): string;

The DNS address for this API service.

universeDomain

get universeDomain(): string;

warn

warn: (code: string, message: string, warnType?: string) => void;

Methods

batchPath(project, location, batch)

batchPath(project: string, location: string, batch: string): string;

Return a fully-qualified batch resource name string.

Parameters
NameDescription
project string
location string
batch string
Returns
TypeDescription
string

{string} Resource name string.

cancelJob(request, options)

cancelJob(request?: protos.google.cloud.dataproc.v1.ICancelJobRequest, options?: CallOptions): Promise<[
        protos.google.cloud.dataproc.v1.IJob,
        protos.google.cloud.dataproc.v1.ICancelJobRequest | undefined,
        {} | undefined
    ]>;

Starts a job cancellation request. To access the job resource after cancellation, call [regions/{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) or [regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get).

Parameters
NameDescription
request ICancelJobRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.ICancelJobRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Job. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The ID of the Google Cloud Platform project that the job
   *  belongs to.
   */
  // const projectId = 'abc123'
  /**
   *  Required. The Dataproc region in which to handle the request.
   */
  // const region = 'us-central1'
  /**
   *  Required. The job ID.
   */
  // const jobId = 'abc123'

  // Imports the Dataproc library
  const {JobControllerClient} = require('@google-cloud/dataproc').v1;

  // Instantiates a client
  const dataprocClient = new JobControllerClient();

  async function callCancelJob() {
    // Construct request
    const request = {
      projectId,
      region,
      jobId,
    };

    // Run request
    const response = await dataprocClient.cancelJob(request);
    console.log(response);
  }

  callCancelJob();

cancelJob(request, options, callback)

cancelJob(request: protos.google.cloud.dataproc.v1.ICancelJobRequest, options: CallOptions, callback: Callback<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.ICancelJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICancelJobRequest
options CallOptions
callback Callback<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.ICancelJobRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

cancelJob(request, callback)

cancelJob(request: protos.google.cloud.dataproc.v1.ICancelJobRequest, callback: Callback<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.ICancelJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICancelJobRequest
callback Callback<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.ICancelJobRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

cancelOperation(request, options, callback)

cancelOperation(request: protos.google.longrunning.CancelOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;

Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an value with a of 1, corresponding to Code.CANCELLED.

Parameters
NameDescription
request CancelOperationRequest

The request object that will be sent.

options CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>

The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

Returns
TypeDescription
Promise<protos.google.protobuf.Empty>
Example

const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});

checkSubmitJobAsOperationProgress(name)

checkSubmitJobAsOperationProgress(name: string): Promise<LROperation<protos.google.cloud.dataproc.v1.Job, protos.google.cloud.dataproc.v1.JobMetadata>>;

Check the status of the long running operation returned by submitJobAsOperation().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.dataproc.v1.Job, protos.google.cloud.dataproc.v1.JobMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The ID of the Google Cloud Platform project that the job
   *  belongs to.
   */
  // const projectId = 'abc123'
  /**
   *  Required. The Dataproc region in which to handle the request.
   */
  // const region = 'us-central1'
  /**
   *  Required. The job resource.
   */
  // const job = {}
  /**
   *  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 google.cloud.dataproc.v1.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.
   */
  // const requestId = 'abc123'

  // Imports the Dataproc library
  const {JobControllerClient} = require('@google-cloud/dataproc').v1;

  // Instantiates a client
  const dataprocClient = new JobControllerClient();

  async function callSubmitJobAsOperation() {
    // Construct request
    const request = {
      projectId,
      region,
      job,
    };

    // Run request
    const [operation] = await dataprocClient.submitJobAsOperation(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callSubmitJobAsOperation();

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
TypeDescription
Promise<void>

{Promise} A promise that resolves when the client is closed.

deleteJob(request, options)

deleteJob(request?: protos.google.cloud.dataproc.v1.IDeleteJobRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        protos.google.cloud.dataproc.v1.IDeleteJobRequest | undefined,
        {} | undefined
    ]>;

Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION.

Parameters
NameDescription
request IDeleteJobRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IDeleteJobRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The ID of the Google Cloud Platform project that the job
   *  belongs to.
   */
  // const projectId = 'abc123'
  /**
   *  Required. The Dataproc region in which to handle the request.
   */
  // const region = 'us-central1'
  /**
   *  Required. The job ID.
   */
  // const jobId = 'abc123'

  // Imports the Dataproc library
  const {JobControllerClient} = require('@google-cloud/dataproc').v1;

  // Instantiates a client
  const dataprocClient = new JobControllerClient();

  async function callDeleteJob() {
    // Construct request
    const request = {
      projectId,
      region,
      jobId,
    };

    // Run request
    const response = await dataprocClient.deleteJob(request);
    console.log(response);
  }

  callDeleteJob();

deleteJob(request, options, callback)

deleteJob(request: protos.google.cloud.dataproc.v1.IDeleteJobRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IDeleteJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteJobRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IDeleteJobRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteJob(request, callback)

deleteJob(request: protos.google.cloud.dataproc.v1.IDeleteJobRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IDeleteJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteJobRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IDeleteJobRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteOperation(request, options, callback)

deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;

Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.

Parameters
NameDescription
request DeleteOperationRequest

The request object that will be sent.

options CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>

The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

Returns
TypeDescription
Promise<protos.google.protobuf.Empty>
Example

const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});

getIamPolicy(request, options, callback)

getIamPolicy(request: IamProtos.google.iam.v1.GetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.Policy]>;

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

Parameters
NameDescription
request IamProtos.google.iam.v1.GetIamPolicyRequest

The request object that will be sent.

options CallOptions | Callback<google.iam.v1.Policy, google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<google.iam.v1.Policy, google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing .

Returns
TypeDescription
Promise<[google.iam.v1.Policy]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

getJob(request, options)

getJob(request?: protos.google.cloud.dataproc.v1.IGetJobRequest, options?: CallOptions): Promise<[
        protos.google.cloud.dataproc.v1.IJob,
        protos.google.cloud.dataproc.v1.IGetJobRequest | undefined,
        {} | undefined
    ]>;

Gets the resource representation for a job in a project.

Parameters
NameDescription
request IGetJobRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.IGetJobRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Job. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The ID of the Google Cloud Platform project that the job
   *  belongs to.
   */
  // const projectId = 'abc123'
  /**
   *  Required. The Dataproc region in which to handle the request.
   */
  // const region = 'us-central1'
  /**
   *  Required. The job ID.
   */
  // const jobId = 'abc123'

  // Imports the Dataproc library
  const {JobControllerClient} = require('@google-cloud/dataproc').v1;

  // Instantiates a client
  const dataprocClient = new JobControllerClient();

  async function callGetJob() {
    // Construct request
    const request = {
      projectId,
      region,
      jobId,
    };

    // Run request
    const response = await dataprocClient.getJob(request);
    console.log(response);
  }

  callGetJob();

getJob(request, options, callback)

getJob(request: protos.google.cloud.dataproc.v1.IGetJobRequest, options: CallOptions, callback: Callback<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.IGetJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetJobRequest
options CallOptions
callback Callback<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.IGetJobRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getJob(request, callback)

getJob(request: protos.google.cloud.dataproc.v1.IGetJobRequest, callback: Callback<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.IGetJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetJobRequest
callback Callback<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.IGetJobRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getOperation(request, options, callback)

getOperation(request: protos.google.longrunning.GetOperationRequest, options?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

Parameters
NameDescription
request GetOperationRequest

The request object that will be sent.

options CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing . {Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

Returns
TypeDescription
Promise<[protos.google.longrunning.Operation]>
Example

const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)

getProjectId()

getProjectId(): Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
NameDescription
callback Callback<string, undefined, undefined>
Returns
TypeDescription
void

initialize()

initialize(): Promise<{
        [name: string]: Function;
    }>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
TypeDescription
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

listJobs(request, options)

listJobs(request?: protos.google.cloud.dataproc.v1.IListJobsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.dataproc.v1.IJob[],
        protos.google.cloud.dataproc.v1.IListJobsRequest | null,
        protos.google.cloud.dataproc.v1.IListJobsResponse
    ]>;

Lists regions/{region}/jobs in a project.

Parameters
NameDescription
request IListJobsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.dataproc.v1.IJob[], protos.google.cloud.dataproc.v1.IListJobsRequest | null, protos.google.cloud.dataproc.v1.IListJobsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of Job. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listJobsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listJobs(request, options, callback)

listJobs(request: protos.google.cloud.dataproc.v1.IListJobsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.dataproc.v1.IListJobsRequest, protos.google.cloud.dataproc.v1.IListJobsResponse | null | undefined, protos.google.cloud.dataproc.v1.IJob>): void;
Parameters
NameDescription
request IListJobsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.dataproc.v1.IListJobsRequest, protos.google.cloud.dataproc.v1.IListJobsResponse | null | undefined, protos.google.cloud.dataproc.v1.IJob>
Returns
TypeDescription
void

listJobs(request, callback)

listJobs(request: protos.google.cloud.dataproc.v1.IListJobsRequest, callback: PaginationCallback<protos.google.cloud.dataproc.v1.IListJobsRequest, protos.google.cloud.dataproc.v1.IListJobsResponse | null | undefined, protos.google.cloud.dataproc.v1.IJob>): void;
Parameters
NameDescription
request IListJobsRequest
callback PaginationCallback<protos.google.cloud.dataproc.v1.IListJobsRequest, protos.google.cloud.dataproc.v1.IListJobsResponse | null | undefined, protos.google.cloud.dataproc.v1.IJob>
Returns
TypeDescription
void

listJobsAsync(request, options)

listJobsAsync(request?: protos.google.cloud.dataproc.v1.IListJobsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.dataproc.v1.IJob>;

Equivalent to listJobs, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request IListJobsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.dataproc.v1.IJob>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Job. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The ID of the Google Cloud Platform project that the job
   *  belongs to.
   */
  // const projectId = 'abc123'
  /**
   *  Required. The Dataproc region in which to handle the request.
   */
  // const region = 'us-central1'
  /**
   *  Optional. The number of results to return in each response.
   */
  // const pageSize = 1234
  /**
   *  Optional. The page token, returned by a previous call, to request the
   *  next page of results.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. If set, the returned jobs list includes only jobs that were
   *  submitted to the named cluster.
   */
  // const clusterName = 'abc123'
  /**
   *  Optional. Specifies enumerated categories of jobs to list.
   *  (default = match ALL jobs).
   *  If `filter` is provided, `jobStateMatcher` will be ignored.
   */
  // const jobStateMatcher = {}
  /**
   *  Optional. A filter constraining the jobs to list. Filters are
   *  case-sensitive and have the following syntax:
   *  field = value  AND field = value   ...
   *  where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label
   *  key. **value** can be `*` to match all values.
   *  `status.state` can be either `ACTIVE` or `NON_ACTIVE`.
   *  Only the logical `AND` operator is supported; space-separated items are
   *  treated as having an implicit `AND` operator.
   *  Example filter:
   *  status.state = ACTIVE AND labels.env = staging AND labels.starred = *
   */
  // const filter = 'abc123'

  // Imports the Dataproc library
  const {JobControllerClient} = require('@google-cloud/dataproc').v1;

  // Instantiates a client
  const dataprocClient = new JobControllerClient();

  async function callListJobs() {
    // Construct request
    const request = {
      projectId,
      region,
    };

    // Run request
    const iterable = dataprocClient.listJobsAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListJobs();

listJobsStream(request, options)

listJobsStream(request?: protos.google.cloud.dataproc.v1.IListJobsRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request IListJobsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing Job on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listJobsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listOperationsAsync(request, options)

listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.ListOperationsResponse>;

Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED. Returns an iterable object.

For-await-of syntax is used with the iterable to recursively get response element on-demand.

Parameters
NameDescription
request ListOperationsRequest

The request object that will be sent.

options CallOptions

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

Returns
TypeDescription
AsyncIterable<protos.google.longrunning.ListOperationsResponse>

{Object} An iterable Object that conforms to iteration protocols.

Example

const client = longrunning.operationsClient();
for await (const response of client.listOperationsAsync(request));
// doThingsWith(response)

matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName)

matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string): string | number;

Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource.

Parameter
NameDescription
projectLocationAutoscalingPolicyName string

A fully-qualified path representing project_location_autoscaling_policy resource.

Returns
TypeDescription
string | number

{string} A string representing the autoscaling_policy.

matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName)

matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string): string | number;

Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource.

Parameter
NameDescription
projectRegionAutoscalingPolicyName string

A fully-qualified path representing project_region_autoscaling_policy resource.

Returns
TypeDescription
string | number

{string} A string representing the autoscaling_policy.

matchBatchFromBatchName(batchName)

matchBatchFromBatchName(batchName: string): string | number;

Parse the batch from Batch resource.

Parameter
NameDescription
batchName string

A fully-qualified path representing Batch resource.

Returns
TypeDescription
string | number

{string} A string representing the batch.

matchClusterFromNodeGroupName(nodeGroupName)

matchClusterFromNodeGroupName(nodeGroupName: string): string | number;

Parse the cluster from NodeGroup resource.

Parameter
NameDescription
nodeGroupName string

A fully-qualified path representing NodeGroup resource.

Returns
TypeDescription
string | number

{string} A string representing the cluster.

matchLocationFromBatchName(batchName)

matchLocationFromBatchName(batchName: string): string | number;

Parse the location from Batch resource.

Parameter
NameDescription
batchName string

A fully-qualified path representing Batch resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName)

matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string): string | number;

Parse the location from ProjectLocationAutoscalingPolicy resource.

Parameter
NameDescription
projectLocationAutoscalingPolicyName string

A fully-qualified path representing project_location_autoscaling_policy resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName)

matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string): string | number;

Parse the location from ProjectLocationWorkflowTemplate resource.

Parameter
NameDescription
projectLocationWorkflowTemplateName string

A fully-qualified path representing project_location_workflow_template resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromSessionName(sessionName)

matchLocationFromSessionName(sessionName: string): string | number;

Parse the location from Session resource.

Parameter
NameDescription
sessionName string

A fully-qualified path representing Session resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromSessionTemplateName(sessionTemplateName)

matchLocationFromSessionTemplateName(sessionTemplateName: string): string | number;

Parse the location from SessionTemplate resource.

Parameter
NameDescription
sessionTemplateName string

A fully-qualified path representing SessionTemplate resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchNodeGroupFromNodeGroupName(nodeGroupName)

matchNodeGroupFromNodeGroupName(nodeGroupName: string): string | number;

Parse the node_group from NodeGroup resource.

Parameter
NameDescription
nodeGroupName string

A fully-qualified path representing NodeGroup resource.

Returns
TypeDescription
string | number

{string} A string representing the node_group.

matchProjectFromBatchName(batchName)

matchProjectFromBatchName(batchName: string): string | number;

Parse the project from Batch resource.

Parameter
NameDescription
batchName string

A fully-qualified path representing Batch resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromNodeGroupName(nodeGroupName)

matchProjectFromNodeGroupName(nodeGroupName: string): string | number;

Parse the project from NodeGroup resource.

Parameter
NameDescription
nodeGroupName string

A fully-qualified path representing NodeGroup resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName)

matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string): string | number;

Parse the project from ProjectLocationAutoscalingPolicy resource.

Parameter
NameDescription
projectLocationAutoscalingPolicyName string

A fully-qualified path representing project_location_autoscaling_policy resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName)

matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string): string | number;

Parse the project from ProjectLocationWorkflowTemplate resource.

Parameter
NameDescription
projectLocationWorkflowTemplateName string

A fully-qualified path representing project_location_workflow_template resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName)

matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string): string | number;

Parse the project from ProjectRegionAutoscalingPolicy resource.

Parameter
NameDescription
projectRegionAutoscalingPolicyName string

A fully-qualified path representing project_region_autoscaling_policy resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName)

matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string): string | number;

Parse the project from ProjectRegionWorkflowTemplate resource.

Parameter
NameDescription
projectRegionWorkflowTemplateName string

A fully-qualified path representing project_region_workflow_template resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromSessionName(sessionName)

matchProjectFromSessionName(sessionName: string): string | number;

Parse the project from Session resource.

Parameter
NameDescription
sessionName string

A fully-qualified path representing Session resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromSessionTemplateName(sessionTemplateName)

matchProjectFromSessionTemplateName(sessionTemplateName: string): string | number;

Parse the project from SessionTemplate resource.

Parameter
NameDescription
sessionTemplateName string

A fully-qualified path representing SessionTemplate resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchRegionFromNodeGroupName(nodeGroupName)

matchRegionFromNodeGroupName(nodeGroupName: string): string | number;

Parse the region from NodeGroup resource.

Parameter
NameDescription
nodeGroupName string

A fully-qualified path representing NodeGroup resource.

Returns
TypeDescription
string | number

{string} A string representing the region.

matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName)

matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string): string | number;

Parse the region from ProjectRegionAutoscalingPolicy resource.

Parameter
NameDescription
projectRegionAutoscalingPolicyName string

A fully-qualified path representing project_region_autoscaling_policy resource.

Returns
TypeDescription
string | number

{string} A string representing the region.

matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName)

matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string): string | number;

Parse the region from ProjectRegionWorkflowTemplate resource.

Parameter
NameDescription
projectRegionWorkflowTemplateName string

A fully-qualified path representing project_region_workflow_template resource.

Returns
TypeDescription
string | number

{string} A string representing the region.

matchSessionFromSessionName(sessionName)

matchSessionFromSessionName(sessionName: string): string | number;

Parse the session from Session resource.

Parameter
NameDescription
sessionName string

A fully-qualified path representing Session resource.

Returns
TypeDescription
string | number

{string} A string representing the session.

matchTemplateFromSessionTemplateName(sessionTemplateName)

matchTemplateFromSessionTemplateName(sessionTemplateName: string): string | number;

Parse the template from SessionTemplate resource.

Parameter
NameDescription
sessionTemplateName string

A fully-qualified path representing SessionTemplate resource.

Returns
TypeDescription
string | number

{string} A string representing the template.

matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName)

matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string): string | number;

Parse the workflow_template from ProjectLocationWorkflowTemplate resource.

Parameter
NameDescription
projectLocationWorkflowTemplateName string

A fully-qualified path representing project_location_workflow_template resource.

Returns
TypeDescription
string | number

{string} A string representing the workflow_template.

matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName)

matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string): string | number;

Parse the workflow_template from ProjectRegionWorkflowTemplate resource.

Parameter
NameDescription
projectRegionWorkflowTemplateName string

A fully-qualified path representing project_region_workflow_template resource.

Returns
TypeDescription
string | number

{string} A string representing the workflow_template.

nodeGroupPath(project, region, cluster, nodeGroup)

nodeGroupPath(project: string, region: string, cluster: string, nodeGroup: string): string;

Return a fully-qualified nodeGroup resource name string.

Parameters
NameDescription
project string
region string
cluster string
nodeGroup string
Returns
TypeDescription
string

{string} Resource name string.

projectLocationAutoscalingPolicyPath(project, location, autoscalingPolicy)

projectLocationAutoscalingPolicyPath(project: string, location: string, autoscalingPolicy: string): string;

Return a fully-qualified projectLocationAutoscalingPolicy resource name string.

Parameters
NameDescription
project string
location string
autoscalingPolicy string
Returns
TypeDescription
string

{string} Resource name string.

projectLocationWorkflowTemplatePath(project, location, workflowTemplate)

projectLocationWorkflowTemplatePath(project: string, location: string, workflowTemplate: string): string;

Return a fully-qualified projectLocationWorkflowTemplate resource name string.

Parameters
NameDescription
project string
location string
workflowTemplate string
Returns
TypeDescription
string

{string} Resource name string.

projectRegionAutoscalingPolicyPath(project, region, autoscalingPolicy)

projectRegionAutoscalingPolicyPath(project: string, region: string, autoscalingPolicy: string): string;

Return a fully-qualified projectRegionAutoscalingPolicy resource name string.

Parameters
NameDescription
project string
region string
autoscalingPolicy string
Returns
TypeDescription
string

{string} Resource name string.

projectRegionWorkflowTemplatePath(project, region, workflowTemplate)

projectRegionWorkflowTemplatePath(project: string, region: string, workflowTemplate: string): string;

Return a fully-qualified projectRegionWorkflowTemplate resource name string.

Parameters
NameDescription
project string
region string
workflowTemplate string
Returns
TypeDescription
string

{string} Resource name string.

sessionPath(project, location, session)

sessionPath(project: string, location: string, session: string): string;

Return a fully-qualified session resource name string.

Parameters
NameDescription
project string
location string
session string
Returns
TypeDescription
string

{string} Resource name string.

sessionTemplatePath(project, location, template)

sessionTemplatePath(project: string, location: string, template: string): string;

Return a fully-qualified sessionTemplate resource name string.

Parameters
NameDescription
project string
location string
template string
Returns
TypeDescription
string

{string} Resource name string.

setIamPolicy(request, options, callback)

setIamPolicy(request: IamProtos.google.iam.v1.SetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.Policy]>;

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
request IamProtos.google.iam.v1.SetIamPolicyRequest

The request object that will be sent.

options CallOptions | Callback<google.iam.v1.Policy, google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<google.iam.v1.Policy, google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing .

Returns
TypeDescription
Promise<[google.iam.v1.Policy]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

submitJob(request, options)

submitJob(request?: protos.google.cloud.dataproc.v1.ISubmitJobRequest, options?: CallOptions): Promise<[
        protos.google.cloud.dataproc.v1.IJob,
        protos.google.cloud.dataproc.v1.ISubmitJobRequest | undefined,
        {} | undefined
    ]>;

Submits a job to a cluster.

Parameters
NameDescription
request ISubmitJobRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.ISubmitJobRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Job. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The ID of the Google Cloud Platform project that the job
   *  belongs to.
   */
  // const projectId = 'abc123'
  /**
   *  Required. The Dataproc region in which to handle the request.
   */
  // const region = 'us-central1'
  /**
   *  Required. The job resource.
   */
  // const job = {}
  /**
   *  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 google.cloud.dataproc.v1.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.
   */
  // const requestId = 'abc123'

  // Imports the Dataproc library
  const {JobControllerClient} = require('@google-cloud/dataproc').v1;

  // Instantiates a client
  const dataprocClient = new JobControllerClient();

  async function callSubmitJob() {
    // Construct request
    const request = {
      projectId,
      region,
      job,
    };

    // Run request
    const response = await dataprocClient.submitJob(request);
    console.log(response);
  }

  callSubmitJob();

submitJob(request, options, callback)

submitJob(request: protos.google.cloud.dataproc.v1.ISubmitJobRequest, options: CallOptions, callback: Callback<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.ISubmitJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ISubmitJobRequest
options CallOptions
callback Callback<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.ISubmitJobRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

submitJob(request, callback)

submitJob(request: protos.google.cloud.dataproc.v1.ISubmitJobRequest, callback: Callback<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.ISubmitJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ISubmitJobRequest
callback Callback<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.ISubmitJobRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

submitJobAsOperation(request, options)

submitJobAsOperation(request?: protos.google.cloud.dataproc.v1.ISubmitJobRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.IJobMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Submits job to a cluster.

Parameters
NameDescription
request ISubmitJobRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.IJobMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The ID of the Google Cloud Platform project that the job
   *  belongs to.
   */
  // const projectId = 'abc123'
  /**
   *  Required. The Dataproc region in which to handle the request.
   */
  // const region = 'us-central1'
  /**
   *  Required. The job resource.
   */
  // const job = {}
  /**
   *  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 google.cloud.dataproc.v1.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.
   */
  // const requestId = 'abc123'

  // Imports the Dataproc library
  const {JobControllerClient} = require('@google-cloud/dataproc').v1;

  // Instantiates a client
  const dataprocClient = new JobControllerClient();

  async function callSubmitJobAsOperation() {
    // Construct request
    const request = {
      projectId,
      region,
      job,
    };

    // Run request
    const [operation] = await dataprocClient.submitJobAsOperation(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callSubmitJobAsOperation();

submitJobAsOperation(request, options, callback)

submitJobAsOperation(request: protos.google.cloud.dataproc.v1.ISubmitJobRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.IJobMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ISubmitJobRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.IJobMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

submitJobAsOperation(request, callback)

submitJobAsOperation(request: protos.google.cloud.dataproc.v1.ISubmitJobRequest, callback: Callback<LROperation<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.IJobMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ISubmitJobRequest
callback Callback<LROperation<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.IJobMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

testIamPermissions(request, options, callback)

testIamPermissions(request: IamProtos.google.iam.v1.TestIamPermissionsRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]>;

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

Parameters
NameDescription
request IamProtos.google.iam.v1.TestIamPermissionsRequest

The request object that will be sent.

options CallOptions | Callback<google.iam.v1.TestIamPermissionsResponse, google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback Callback<google.iam.v1.TestIamPermissionsResponse, google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing .

Returns
TypeDescription
Promise<[google.iam.v1.TestIamPermissionsResponse]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

updateJob(request, options)

updateJob(request?: protos.google.cloud.dataproc.v1.IUpdateJobRequest, options?: CallOptions): Promise<[
        protos.google.cloud.dataproc.v1.IJob,
        protos.google.cloud.dataproc.v1.IUpdateJobRequest | undefined,
        {} | undefined
    ]>;

Updates a job in a project.

Parameters
NameDescription
request IUpdateJobRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.IUpdateJobRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Job. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The ID of the Google Cloud Platform project that the job
   *  belongs to.
   */
  // const projectId = 'abc123'
  /**
   *  Required. The Dataproc region in which to handle the request.
   */
  // const region = 'us-central1'
  /**
   *  Required. The job ID.
   */
  // const jobId = 'abc123'
  /**
   *  Required. The changes to the job.
   */
  // const job = {}
  /**
   *  Required. Specifies the path, relative to Job, of
   *  the field to update. For example, to update the labels of a Job the
   *  update_mask parameter would be specified as
   *  labels, and the `PATCH` request body would specify the new
   *  value. Note: Currently, labels is the only
   *  field that can be updated.
   */
  // const updateMask = {}

  // Imports the Dataproc library
  const {JobControllerClient} = require('@google-cloud/dataproc').v1;

  // Instantiates a client
  const dataprocClient = new JobControllerClient();

  async function callUpdateJob() {
    // Construct request
    const request = {
      projectId,
      region,
      jobId,
      job,
      updateMask,
    };

    // Run request
    const response = await dataprocClient.updateJob(request);
    console.log(response);
  }

  callUpdateJob();

updateJob(request, options, callback)

updateJob(request: protos.google.cloud.dataproc.v1.IUpdateJobRequest, options: CallOptions, callback: Callback<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.IUpdateJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateJobRequest
options CallOptions
callback Callback<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.IUpdateJobRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateJob(request, callback)

updateJob(request: protos.google.cloud.dataproc.v1.IUpdateJobRequest, callback: Callback<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.IUpdateJobRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateJobRequest
callback Callback<protos.google.cloud.dataproc.v1.IJob, protos.google.cloud.dataproc.v1.IUpdateJobRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void