Google Cloud Dataproc v1 API - Class JobControllerClient (5.10.0)

public abstract class JobControllerClient

Reference documentation and code samples for the Google Cloud Dataproc v1 API class JobControllerClient.

JobController client wrapper, for convenient use.

Inheritance

object > JobControllerClient

Derived Types

Namespace

Google.Cloud.Dataproc.V1

Assembly

Google.Cloud.Dataproc.V1.dll

Remarks

The JobController provides methods to manage jobs.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default JobController scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

The default JobController scopes are:

GrpcClient

public virtual JobController.JobControllerClient GrpcClient { get; }

The underlying gRPC JobController client

Property Value
TypeDescription
JobControllerJobControllerClient

IAMPolicyClient

public virtual IAMPolicyClient IAMPolicyClient { get; }

The IAMPolicyClient associated with this client.

Property Value
TypeDescription
IAMPolicyClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

SubmitJobAsOperationOperationsClient

public virtual OperationsClient SubmitJobAsOperationOperationsClient { get; }

The long-running operations client for SubmitJobAsOperation.

Property Value
TypeDescription
OperationsClient

Methods

CancelJob(CancelJobRequest, CallSettings)

public virtual Job CancelJob(CancelJobRequest request, CallSettings callSettings = null)

Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get.

Parameters
NameDescription
requestCancelJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Job

The RPC response.

Example
// Create client
JobControllerClient jobControllerClient = JobControllerClient.Create();
// Initialize request argument(s)
CancelJobRequest request = new CancelJobRequest
{
    ProjectId = "",
    JobId = "",
    Region = "",
};
// Make the request
Job response = jobControllerClient.CancelJob(request);

CancelJob(string, string, string, CallSettings)

public virtual Job CancelJob(string projectId, string region, string jobId, CallSettings callSettings = null)

Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the job belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

jobIdstring

Required. The job ID.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Job

The RPC response.

Example
// Create client
JobControllerClient jobControllerClient = JobControllerClient.Create();
// Initialize request argument(s)
string projectId = "";
string region = "";
string jobId = "";
// Make the request
Job response = jobControllerClient.CancelJob(projectId, region, jobId);

CancelJobAsync(CancelJobRequest, CallSettings)

public virtual Task<Job> CancelJobAsync(CancelJobRequest request, CallSettings callSettings = null)

Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get.

Parameters
NameDescription
requestCancelJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
CancelJobRequest request = new CancelJobRequest
{
    ProjectId = "",
    JobId = "",
    Region = "",
};
// Make the request
Job response = await jobControllerClient.CancelJobAsync(request);

CancelJobAsync(CancelJobRequest, CancellationToken)

public virtual Task<Job> CancelJobAsync(CancelJobRequest request, CancellationToken cancellationToken)

Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get.

Parameters
NameDescription
requestCancelJobRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
CancelJobRequest request = new CancelJobRequest
{
    ProjectId = "",
    JobId = "",
    Region = "",
};
// Make the request
Job response = await jobControllerClient.CancelJobAsync(request);

CancelJobAsync(string, string, string, CallSettings)

public virtual Task<Job> CancelJobAsync(string projectId, string region, string jobId, CallSettings callSettings = null)

Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the job belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

jobIdstring

Required. The job ID.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
string jobId = "";
// Make the request
Job response = await jobControllerClient.CancelJobAsync(projectId, region, jobId);

CancelJobAsync(string, string, string, CancellationToken)

public virtual Task<Job> CancelJobAsync(string projectId, string region, string jobId, CancellationToken cancellationToken)

Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the job belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

jobIdstring

Required. The job ID.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
string jobId = "";
// Make the request
Job response = await jobControllerClient.CancelJobAsync(projectId, region, jobId);

Create()

public static JobControllerClient Create()

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

Returns
TypeDescription
JobControllerClient

The created JobControllerClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskJobControllerClient

The task representing the created JobControllerClient.

DeleteJob(DeleteJobRequest, CallSettings)

public virtual void DeleteJob(DeleteJobRequest request, CallSettings callSettings = null)

Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION.

Parameters
NameDescription
requestDeleteJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
JobControllerClient jobControllerClient = JobControllerClient.Create();
// Initialize request argument(s)
DeleteJobRequest request = new DeleteJobRequest
{
    ProjectId = "",
    JobId = "",
    Region = "",
};
// Make the request
jobControllerClient.DeleteJob(request);

DeleteJob(string, string, string, CallSettings)

public virtual void DeleteJob(string projectId, string region, string jobId, CallSettings callSettings = null)

Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the job belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

jobIdstring

Required. The job ID.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
JobControllerClient jobControllerClient = JobControllerClient.Create();
// Initialize request argument(s)
string projectId = "";
string region = "";
string jobId = "";
// Make the request
jobControllerClient.DeleteJob(projectId, region, jobId);

DeleteJobAsync(DeleteJobRequest, CallSettings)

public virtual Task DeleteJobAsync(DeleteJobRequest request, CallSettings callSettings = null)

Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION.

Parameters
NameDescription
requestDeleteJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
DeleteJobRequest request = new DeleteJobRequest
{
    ProjectId = "",
    JobId = "",
    Region = "",
};
// Make the request
await jobControllerClient.DeleteJobAsync(request);

DeleteJobAsync(DeleteJobRequest, CancellationToken)

public virtual Task DeleteJobAsync(DeleteJobRequest request, CancellationToken cancellationToken)

Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION.

Parameters
NameDescription
requestDeleteJobRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
DeleteJobRequest request = new DeleteJobRequest
{
    ProjectId = "",
    JobId = "",
    Region = "",
};
// Make the request
await jobControllerClient.DeleteJobAsync(request);

DeleteJobAsync(string, string, string, CallSettings)

public virtual Task DeleteJobAsync(string projectId, string region, string jobId, CallSettings callSettings = null)

Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the job belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

jobIdstring

Required. The job ID.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
string jobId = "";
// Make the request
await jobControllerClient.DeleteJobAsync(projectId, region, jobId);

DeleteJobAsync(string, string, string, CancellationToken)

public virtual Task DeleteJobAsync(string projectId, string region, string jobId, CancellationToken cancellationToken)

Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the job belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

jobIdstring

Required. The job ID.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
string jobId = "";
// Make the request
await jobControllerClient.DeleteJobAsync(projectId, region, jobId);

GetJob(GetJobRequest, CallSettings)

public virtual Job GetJob(GetJobRequest request, CallSettings callSettings = null)

Gets the resource representation for a job in a project.

Parameters
NameDescription
requestGetJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Job

The RPC response.

Example
// Create client
JobControllerClient jobControllerClient = JobControllerClient.Create();
// Initialize request argument(s)
GetJobRequest request = new GetJobRequest
{
    ProjectId = "",
    JobId = "",
    Region = "",
};
// Make the request
Job response = jobControllerClient.GetJob(request);

GetJob(string, string, string, CallSettings)

public virtual Job GetJob(string projectId, string region, string jobId, CallSettings callSettings = null)

Gets the resource representation for a job in a project.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the job belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

jobIdstring

Required. The job ID.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Job

The RPC response.

Example
// Create client
JobControllerClient jobControllerClient = JobControllerClient.Create();
// Initialize request argument(s)
string projectId = "";
string region = "";
string jobId = "";
// Make the request
Job response = jobControllerClient.GetJob(projectId, region, jobId);

GetJobAsync(GetJobRequest, CallSettings)

public virtual Task<Job> GetJobAsync(GetJobRequest request, CallSettings callSettings = null)

Gets the resource representation for a job in a project.

Parameters
NameDescription
requestGetJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
GetJobRequest request = new GetJobRequest
{
    ProjectId = "",
    JobId = "",
    Region = "",
};
// Make the request
Job response = await jobControllerClient.GetJobAsync(request);

GetJobAsync(GetJobRequest, CancellationToken)

public virtual Task<Job> GetJobAsync(GetJobRequest request, CancellationToken cancellationToken)

Gets the resource representation for a job in a project.

Parameters
NameDescription
requestGetJobRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
GetJobRequest request = new GetJobRequest
{
    ProjectId = "",
    JobId = "",
    Region = "",
};
// Make the request
Job response = await jobControllerClient.GetJobAsync(request);

GetJobAsync(string, string, string, CallSettings)

public virtual Task<Job> GetJobAsync(string projectId, string region, string jobId, CallSettings callSettings = null)

Gets the resource representation for a job in a project.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the job belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

jobIdstring

Required. The job ID.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
string jobId = "";
// Make the request
Job response = await jobControllerClient.GetJobAsync(projectId, region, jobId);

GetJobAsync(string, string, string, CancellationToken)

public virtual Task<Job> GetJobAsync(string projectId, string region, string jobId, CancellationToken cancellationToken)

Gets the resource representation for a job in a project.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the job belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

jobIdstring

Required. The job ID.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
string jobId = "";
// Make the request
Job response = await jobControllerClient.GetJobAsync(projectId, region, jobId);

ListJobs(ListJobsRequest, CallSettings)

public virtual PagedEnumerable<ListJobsResponse, Job> ListJobs(ListJobsRequest request, CallSettings callSettings = null)

Lists regions/{region}/jobs in a project.

Parameters
NameDescription
requestListJobsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListJobsResponseJob

A pageable sequence of Job resources.

Example
// Create client
JobControllerClient jobControllerClient = JobControllerClient.Create();
// Initialize request argument(s)
ListJobsRequest request = new ListJobsRequest
{
    ProjectId = "",
    ClusterName = "",
    JobStateMatcher = ListJobsRequest.Types.JobStateMatcher.All,
    Region = "",
    Filter = "",
};
// Make the request
PagedEnumerable<ListJobsResponse, Job> response = jobControllerClient.ListJobs(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Job 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 (ListJobsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Job 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<Job> 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 (Job 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;

ListJobs(string, string, string, int?, CallSettings)

public virtual PagedEnumerable<ListJobsResponse, Job> ListJobs(string projectId, string region, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists regions/{region}/jobs in a project.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the job belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListJobsResponseJob

A pageable sequence of Job resources.

Example
// Create client
JobControllerClient jobControllerClient = JobControllerClient.Create();
// Initialize request argument(s)
string projectId = "";
string region = "";
// Make the request
PagedEnumerable<ListJobsResponse, Job> response = jobControllerClient.ListJobs(projectId, region);

// Iterate over all response items, lazily performing RPCs as required
foreach (Job 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 (ListJobsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Job 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<Job> 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 (Job 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;

ListJobs(string, string, string, string, int?, CallSettings)

public virtual PagedEnumerable<ListJobsResponse, Job> ListJobs(string projectId, string region, string filter, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists regions/{region}/jobs in a project.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the job belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

filterstring

Optional. A filter constraining the jobs to list. Filters are case-sensitive and have the following syntax:

[field = value] AND [field [= value]] ...

where field is status.state or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be either ACTIVE or NON_ACTIVE. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.

Example filter:

status.state = ACTIVE AND labels.env = staging AND labels.starred = *

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListJobsResponseJob

A pageable sequence of Job resources.

Example
// Create client
JobControllerClient jobControllerClient = JobControllerClient.Create();
// Initialize request argument(s)
string projectId = "";
string region = "";
string filter = "";
// Make the request
PagedEnumerable<ListJobsResponse, Job> response = jobControllerClient.ListJobs(projectId, region, filter: filter);

// Iterate over all response items, lazily performing RPCs as required
foreach (Job 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 (ListJobsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Job 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<Job> 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 (Job 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;

ListJobsAsync(ListJobsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListJobsResponse, Job> ListJobsAsync(ListJobsRequest request, CallSettings callSettings = null)

Lists regions/{region}/jobs in a project.

Parameters
NameDescription
requestListJobsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListJobsResponseJob

A pageable asynchronous sequence of Job resources.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
ListJobsRequest request = new ListJobsRequest
{
    ProjectId = "",
    ClusterName = "",
    JobStateMatcher = ListJobsRequest.Types.JobStateMatcher.All,
    Region = "",
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListJobsResponse, Job> response = jobControllerClient.ListJobsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Job 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((ListJobsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Job 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<Job> 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 (Job 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;

ListJobsAsync(string, string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListJobsResponse, Job> ListJobsAsync(string projectId, string region, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists regions/{region}/jobs in a project.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the job belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListJobsResponseJob

A pageable asynchronous sequence of Job resources.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
// Make the request
PagedAsyncEnumerable<ListJobsResponse, Job> response = jobControllerClient.ListJobsAsync(projectId, region);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Job 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((ListJobsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Job 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<Job> 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 (Job 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;

ListJobsAsync(string, string, string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListJobsResponse, Job> ListJobsAsync(string projectId, string region, string filter, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists regions/{region}/jobs in a project.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the job belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

filterstring

Optional. A filter constraining the jobs to list. Filters are case-sensitive and have the following syntax:

[field = value] AND [field [= value]] ...

where field is status.state or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be either ACTIVE or NON_ACTIVE. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.

Example filter:

status.state = ACTIVE AND labels.env = staging AND labels.starred = *

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListJobsResponseJob

A pageable asynchronous sequence of Job resources.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
string filter = "";
// Make the request
PagedAsyncEnumerable<ListJobsResponse, Job> response = jobControllerClient.ListJobsAsync(projectId, region, filter: filter);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Job 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((ListJobsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Job 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<Job> 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 (Job 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;

PollOnceSubmitJobAsOperation(string, CallSettings)

public virtual Operation<Job, JobMetadata> PollOnceSubmitJobAsOperation(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of SubmitJobAsOperation .

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationJobJobMetadata

The result of polling the operation.

PollOnceSubmitJobAsOperationAsync(string, CallSettings)

public virtual Task<Operation<Job, JobMetadata>> PollOnceSubmitJobAsOperationAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of SubmitJobAsOperation.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationJobJobMetadata

A task representing the result of polling the operation.

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.

SubmitJob(SubmitJobRequest, CallSettings)

public virtual Job SubmitJob(SubmitJobRequest request, CallSettings callSettings = null)

Submits a job to a cluster.

Parameters
NameDescription
requestSubmitJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Job

The RPC response.

Example
// Create client
JobControllerClient jobControllerClient = JobControllerClient.Create();
// Initialize request argument(s)
SubmitJobRequest request = new SubmitJobRequest
{
    ProjectId = "",
    Job = new Job(),
    Region = "",
    RequestId = "",
};
// Make the request
Job response = jobControllerClient.SubmitJob(request);

SubmitJob(string, string, Job, CallSettings)

public virtual Job SubmitJob(string projectId, string region, Job job, CallSettings callSettings = null)

Submits a job to a cluster.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the job belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

jobJob

Required. The job resource.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Job

The RPC response.

Example
// Create client
JobControllerClient jobControllerClient = JobControllerClient.Create();
// Initialize request argument(s)
string projectId = "";
string region = "";
Job job = new Job();
// Make the request
Job response = jobControllerClient.SubmitJob(projectId, region, job);

SubmitJobAsOperation(SubmitJobRequest, CallSettings)

public virtual Operation<Job, JobMetadata> SubmitJobAsOperation(SubmitJobRequest request, CallSettings callSettings = null)

Submits job to a cluster.

Parameters
NameDescription
requestSubmitJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationJobJobMetadata

The RPC response.

Example
// Create client
JobControllerClient jobControllerClient = JobControllerClient.Create();
// Initialize request argument(s)
SubmitJobRequest request = new SubmitJobRequest
{
    ProjectId = "",
    Job = new Job(),
    Region = "",
    RequestId = "",
};
// Make the request
Operation<Job, JobMetadata> response = jobControllerClient.SubmitJobAsOperation(request);

// Poll until the returned long-running operation is complete
Operation<Job, JobMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Job result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Job, JobMetadata> retrievedResponse = jobControllerClient.PollOnceSubmitJobAsOperation(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Job retrievedResult = retrievedResponse.Result;
}

SubmitJobAsOperation(string, string, Job, CallSettings)

public virtual Operation<Job, JobMetadata> SubmitJobAsOperation(string projectId, string region, Job job, CallSettings callSettings = null)

Submits job to a cluster.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the job belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

jobJob

Required. The job resource.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationJobJobMetadata

The RPC response.

Example
// Create client
JobControllerClient jobControllerClient = JobControllerClient.Create();
// Initialize request argument(s)
string projectId = "";
string region = "";
Job job = new Job();
// Make the request
Operation<Job, JobMetadata> response = jobControllerClient.SubmitJobAsOperation(projectId, region, job);

// Poll until the returned long-running operation is complete
Operation<Job, JobMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Job result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Job, JobMetadata> retrievedResponse = jobControllerClient.PollOnceSubmitJobAsOperation(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Job retrievedResult = retrievedResponse.Result;
}

SubmitJobAsOperationAsync(SubmitJobRequest, CallSettings)

public virtual Task<Operation<Job, JobMetadata>> SubmitJobAsOperationAsync(SubmitJobRequest request, CallSettings callSettings = null)

Submits job to a cluster.

Parameters
NameDescription
requestSubmitJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationJobJobMetadata

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
SubmitJobRequest request = new SubmitJobRequest
{
    ProjectId = "",
    Job = new Job(),
    Region = "",
    RequestId = "",
};
// Make the request
Operation<Job, JobMetadata> response = await jobControllerClient.SubmitJobAsOperationAsync(request);

// Poll until the returned long-running operation is complete
Operation<Job, JobMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Job result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Job, JobMetadata> retrievedResponse = await jobControllerClient.PollOnceSubmitJobAsOperationAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Job retrievedResult = retrievedResponse.Result;
}

SubmitJobAsOperationAsync(SubmitJobRequest, CancellationToken)

public virtual Task<Operation<Job, JobMetadata>> SubmitJobAsOperationAsync(SubmitJobRequest request, CancellationToken cancellationToken)

Submits job to a cluster.

Parameters
NameDescription
requestSubmitJobRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationJobJobMetadata

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
SubmitJobRequest request = new SubmitJobRequest
{
    ProjectId = "",
    Job = new Job(),
    Region = "",
    RequestId = "",
};
// Make the request
Operation<Job, JobMetadata> response = await jobControllerClient.SubmitJobAsOperationAsync(request);

// Poll until the returned long-running operation is complete
Operation<Job, JobMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Job result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Job, JobMetadata> retrievedResponse = await jobControllerClient.PollOnceSubmitJobAsOperationAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Job retrievedResult = retrievedResponse.Result;
}

SubmitJobAsOperationAsync(string, string, Job, CallSettings)

public virtual Task<Operation<Job, JobMetadata>> SubmitJobAsOperationAsync(string projectId, string region, Job job, CallSettings callSettings = null)

Submits job to a cluster.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the job belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

jobJob

Required. The job resource.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationJobJobMetadata

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
Job job = new Job();
// Make the request
Operation<Job, JobMetadata> response = await jobControllerClient.SubmitJobAsOperationAsync(projectId, region, job);

// Poll until the returned long-running operation is complete
Operation<Job, JobMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Job result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Job, JobMetadata> retrievedResponse = await jobControllerClient.PollOnceSubmitJobAsOperationAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Job retrievedResult = retrievedResponse.Result;
}

SubmitJobAsOperationAsync(string, string, Job, CancellationToken)

public virtual Task<Operation<Job, JobMetadata>> SubmitJobAsOperationAsync(string projectId, string region, Job job, CancellationToken cancellationToken)

Submits job to a cluster.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the job belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

jobJob

Required. The job resource.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationJobJobMetadata

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
Job job = new Job();
// Make the request
Operation<Job, JobMetadata> response = await jobControllerClient.SubmitJobAsOperationAsync(projectId, region, job);

// Poll until the returned long-running operation is complete
Operation<Job, JobMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Job result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Job, JobMetadata> retrievedResponse = await jobControllerClient.PollOnceSubmitJobAsOperationAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Job retrievedResult = retrievedResponse.Result;
}

SubmitJobAsync(SubmitJobRequest, CallSettings)

public virtual Task<Job> SubmitJobAsync(SubmitJobRequest request, CallSettings callSettings = null)

Submits a job to a cluster.

Parameters
NameDescription
requestSubmitJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
SubmitJobRequest request = new SubmitJobRequest
{
    ProjectId = "",
    Job = new Job(),
    Region = "",
    RequestId = "",
};
// Make the request
Job response = await jobControllerClient.SubmitJobAsync(request);

SubmitJobAsync(SubmitJobRequest, CancellationToken)

public virtual Task<Job> SubmitJobAsync(SubmitJobRequest request, CancellationToken cancellationToken)

Submits a job to a cluster.

Parameters
NameDescription
requestSubmitJobRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
SubmitJobRequest request = new SubmitJobRequest
{
    ProjectId = "",
    Job = new Job(),
    Region = "",
    RequestId = "",
};
// Make the request
Job response = await jobControllerClient.SubmitJobAsync(request);

SubmitJobAsync(string, string, Job, CallSettings)

public virtual Task<Job> SubmitJobAsync(string projectId, string region, Job job, CallSettings callSettings = null)

Submits a job to a cluster.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the job belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

jobJob

Required. The job resource.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
Job job = new Job();
// Make the request
Job response = await jobControllerClient.SubmitJobAsync(projectId, region, job);

SubmitJobAsync(string, string, Job, CancellationToken)

public virtual Task<Job> SubmitJobAsync(string projectId, string region, Job job, CancellationToken cancellationToken)

Submits a job to a cluster.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the job belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

jobJob

Required. The job resource.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
Job job = new Job();
// Make the request
Job response = await jobControllerClient.SubmitJobAsync(projectId, region, job);

UpdateJob(UpdateJobRequest, CallSettings)

public virtual Job UpdateJob(UpdateJobRequest request, CallSettings callSettings = null)

Updates a job in a project.

Parameters
NameDescription
requestUpdateJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Job

The RPC response.

Example
// Create client
JobControllerClient jobControllerClient = JobControllerClient.Create();
// Initialize request argument(s)
UpdateJobRequest request = new UpdateJobRequest
{
    ProjectId = "",
    Region = "",
    JobId = "",
    Job = new Job(),
    UpdateMask = new FieldMask(),
};
// Make the request
Job response = jobControllerClient.UpdateJob(request);

UpdateJobAsync(UpdateJobRequest, CallSettings)

public virtual Task<Job> UpdateJobAsync(UpdateJobRequest request, CallSettings callSettings = null)

Updates a job in a project.

Parameters
NameDescription
requestUpdateJobRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
UpdateJobRequest request = new UpdateJobRequest
{
    ProjectId = "",
    Region = "",
    JobId = "",
    Job = new Job(),
    UpdateMask = new FieldMask(),
};
// Make the request
Job response = await jobControllerClient.UpdateJobAsync(request);

UpdateJobAsync(UpdateJobRequest, CancellationToken)

public virtual Task<Job> UpdateJobAsync(UpdateJobRequest request, CancellationToken cancellationToken)

Updates a job in a project.

Parameters
NameDescription
requestUpdateJobRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskJob

A Task containing the RPC response.

Example
// Create client
JobControllerClient jobControllerClient = await JobControllerClient.CreateAsync();
// Initialize request argument(s)
UpdateJobRequest request = new UpdateJobRequest
{
    ProjectId = "",
    Region = "",
    JobId = "",
    Job = new Job(),
    UpdateMask = new FieldMask(),
};
// Make the request
Job response = await jobControllerClient.UpdateJobAsync(request);