Class v1beta3.MessagesV1Beta3Client (3.0.2)

The Dataflow Messages API is used for monitoring the progress of Dataflow jobs. v1beta3

Package

@google-cloud/dataflow

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of MessagesV1Beta3Client.

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 MessagesV1Beta3Client({fallback: true}, 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;

innerApiCalls

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

messagesV1Beta3Stub

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

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;

Methods

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.

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.

listJobMessages(request, options)

listJobMessages(request?: protos.google.dataflow.v1beta3.IListJobMessagesRequest, options?: CallOptions): Promise<[
        protos.google.dataflow.v1beta3.IJobMessage[],
        protos.google.dataflow.v1beta3.IListJobMessagesRequest | null,
        protos.google.dataflow.v1beta3.IListJobMessagesResponse
    ]>;

Request the job status.

To request the status of a job, we recommend using projects.locations.jobs.messages.list with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using projects.jobs.messages.list is not recommended, as you can only request the status of jobs that are running in us-central1.

Parameters
NameDescription
request IListJobMessagesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.dataflow.v1beta3.IJobMessage[], protos.google.dataflow.v1beta3.IListJobMessagesRequest | null, protos.google.dataflow.v1beta3.IListJobMessagesResponse ]>

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

listJobMessages(request, options, callback)

listJobMessages(request: protos.google.dataflow.v1beta3.IListJobMessagesRequest, options: CallOptions, callback: PaginationCallback<protos.google.dataflow.v1beta3.IListJobMessagesRequest, protos.google.dataflow.v1beta3.IListJobMessagesResponse | null | undefined, protos.google.dataflow.v1beta3.IJobMessage>): void;
Parameters
NameDescription
request IListJobMessagesRequest
options CallOptions
callback PaginationCallback<protos.google.dataflow.v1beta3.IListJobMessagesRequest, protos.google.dataflow.v1beta3.IListJobMessagesResponse | null | undefined, protos.google.dataflow.v1beta3.IJobMessage>
Returns
TypeDescription
void

listJobMessages(request, callback)

listJobMessages(request: protos.google.dataflow.v1beta3.IListJobMessagesRequest, callback: PaginationCallback<protos.google.dataflow.v1beta3.IListJobMessagesRequest, protos.google.dataflow.v1beta3.IListJobMessagesResponse | null | undefined, protos.google.dataflow.v1beta3.IJobMessage>): void;
Parameters
NameDescription
request IListJobMessagesRequest
callback PaginationCallback<protos.google.dataflow.v1beta3.IListJobMessagesRequest, protos.google.dataflow.v1beta3.IListJobMessagesResponse | null | undefined, protos.google.dataflow.v1beta3.IJobMessage>
Returns
TypeDescription
void

listJobMessagesAsync(request, options)

listJobMessagesAsync(request?: protos.google.dataflow.v1beta3.IListJobMessagesRequest, options?: CallOptions): AsyncIterable<protos.google.dataflow.v1beta3.IJobMessage>;

Equivalent to listJobMessages, but returns an iterable object.

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

Parameters
NameDescription
request IListJobMessagesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.dataflow.v1beta3.IJobMessage>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing JobMessage. 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.
   */
  /**
   *  A project id.
   */
  // const projectId = 'abc123'
  /**
   *  The job to get messages about.
   */
  // const jobId = 'abc123'
  /**
   *  Filter to only get messages with importance >= level
   */
  // const minimumImportance = {}
  /**
   *  If specified, determines the maximum number of messages to
   *  return.  If unspecified, the service may choose an appropriate
   *  default, or may return an arbitrarily large number of results.
   */
  // const pageSize = 1234
  /**
   *  If supplied, this should be the value of next_page_token returned
   *  by an earlier call. This will cause the next page of results to
   *  be returned.
   */
  // const pageToken = 'abc123'
  /**
   *  If specified, return only messages with timestamps >= start_time.
   *  The default is the job creation time (i.e. beginning of messages).
   */
  // const startTime = {}
  /**
   *  Return only messages with timestamps < end_time.="" the="" default="" is="" now="" *="" (i.e.="" return="" up="" to="" the="" latest="" messages="" available).="" */="" const="" endtime="{}" *="" *="" the="" regional="" endpoint="" *="" (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints)="" that="" *="" contains="" the="" job="" specified="" by="" job_id.="" */="" const="" location='abc123' imports="" the="" dataflow="" library="" const="" {messagesv1beta3client}="require('@google-cloud/dataflow').v1beta3;" instantiates="" a="" client="" const="" dataflowclient="new" messagesv1beta3client();="" async="" function="" calllistjobmessages()="" {="" construct="" request="" const="" request="{" };="" run="" request="" const="" iterable="await" dataflowclient.listjobmessagesasync(request);="" for="" await="" (const="" response="" of="" iterable)="" {="" console.log(response);="" }="" }="" calllistjobmessages();="">

listJobMessagesStream(request, options)

listJobMessagesStream(request?: protos.google.dataflow.v1beta3.IListJobMessagesRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request IListJobMessagesRequest

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 JobMessage 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 listJobMessagesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.