The Cloud Scheduler API allows external entities to reliably schedule asynchronous jobs. v1
Package
@google-cloud/schedulerConstructors
(constructor)(opts, gaxInstance)
constructor
(
opts
?:
ClientOptions
,
gaxInstance
?:
typeof
gax
|
typeof
gax
.
fallback
);
Construct an instance of CloudSchedulerClient.
opts
ClientOptions
gaxInstance
typeof gax
| typeof fallback
: loaded instance of google-gax
. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new CloudSchedulerClient({fallback: true}, gax); ```
Properties
apiEndpoint
get
apiEndpoint
()
:
string
;
The DNS address for this API service.
apiEndpoint
static
get
apiEndpoint
()
:
string
;
The DNS address for this API service - same as servicePath.
auth
auth
:
gax
.
GoogleAuth
;
cloudSchedulerStub
cloudSchedulerStub
?:
Promise
< {
[
name
:
string
]
:
Function
;
}>;
descriptors
descriptors
:
Descriptors
;
innerApiCalls
innerApiCalls
:
{
[
name
:
string
]
:
Function
;
};
locationsClient
locationsClient
:
LocationsClient
;
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.
universeDomain
get
universeDomain
()
:
string
;
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.
Promise
<void>
{Promise} A promise that resolves when the client is closed.
createJob(request, options)
createJob
(
request
?:
protos
.
google
.
cloud
.
scheduler
.
v1
.
ICreateJobRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
ICreateJobRequest
|
undefined
,
{}
|
undefined
]>;
Creates a job.
request
options
Promise
<[ protos.google.cloud.scheduler.v1.IJob
, protos.google.cloud.scheduler.v1.ICreateJobRequest
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation 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.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.
*/
// const job = {}
// Imports the Scheduler library
const
{
CloudSchedulerClient
}
=
require
(
' @google-cloud/scheduler
'
).
v1
;
// 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
.
v1
.
ICreateJobRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
ICreateJobRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< protos.google.cloud.scheduler.v1.IJob
, protos.google.cloud.scheduler.v1.ICreateJobRequest
| null | undefined, {} | null | undefined>
void
createJob(request, callback)
createJob
(
request
:
protos
.
google
.
cloud
.
scheduler
.
v1
.
ICreateJobRequest
,
callback
:
Callback<protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
ICreateJobRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< protos.google.cloud.scheduler.v1.IJob
, protos.google.cloud.scheduler.v1.ICreateJobRequest
| null | undefined, {} | null | undefined>
void
deleteJob(request, options)
deleteJob
(
request
?:
protos
.
google
.
cloud
.
scheduler
.
v1
.
IDeleteJobRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
protobuf
.
IEmpty
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
IDeleteJobRequest
|
undefined
,
{}
|
undefined
]>;
Deletes a job.
request
options
Promise
<[ protos.google.protobuf.IEmpty
, protos.google.cloud.scheduler.v1.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 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
'
).
v1
;
// 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
.
v1
.
IDeleteJobRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
protobuf
.
IEmpty
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
IDeleteJobRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< protos.google.protobuf.IEmpty
, protos.google.cloud.scheduler.v1.IDeleteJobRequest
| null | undefined, {} | null | undefined>
void
deleteJob(request, callback)
deleteJob
(
request
:
protos
.
google
.
cloud
.
scheduler
.
v1
.
IDeleteJobRequest
,
callback
:
Callback<protos
.
google
.
protobuf
.
IEmpty
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
IDeleteJobRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< protos.google.protobuf.IEmpty
, protos.google.cloud.scheduler.v1.IDeleteJobRequest
| null | undefined, {} | null | undefined>
void
getJob(request, options)
getJob
(
request
?:
protos
.
google
.
cloud
.
scheduler
.
v1
.
IGetJobRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
IGetJobRequest
|
undefined
,
{}
|
undefined
]>;
Gets a job.
request
options
Promise
<[ protos.google.cloud.scheduler.v1.IJob
, protos.google.cloud.scheduler.v1.IGetJobRequest
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation 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
'
).
v1
;
// 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
.
v1
.
IGetJobRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
IGetJobRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< protos.google.cloud.scheduler.v1.IJob
, protos.google.cloud.scheduler.v1.IGetJobRequest
| null | undefined, {} | null | undefined>
void
getJob(request, callback)
getJob
(
request
:
protos
.
google
.
cloud
.
scheduler
.
v1
.
IGetJobRequest
,
callback
:
Callback<protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
IGetJobRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< protos.google.cloud.scheduler.v1.IJob
, protos.google.cloud.scheduler.v1.IGetJobRequest
| null | undefined, {} | null | undefined>
void
getLocation(request, options, callback)
getLocation
(
request
:
LocationProtos
.
google
.
cloud
.
location
.
IGetLocationRequest
,
options
?:
gax
.
CallOptions
|
Callback<LocationProtos
.
google
.
cloud
.
location
.
ILocation
,
LocationProtos
.
google
.
cloud
.
location
.
IGetLocationRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> ,
callback
?:
Callback<LocationProtos
.
google
.
cloud
.
location
.
ILocation
,
LocationProtos
.
google
.
cloud
.
location
.
IGetLocationRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
Promise<LocationProtos
.
google
.
cloud
.
location
.
ILocation
> ;
Gets information about a location.
request
LocationProtos.google.cloud.location.IGetLocationRequest
The request object that will be sent.
options
CallOptions
| Callback
< google.cloud.location.ILocation
, google.cloud.location.IGetLocationRequest
| null | undefined, {} | null | undefined>
Call options. See CallOptions for more details.
callback
Callback
< google.cloud.location.ILocation
, google.cloud.location.IGetLocationRequest
| null | undefined, {} | null | undefined>
Promise
< google.cloud.location.ILocation
>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.
const
[
response
]
=
await
client
.
getLocation
(
request
);
getProjectId()
getProjectId
()
:
Promise<string>
;
Promise
<string>
getProjectId(callback)
getProjectId
(
callback
:
Callback<string
,
undefined
,
undefined
> )
:
void
;
callback
Callback
<string, undefined, undefined>
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.
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.
project
string
location
string
job
string
string
{string} Resource name string.
listJobs(request, options)
listJobs
(
request
?:
protos
.
google
.
cloud
.
scheduler
.
v1
.
IListJobsRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
[],
protos
.
google
.
cloud
.
scheduler
.
v1
.
IListJobsRequest
|
null
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
IListJobsResponse
]>;
Lists jobs.
request
options
Promise
<[ protos.google.cloud.scheduler.v1.IJob
[], protos.google.cloud.scheduler.v1.IListJobsRequest
| null, protos.google.cloud.scheduler.v1.IListJobsResponse
]>
{Promise} - The promise which resolves to an array. The first element of the array is Array of . 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 listJobsAsync()
method described below for async iteration which you can stop as needed. Please see the documentation
for more details and examples.
listJobs(request, options, callback)
listJobs
(
request
:
protos
.
google
.
cloud
.
scheduler
.
v1
.
IListJobsRequest
,
options
:
CallOptions
,
callback
:
PaginationCallback<protos
.
google
.
cloud
.
scheduler
.
v1
.
IListJobsRequest
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
IListJobsResponse
|
null
|
undefined
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
> )
:
void
;
request
options
CallOptions
callback
PaginationCallback
< protos.google.cloud.scheduler.v1.IListJobsRequest
, protos.google.cloud.scheduler.v1.IListJobsResponse
| null | undefined, protos.google.cloud.scheduler.v1.IJob
>
void
listJobs(request, callback)
listJobs
(
request
:
protos
.
google
.
cloud
.
scheduler
.
v1
.
IListJobsRequest
,
callback
:
PaginationCallback<protos
.
google
.
cloud
.
scheduler
.
v1
.
IListJobsRequest
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
IListJobsResponse
|
null
|
undefined
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
> )
:
void
;
request
callback
PaginationCallback
< protos.google.cloud.scheduler.v1.IListJobsRequest
, protos.google.cloud.scheduler.v1.IListJobsResponse
| null | undefined, protos.google.cloud.scheduler.v1.IJob
>
void
listJobsAsync(request, options)
listJobsAsync
(
request
?:
protos
.
google
.
cloud
.
scheduler
.
v1
.
IListJobsRequest
,
options
?:
CallOptions
)
:
AsyncIterable<protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
> ;
Equivalent to listJobs
, but returns an iterable object.
for
- await
- of
syntax is used with the iterable to get response elements on-demand.
request
options
AsyncIterable
< protos.google.cloud.scheduler.v1.IJob
>
{Object} An iterable Object that allows async iteration . When you iterate the returned iterable, each element will be an object representing . 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 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.v1.ListJobsResponse.next_page_token returned from
* the previous call to ListJobs google.cloud.scheduler.v1.CloudScheduler.ListJobs. It is an error to
* switch the value of filter google.cloud.scheduler.v1.ListJobsRequest.filter or
* order_by google.cloud.scheduler.v1.ListJobsRequest.order_by while iterating through pages.
*/
// const pageToken = 'abc123'
// Imports the Scheduler library
const
{
CloudSchedulerClient
}
=
require
(
' @google-cloud/scheduler
'
).
v1
;
// 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
.
v1
.
IListJobsRequest
,
options
?:
CallOptions
)
:
Transform
;
Equivalent to listJobs
, but returns a NodeJS Stream object.
request
options
Transform
{Stream} An object stream which emits an object representing 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 listJobsAsync()
method described below for async iteration which you can stop as needed. Please see the documentation
for more details and examples.
listLocationsAsync(request, options)
listLocationsAsync
(
request
:
LocationProtos
.
google
.
cloud
.
location
.
IListLocationsRequest
,
options
?:
CallOptions
)
:
AsyncIterable<LocationProtos
.
google
.
cloud
.
location
.
ILocation
> ;
Lists information about the supported locations for this service. Returns an iterable object.
for
- await
- of
syntax is used with the iterable to get response elements on-demand.
request
LocationProtos.google.cloud.location.IListLocationsRequest
The request object that will be sent.
options
AsyncIterable
< google.cloud.location.ILocation
>
{Object} An iterable Object that allows async iteration . When you iterate the returned iterable, each element will be an object representing . 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 for more details and examples.
const
iterable
=
client
.
listLocationsAsync
(
request
);
for
await
(
const
response
of
iterable
)
{
// process response
}
locationPath(project, location)
locationPath
(
project
:
string
,
location
:
string
)
:
string
;
Return a fully-qualified location resource name string.
project
string
location
string
string
{string} Resource name string.
matchJobFromJobName(jobName)
matchJobFromJobName
(
jobName
:
string
)
:
string
|
number
;
Parse the job from Job resource.
jobName
string
A fully-qualified path representing Job resource.
string | number
{string} A string representing the job.
matchLocationFromJobName(jobName)
matchLocationFromJobName
(
jobName
:
string
)
:
string
|
number
;
Parse the location from Job resource.
jobName
string
A fully-qualified path representing Job resource.
string | number
{string} A string representing the location.
matchLocationFromLocationName(locationName)
matchLocationFromLocationName
(
locationName
:
string
)
:
string
|
number
;
Parse the location from Location resource.
locationName
string
A fully-qualified path representing Location resource.
string | number
{string} A string representing the location.
matchProjectFromJobName(jobName)
matchProjectFromJobName
(
jobName
:
string
)
:
string
|
number
;
Parse the project from Job resource.
jobName
string
A fully-qualified path representing Job resource.
string | number
{string} A string representing the project.
matchProjectFromLocationName(locationName)
matchProjectFromLocationName
(
locationName
:
string
)
:
string
|
number
;
Parse the project from Location resource.
locationName
string
A fully-qualified path representing Location resource.
string | number
{string} A string representing the project.
matchProjectFromProjectName(projectName)
matchProjectFromProjectName
(
projectName
:
string
)
:
string
|
number
;
Parse the project from Project resource.
projectName
string
A fully-qualified path representing Project resource.
string | number
{string} A string representing the project.
pauseJob(request, options)
pauseJob
(
request
?:
protos
.
google
.
cloud
.
scheduler
.
v1
.
IPauseJobRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
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.
request
options
Promise
<[ protos.google.cloud.scheduler.v1.IJob
, protos.google.cloud.scheduler.v1.IPauseJobRequest
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation 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
'
).
v1
;
// 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
.
v1
.
IPauseJobRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
IPauseJobRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< protos.google.cloud.scheduler.v1.IJob
, protos.google.cloud.scheduler.v1.IPauseJobRequest
| null | undefined, {} | null | undefined>
void
pauseJob(request, callback)
pauseJob
(
request
:
protos
.
google
.
cloud
.
scheduler
.
v1
.
IPauseJobRequest
,
callback
:
Callback<protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
IPauseJobRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< protos.google.cloud.scheduler.v1.IJob
, protos.google.cloud.scheduler.v1.IPauseJobRequest
| null | undefined, {} | null | undefined>
void
projectPath(project)
projectPath
(
project
:
string
)
:
string
;
Return a fully-qualified project resource name string.
project
string
string
{string} Resource name string.
resumeJob(request, options)
resumeJob
(
request
?:
protos
.
google
.
cloud
.
scheduler
.
v1
.
IResumeJobRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
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.
request
options
Promise
<[ protos.google.cloud.scheduler.v1.IJob
, protos.google.cloud.scheduler.v1.IResumeJobRequest
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation 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
'
).
v1
;
// 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
.
v1
.
IResumeJobRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
IResumeJobRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< protos.google.cloud.scheduler.v1.IJob
, protos.google.cloud.scheduler.v1.IResumeJobRequest
| null | undefined, {} | null | undefined>
void
resumeJob(request, callback)
resumeJob
(
request
:
protos
.
google
.
cloud
.
scheduler
.
v1
.
IResumeJobRequest
,
callback
:
Callback<protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
IResumeJobRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< protos.google.cloud.scheduler.v1.IJob
, protos.google.cloud.scheduler.v1.IResumeJobRequest
| null | undefined, {} | null | undefined>
void
runJob(request, options)
runJob
(
request
?:
protos
.
google
.
cloud
.
scheduler
.
v1
.
IRunJobRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
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.
request
options
Promise
<[ protos.google.cloud.scheduler.v1.IJob
, protos.google.cloud.scheduler.v1.IRunJobRequest
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation 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
'
).
v1
;
// 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
.
v1
.
IRunJobRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
IRunJobRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< protos.google.cloud.scheduler.v1.IJob
, protos.google.cloud.scheduler.v1.IRunJobRequest
| null | undefined, {} | null | undefined>
void
runJob(request, callback)
runJob
(
request
:
protos
.
google
.
cloud
.
scheduler
.
v1
.
IRunJobRequest
,
callback
:
Callback<protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
IRunJobRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< protos.google.cloud.scheduler.v1.IJob
, protos.google.cloud.scheduler.v1.IRunJobRequest
| null | undefined, {} | null | undefined>
void
updateJob(request, options)
updateJob
(
request
?:
protos
.
google
.
cloud
.
scheduler
.
v1
.
IUpdateJobRequest
,
options
?:
CallOptions
)
:
Promise
< [
protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
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.
request
options
Promise
<[ protos.google.cloud.scheduler.v1.IJob
, protos.google.cloud.scheduler.v1.IUpdateJobRequest
| undefined,
{} | undefined
]>
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation 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.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.
*/
// 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
'
).
v1
;
// 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
.
v1
.
IUpdateJobRequest
,
options
:
CallOptions
,
callback
:
Callback<protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
IUpdateJobRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
options
CallOptions
callback
Callback
< protos.google.cloud.scheduler.v1.IJob
, protos.google.cloud.scheduler.v1.IUpdateJobRequest
| null | undefined, {} | null | undefined>
void
updateJob(request, callback)
updateJob
(
request
:
protos
.
google
.
cloud
.
scheduler
.
v1
.
IUpdateJobRequest
,
callback
:
Callback<protos
.
google
.
cloud
.
scheduler
.
v1
.
IJob
,
protos
.
google
.
cloud
.
scheduler
.
v1
.
IUpdateJobRequest
|
null
|
undefined
,
{}
|
null
|
undefined
> )
:
void
;
request
callback
Callback
< protos.google.cloud.scheduler.v1.IJob
, protos.google.cloud.scheduler.v1.IUpdateJobRequest
| null | undefined, {} | null | undefined>
void