Google Cloud Scheduler v1 API - Class CloudSchedulerClient (3.4.0)

public abstract class CloudSchedulerClient

Reference documentation and code samples for the Google Cloud Scheduler v1 API class CloudSchedulerClient.

CloudScheduler client wrapper, for convenient use.

Inheritance

object > CloudSchedulerClient

Derived Types

Namespace

Google.Cloud.Scheduler.V1

Assembly

Google.Cloud.Scheduler.V1.dll

Remarks

The Cloud Scheduler API allows external entities to reliably schedule asynchronous jobs.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default CloudScheduler scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default CloudScheduler scopes are:

GrpcClient

public virtual CloudScheduler.CloudSchedulerClient GrpcClient { get; }

The underlying gRPC CloudScheduler client

Property Value
Type Description
CloudSchedulerCloudSchedulerClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
Type Description
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

Create()

public static CloudSchedulerClient Create()

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

Returns
Type Description
CloudSchedulerClient

The created CloudSchedulerClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskCloudSchedulerClient

The task representing the created CloudSchedulerClient.

CreateJob(LocationName, Job, CallSettings)

public virtual Job CreateJob(LocationName parent, Job job, CallSettings callSettings = null)

Creates a job.

Parameters
Name Description
parent LocationName

Required. The location name. For example: projects/PROJECT_ID/locations/LOCATION_ID.

job Job

Required. The job to add. The user can optionally specify a name for the job in [name][google.cloud.scheduler.v1.Job.name]. [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an existing job. If a name is not specified then the system will generate a random unique name that will be returned ([name][google.cloud.scheduler.v1.Job.name]) in the response.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Job

The RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Job job = new Job();
// Make the request
Job response = cloudSchedulerClient.CreateJob(parent, job);

CreateJob(CreateJobRequest, CallSettings)

public virtual Job CreateJob(CreateJobRequest request, CallSettings callSettings = null)

Creates a job.

Parameters
Name Description
request CreateJobRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Job

The RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
CreateJobRequest request = new CreateJobRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Job = new Job(),
};
// Make the request
Job response = cloudSchedulerClient.CreateJob(request);

CreateJob(string, Job, CallSettings)

public virtual Job CreateJob(string parent, Job job, CallSettings callSettings = null)

Creates a job.

Parameters
Name Description
parent string

Required. The location name. For example: projects/PROJECT_ID/locations/LOCATION_ID.

job Job

Required. The job to add. The user can optionally specify a name for the job in [name][google.cloud.scheduler.v1.Job.name]. [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an existing job. If a name is not specified then the system will generate a random unique name that will be returned ([name][google.cloud.scheduler.v1.Job.name]) in the response.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Job

The RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Job job = new Job();
// Make the request
Job response = cloudSchedulerClient.CreateJob(parent, job);

CreateJobAsync(LocationName, Job, CallSettings)

public virtual Task<Job> CreateJobAsync(LocationName parent, Job job, CallSettings callSettings = null)

Creates a job.

Parameters
Name Description
parent LocationName

Required. The location name. For example: projects/PROJECT_ID/locations/LOCATION_ID.

job Job

Required. The job to add. The user can optionally specify a name for the job in [name][google.cloud.scheduler.v1.Job.name]. [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an existing job. If a name is not specified then the system will generate a random unique name that will be returned ([name][google.cloud.scheduler.v1.Job.name]) in the response.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Job job = new Job();
// Make the request
Job response = await cloudSchedulerClient.CreateJobAsync(parent, job);

CreateJobAsync(LocationName, Job, CancellationToken)

public virtual Task<Job> CreateJobAsync(LocationName parent, Job job, CancellationToken cancellationToken)

Creates a job.

Parameters
Name Description
parent LocationName

Required. The location name. For example: projects/PROJECT_ID/locations/LOCATION_ID.

job Job

Required. The job to add. The user can optionally specify a name for the job in [name][google.cloud.scheduler.v1.Job.name]. [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an existing job. If a name is not specified then the system will generate a random unique name that will be returned ([name][google.cloud.scheduler.v1.Job.name]) in the response.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Job job = new Job();
// Make the request
Job response = await cloudSchedulerClient.CreateJobAsync(parent, job);

CreateJobAsync(CreateJobRequest, CallSettings)

public virtual Task<Job> CreateJobAsync(CreateJobRequest request, CallSettings callSettings = null)

Creates a job.

Parameters
Name Description
request CreateJobRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
CreateJobRequest request = new CreateJobRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Job = new Job(),
};
// Make the request
Job response = await cloudSchedulerClient.CreateJobAsync(request);

CreateJobAsync(CreateJobRequest, CancellationToken)

public virtual Task<Job> CreateJobAsync(CreateJobRequest request, CancellationToken cancellationToken)

Creates a job.

Parameters
Name Description
request CreateJobRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
CreateJobRequest request = new CreateJobRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Job = new Job(),
};
// Make the request
Job response = await cloudSchedulerClient.CreateJobAsync(request);

CreateJobAsync(string, Job, CallSettings)

public virtual Task<Job> CreateJobAsync(string parent, Job job, CallSettings callSettings = null)

Creates a job.

Parameters
Name Description
parent string

Required. The location name. For example: projects/PROJECT_ID/locations/LOCATION_ID.

job Job

Required. The job to add. The user can optionally specify a name for the job in [name][google.cloud.scheduler.v1.Job.name]. [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an existing job. If a name is not specified then the system will generate a random unique name that will be returned ([name][google.cloud.scheduler.v1.Job.name]) in the response.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Job job = new Job();
// Make the request
Job response = await cloudSchedulerClient.CreateJobAsync(parent, job);

CreateJobAsync(string, Job, CancellationToken)

public virtual Task<Job> CreateJobAsync(string parent, Job job, CancellationToken cancellationToken)

Creates a job.

Parameters
Name Description
parent string

Required. The location name. For example: projects/PROJECT_ID/locations/LOCATION_ID.

job Job

Required. The job to add. The user can optionally specify a name for the job in [name][google.cloud.scheduler.v1.Job.name]. [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an existing job. If a name is not specified then the system will generate a random unique name that will be returned ([name][google.cloud.scheduler.v1.Job.name]) in the response.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Job job = new Job();
// Make the request
Job response = await cloudSchedulerClient.CreateJobAsync(parent, job);

DeleteJob(DeleteJobRequest, CallSettings)

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

Deletes a job.

Parameters
Name Description
request DeleteJobRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
DeleteJobRequest request = new DeleteJobRequest
{
    JobName = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
cloudSchedulerClient.DeleteJob(request);

DeleteJob(JobName, CallSettings)

public virtual void DeleteJob(JobName name, CallSettings callSettings = null)

Deletes a job.

Parameters
Name Description
name JobName

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
JobName name = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
cloudSchedulerClient.DeleteJob(name);

DeleteJob(string, CallSettings)

public virtual void DeleteJob(string name, CallSettings callSettings = null)

Deletes a job.

Parameters
Name Description
name string

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
cloudSchedulerClient.DeleteJob(name);

DeleteJobAsync(DeleteJobRequest, CallSettings)

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

Deletes a job.

Parameters
Name Description
request DeleteJobRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
DeleteJobRequest request = new DeleteJobRequest
{
    JobName = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
await cloudSchedulerClient.DeleteJobAsync(request);

DeleteJobAsync(DeleteJobRequest, CancellationToken)

public virtual Task DeleteJobAsync(DeleteJobRequest request, CancellationToken cancellationToken)

Deletes a job.

Parameters
Name Description
request DeleteJobRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
DeleteJobRequest request = new DeleteJobRequest
{
    JobName = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
await cloudSchedulerClient.DeleteJobAsync(request);

DeleteJobAsync(JobName, CallSettings)

public virtual Task DeleteJobAsync(JobName name, CallSettings callSettings = null)

Deletes a job.

Parameters
Name Description
name JobName

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
JobName name = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
await cloudSchedulerClient.DeleteJobAsync(name);

DeleteJobAsync(JobName, CancellationToken)

public virtual Task DeleteJobAsync(JobName name, CancellationToken cancellationToken)

Deletes a job.

Parameters
Name Description
name JobName

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
JobName name = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
await cloudSchedulerClient.DeleteJobAsync(name);

DeleteJobAsync(string, CallSettings)

public virtual Task DeleteJobAsync(string name, CallSettings callSettings = null)

Deletes a job.

Parameters
Name Description
name string

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
await cloudSchedulerClient.DeleteJobAsync(name);

DeleteJobAsync(string, CancellationToken)

public virtual Task DeleteJobAsync(string name, CancellationToken cancellationToken)

Deletes a job.

Parameters
Name Description
name string

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
await cloudSchedulerClient.DeleteJobAsync(name);

GetJob(GetJobRequest, CallSettings)

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

Gets a job.

Parameters
Name Description
request GetJobRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Job

The RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
GetJobRequest request = new GetJobRequest
{
    JobName = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
Job response = cloudSchedulerClient.GetJob(request);

GetJob(JobName, CallSettings)

public virtual Job GetJob(JobName name, CallSettings callSettings = null)

Gets a job.

Parameters
Name Description
name JobName

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Job

The RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
JobName name = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
Job response = cloudSchedulerClient.GetJob(name);

GetJob(string, CallSettings)

public virtual Job GetJob(string name, CallSettings callSettings = null)

Gets a job.

Parameters
Name Description
name string

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Job

The RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
Job response = cloudSchedulerClient.GetJob(name);

GetJobAsync(GetJobRequest, CallSettings)

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

Gets a job.

Parameters
Name Description
request GetJobRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
GetJobRequest request = new GetJobRequest
{
    JobName = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
Job response = await cloudSchedulerClient.GetJobAsync(request);

GetJobAsync(GetJobRequest, CancellationToken)

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

Gets a job.

Parameters
Name Description
request GetJobRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
GetJobRequest request = new GetJobRequest
{
    JobName = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
Job response = await cloudSchedulerClient.GetJobAsync(request);

GetJobAsync(JobName, CallSettings)

public virtual Task<Job> GetJobAsync(JobName name, CallSettings callSettings = null)

Gets a job.

Parameters
Name Description
name JobName

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
JobName name = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
Job response = await cloudSchedulerClient.GetJobAsync(name);

GetJobAsync(JobName, CancellationToken)

public virtual Task<Job> GetJobAsync(JobName name, CancellationToken cancellationToken)

Gets a job.

Parameters
Name Description
name JobName

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
JobName name = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
Job response = await cloudSchedulerClient.GetJobAsync(name);

GetJobAsync(string, CallSettings)

public virtual Task<Job> GetJobAsync(string name, CallSettings callSettings = null)

Gets a job.

Parameters
Name Description
name string

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
Job response = await cloudSchedulerClient.GetJobAsync(name);

GetJobAsync(string, CancellationToken)

public virtual Task<Job> GetJobAsync(string name, CancellationToken cancellationToken)

Gets a job.

Parameters
Name Description
name string

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
Job response = await cloudSchedulerClient.GetJobAsync(name);

ListJobs(LocationName, string, int?, CallSettings)

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

Lists jobs.

Parameters
Name Description
parent LocationName

Required. The location name. For example: projects/PROJECT_ID/locations/LOCATION_ID.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListJobsResponseJob

A pageable sequence of Job resources.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListJobsResponse, Job> response = cloudSchedulerClient.ListJobs(parent);

// 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(ListJobsRequest, CallSettings)

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

Lists jobs.

Parameters
Name Description
request ListJobsRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListJobsResponseJob

A pageable sequence of Job resources.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
ListJobsRequest request = new ListJobsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedEnumerable<ListJobsResponse, Job> response = cloudSchedulerClient.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, int?, CallSettings)

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

Lists jobs.

Parameters
Name Description
parent string

Required. The location name. For example: projects/PROJECT_ID/locations/LOCATION_ID.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListJobsResponseJob

A pageable sequence of Job resources.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListJobsResponse, Job> response = cloudSchedulerClient.ListJobs(parent);

// 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(LocationName, string, int?, CallSettings)

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

Lists jobs.

Parameters
Name Description
parent LocationName

Required. The location name. For example: projects/PROJECT_ID/locations/LOCATION_ID.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListJobsResponseJob

A pageable asynchronous sequence of Job resources.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListJobsResponse, Job> response = cloudSchedulerClient.ListJobsAsync(parent);

// 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(ListJobsRequest, CallSettings)

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

Lists jobs.

Parameters
Name Description
request ListJobsRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListJobsResponseJob

A pageable asynchronous sequence of Job resources.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
ListJobsRequest request = new ListJobsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedAsyncEnumerable<ListJobsResponse, Job> response = cloudSchedulerClient.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, int?, CallSettings)

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

Lists jobs.

Parameters
Name Description
parent string

Required. The location name. For example: projects/PROJECT_ID/locations/LOCATION_ID.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListJobsResponseJob

A pageable asynchronous sequence of Job resources.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListJobsResponse, Job> response = cloudSchedulerClient.ListJobsAsync(parent);

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

PauseJob(JobName, CallSettings)

public virtual Job PauseJob(JobName name, CallSettings callSettings = null)

Pauses a job.

If a job is paused then the system will stop executing the job until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob]. The state of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if paused it will be set to [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED] to be paused.

Parameters
Name Description
name JobName

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Job

The RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
JobName name = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
Job response = cloudSchedulerClient.PauseJob(name);

PauseJob(PauseJobRequest, CallSettings)

public virtual Job PauseJob(PauseJobRequest request, CallSettings callSettings = null)

Pauses a job.

If a job is paused then the system will stop executing the job until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob]. The state of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if paused it will be set to [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED] to be paused.

Parameters
Name Description
request PauseJobRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Job

The RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
PauseJobRequest request = new PauseJobRequest
{
    JobName = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
Job response = cloudSchedulerClient.PauseJob(request);

PauseJob(string, CallSettings)

public virtual Job PauseJob(string name, CallSettings callSettings = null)

Pauses a job.

If a job is paused then the system will stop executing the job until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob]. The state of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if paused it will be set to [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED] to be paused.

Parameters
Name Description
name string

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Job

The RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
Job response = cloudSchedulerClient.PauseJob(name);

PauseJobAsync(JobName, CallSettings)

public virtual Task<Job> PauseJobAsync(JobName name, CallSettings callSettings = null)

Pauses a job.

If a job is paused then the system will stop executing the job until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob]. The state of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if paused it will be set to [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED] to be paused.

Parameters
Name Description
name JobName

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
JobName name = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
Job response = await cloudSchedulerClient.PauseJobAsync(name);

PauseJobAsync(JobName, CancellationToken)

public virtual Task<Job> PauseJobAsync(JobName name, CancellationToken cancellationToken)

Pauses a job.

If a job is paused then the system will stop executing the job until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob]. The state of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if paused it will be set to [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED] to be paused.

Parameters
Name Description
name JobName

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
JobName name = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
Job response = await cloudSchedulerClient.PauseJobAsync(name);

PauseJobAsync(PauseJobRequest, CallSettings)

public virtual Task<Job> PauseJobAsync(PauseJobRequest request, CallSettings callSettings = null)

Pauses a job.

If a job is paused then the system will stop executing the job until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob]. The state of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if paused it will be set to [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED] to be paused.

Parameters
Name Description
request PauseJobRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
PauseJobRequest request = new PauseJobRequest
{
    JobName = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
Job response = await cloudSchedulerClient.PauseJobAsync(request);

PauseJobAsync(PauseJobRequest, CancellationToken)

public virtual Task<Job> PauseJobAsync(PauseJobRequest request, CancellationToken cancellationToken)

Pauses a job.

If a job is paused then the system will stop executing the job until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob]. The state of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if paused it will be set to [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED] to be paused.

Parameters
Name Description
request PauseJobRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
PauseJobRequest request = new PauseJobRequest
{
    JobName = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
Job response = await cloudSchedulerClient.PauseJobAsync(request);

PauseJobAsync(string, CallSettings)

public virtual Task<Job> PauseJobAsync(string name, CallSettings callSettings = null)

Pauses a job.

If a job is paused then the system will stop executing the job until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob]. The state of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if paused it will be set to [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED] to be paused.

Parameters
Name Description
name string

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
Job response = await cloudSchedulerClient.PauseJobAsync(name);

PauseJobAsync(string, CancellationToken)

public virtual Task<Job> PauseJobAsync(string name, CancellationToken cancellationToken)

Pauses a job.

If a job is paused then the system will stop executing the job until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob]. The state of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if paused it will be set to [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED] to be paused.

Parameters
Name Description
name string

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
Job response = await cloudSchedulerClient.PauseJobAsync(name);

ResumeJob(JobName, CallSettings)

public virtual Job ResumeJob(JobName name, CallSettings callSettings = null)

Resume a job.

This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. The state of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state]; after calling this method it will be set to [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job must be in [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED] to be resumed.

Parameters
Name Description
name JobName

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Job

The RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
JobName name = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
Job response = cloudSchedulerClient.ResumeJob(name);

ResumeJob(ResumeJobRequest, CallSettings)

public virtual Job ResumeJob(ResumeJobRequest request, CallSettings callSettings = null)

Resume a job.

This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. The state of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state]; after calling this method it will be set to [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job must be in [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED] to be resumed.

Parameters
Name Description
request ResumeJobRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Job

The RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
ResumeJobRequest request = new ResumeJobRequest
{
    JobName = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
Job response = cloudSchedulerClient.ResumeJob(request);

ResumeJob(string, CallSettings)

public virtual Job ResumeJob(string name, CallSettings callSettings = null)

Resume a job.

This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. The state of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state]; after calling this method it will be set to [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job must be in [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED] to be resumed.

Parameters
Name Description
name string

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Job

The RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
Job response = cloudSchedulerClient.ResumeJob(name);

ResumeJobAsync(JobName, CallSettings)

public virtual Task<Job> ResumeJobAsync(JobName name, CallSettings callSettings = null)

Resume a job.

This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. The state of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state]; after calling this method it will be set to [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job must be in [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED] to be resumed.

Parameters
Name Description
name JobName

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
JobName name = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
Job response = await cloudSchedulerClient.ResumeJobAsync(name);

ResumeJobAsync(JobName, CancellationToken)

public virtual Task<Job> ResumeJobAsync(JobName name, CancellationToken cancellationToken)

Resume a job.

This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. The state of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state]; after calling this method it will be set to [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job must be in [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED] to be resumed.

Parameters
Name Description
name JobName

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
JobName name = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
Job response = await cloudSchedulerClient.ResumeJobAsync(name);

ResumeJobAsync(ResumeJobRequest, CallSettings)

public virtual Task<Job> ResumeJobAsync(ResumeJobRequest request, CallSettings callSettings = null)

Resume a job.

This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. The state of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state]; after calling this method it will be set to [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job must be in [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED] to be resumed.

Parameters
Name Description
request ResumeJobRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
ResumeJobRequest request = new ResumeJobRequest
{
    JobName = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
Job response = await cloudSchedulerClient.ResumeJobAsync(request);

ResumeJobAsync(ResumeJobRequest, CancellationToken)

public virtual Task<Job> ResumeJobAsync(ResumeJobRequest request, CancellationToken cancellationToken)

Resume a job.

This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. The state of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state]; after calling this method it will be set to [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job must be in [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED] to be resumed.

Parameters
Name Description
request ResumeJobRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
ResumeJobRequest request = new ResumeJobRequest
{
    JobName = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
Job response = await cloudSchedulerClient.ResumeJobAsync(request);

ResumeJobAsync(string, CallSettings)

public virtual Task<Job> ResumeJobAsync(string name, CallSettings callSettings = null)

Resume a job.

This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. The state of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state]; after calling this method it will be set to [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job must be in [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED] to be resumed.

Parameters
Name Description
name string

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
Job response = await cloudSchedulerClient.ResumeJobAsync(name);

ResumeJobAsync(string, CancellationToken)

public virtual Task<Job> ResumeJobAsync(string name, CancellationToken cancellationToken)

Resume a job.

This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. The state of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state]; after calling this method it will be set to [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job must be in [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED] to be resumed.

Parameters
Name Description
name string

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
Job response = await cloudSchedulerClient.ResumeJobAsync(name);

RunJob(JobName, CallSettings)

public virtual Job RunJob(JobName name, CallSettings callSettings = null)

Forces a job to run now.

When this method is called, Cloud Scheduler will dispatch the job, even if the job is already running.

Parameters
Name Description
name JobName

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Job

The RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
JobName name = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
Job response = cloudSchedulerClient.RunJob(name);

RunJob(RunJobRequest, CallSettings)

public virtual Job RunJob(RunJobRequest request, CallSettings callSettings = null)

Forces a job to run now.

When this method is called, Cloud Scheduler will dispatch the job, even if the job is already running.

Parameters
Name Description
request RunJobRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Job

The RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
RunJobRequest request = new RunJobRequest
{
    JobName = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
Job response = cloudSchedulerClient.RunJob(request);

RunJob(string, CallSettings)

public virtual Job RunJob(string name, CallSettings callSettings = null)

Forces a job to run now.

When this method is called, Cloud Scheduler will dispatch the job, even if the job is already running.

Parameters
Name Description
name string

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Job

The RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
Job response = cloudSchedulerClient.RunJob(name);

RunJobAsync(JobName, CallSettings)

public virtual Task<Job> RunJobAsync(JobName name, CallSettings callSettings = null)

Forces a job to run now.

When this method is called, Cloud Scheduler will dispatch the job, even if the job is already running.

Parameters
Name Description
name JobName

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
JobName name = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
Job response = await cloudSchedulerClient.RunJobAsync(name);

RunJobAsync(JobName, CancellationToken)

public virtual Task<Job> RunJobAsync(JobName name, CancellationToken cancellationToken)

Forces a job to run now.

When this method is called, Cloud Scheduler will dispatch the job, even if the job is already running.

Parameters
Name Description
name JobName

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
JobName name = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]");
// Make the request
Job response = await cloudSchedulerClient.RunJobAsync(name);

RunJobAsync(RunJobRequest, CallSettings)

public virtual Task<Job> RunJobAsync(RunJobRequest request, CallSettings callSettings = null)

Forces a job to run now.

When this method is called, Cloud Scheduler will dispatch the job, even if the job is already running.

Parameters
Name Description
request RunJobRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
RunJobRequest request = new RunJobRequest
{
    JobName = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
Job response = await cloudSchedulerClient.RunJobAsync(request);

RunJobAsync(RunJobRequest, CancellationToken)

public virtual Task<Job> RunJobAsync(RunJobRequest request, CancellationToken cancellationToken)

Forces a job to run now.

When this method is called, Cloud Scheduler will dispatch the job, even if the job is already running.

Parameters
Name Description
request RunJobRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
RunJobRequest request = new RunJobRequest
{
    JobName = JobName.FromProjectLocationJob("[PROJECT]", "[LOCATION]", "[JOB]"),
};
// Make the request
Job response = await cloudSchedulerClient.RunJobAsync(request);

RunJobAsync(string, CallSettings)

public virtual Task<Job> RunJobAsync(string name, CallSettings callSettings = null)

Forces a job to run now.

When this method is called, Cloud Scheduler will dispatch the job, even if the job is already running.

Parameters
Name Description
name string

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
Job response = await cloudSchedulerClient.RunJobAsync(name);

RunJobAsync(string, CancellationToken)

public virtual Task<Job> RunJobAsync(string name, CancellationToken cancellationToken)

Forces a job to run now.

When this method is called, Cloud Scheduler will dispatch the job, even if the job is already running.

Parameters
Name Description
name string

Required. The job name. For example: projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/jobs/[JOB]";
// Make the request
Job response = await cloudSchedulerClient.RunJobAsync(name);

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
Type Description
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.

UpdateJob(Job, FieldMask, CallSettings)

public virtual Job UpdateJob(Job job, FieldMask updateMask, CallSettings callSettings = null)

Updates a job.

If successful, the updated [Job][google.cloud.scheduler.v1.Job] is returned. If the job does not exist, NOT_FOUND is returned.

If UpdateJob does not successfully return, it is possible for the job to be in an [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1.Job.State.UPDATE_FAILED] state. A job in this state may not be executed. If this happens, retry the UpdateJob request until a successful response is received.

Parameters
Name Description
job Job

Required. The new job properties. [name][google.cloud.scheduler.v1.Job.name] must be specified.

Output only fields cannot be modified using UpdateJob. Any value specified for an output only field will be ignored.

updateMask FieldMask

A mask used to specify which fields of the job are being updated.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Job

The RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
Job job = new Job();
FieldMask updateMask = new FieldMask();
// Make the request
Job response = cloudSchedulerClient.UpdateJob(job, updateMask);

UpdateJob(UpdateJobRequest, CallSettings)

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

Updates a job.

If successful, the updated [Job][google.cloud.scheduler.v1.Job] is returned. If the job does not exist, NOT_FOUND is returned.

If UpdateJob does not successfully return, it is possible for the job to be in an [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1.Job.State.UPDATE_FAILED] state. A job in this state may not be executed. If this happens, retry the UpdateJob request until a successful response is received.

Parameters
Name Description
request UpdateJobRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Job

The RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = CloudSchedulerClient.Create();
// Initialize request argument(s)
UpdateJobRequest request = new UpdateJobRequest
{
    Job = new Job(),
    UpdateMask = new FieldMask(),
};
// Make the request
Job response = cloudSchedulerClient.UpdateJob(request);

UpdateJobAsync(Job, FieldMask, CallSettings)

public virtual Task<Job> UpdateJobAsync(Job job, FieldMask updateMask, CallSettings callSettings = null)

Updates a job.

If successful, the updated [Job][google.cloud.scheduler.v1.Job] is returned. If the job does not exist, NOT_FOUND is returned.

If UpdateJob does not successfully return, it is possible for the job to be in an [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1.Job.State.UPDATE_FAILED] state. A job in this state may not be executed. If this happens, retry the UpdateJob request until a successful response is received.

Parameters
Name Description
job Job

Required. The new job properties. [name][google.cloud.scheduler.v1.Job.name] must be specified.

Output only fields cannot be modified using UpdateJob. Any value specified for an output only field will be ignored.

updateMask FieldMask

A mask used to specify which fields of the job are being updated.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
Job job = new Job();
FieldMask updateMask = new FieldMask();
// Make the request
Job response = await cloudSchedulerClient.UpdateJobAsync(job, updateMask);

UpdateJobAsync(Job, FieldMask, CancellationToken)

public virtual Task<Job> UpdateJobAsync(Job job, FieldMask updateMask, CancellationToken cancellationToken)

Updates a job.

If successful, the updated [Job][google.cloud.scheduler.v1.Job] is returned. If the job does not exist, NOT_FOUND is returned.

If UpdateJob does not successfully return, it is possible for the job to be in an [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1.Job.State.UPDATE_FAILED] state. A job in this state may not be executed. If this happens, retry the UpdateJob request until a successful response is received.

Parameters
Name Description
job Job

Required. The new job properties. [name][google.cloud.scheduler.v1.Job.name] must be specified.

Output only fields cannot be modified using UpdateJob. Any value specified for an output only field will be ignored.

updateMask FieldMask

A mask used to specify which fields of the job are being updated.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
Job job = new Job();
FieldMask updateMask = new FieldMask();
// Make the request
Job response = await cloudSchedulerClient.UpdateJobAsync(job, updateMask);

UpdateJobAsync(UpdateJobRequest, CallSettings)

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

Updates a job.

If successful, the updated [Job][google.cloud.scheduler.v1.Job] is returned. If the job does not exist, NOT_FOUND is returned.

If UpdateJob does not successfully return, it is possible for the job to be in an [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1.Job.State.UPDATE_FAILED] state. A job in this state may not be executed. If this happens, retry the UpdateJob request until a successful response is received.

Parameters
Name Description
request UpdateJobRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
UpdateJobRequest request = new UpdateJobRequest
{
    Job = new Job(),
    UpdateMask = new FieldMask(),
};
// Make the request
Job response = await cloudSchedulerClient.UpdateJobAsync(request);

UpdateJobAsync(UpdateJobRequest, CancellationToken)

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

Updates a job.

If successful, the updated [Job][google.cloud.scheduler.v1.Job] is returned. If the job does not exist, NOT_FOUND is returned.

If UpdateJob does not successfully return, it is possible for the job to be in an [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1.Job.State.UPDATE_FAILED] state. A job in this state may not be executed. If this happens, retry the UpdateJob request until a successful response is received.

Parameters
Name Description
request UpdateJobRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskJob

A Task containing the RPC response.

Example
// Create client
CloudSchedulerClient cloudSchedulerClient = await CloudSchedulerClient.CreateAsync();
// Initialize request argument(s)
UpdateJobRequest request = new UpdateJobRequest
{
    Job = new Job(),
    UpdateMask = new FieldMask(),
};
// Make the request
Job response = await cloudSchedulerClient.UpdateJobAsync(request);