Class v1.WorkflowTemplateServiceClient (4.5.0)

The API interface for managing Workflow Templates in the Dataproc API. v1

Package

@google-cloud/dataproc

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of WorkflowTemplateServiceClient.

Parameters
NameDescription
opts ClientOptions
gaxInstance typeof gax | typeof gax.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 WorkflowTemplateServiceClient({fallback: 'rest'}, gax); ```

Properties

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

iamClient

iamClient: IamClient;

innerApiCalls

innerApiCalls: {
        [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.

warn

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

workflowTemplateServiceStub

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

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.

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 protos.google.longrunning.CancelOperationRequest

The request object that will be sent.

options gax.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: ''});

checkInstantiateInlineWorkflowTemplateProgress(name)

checkInstantiateInlineWorkflowTemplateProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.dataproc.v1.WorkflowMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.dataproc.v1.WorkflowMetadata>>

{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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) 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 resource name of the region or location, as described
   *  in https://cloud.google.com/apis/design/resource_names.
   *  * For `projects.regions.workflowTemplates,instantiateinline`, the resource
   *    name of the region has the following format:
   *    `projects/{project_id}/regions/{region}`
   *  * For `projects.locations.workflowTemplates.instantiateinline`, the
   *    resource name of the location has the following format:
   *    `projects/{project_id}/locations/{location}`
   */
  // const parent = 'abc123'
  /**
   *  Required. The workflow template to instantiate.
   */
  // const template = {}
  /**
   *  Optional. A tag that prevents multiple concurrent workflow
   *  instances with the same tag from running. This mitigates risk of
   *  concurrent instances started due to retries.
   *  It is recommended to always set this value to a
   *  UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).
   *  The tag 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 {WorkflowTemplateServiceClient} = require('@google-cloud/dataproc').v1;

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

  async function callInstantiateInlineWorkflowTemplate() {
    // Construct request
    const request = {
      parent,
      template,
    };

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

  callInstantiateInlineWorkflowTemplate();

checkInstantiateWorkflowTemplateProgress(name)

checkInstantiateWorkflowTemplateProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.dataproc.v1.WorkflowMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.dataproc.v1.WorkflowMetadata>>

{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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) 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 resource name of the workflow template, as described
   *  in https://cloud.google.com/apis/design/resource_names.
   *  * For `projects.regions.workflowTemplates.instantiate`, the resource name
   *  of the template has the following format:
   *    `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
   *  * For `projects.locations.workflowTemplates.instantiate`, the resource name
   *    of the template has the following format:
   *    `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
   */
  // const name = 'abc123'
  /**
   *  Optional. The version of workflow template to instantiate. If specified,
   *  the workflow will be instantiated only if the current version of
   *  the workflow template has the supplied version.
   *  This option cannot be used to instantiate a previous version of
   *  workflow template.
   */
  // const version = 1234
  /**
   *  Optional. A tag that prevents multiple concurrent workflow
   *  instances with the same tag from running. This mitigates risk of
   *  concurrent instances started due to retries.
   *  It is recommended to always set this value to a
   *  UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).
   *  The tag must contain only letters (a-z, A-Z), numbers (0-9),
   *  underscores (_), and hyphens (-). The maximum length is 40 characters.
   */
  // const requestId = 'abc123'
  /**
   *  Optional. Map from parameter names to values that should be used for those
   *  parameters. Values may not exceed 1000 characters.
   */
  // const parameters = 1234

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

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

  async function callInstantiateWorkflowTemplate() {
    // Construct request
    const request = {
      name,
    };

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

  callInstantiateWorkflowTemplate();

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.

createWorkflowTemplate(request, options)

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

Creates new workflow template.

Parameters
NameDescription
request protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.dataproc.v1.IWorkflowTemplate, (protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) 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 resource name of the region or location, as described
   *  in https://cloud.google.com/apis/design/resource_names.
   *  * For `projects.regions.workflowTemplates.create`, the resource name of the
   *    region has the following format:
   *    `projects/{project_id}/regions/{region}`
   *  * For `projects.locations.workflowTemplates.create`, the resource name of
   *    the location has the following format:
   *    `projects/{project_id}/locations/{location}`
   */
  // const parent = 'abc123'
  /**
   *  Required. The Dataproc workflow template to create.
   */
  // const template = {}

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

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

  async function callCreateWorkflowTemplate() {
    // Construct request
    const request = {
      parent,
      template,
    };

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

  callCreateWorkflowTemplate();

createWorkflowTemplate(request, options, callback)

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

createWorkflowTemplate(request, callback)

createWorkflowTemplate(request: protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest, callback: Callback<protos.google.cloud.dataproc.v1.IWorkflowTemplate, protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest
callback Callback<protos.google.cloud.dataproc.v1.IWorkflowTemplate, protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest | 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 protos.google.longrunning.DeleteOperationRequest

The request object that will be sent.

options gax.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: ''});

deleteWorkflowTemplate(request, options)

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

Deletes a workflow template. It does not cancel in-progress workflows.

Parameters
NameDescription
request protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest

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.IDeleteWorkflowTemplateRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) 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 resource name of the workflow template, as described
   *  in https://cloud.google.com/apis/design/resource_names.
   *  * For `projects.regions.workflowTemplates.delete`, the resource name
   *  of the template has the following format:
   *    `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
   *  * For `projects.locations.workflowTemplates.instantiate`, the resource name
   *    of the template has the following format:
   *    `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
   */
  // const name = 'abc123'
  /**
   *  Optional. The version of workflow template to delete. If specified,
   *  will only delete the template if the current server version matches
   *  specified version.
   */
  // const version = 1234

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

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

  async function callDeleteWorkflowTemplate() {
    // Construct request
    const request = {
      name,
    };

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

  callDeleteWorkflowTemplate();

deleteWorkflowTemplate(request, options, callback)

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

deleteWorkflowTemplate(request, callback)

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

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 gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.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<IamProtos.google.iam.v1.Policy, IamProtos.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<IamProtos.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.

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 protos.google.longrunning.GetOperationRequest

The request object that will be sent.

options gax.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

getWorkflowTemplate(request, options)

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

Retrieves the latest workflow template.

Can retrieve previously instantiated template by specifying optional version parameter.

Parameters
NameDescription
request protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

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

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) 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 resource name of the workflow template, as described
   *  in https://cloud.google.com/apis/design/resource_names.
   *  * For `projects.regions.workflowTemplates.get`, the resource name of the
   *    template has the following format:
   *    `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
   *  * For `projects.locations.workflowTemplates.get`, the resource name of the
   *    template has the following format:
   *    `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
   */
  // const name = 'abc123'
  /**
   *  Optional. The version of workflow template to retrieve. Only previously
   *  instantiated versions can be retrieved.
   *  If unspecified, retrieves the current version.
   */
  // const version = 1234

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

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

  async function callGetWorkflowTemplate() {
    // Construct request
    const request = {
      name,
    };

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

  callGetWorkflowTemplate();

getWorkflowTemplate(request, options, callback)

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

getWorkflowTemplate(request, callback)

getWorkflowTemplate(request: protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest, callback: Callback<protos.google.cloud.dataproc.v1.IWorkflowTemplate, protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest
callback Callback<protos.google.cloud.dataproc.v1.IWorkflowTemplate, protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest | null | undefined, {} | null | 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.

instantiateInlineWorkflowTemplate(request, options)

instantiateInlineWorkflowTemplate(request?: protos.google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IWorkflowMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Instantiates a template and begins execution.

This method is equivalent to executing the sequence , , .

The returned Operation can be used to track execution of workflow by polling . The Operation will complete when entire workflow is finished.

The running workflow can be aborted via . This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.

The will be [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see [Using WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).

On successful completion, will be .

Parameters
NameDescription
request protos.google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IWorkflowMetadata>, 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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) 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 resource name of the region or location, as described
   *  in https://cloud.google.com/apis/design/resource_names.
   *  * For `projects.regions.workflowTemplates,instantiateinline`, the resource
   *    name of the region has the following format:
   *    `projects/{project_id}/regions/{region}`
   *  * For `projects.locations.workflowTemplates.instantiateinline`, the
   *    resource name of the location has the following format:
   *    `projects/{project_id}/locations/{location}`
   */
  // const parent = 'abc123'
  /**
   *  Required. The workflow template to instantiate.
   */
  // const template = {}
  /**
   *  Optional. A tag that prevents multiple concurrent workflow
   *  instances with the same tag from running. This mitigates risk of
   *  concurrent instances started due to retries.
   *  It is recommended to always set this value to a
   *  UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).
   *  The tag 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 {WorkflowTemplateServiceClient} = require('@google-cloud/dataproc').v1;

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

  async function callInstantiateInlineWorkflowTemplate() {
    // Construct request
    const request = {
      parent,
      template,
    };

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

  callInstantiateInlineWorkflowTemplate();

instantiateInlineWorkflowTemplate(request, options, callback)

instantiateInlineWorkflowTemplate(request: protos.google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IWorkflowMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IWorkflowMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

instantiateInlineWorkflowTemplate(request, callback)

instantiateInlineWorkflowTemplate(request: protos.google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IWorkflowMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IWorkflowMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

instantiateWorkflowTemplate(request, options)

instantiateWorkflowTemplate(request?: protos.google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IWorkflowMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Instantiates a template and begins execution.

The returned Operation can be used to track execution of workflow by polling . The Operation will complete when entire workflow is finished.

The running workflow can be aborted via . This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.

The will be [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see [Using WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).

On successful completion, will be .

Parameters
NameDescription
request protos.google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IWorkflowMetadata>, 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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) 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 resource name of the workflow template, as described
   *  in https://cloud.google.com/apis/design/resource_names.
   *  * For `projects.regions.workflowTemplates.instantiate`, the resource name
   *  of the template has the following format:
   *    `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}`
   *  * For `projects.locations.workflowTemplates.instantiate`, the resource name
   *    of the template has the following format:
   *    `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}`
   */
  // const name = 'abc123'
  /**
   *  Optional. The version of workflow template to instantiate. If specified,
   *  the workflow will be instantiated only if the current version of
   *  the workflow template has the supplied version.
   *  This option cannot be used to instantiate a previous version of
   *  workflow template.
   */
  // const version = 1234
  /**
   *  Optional. A tag that prevents multiple concurrent workflow
   *  instances with the same tag from running. This mitigates risk of
   *  concurrent instances started due to retries.
   *  It is recommended to always set this value to a
   *  UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).
   *  The tag must contain only letters (a-z, A-Z), numbers (0-9),
   *  underscores (_), and hyphens (-). The maximum length is 40 characters.
   */
  // const requestId = 'abc123'
  /**
   *  Optional. Map from parameter names to values that should be used for those
   *  parameters. Values may not exceed 1000 characters.
   */
  // const parameters = 1234

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

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

  async function callInstantiateWorkflowTemplate() {
    // Construct request
    const request = {
      name,
    };

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

  callInstantiateWorkflowTemplate();

instantiateWorkflowTemplate(request, options, callback)

instantiateWorkflowTemplate(request: protos.google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IWorkflowMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IWorkflowMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

instantiateWorkflowTemplate(request, callback)

instantiateWorkflowTemplate(request: protos.google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IWorkflowMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IWorkflowMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

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 protos.google.longrunning.ListOperationsRequest

The request object that will be sent.

options gax.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)

listWorkflowTemplates(request, options)

listWorkflowTemplates(request?: protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.dataproc.v1.IWorkflowTemplate[],
        protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest | null,
        protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse
    ]>;

Lists workflows that match the specified filter in the request.

Parameters
NameDescription
request protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.dataproc.v1.IWorkflowTemplate[], protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest | null, protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . 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 listWorkflowTemplatesAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listWorkflowTemplates(request, options, callback)

listWorkflowTemplates(request: protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse | null | undefined, protos.google.cloud.dataproc.v1.IWorkflowTemplate>): void;
Parameters
NameDescription
request protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse | null | undefined, protos.google.cloud.dataproc.v1.IWorkflowTemplate>
Returns
TypeDescription
void

listWorkflowTemplates(request, callback)

listWorkflowTemplates(request: protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, callback: PaginationCallback<protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse | null | undefined, protos.google.cloud.dataproc.v1.IWorkflowTemplate>): void;
Parameters
NameDescription
request protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest
callback PaginationCallback<protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse | null | undefined, protos.google.cloud.dataproc.v1.IWorkflowTemplate>
Returns
TypeDescription
void

listWorkflowTemplatesAsync(request, options)

listWorkflowTemplatesAsync(request?: protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.dataproc.v1.IWorkflowTemplate>;

Equivalent to listWorkflowTemplates, but returns an iterable object.

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

Parameters
NameDescription
request protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

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

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing . 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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) 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 resource name of the region or location, as described
   *  in https://cloud.google.com/apis/design/resource_names.
   *  * For `projects.regions.workflowTemplates,list`, the resource
   *    name of the region has the following format:
   *    `projects/{project_id}/regions/{region}`
   *  * For `projects.locations.workflowTemplates.list`, the
   *    resource name of the location has the following format:
   *    `projects/{project_id}/locations/{location}`
   */
  // const parent = 'abc123'
  /**
   *  Optional. The maximum 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'

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

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

  async function callListWorkflowTemplates() {
    // Construct request
    const request = {
      parent,
    };

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

  callListWorkflowTemplates();

listWorkflowTemplatesStream(request, options)

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

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

Parameters
NameDescription
request protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest

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 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 listWorkflowTemplatesAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

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.

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.

matchProjectFromProjectName(projectName)

matchProjectFromProjectName(projectName: string): string | number;

Parse the project from Project resource.

Parameter
NameDescription
projectName string

A fully-qualified path representing Project 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.

matchProjectFromRegionName(regionName)

matchProjectFromRegionName(regionName: string): string | number;

Parse the project from Region resource.

Parameter
NameDescription
regionName string

A fully-qualified path representing Region 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.

matchRegionFromRegionName(regionName)

matchRegionFromRegionName(regionName: string): string | number;

Parse the region from Region resource.

Parameter
NameDescription
regionName string

A fully-qualified path representing Region resource.

Returns
TypeDescription
string | number

{string} A string representing the region.

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.

projectPath(project)

projectPath(project: string): string;

Return a fully-qualified project resource name string.

Parameter
NameDescription
project 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.

regionPath(project, region)

regionPath(project: string, region: string): string;

Return a fully-qualified region resource name string.

Parameters
NameDescription
project string
region 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 gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.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<IamProtos.google.iam.v1.Policy, IamProtos.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<IamProtos.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.

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 gax.CallOptions | Callback<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.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<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.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<IamProtos.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.

updateWorkflowTemplate(request, options)

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

Updates (replaces) workflow template. The updated template must contain version that matches the current server version.

Parameters
NameDescription
request protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.dataproc.v1.IWorkflowTemplate, (protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) 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 updated workflow template.
   *  The `template.version` field must match the current version.
   */
  // const template = {}

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

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

  async function callUpdateWorkflowTemplate() {
    // Construct request
    const request = {
      template,
    };

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

  callUpdateWorkflowTemplate();

updateWorkflowTemplate(request, options, callback)

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

updateWorkflowTemplate(request, callback)

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