The Dataflow Metrics API lets you monitor the progress of Dataflow jobs. v1beta3
Package
@google-cloud/dataflowConstructors
(constructor)(opts, gaxInstance)
constructor
(
opts
?:
ClientOptions
,
gaxInstance
?:
typeof
gax
|
typeof
gax
.
fallback
);
Construct an instance of MetricsV1Beta3Client.
opts
ClientOptions
gaxInstance
typeof gax | typeof gax.fallback
: loaded instance of google-gax
. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new MetricsV1Beta3Client({fallback: 'rest'}, gax); ```
Properties
apiEndpoint
static
get
apiEndpoint
()
:
string
;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
auth
auth
:
gax
.
GoogleAuth
;
descriptors
descriptors
:
Descriptors
;
innerApiCalls
innerApiCalls
:
{
[
name
:
string
]
:
Function
;
};
metricsV1Beta3Stub
metricsV1Beta3Stub
?:
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.
Promise
<void>
{Promise} A promise that resolves when the client is closed.
getJobExecutionDetails(request, options)
getJobExecutionDetails
(
request
?:
protos
.
google
.
dataflow
.
v1beta3
.
IGetJobExecutionDetailsRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
dataflow
.
v1beta3
.
IStageSummary
[],
protos
.
google
.
dataflow
.
v1beta3
.
IGetJobExecutionDetailsRequest
|
null
,
protos
.
google
.
dataflow
.
v1beta3
.
IJobExecutionDetails
]>;
Request detailed information about the execution status of the job.
EXPERIMENTAL. This API is subject to change or removal without notice.
request
protos. google.dataflow.v1beta3.IGetJobExecutionDetailsRequest
The request object that will be sent.
options
Promise
<[
protos. google.dataflow.v1beta3.IStageSummary
[],
protos. google.dataflow.v1beta3.IGetJobExecutionDetailsRequest
| null,
protos. google.dataflow.v1beta3.IJobExecutionDetails
]>
{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using getJobExecutionDetailsAsync()
method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
getJobExecutionDetails(request, options, callback)
getJobExecutionDetails
(
request
:
protos
.
google
.
dataflow
.
v1beta3
.
IGetJobExecutionDetailsRequest
,
options
:
CallOptions
,
callback
:
PaginationCallback<protos
.
google
.
dataflow
.
v1beta3
.
IGetJobExecutionDetailsRequest
,
protos
.
google
.
dataflow
.
v1beta3
.
IJobExecutionDetails
|
null
|
undefined
,
protos
.
google
.
dataflow
.
v1beta3
.
IStageSummary
> )
:
void
;
request
protos. google.dataflow.v1beta3.IGetJobExecutionDetailsRequest
options
CallOptions
callback
PaginationCallback
<protos. google.dataflow.v1beta3.IGetJobExecutionDetailsRequest
, protos. google.dataflow.v1beta3.IJobExecutionDetails
| null | undefined, protos. google.dataflow.v1beta3.IStageSummary
>
void
getJobExecutionDetails(request, callback)
getJobExecutionDetails
(
request
:
protos
.
google
.
dataflow
.
v1beta3
.
IGetJobExecutionDetailsRequest
,
callback
:
PaginationCallback<protos
.
google
.
dataflow
.
v1beta3
.
IGetJobExecutionDetailsRequest
,
protos
.
google
.
dataflow
.
v1beta3
.
IJobExecutionDetails
|
null
|
undefined
,
protos
.
google
.
dataflow
.
v1beta3
.
IStageSummary
> )
:
void
;
request
protos. google.dataflow.v1beta3.IGetJobExecutionDetailsRequest
callback
PaginationCallback
<protos. google.dataflow.v1beta3.IGetJobExecutionDetailsRequest
, protos. google.dataflow.v1beta3.IJobExecutionDetails
| null | undefined, protos. google.dataflow.v1beta3.IStageSummary
>
void
getJobExecutionDetailsAsync(request, options)
getJobExecutionDetailsAsync
(
request
?:
protos
.
google
.
dataflow
.
v1beta3
.
IGetJobExecutionDetailsRequest
,
options
?:
CallOptions
)
:
AsyncIterable<protos
.
google
.
dataflow
.
v1beta3
.
IStageSummary
> ;
Equivalent to getJobExecutionDetails
, but returns an iterable object.
for
- await
- of
syntax is used with the iterable to get response elements on-demand.
request
protos. google.dataflow.v1beta3.IGetJobExecutionDetailsRequest
The request object that will be sent.
options
AsyncIterable
<protos. google.dataflow.v1beta3.IStageSummary
>
{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
/**
* 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 execution details for.
*/
// const jobId = 'abc123'
/**
* The regional endpoint
* (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that
* contains the job specified by job_id.
*/
// const location = 'abc123'
/**
* If specified, determines the maximum number of stages 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'
// Imports the Dataflow library
const
{
MetricsV1Beta3Client
}
=
require
(
' @google-cloud/dataflow
'
).
v1beta3
;
// Instantiates a client
const
dataflowClient
=
new
MetricsV1Beta3Client
();
async
function
callGetJobExecutionDetails
()
{
// Construct request
const
request
=
{
};
// Run request
const
iterable
=
await
dataflowClient
.
getJobExecutionDetailsAsync
(
request
);
for
await
(
const
response
of
iterable
)
{
console
.
log
(
response
);
}
}
callGetJobExecutionDetails
();
getJobExecutionDetailsStream(request, options)
getJobExecutionDetailsStream
(
request
?:
protos
.
google
.
dataflow
.
v1beta3
.
IGetJobExecutionDetailsRequest
,
options
?:
CallOptions
)
:
Transform
;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
request
protos. google.dataflow.v1beta3.IGetJobExecutionDetailsRequest
The request object that will be sent.
options
Transform
{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using getJobExecutionDetailsAsync()
method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
getJobMetrics(request, options)
getJobMetrics
(
request
?:
protos
.
google
.
dataflow
.
v1beta3
.
IGetJobMetricsRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
dataflow
.
v1beta3
.
IJobMetrics
,
protos
.
google
.
dataflow
.
v1beta3
.
IGetJobMetricsRequest
|
undefined
,
{}
|
undefined
]>;
Request the job status.
To request the status of a job, we recommend using projects.locations.jobs.getMetrics
with a [regional endpoint] ( https://cloud.google.com/dataflow/docs/concepts/regional-endpoints
). Using projects.jobs.getMetrics
is not recommended, as you can only request the status of jobs that are running in us-central1
.
request
protos. google.dataflow.v1beta3.IGetJobMetricsRequest
The request object that will be sent.
options
Promise
<[
protos. google.dataflow.v1beta3.IJobMetrics
,
protos. google.dataflow.v1beta3.IGetJobMetricsRequest
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.
/**
* 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 metrics for.
*/
// const jobId = 'abc123'
/**
* Return only metric data that has changed since this time.
* Default is to return all information about all metrics for the job.
*/
// const startTime = {}
/**
* 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
{
MetricsV1Beta3Client
}
=
require
(
' @google-cloud/dataflow
'
).
v1beta3
;
// Instantiates a client
const
dataflowClient
=
new
MetricsV1Beta3Client
();
async
function
callGetJobMetrics
()
{
// Construct request
const
request
=
{
};
// Run request
const
response
=
await
dataflowClient
.
getJobMetrics
(
request
);
console
.
log
(
response
);
}
callGetJobMetrics
();
getJobMetrics(request, options, callback)
getJobMetrics
(
request
:
protos
.
google
.
dataflow
.
v1beta3
.
IGetJobMetricsRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
dataflow
.
v1beta3
.
IJobMetrics
,
protos
.
google
.
dataflow
.
v1beta3
.
IGetJobMetricsRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
protos. google.dataflow.v1beta3.IGetJobMetricsRequest
options
CallOptions
callback
Callback
<protos. google.dataflow.v1beta3.IJobMetrics
, protos. google.dataflow.v1beta3.IGetJobMetricsRequest
| null | undefined, {} | null | undefined>
void
getJobMetrics(request, callback)
getJobMetrics
(
request
:
protos
.
google
.
dataflow
.
v1beta3
.
IGetJobMetricsRequest
,
callback
:
Callback<protos
.
google
.
dataflow
.
v1beta3
.
IJobMetrics
,
protos
.
google
.
dataflow
.
v1beta3
.
IGetJobMetricsRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
protos. google.dataflow.v1beta3.IGetJobMetricsRequest
callback
Callback
<protos. google.dataflow.v1beta3.IJobMetrics
, protos. google.dataflow.v1beta3.IGetJobMetricsRequest
| null | undefined, {} | null | undefined>
void
getProjectId()
getProjectId
()
:
Promise<string>
;
Promise
<string>
getProjectId(callback)
getProjectId
(
callback
:
Callback<string
,
undefined
,
undefined
> )
:
void
;
callback
Callback
<string, undefined, undefined>
void
getStageExecutionDetails(request, options)
getStageExecutionDetails
(
request
?:
protos
.
google
.
dataflow
.
v1beta3
.
IGetStageExecutionDetailsRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
dataflow
.
v1beta3
.
IWorkerDetails
[],
protos
.
google
.
dataflow
.
v1beta3
.
IGetStageExecutionDetailsRequest
|
null
,
protos
.
google
.
dataflow
.
v1beta3
.
IStageExecutionDetails
]>;
Request detailed information about the execution status of a stage of the job.
EXPERIMENTAL. This API is subject to change or removal without notice.
request
protos. google.dataflow.v1beta3.IGetStageExecutionDetailsRequest
The request object that will be sent.
options
Promise
<[
protos. google.dataflow.v1beta3.IWorkerDetails
[],
protos. google.dataflow.v1beta3.IGetStageExecutionDetailsRequest
| null,
protos. google.dataflow.v1beta3.IStageExecutionDetails
]>
{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using getStageExecutionDetailsAsync()
method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
getStageExecutionDetails(request, options, callback)
getStageExecutionDetails
(
request
:
protos
.
google
.
dataflow
.
v1beta3
.
IGetStageExecutionDetailsRequest
,
options
:
CallOptions
,
callback
:
PaginationCallback<protos
.
google
.
dataflow
.
v1beta3
.
IGetStageExecutionDetailsRequest
,
protos
.
google
.
dataflow
.
v1beta3
.
IStageExecutionDetails
|
null
|
undefined
,
protos
.
google
.
dataflow
.
v1beta3
.
IWorkerDetails
> )
:
void
;
request
protos. google.dataflow.v1beta3.IGetStageExecutionDetailsRequest
options
CallOptions
callback
PaginationCallback
<protos. google.dataflow.v1beta3.IGetStageExecutionDetailsRequest
, protos. google.dataflow.v1beta3.IStageExecutionDetails
| null | undefined, protos. google.dataflow.v1beta3.IWorkerDetails
>
void
getStageExecutionDetails(request, callback)
getStageExecutionDetails
(
request
:
protos
.
google
.
dataflow
.
v1beta3
.
IGetStageExecutionDetailsRequest
,
callback
:
PaginationCallback<protos
.
google
.
dataflow
.
v1beta3
.
IGetStageExecutionDetailsRequest
,
protos
.
google
.
dataflow
.
v1beta3
.
IStageExecutionDetails
|
null
|
undefined
,
protos
.
google
.
dataflow
.
v1beta3
.
IWorkerDetails
> )
:
void
;
request
protos. google.dataflow.v1beta3.IGetStageExecutionDetailsRequest
callback
PaginationCallback
<protos. google.dataflow.v1beta3.IGetStageExecutionDetailsRequest
, protos. google.dataflow.v1beta3.IStageExecutionDetails
| null | undefined, protos. google.dataflow.v1beta3.IWorkerDetails
>
void
getStageExecutionDetailsAsync(request, options)
getStageExecutionDetailsAsync
(
request
?:
protos
.
google
.
dataflow
.
v1beta3
.
IGetStageExecutionDetailsRequest
,
options
?:
CallOptions
)
:
AsyncIterable<protos
.
google
.
dataflow
.
v1beta3
.
IWorkerDetails
> ;
Equivalent to getStageExecutionDetails
, but returns an iterable object.
for
- await
- of
syntax is used with the iterable to get response elements on-demand.
request
protos. google.dataflow.v1beta3.IGetStageExecutionDetailsRequest
The request object that will be sent.
options
AsyncIterable
<protos. google.dataflow.v1beta3.IWorkerDetails
>
{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
/**
* 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 execution details for.
*/
// const jobId = 'abc123'
/**
* The regional endpoint
* (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that
* contains the job specified by job_id.
*/
// const location = 'abc123'
/**
* The stage for which to fetch information.
*/
// const stageId = 'abc123'
/**
* If specified, determines the maximum number of work items 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'
/**
* Lower time bound of work items to include, by start time.
*/
// const startTime = {}
/**
* Upper time bound of work items to include, by start time.
*/
// const endTime = {}
// Imports the Dataflow library
const
{
MetricsV1Beta3Client
}
=
require
(
' @google-cloud/dataflow
'
).
v1beta3
;
// Instantiates a client
const
dataflowClient
=
new
MetricsV1Beta3Client
();
async
function
callGetStageExecutionDetails
()
{
// Construct request
const
request
=
{
};
// Run request
const
iterable
=
await
dataflowClient
.
getStageExecutionDetailsAsync
(
request
);
for
await
(
const
response
of
iterable
)
{
console
.
log
(
response
);
}
}
callGetStageExecutionDetails
();
getStageExecutionDetailsStream(request, options)
getStageExecutionDetailsStream
(
request
?:
protos
.
google
.
dataflow
.
v1beta3
.
IGetStageExecutionDetailsRequest
,
options
?:
CallOptions
)
:
Transform
;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
request
protos. google.dataflow.v1beta3.IGetStageExecutionDetailsRequest
The request object that will be sent.
options
Transform
{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using getStageExecutionDetailsAsync()
method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.
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.
Promise
<{
[name: string]: Function
;
}>
{Promise} A promise that resolves to an authenticated service stub.