Class JobControllerClient (3.2.0)

public abstract 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
IReadOnlyList<String>
Remarks

The default JobController scopes are:

GrpcClient

public virtual JobController.JobControllerClient GrpcClient { get; }

The underlying gRPC JobController client

Property Value
TypeDescription
JobController.JobControllerClient

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
Task<Job>

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
Task<Job>

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
Task<Job>

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
Task<Job>

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(CancellationToken))

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
Task<JobControllerClient>

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
Task<Job>

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
Task<Job>

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
Task<Job>

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
Task<Job>

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
PagedEnumerable<ListJobsResponse, Job>

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, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListJobsResponse, Job> ListJobs(string projectId, string region, string pageToken = null, int? pageSize = default(int? ), 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.

pageSizeNullable<Int32>

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
PagedEnumerable<ListJobsResponse, Job>

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, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListJobsResponse, Job> ListJobs(string projectId, string region, string filter, string pageToken = null, int? pageSize = default(int? ), 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.

pageSizeNullable<Int32>

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
PagedEnumerable<ListJobsResponse, Job>

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
PagedAsyncEnumerable<ListJobsResponse, Job>

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, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListJobsResponse, Job> ListJobsAsync(string projectId, string region, string pageToken = null, int? pageSize = default(int? ), 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.

pageSizeNullable<Int32>

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
PagedAsyncEnumerable<ListJobsResponse, Job>

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, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListJobsResponse, Job> ListJobsAsync(string projectId, string region, string filter, string pageToken = null, int? pageSize = default(int? ), 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.

pageSizeNullable<Int32>

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
PagedAsyncEnumerable<ListJobsResponse, Job>

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
Operation<Job, JobMetadata>

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
Task<Operation<Job, JobMetadata>>

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
Operation<Job, JobMetadata>

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
Operation<Job, JobMetadata>

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
Task<Operation<Job, JobMetadata>>

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
Task<Operation<Job, JobMetadata>>

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
Task<Operation<Job, JobMetadata>>

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
Task<Operation<Job, JobMetadata>>

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
Task<Job>

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
Task<Job>

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
Task<Job>

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
Task<Job>

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
Task<Job>

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
Task<Job>

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);