The Cloud Scheduler API allows external entities to reliably schedule asynchronous jobs. v1beta1
Package
@google-cloud/schedulerConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of CloudSchedulerClient.
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof gax.fallback
: loaded instance of |
Properties
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
auth
auth: gax.GoogleAuth;
cloudSchedulerStub
cloudSchedulerStub?: Promise<{
[name: string]: Function;
}>;
descriptors
descriptors: Descriptors;
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};
port
static get port(): number;
The port for this API service.
scopes
static get scopes(): string[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static get servicePath(): string;
The DNS address for this API service.
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
close()
close(): Promise<void>;
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Type | Description |
Promise<void> | {Promise} A promise that resolves when the client is closed. |
createJob(request, options)
createJob(request?: protos.google.cloud.scheduler.v1beta1.ICreateJobRequest, options?: CallOptions): Promise<[
protos.google.cloud.scheduler.v1beta1.IJob,
protos.google.cloud.scheduler.v1beta1.ICreateJobRequest | undefined,
{} | undefined
]>;
Creates a job.
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.ICreateJobRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.ICreateJobRequest | undefined, {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Job]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The location name. For example:
* `projects/PROJECT_ID/locations/LOCATION_ID`.
*/
// const parent = 'abc123'
/**
* Required. The job to add. The user can optionally specify a name for the
* job in name google.cloud.scheduler.v1beta1.Job.name. name google.cloud.scheduler.v1beta1.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.v1beta1.Job.name) in the response.
*/
// const job = {}
// Imports the Scheduler library
const {CloudSchedulerClient} = require('@google-cloud/scheduler').v1beta1;
// Instantiates a client
const schedulerClient = new CloudSchedulerClient();
async function callCreateJob() {
// Construct request
const request = {
parent,
job,
};
// Run request
const response = await schedulerClient.createJob(request);
console.log(response);
}
callCreateJob();
createJob(request, options, callback)
createJob(request: protos.google.cloud.scheduler.v1beta1.ICreateJobRequest, options: CallOptions, callback: Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.ICreateJobRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.ICreateJobRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.ICreateJobRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
createJob(request, callback)
createJob(request: protos.google.cloud.scheduler.v1beta1.ICreateJobRequest, callback: Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.ICreateJobRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.ICreateJobRequest
|
callback |
Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.ICreateJobRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
deleteJob(request, options)
deleteJob(request?: protos.google.cloud.scheduler.v1beta1.IDeleteJobRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
protos.google.cloud.scheduler.v1beta1.IDeleteJobRequest | undefined,
{} | undefined
]>;
Deletes a job.
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IDeleteJobRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.protobuf.IEmpty, protos.google.cloud.scheduler.v1beta1.IDeleteJobRequest | undefined, {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Empty]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The job name. For example:
* `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
*/
// const name = 'abc123'
// Imports the Scheduler library
const {CloudSchedulerClient} = require('@google-cloud/scheduler').v1beta1;
// Instantiates a client
const schedulerClient = new CloudSchedulerClient();
async function callDeleteJob() {
// Construct request
const request = {
name,
};
// Run request
const response = await schedulerClient.deleteJob(request);
console.log(response);
}
callDeleteJob();
deleteJob(request, options, callback)
deleteJob(request: protos.google.cloud.scheduler.v1beta1.IDeleteJobRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.scheduler.v1beta1.IDeleteJobRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IDeleteJobRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.scheduler.v1beta1.IDeleteJobRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
deleteJob(request, callback)
deleteJob(request: protos.google.cloud.scheduler.v1beta1.IDeleteJobRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.scheduler.v1beta1.IDeleteJobRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IDeleteJobRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.scheduler.v1beta1.IDeleteJobRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
getJob(request, options)
getJob(request?: protos.google.cloud.scheduler.v1beta1.IGetJobRequest, options?: CallOptions): Promise<[
protos.google.cloud.scheduler.v1beta1.IJob,
protos.google.cloud.scheduler.v1beta1.IGetJobRequest | undefined,
{} | undefined
]>;
Gets a job.
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IGetJobRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IGetJobRequest | undefined, {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Job]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The job name. For example:
* `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
*/
// const name = 'abc123'
// Imports the Scheduler library
const {CloudSchedulerClient} = require('@google-cloud/scheduler').v1beta1;
// Instantiates a client
const schedulerClient = new CloudSchedulerClient();
async function callGetJob() {
// Construct request
const request = {
name,
};
// Run request
const response = await schedulerClient.getJob(request);
console.log(response);
}
callGetJob();
getJob(request, options, callback)
getJob(request: protos.google.cloud.scheduler.v1beta1.IGetJobRequest, options: CallOptions, callback: Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IGetJobRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IGetJobRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IGetJobRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
getJob(request, callback)
getJob(request: protos.google.cloud.scheduler.v1beta1.IGetJobRequest, callback: Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IGetJobRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IGetJobRequest
|
callback |
Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IGetJobRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
getProjectId()
getProjectId(): Promise<string>;
Type | Description |
Promise<string> |
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;
Name | Description |
callback |
Callback<string, undefined, undefined>
|
Type | Description |
void |
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Type | Description |
Promise<{ [name: string]: Function; }> | {Promise} A promise that resolves to an authenticated service stub. |
jobPath(project, location, job)
jobPath(project: string, location: string, job: string): string;
Return a fully-qualified job resource name string.
Name | Description |
project |
string
|
location |
string
|
job |
string
|
Type | Description |
string | {string} Resource name string. |
listJobs(request, options)
listJobs(request?: protos.google.cloud.scheduler.v1beta1.IListJobsRequest, options?: CallOptions): Promise<[
protos.google.cloud.scheduler.v1beta1.IJob[],
protos.google.cloud.scheduler.v1beta1.IListJobsRequest | null,
protos.google.cloud.scheduler.v1beta1.IListJobsResponse
]>;
Lists jobs.
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IListJobsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.scheduler.v1beta1.IJob[], protos.google.cloud.scheduler.v1beta1.IListJobsRequest | null, protos.google.cloud.scheduler.v1beta1.IListJobsResponse ]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of [Job]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listJobs(request, options, callback)
listJobs(request: protos.google.cloud.scheduler.v1beta1.IListJobsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.scheduler.v1beta1.IListJobsRequest, protos.google.cloud.scheduler.v1beta1.IListJobsResponse | null | undefined, protos.google.cloud.scheduler.v1beta1.IJob>): void;
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IListJobsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.scheduler.v1beta1.IListJobsRequest, protos.google.cloud.scheduler.v1beta1.IListJobsResponse | null | undefined, protos.google.cloud.scheduler.v1beta1.IJob>
|
Type | Description |
void |
listJobs(request, callback)
listJobs(request: protos.google.cloud.scheduler.v1beta1.IListJobsRequest, callback: PaginationCallback<protos.google.cloud.scheduler.v1beta1.IListJobsRequest, protos.google.cloud.scheduler.v1beta1.IListJobsResponse | null | undefined, protos.google.cloud.scheduler.v1beta1.IJob>): void;
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IListJobsRequest
|
callback |
PaginationCallback<protos.google.cloud.scheduler.v1beta1.IListJobsRequest, protos.google.cloud.scheduler.v1beta1.IListJobsResponse | null | undefined, protos.google.cloud.scheduler.v1beta1.IJob>
|
Type | Description |
void |
listJobsAsync(request, options)
listJobsAsync(request?: protos.google.cloud.scheduler.v1beta1.IListJobsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.scheduler.v1beta1.IJob>;
Equivalent to listJobs
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IListJobsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
AsyncIterable<protos.google.cloud.scheduler.v1beta1.IJob> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Job]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The location name. For example:
* `projects/PROJECT_ID/locations/LOCATION_ID`.
*/
// const parent = 'abc123'
/**
* Requested page size.
* The maximum page size is 500. If unspecified, the page size will
* be the maximum. Fewer jobs than requested might be returned,
* even if more jobs exist; use next_page_token to determine if more
* jobs exist.
*/
// const pageSize = 1234
/**
* A token identifying a page of results the server will return. To
* request the first page results, page_token must be empty. To
* request the next page of results, page_token must be the value of
* next_page_token google.cloud.scheduler.v1beta1.ListJobsResponse.next_page_token returned from
* the previous call to ListJobs google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs. It is an error to
* switch the value of filter google.cloud.scheduler.v1beta1.ListJobsRequest.filter or
* order_by google.cloud.scheduler.v1beta1.ListJobsRequest.order_by while iterating through pages.
*/
// const pageToken = 'abc123'
// Imports the Scheduler library
const {CloudSchedulerClient} = require('@google-cloud/scheduler').v1beta1;
// Instantiates a client
const schedulerClient = new CloudSchedulerClient();
async function callListJobs() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await schedulerClient.listJobsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListJobs();
listJobsStream(request, options)
listJobsStream(request?: protos.google.cloud.scheduler.v1beta1.IListJobsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IListJobsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Transform | {Stream} An object stream which emits an object representing [Job] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
locationPath(project, location)
locationPath(project: string, location: string): string;
Return a fully-qualified location resource name string.
Name | Description |
project |
string
|
location |
string
|
Type | Description |
string | {string} Resource name string. |
matchJobFromJobName(jobName)
matchJobFromJobName(jobName: string): string | number;
Parse the job from Job resource.
Name | Description |
jobName |
string
A fully-qualified path representing Job resource. |
Type | Description |
string | number | {string} A string representing the job. |
matchLocationFromJobName(jobName)
matchLocationFromJobName(jobName: string): string | number;
Parse the location from Job resource.
Name | Description |
jobName |
string
A fully-qualified path representing Job resource. |
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromLocationName(locationName)
matchLocationFromLocationName(locationName: string): string | number;
Parse the location from Location resource.
Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
Type | Description |
string | number | {string} A string representing the location. |
matchProjectFromJobName(jobName)
matchProjectFromJobName(jobName: string): string | number;
Parse the project from Job resource.
Name | Description |
jobName |
string
A fully-qualified path representing Job resource. |
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromLocationName(locationName)
matchProjectFromLocationName(locationName: string): string | number;
Parse the project from Location resource.
Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromProjectName(projectName)
matchProjectFromProjectName(projectName: string): string | number;
Parse the project from Project resource.
Name | Description |
projectName |
string
A fully-qualified path representing Project resource. |
Type | Description |
string | number | {string} A string representing the project. |
pauseJob(request, options)
pauseJob(request?: protos.google.cloud.scheduler.v1beta1.IPauseJobRequest, options?: CallOptions): Promise<[
protos.google.cloud.scheduler.v1beta1.IJob,
protos.google.cloud.scheduler.v1beta1.IPauseJobRequest | undefined,
{} | undefined
]>;
Pauses a job.
If a job is paused then the system will stop executing the job until it is re-enabled via . The state of the job is stored in ; if paused it will be set to . A job must be in to be paused.
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IPauseJobRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IPauseJobRequest | undefined, {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Job]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The job name. For example:
* `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
*/
// const name = 'abc123'
// Imports the Scheduler library
const {CloudSchedulerClient} = require('@google-cloud/scheduler').v1beta1;
// Instantiates a client
const schedulerClient = new CloudSchedulerClient();
async function callPauseJob() {
// Construct request
const request = {
name,
};
// Run request
const response = await schedulerClient.pauseJob(request);
console.log(response);
}
callPauseJob();
pauseJob(request, options, callback)
pauseJob(request: protos.google.cloud.scheduler.v1beta1.IPauseJobRequest, options: CallOptions, callback: Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IPauseJobRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IPauseJobRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IPauseJobRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
pauseJob(request, callback)
pauseJob(request: protos.google.cloud.scheduler.v1beta1.IPauseJobRequest, callback: Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IPauseJobRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IPauseJobRequest
|
callback |
Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IPauseJobRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
projectPath(project)
projectPath(project: string): string;
Return a fully-qualified project resource name string.
Name | Description |
project |
string
|
Type | Description |
string | {string} Resource name string. |
resumeJob(request, options)
resumeJob(request?: protos.google.cloud.scheduler.v1beta1.IResumeJobRequest, options?: CallOptions): Promise<[
protos.google.cloud.scheduler.v1beta1.IJob,
protos.google.cloud.scheduler.v1beta1.IResumeJobRequest | undefined,
{} | undefined
]>;
Resume a job.
This method reenables a job after it has been . The state of a job is stored in ; after calling this method it will be set to . A job must be in to be resumed.
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IResumeJobRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IResumeJobRequest | undefined, {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Job]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The job name. For example:
* `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
*/
// const name = 'abc123'
// Imports the Scheduler library
const {CloudSchedulerClient} = require('@google-cloud/scheduler').v1beta1;
// Instantiates a client
const schedulerClient = new CloudSchedulerClient();
async function callResumeJob() {
// Construct request
const request = {
name,
};
// Run request
const response = await schedulerClient.resumeJob(request);
console.log(response);
}
callResumeJob();
resumeJob(request, options, callback)
resumeJob(request: protos.google.cloud.scheduler.v1beta1.IResumeJobRequest, options: CallOptions, callback: Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IResumeJobRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IResumeJobRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IResumeJobRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
resumeJob(request, callback)
resumeJob(request: protos.google.cloud.scheduler.v1beta1.IResumeJobRequest, callback: Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IResumeJobRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IResumeJobRequest
|
callback |
Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IResumeJobRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
runJob(request, options)
runJob(request?: protos.google.cloud.scheduler.v1beta1.IRunJobRequest, options?: CallOptions): Promise<[
protos.google.cloud.scheduler.v1beta1.IJob,
protos.google.cloud.scheduler.v1beta1.IRunJobRequest | undefined,
{} | undefined
]>;
Forces a job to run now.
When this method is called, Cloud Scheduler will dispatch the job, even if the job is already running.
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IRunJobRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IRunJobRequest | undefined, {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Job]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The job name. For example:
* `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
*/
// const name = 'abc123'
// Imports the Scheduler library
const {CloudSchedulerClient} = require('@google-cloud/scheduler').v1beta1;
// Instantiates a client
const schedulerClient = new CloudSchedulerClient();
async function callRunJob() {
// Construct request
const request = {
name,
};
// Run request
const response = await schedulerClient.runJob(request);
console.log(response);
}
callRunJob();
runJob(request, options, callback)
runJob(request: protos.google.cloud.scheduler.v1beta1.IRunJobRequest, options: CallOptions, callback: Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IRunJobRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IRunJobRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IRunJobRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
runJob(request, callback)
runJob(request: protos.google.cloud.scheduler.v1beta1.IRunJobRequest, callback: Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IRunJobRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IRunJobRequest
|
callback |
Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IRunJobRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
updateJob(request, options)
updateJob(request?: protos.google.cloud.scheduler.v1beta1.IUpdateJobRequest, options?: CallOptions): Promise<[
protos.google.cloud.scheduler.v1beta1.IJob,
protos.google.cloud.scheduler.v1beta1.IUpdateJobRequest | undefined,
{} | undefined
]>;
Updates a job.
If successful, the updated 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 state. A job in this state may not be executed. If this happens, retry the UpdateJob request until a successful response is received.
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IUpdateJobRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IUpdateJobRequest | undefined, {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Job]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The new job properties. name google.cloud.scheduler.v1beta1.Job.name must be specified.
* Output only fields cannot be modified using UpdateJob.
* Any value specified for an output only field will be ignored.
*/
// const job = {}
/**
* A mask used to specify which fields of the job are being updated.
*/
// const updateMask = {}
// Imports the Scheduler library
const {CloudSchedulerClient} = require('@google-cloud/scheduler').v1beta1;
// Instantiates a client
const schedulerClient = new CloudSchedulerClient();
async function callUpdateJob() {
// Construct request
const request = {
job,
};
// Run request
const response = await schedulerClient.updateJob(request);
console.log(response);
}
callUpdateJob();
updateJob(request, options, callback)
updateJob(request: protos.google.cloud.scheduler.v1beta1.IUpdateJobRequest, options: CallOptions, callback: Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IUpdateJobRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IUpdateJobRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IUpdateJobRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
updateJob(request, callback)
updateJob(request: protos.google.cloud.scheduler.v1beta1.IUpdateJobRequest, callback: Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IUpdateJobRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.scheduler.v1beta1.IUpdateJobRequest
|
callback |
Callback<protos.google.cloud.scheduler.v1beta1.IJob, protos.google.cloud.scheduler.v1beta1.IUpdateJobRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |