Get stage execution details (async)

Demonstrates how to get information about the workers and work items within a stage.

Code sample

Node.js

/**
 * 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();

Python

from google.cloud import dataflow_v1beta3


async def sample_get_stage_execution_details():
    # Create a client
    client = dataflow_v1beta3.MetricsV1Beta3AsyncClient()

    # Initialize request argument(s)
    request = dataflow_v1beta3.GetStageExecutionDetailsRequest(
    )

    # Make the request
    page_result = client.get_stage_execution_details(request=request)

    # Handle the response
    async for response in page_result:
        print(response)

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.