Class v1.SessionTemplateControllerClient (5.7.0)

The SessionTemplateController provides methods to manage session templates. v1

Package

@google-cloud/dataproc

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of SessionTemplateControllerClient.

Parameters
Name Description
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 SessionTemplateControllerClient({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;
    };

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.

sessionTemplateControllerStub

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

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
Name Description
project string
location string
batch string
Returns
Type Description
string

{string} Resource name string.

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
Type Description
Promise<void>

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

createSessionTemplate(request, options)

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

Create a session template synchronously.

Parameters
Name Description
request ICreateSessionTemplateRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.dataproc.v1.ISessionTemplate, protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing SessionTemplate. 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 parent resource where this session template will be created.
   */
  // const parent = 'abc123'
  /**
   *  Required. The session template to create.
   */
  // const sessionTemplate = {}

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

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

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

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

  callCreateSessionTemplate();

createSessionTemplate(request, options, callback)

createSessionTemplate(request: protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest, options: CallOptions, callback: Callback<protos.google.cloud.dataproc.v1.ISessionTemplate, protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateSessionTemplateRequest
options CallOptions
callback Callback<protos.google.cloud.dataproc.v1.ISessionTemplate, protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createSessionTemplate(request, callback)

createSessionTemplate(request: protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest, callback: Callback<protos.google.cloud.dataproc.v1.ISessionTemplate, protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateSessionTemplateRequest
callback Callback<protos.google.cloud.dataproc.v1.ISessionTemplate, protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteSessionTemplate(request, options)

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

Deletes a session template.

Parameters
Name Description
request IDeleteSessionTemplateRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest | 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 name of the session template resource to delete.
   */
  // const name = 'abc123'

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

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

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

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

  callDeleteSessionTemplate();

deleteSessionTemplate(request, options, callback)

deleteSessionTemplate(request: protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteSessionTemplateRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteSessionTemplate(request, callback)

deleteSessionTemplate(request: protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteSessionTemplateRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
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
Name Description
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
Type Description
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.

getProjectId()

getProjectId(): Promise<string>;
Returns
Type Description
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
Name Description
callback Callback<string, undefined, undefined>
Returns
Type Description
void

getSessionTemplate(request, options)

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

Gets the resource representation for a session template.

Parameters
Name Description
request IGetSessionTemplateRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.dataproc.v1.ISessionTemplate, protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing SessionTemplate. 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 name of the session template to retrieve.
   */
  // const name = 'abc123'

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

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

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

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

  callGetSessionTemplate();

getSessionTemplate(request, options, callback)

getSessionTemplate(request: protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest, options: CallOptions, callback: Callback<protos.google.cloud.dataproc.v1.ISessionTemplate, protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetSessionTemplateRequest
options CallOptions
callback Callback<protos.google.cloud.dataproc.v1.ISessionTemplate, protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getSessionTemplate(request, callback)

getSessionTemplate(request: protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest, callback: Callback<protos.google.cloud.dataproc.v1.ISessionTemplate, protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetSessionTemplateRequest
callback Callback<protos.google.cloud.dataproc.v1.ISessionTemplate, protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
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
Type Description
Promise<{ [name: string]: Function; }>

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

listSessionTemplates(request, options)

listSessionTemplates(request?: protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.dataproc.v1.ISessionTemplate[],
        protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest | null,
        protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse
    ]>;

Lists session templates.

Parameters
Name Description
request IListSessionTemplatesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.dataproc.v1.ISessionTemplate[], protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest | null, protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of SessionTemplate. 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 listSessionTemplatesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listSessionTemplates(request, options, callback)

listSessionTemplates(request: protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse | null | undefined, protos.google.cloud.dataproc.v1.ISessionTemplate>): void;
Parameters
Name Description
request IListSessionTemplatesRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse | null | undefined, protos.google.cloud.dataproc.v1.ISessionTemplate>
Returns
Type Description
void

listSessionTemplates(request, callback)

listSessionTemplates(request: protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, callback: PaginationCallback<protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse | null | undefined, protos.google.cloud.dataproc.v1.ISessionTemplate>): void;
Parameters
Name Description
request IListSessionTemplatesRequest
callback PaginationCallback<protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse | null | undefined, protos.google.cloud.dataproc.v1.ISessionTemplate>
Returns
Type Description
void

listSessionTemplatesAsync(request, options)

listSessionTemplatesAsync(request?: protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.dataproc.v1.ISessionTemplate>;

Equivalent to listSessionTemplates, but returns an iterable object.

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

Parameters
Name Description
request IListSessionTemplatesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.cloud.dataproc.v1.ISessionTemplate>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing SessionTemplate. 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 parent that owns this collection of session templates.
   */
  // const parent = 'abc123'
  /**
   *  Optional. The maximum number of sessions to return in each response.
   *  The service may return fewer than this value.
   */
  // const pageSize = 1234
  /**
   *  Optional. A page token received from a previous `ListSessions` call.
   *  Provide this token to retrieve the subsequent page.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. A filter for the session templates to return in the response.
   *  Filters are case sensitive and have the following syntax:
   *  field = value  AND field = value   ...
   */
  // const filter = 'abc123'

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

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

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

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

  callListSessionTemplates();

listSessionTemplatesStream(request, options)

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

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

Parameters
Name Description
request IListSessionTemplatesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing SessionTemplate 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 listSessionTemplatesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

locationPath(project, location)

locationPath(project: string, location: string): string;

Return a fully-qualified location resource name string.

Parameters
Name Description
project string
location string
Returns
Type Description
string

{string} Resource name string.

matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName)

matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string): string | number;

Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource.

Parameter
Name Description
projectLocationAutoscalingPolicyName string

A fully-qualified path representing project_location_autoscaling_policy resource.

Returns
Type Description
string | number

{string} A string representing the autoscaling_policy.

matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName)

matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string): string | number;

Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource.

Parameter
Name Description
projectRegionAutoscalingPolicyName string

A fully-qualified path representing project_region_autoscaling_policy resource.

Returns
Type Description
string | number

{string} A string representing the autoscaling_policy.

matchBatchFromBatchName(batchName)

matchBatchFromBatchName(batchName: string): string | number;

Parse the batch from Batch resource.

Parameter
Name Description
batchName string

A fully-qualified path representing Batch resource.

Returns
Type Description
string | number

{string} A string representing the batch.

matchClusterFromNodeGroupName(nodeGroupName)

matchClusterFromNodeGroupName(nodeGroupName: string): string | number;

Parse the cluster from NodeGroup resource.

Parameter
Name Description
nodeGroupName string

A fully-qualified path representing NodeGroup resource.

Returns
Type Description
string | number

{string} A string representing the cluster.

matchLocationFromBatchName(batchName)

matchLocationFromBatchName(batchName: string): string | number;

Parse the location from Batch resource.

Parameter
Name Description
batchName string

A fully-qualified path representing Batch resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromLocationName(locationName)

matchLocationFromLocationName(locationName: string): string | number;

Parse the location from Location resource.

Parameter
Name Description
locationName string

A fully-qualified path representing Location resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName)

matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string): string | number;

Parse the location from ProjectLocationAutoscalingPolicy resource.

Parameter
Name Description
projectLocationAutoscalingPolicyName string

A fully-qualified path representing project_location_autoscaling_policy resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName)

matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string): string | number;

Parse the location from ProjectLocationWorkflowTemplate resource.

Parameter
Name Description
projectLocationWorkflowTemplateName string

A fully-qualified path representing project_location_workflow_template resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromSessionName(sessionName)

matchLocationFromSessionName(sessionName: string): string | number;

Parse the location from Session resource.

Parameter
Name Description
sessionName string

A fully-qualified path representing Session resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromSessionTemplateName(sessionTemplateName)

matchLocationFromSessionTemplateName(sessionTemplateName: string): string | number;

Parse the location from SessionTemplate resource.

Parameter
Name Description
sessionTemplateName string

A fully-qualified path representing SessionTemplate resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchNodeGroupFromNodeGroupName(nodeGroupName)

matchNodeGroupFromNodeGroupName(nodeGroupName: string): string | number;

Parse the node_group from NodeGroup resource.

Parameter
Name Description
nodeGroupName string

A fully-qualified path representing NodeGroup resource.

Returns
Type Description
string | number

{string} A string representing the node_group.

matchProjectFromBatchName(batchName)

matchProjectFromBatchName(batchName: string): string | number;

Parse the project from Batch resource.

Parameter
Name Description
batchName string

A fully-qualified path representing Batch resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromLocationName(locationName)

matchProjectFromLocationName(locationName: string): string | number;

Parse the project from Location resource.

Parameter
Name Description
locationName string

A fully-qualified path representing Location resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromNodeGroupName(nodeGroupName)

matchProjectFromNodeGroupName(nodeGroupName: string): string | number;

Parse the project from NodeGroup resource.

Parameter
Name Description
nodeGroupName string

A fully-qualified path representing NodeGroup resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName)

matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string): string | number;

Parse the project from ProjectLocationAutoscalingPolicy resource.

Parameter
Name Description
projectLocationAutoscalingPolicyName string

A fully-qualified path representing project_location_autoscaling_policy resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName)

matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string): string | number;

Parse the project from ProjectLocationWorkflowTemplate resource.

Parameter
Name Description
projectLocationWorkflowTemplateName string

A fully-qualified path representing project_location_workflow_template resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectName(projectName)

matchProjectFromProjectName(projectName: string): string | number;

Parse the project from Project resource.

Parameter
Name Description
projectName string

A fully-qualified path representing Project resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName)

matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string): string | number;

Parse the project from ProjectRegionAutoscalingPolicy resource.

Parameter
Name Description
projectRegionAutoscalingPolicyName string

A fully-qualified path representing project_region_autoscaling_policy resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName)

matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string): string | number;

Parse the project from ProjectRegionWorkflowTemplate resource.

Parameter
Name Description
projectRegionWorkflowTemplateName string

A fully-qualified path representing project_region_workflow_template resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromSessionName(sessionName)

matchProjectFromSessionName(sessionName: string): string | number;

Parse the project from Session resource.

Parameter
Name Description
sessionName string

A fully-qualified path representing Session resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromSessionTemplateName(sessionTemplateName)

matchProjectFromSessionTemplateName(sessionTemplateName: string): string | number;

Parse the project from SessionTemplate resource.

Parameter
Name Description
sessionTemplateName string

A fully-qualified path representing SessionTemplate resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchRegionFromNodeGroupName(nodeGroupName)

matchRegionFromNodeGroupName(nodeGroupName: string): string | number;

Parse the region from NodeGroup resource.

Parameter
Name Description
nodeGroupName string

A fully-qualified path representing NodeGroup resource.

Returns
Type Description
string | number

{string} A string representing the region.

matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName)

matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string): string | number;

Parse the region from ProjectRegionAutoscalingPolicy resource.

Parameter
Name Description
projectRegionAutoscalingPolicyName string

A fully-qualified path representing project_region_autoscaling_policy resource.

Returns
Type Description
string | number

{string} A string representing the region.

matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName)

matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string): string | number;

Parse the region from ProjectRegionWorkflowTemplate resource.

Parameter
Name Description
projectRegionWorkflowTemplateName string

A fully-qualified path representing project_region_workflow_template resource.

Returns
Type Description
string | number

{string} A string representing the region.

matchSessionFromSessionName(sessionName)

matchSessionFromSessionName(sessionName: string): string | number;

Parse the session from Session resource.

Parameter
Name Description
sessionName string

A fully-qualified path representing Session resource.

Returns
Type Description
string | number

{string} A string representing the session.

matchTemplateFromSessionTemplateName(sessionTemplateName)

matchTemplateFromSessionTemplateName(sessionTemplateName: string): string | number;

Parse the template from SessionTemplate resource.

Parameter
Name Description
sessionTemplateName string

A fully-qualified path representing SessionTemplate resource.

Returns
Type Description
string | number

{string} A string representing the template.

matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName)

matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string): string | number;

Parse the workflow_template from ProjectLocationWorkflowTemplate resource.

Parameter
Name Description
projectLocationWorkflowTemplateName string

A fully-qualified path representing project_location_workflow_template resource.

Returns
Type Description
string | number

{string} A string representing the workflow_template.

matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName)

matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string): string | number;

Parse the workflow_template from ProjectRegionWorkflowTemplate resource.

Parameter
Name Description
projectRegionWorkflowTemplateName string

A fully-qualified path representing project_region_workflow_template resource.

Returns
Type Description
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
Name Description
project string
region string
cluster string
nodeGroup string
Returns
Type Description
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
Name Description
project string
location string
autoscalingPolicy string
Returns
Type Description
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
Name Description
project string
location string
workflowTemplate string
Returns
Type Description
string

{string} Resource name string.

projectPath(project)

projectPath(project: string): string;

Return a fully-qualified project resource name string.

Parameter
Name Description
project string
Returns
Type Description
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
Name Description
project string
region string
autoscalingPolicy string
Returns
Type Description
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
Name Description
project string
region string
workflowTemplate string
Returns
Type Description
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
Name Description
project string
location string
session string
Returns
Type Description
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
Name Description
project string
location string
template string
Returns
Type Description
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
Name Description
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
Type Description
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.

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
Name Description
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
Type Description
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.

updateSessionTemplate(request, options)

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

Updates the session template synchronously.

Parameters
Name Description
request IUpdateSessionTemplateRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.dataproc.v1.ISessionTemplate, protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing SessionTemplate. 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 updated session template.
   */
  // const sessionTemplate = {}

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

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

  async function callUpdateSessionTemplate() {
    // Construct request
    const request = {
      sessionTemplate,
    };

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

  callUpdateSessionTemplate();

updateSessionTemplate(request, options, callback)

updateSessionTemplate(request: protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest, options: CallOptions, callback: Callback<protos.google.cloud.dataproc.v1.ISessionTemplate, protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateSessionTemplateRequest
options CallOptions
callback Callback<protos.google.cloud.dataproc.v1.ISessionTemplate, protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateSessionTemplate(request, callback)

updateSessionTemplate(request: protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest, callback: Callback<protos.google.cloud.dataproc.v1.ISessionTemplate, protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateSessionTemplateRequest
callback Callback<protos.google.cloud.dataproc.v1.ISessionTemplate, protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void