Dataflow v1beta3 API - Class MessagesV1Beta3Client (2.0.0-beta05)

public abstract class MessagesV1Beta3Client

Reference documentation and code samples for the Dataflow v1beta3 API class MessagesV1Beta3Client.

MessagesV1Beta3 client wrapper, for convenient use.

Inheritance

object > MessagesV1Beta3Client

Namespace

Google.Cloud.Dataflow.V1Beta3

Assembly

Google.Cloud.Dataflow.V1Beta3.dll

Remarks

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

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the MessagesV1Beta3 service, which is a host of "dataflow.googleapis.com" and a port of 443.

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default MessagesV1Beta3 scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

GrpcClient

public virtual MessagesV1Beta3.MessagesV1Beta3Client GrpcClient { get; }

The underlying gRPC MessagesV1Beta3 client

Property Value
TypeDescription
MessagesV1Beta3MessagesV1Beta3Client

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

Create()

public static MessagesV1Beta3Client Create()

Synchronously creates a MessagesV1Beta3Client using the default credentials, endpoint and settings. To specify custom credentials or other settings, use MessagesV1Beta3ClientBuilder.

Returns
TypeDescription
MessagesV1Beta3Client

The created MessagesV1Beta3Client.

CreateAsync(CancellationToken)

public static Task<MessagesV1Beta3Client> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a MessagesV1Beta3Client using the default credentials, endpoint and settings. To specify custom credentials or other settings, use MessagesV1Beta3ClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskMessagesV1Beta3Client

The task representing the created MessagesV1Beta3Client.

ListJobMessages(ListJobMessagesRequest, CallSettings)

public virtual PagedEnumerable<ListJobMessagesResponse, JobMessage> ListJobMessages(ListJobMessagesRequest request, CallSettings callSettings = null)

Request the job status.

To request the status of a job, we recommend using projects.locations.jobs.messages.list with a regional endpoint. 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
requestListJobMessagesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListJobMessagesResponseJobMessage

A pageable sequence of JobMessage resources.

Example
// Create client
MessagesV1Beta3Client messagesV1Beta3Client = MessagesV1Beta3Client.Create();
// Initialize request argument(s)
ListJobMessagesRequest request = new ListJobMessagesRequest
{
    ProjectId = "",
    JobId = "",
    MinimumImportance = JobMessageImportance.Unknown,
    StartTime = new Timestamp(),
    EndTime = new Timestamp(),
    Location = "",
};
// Make the request
PagedEnumerable<ListJobMessagesResponse, JobMessage> response = messagesV1Beta3Client.ListJobMessages(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (JobMessage item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListJobMessagesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (JobMessage item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<JobMessage> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (JobMessage item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListJobMessagesAsync(ListJobMessagesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListJobMessagesResponse, JobMessage> ListJobMessagesAsync(ListJobMessagesRequest request, CallSettings callSettings = null)

Request the job status.

To request the status of a job, we recommend using projects.locations.jobs.messages.list with a regional endpoint. 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
requestListJobMessagesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListJobMessagesResponseJobMessage

A pageable asynchronous sequence of JobMessage resources.

Example
// Create client
MessagesV1Beta3Client messagesV1Beta3Client = await MessagesV1Beta3Client.CreateAsync();
// Initialize request argument(s)
ListJobMessagesRequest request = new ListJobMessagesRequest
{
    ProjectId = "",
    JobId = "",
    MinimumImportance = JobMessageImportance.Unknown,
    StartTime = new Timestamp(),
    EndTime = new Timestamp(),
    Location = "",
};
// Make the request
PagedAsyncEnumerable<ListJobMessagesResponse, JobMessage> response = messagesV1Beta3Client.ListJobMessagesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((JobMessage item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListJobMessagesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (JobMessage item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<JobMessage> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (JobMessage item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.