Class v1.AutoscalingPolicyServiceClient (5.5.0)

The API interface for managing autoscaling policies 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 AutoscalingPolicyServiceClient.

Parameters
NameDescription
opts ClientOptions
gaxInstance typeof gax | typeof fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new AutoscalingPolicyServiceClient({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;

autoscalingPolicyServiceStub

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

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.

universeDomain

get universeDomain(): string;

warn

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

Methods

batchPath(project, location, batch)

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

Return a fully-qualified batch resource name string.

Parameters
NameDescription
project string
location string
batch string
Returns
TypeDescription
string

{string} Resource name string.

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.

createAutoscalingPolicy(request, options)

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

Creates new autoscaling policy.

Parameters
NameDescription
request ICreateAutoscalingPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

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

{Promise} - The promise which resolves to an array. The first element of the array is an object representing AutoscalingPolicy. 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 "resource name" of the region or location, as described
   *  in https://cloud.google.com/apis/design/resource_names.
   *  * For `projects.regions.autoscalingPolicies.create`, the resource name
   *    of the region has the following format:
   *    `projects/{project_id}/regions/{region}`
   *  * For `projects.locations.autoscalingPolicies.create`, the resource name
   *    of the location has the following format:
   *    `projects/{project_id}/locations/{location}`
   */
  // const parent = 'abc123'
  /**
   *  Required. The autoscaling policy to create.
   */
  // const policy = {}

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

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

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

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

  callCreateAutoscalingPolicy();

createAutoscalingPolicy(request, options, callback)

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

createAutoscalingPolicy(request, callback)

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

deleteAutoscalingPolicy(request, options)

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

Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.

Parameters
NameDescription
request IDeleteAutoscalingPolicyRequest

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.IDeleteAutoscalingPolicyRequest | 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 "resource name" of the autoscaling policy, as described
   *  in https://cloud.google.com/apis/design/resource_names.
   *  * For `projects.regions.autoscalingPolicies.delete`, the resource name
   *    of the policy has the following format:
   *    `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}`
   *  * For `projects.locations.autoscalingPolicies.delete`, the resource name
   *    of the policy has the following format:
   *    `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}`
   */
  // const name = 'abc123'

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

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

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

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

  callDeleteAutoscalingPolicy();

deleteAutoscalingPolicy(request, options, callback)

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

deleteAutoscalingPolicy(request, callback)

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

getAutoscalingPolicy(request, options)

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

Retrieves autoscaling policy.

Parameters
NameDescription
request IGetAutoscalingPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

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

{Promise} - The promise which resolves to an array. The first element of the array is an object representing AutoscalingPolicy. 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 "resource name" of the autoscaling policy, as described
   *  in https://cloud.google.com/apis/design/resource_names.
   *  * For `projects.regions.autoscalingPolicies.get`, the resource name
   *    of the policy has the following format:
   *    `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}`
   *  * For `projects.locations.autoscalingPolicies.get`, the resource name
   *    of the policy has the following format:
   *    `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}`
   */
  // const name = 'abc123'

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

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

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

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

  callGetAutoscalingPolicy();

getAutoscalingPolicy(request, options, callback)

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

getAutoscalingPolicy(request, callback)

getAutoscalingPolicy(request: protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest, callback: Callback<protos.google.cloud.dataproc.v1.IAutoscalingPolicy, protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetAutoscalingPolicyRequest
callback Callback<protos.google.cloud.dataproc.v1.IAutoscalingPolicy, protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest | 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 CallOptions | Callback<google.iam.v1.Policy, google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>

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

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

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

The second parameter to the callback is an object representing .

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

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

getProjectId()

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

getProjectId(callback)

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

initialize()

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

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

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

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

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

listAutoscalingPolicies(request, options)

listAutoscalingPolicies(request?: protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.dataproc.v1.IAutoscalingPolicy[],
        protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest | null,
        protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse
    ]>;

Lists autoscaling policies in the project.

Parameters
NameDescription
request IListAutoscalingPoliciesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.dataproc.v1.IAutoscalingPolicy[], protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest | null, protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse ]>

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

listAutoscalingPolicies(request, options, callback)

listAutoscalingPolicies(request: protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse | null | undefined, protos.google.cloud.dataproc.v1.IAutoscalingPolicy>): void;
Parameters
NameDescription
request IListAutoscalingPoliciesRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse | null | undefined, protos.google.cloud.dataproc.v1.IAutoscalingPolicy>
Returns
TypeDescription
void

listAutoscalingPolicies(request, callback)

listAutoscalingPolicies(request: protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, callback: PaginationCallback<protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse | null | undefined, protos.google.cloud.dataproc.v1.IAutoscalingPolicy>): void;
Parameters
NameDescription
request IListAutoscalingPoliciesRequest
callback PaginationCallback<protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse | null | undefined, protos.google.cloud.dataproc.v1.IAutoscalingPolicy>
Returns
TypeDescription
void

listAutoscalingPoliciesAsync(request, options)

listAutoscalingPoliciesAsync(request?: protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.dataproc.v1.IAutoscalingPolicy>;

Equivalent to listAutoscalingPolicies, but returns an iterable object.

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

Parameters
NameDescription
request IListAutoscalingPoliciesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

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

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing AutoscalingPolicy. 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 "resource name" of the region or location, as described
   *  in https://cloud.google.com/apis/design/resource_names.
   *  * For `projects.regions.autoscalingPolicies.list`, the resource name
   *    of the region has the following format:
   *    `projects/{project_id}/regions/{region}`
   *  * For `projects.locations.autoscalingPolicies.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.
   *  Must be less than or equal to 1000. Defaults to 100.
   */
  // 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 {AutoscalingPolicyServiceClient} = require('@google-cloud/dataproc').v1;

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

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

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

  callListAutoscalingPolicies();

listAutoscalingPoliciesStream(request, options)

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

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

Parameters
NameDescription
request IListAutoscalingPoliciesRequest

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 AutoscalingPolicy 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 listAutoscalingPoliciesAsync() 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
NameDescription
project string
location string
Returns
TypeDescription
string

{string} Resource name string.

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.

matchLocationFromLocationName(locationName)

matchLocationFromLocationName(locationName: string): string | number;

Parse the location from Location resource.

Parameter
NameDescription
locationName string

A fully-qualified path representing Location resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName)

matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string): string | number;

Parse the location from ProjectLocationAutoscalingPolicy resource.

Parameter
NameDescription
projectLocationAutoscalingPolicyName string

A fully-qualified path representing project_location_autoscaling_policy resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName)

matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string): string | number;

Parse the location from ProjectLocationWorkflowTemplate resource.

Parameter
NameDescription
projectLocationWorkflowTemplateName string

A fully-qualified path representing project_location_workflow_template resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromSessionName(sessionName)

matchLocationFromSessionName(sessionName: string): string | number;

Parse the location from Session resource.

Parameter
NameDescription
sessionName string

A fully-qualified path representing Session resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromSessionTemplateName(sessionTemplateName)

matchLocationFromSessionTemplateName(sessionTemplateName: string): string | number;

Parse the location from SessionTemplate resource.

Parameter
NameDescription
sessionTemplateName string

A fully-qualified path representing SessionTemplate resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchNodeGroupFromNodeGroupName(nodeGroupName)

matchNodeGroupFromNodeGroupName(nodeGroupName: string): string | number;

Parse the node_group from NodeGroup resource.

Parameter
NameDescription
nodeGroupName string

A fully-qualified path representing NodeGroup resource.

Returns
TypeDescription
string | number

{string} A string representing the node_group.

matchProjectFromBatchName(batchName)

matchProjectFromBatchName(batchName: string): string | number;

Parse the project from Batch resource.

Parameter
NameDescription
batchName string

A fully-qualified path representing Batch resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromLocationName(locationName)

matchProjectFromLocationName(locationName: string): string | number;

Parse the project from Location resource.

Parameter
NameDescription
locationName string

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

matchProjectFromSessionName(sessionName)

matchProjectFromSessionName(sessionName: string): string | number;

Parse the project from Session resource.

Parameter
NameDescription
sessionName string

A fully-qualified path representing Session resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromSessionTemplateName(sessionTemplateName)

matchProjectFromSessionTemplateName(sessionTemplateName: string): string | number;

Parse the project from SessionTemplate resource.

Parameter
NameDescription
sessionTemplateName string

A fully-qualified path representing SessionTemplate resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchRegionFromNodeGroupName(nodeGroupName)

matchRegionFromNodeGroupName(nodeGroupName: string): string | number;

Parse the region from NodeGroup resource.

Parameter
NameDescription
nodeGroupName string

A fully-qualified path representing NodeGroup resource.

Returns
TypeDescription
string | number

{string} A string representing the region.

matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName)

matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string): string | number;

Parse the region from ProjectRegionAutoscalingPolicy resource.

Parameter
NameDescription
projectRegionAutoscalingPolicyName string

A fully-qualified path representing project_region_autoscaling_policy resource.

Returns
TypeDescription
string | number

{string} A string representing the region.

matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName)

matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string): string | number;

Parse the region from ProjectRegionWorkflowTemplate resource.

Parameter
NameDescription
projectRegionWorkflowTemplateName string

A fully-qualified path representing project_region_workflow_template resource.

Returns
TypeDescription
string | number

{string} A string representing the region.

matchSessionFromSessionName(sessionName)

matchSessionFromSessionName(sessionName: string): string | number;

Parse the session from Session resource.

Parameter
NameDescription
sessionName string

A fully-qualified path representing Session resource.

Returns
TypeDescription
string | number

{string} A string representing the session.

matchTemplateFromSessionTemplateName(sessionTemplateName)

matchTemplateFromSessionTemplateName(sessionTemplateName: string): string | number;

Parse the template from SessionTemplate resource.

Parameter
NameDescription
sessionTemplateName string

A fully-qualified path representing SessionTemplate resource.

Returns
TypeDescription
string | number

{string} A string representing the template.

matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName)

matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string): string | number;

Parse the workflow_template from ProjectLocationWorkflowTemplate resource.

Parameter
NameDescription
projectLocationWorkflowTemplateName string

A fully-qualified path representing project_location_workflow_template resource.

Returns
TypeDescription
string | number

{string} A string representing the workflow_template.

matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName)

matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string): string | number;

Parse the workflow_template from ProjectRegionWorkflowTemplate resource.

Parameter
NameDescription
projectRegionWorkflowTemplateName string

A fully-qualified path representing project_region_workflow_template resource.

Returns
TypeDescription
string | number

{string} A string representing the workflow_template.

nodeGroupPath(project, region, cluster, nodeGroup)

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

Return a fully-qualified nodeGroup resource name string.

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

{string} Resource name string.

projectLocationAutoscalingPolicyPath(project, location, autoscalingPolicy)

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

Return a fully-qualified projectLocationAutoscalingPolicy resource name string.

Parameters
NameDescription
project string
location string
autoscalingPolicy string
Returns
TypeDescription
string

{string} Resource name string.

projectLocationWorkflowTemplatePath(project, location, workflowTemplate)

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

Return a fully-qualified projectLocationWorkflowTemplate resource name string.

Parameters
NameDescription
project string
location string
workflowTemplate string
Returns
TypeDescription
string

{string} Resource name string.

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.

sessionPath(project, location, session)

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

Return a fully-qualified session resource name string.

Parameters
NameDescription
project string
location string
session string
Returns
TypeDescription
string

{string} Resource name string.

sessionTemplatePath(project, location, template)

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

Return a fully-qualified sessionTemplate resource name string.

Parameters
NameDescription
project string
location string
template string
Returns
TypeDescription
string

{string} Resource name string.

setIamPolicy(request, options, callback)

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

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

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

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

The request object that will be sent.

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

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

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

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

The second parameter to the callback is an object representing .

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

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

testIamPermissions(request, options, callback)

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

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

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

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

The request object that will be sent.

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

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

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

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

The second parameter to the callback is an object representing .

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

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

updateAutoscalingPolicy(request, options)

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

Updates (replaces) autoscaling policy.

Disabled check for update_mask, because all updates will be full replacements.

Parameters
NameDescription
request IUpdateAutoscalingPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

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

{Promise} - The promise which resolves to an array. The first element of the array is an object representing AutoscalingPolicy. 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 autoscaling policy.
   */
  // const policy = {}

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

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

  async function callUpdateAutoscalingPolicy() {
    // Construct request
    const request = {
      policy,
    };

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

  callUpdateAutoscalingPolicy();

updateAutoscalingPolicy(request, options, callback)

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

updateAutoscalingPolicy(request, callback)

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