Cloud Scheduler
Creating Google Cloud Scheduler jobs in DuploCloud
Last updated
Was this helpful?
Creating Google Cloud Scheduler jobs in DuploCloud
Last updated
Was this helpful?
is a fully managed cron job service. It allows you to run jobs (tasks) on a scheduled basis.
You can set up recurring tasks that trigger HTTP endpoints, Pub/Sub topics, or App Engine services at specific intervals:
Pub/Sub: Sends messages to a Pub/Sub topic. Commonly used for event-driven architectures.
App Engine: Triggers an HTTP request to a specific App Engine service and version. Useful for Background tasks and scheduled jobs.
HTTP: Sends HTTP requests to an endpoint (e.g., API or webhook) using methods like GET or POST.
Before creating the Cloud Scheduler job, ensure that you have created a , as the job will send messages to that topic.
In the DuploCloud Portal, navigate to Cloud Services -> Cloud Scheduler.
Click Add. The Create Scheduler Job pane displays.
Configure the Job settings:
Name: Provide a unique name for the job.
Schedule: Set the cron schedule (e.g., 0 12 * * *
for noon every day).
Description: Optionally, provide a description for the job.
Time zone: Select the desired time zone (default is UTC).
Target Type: Choose Pub/Sub.
Topic Name: Select the Pub/Sub topic to which messages will be published.
Attributes: Optionally, add custom attributes for the message.
Data: Optionally, enter the message body.
Click Create. The job will trigger based on the schedule you set, sending messages to the selected Pub/Sub topic.
In the DuploCloud Portal, navigate to Cloud Services -> Cloud Scheduler.
Click Add. The Create Scheduler Job pane displays.
Configure the Job settings:
Name: Provide a unique name for the job.
Schedule: Set the cron schedule (e.g., 0 0 * * 0
for midnight every day).
Description: Optionally, provide a description for the job.
Time zone: Select the desired time zone (default is UTC).
Target Type: Choose App Engine.
Service: Enter the App Engine service to be invoked.
Version: Select the version of the service to use.
HTTP Method: Choose the HTTP method (e.g., GET, POST).
Relative URI: Optionally, enter the relative URI for the request (e.g., /api/endpoint
).
HTTP Body: Optionally, enter the message body.
HTTP Headers: Optionally, add any necessary HTTP headers for the request.
Click Create. The job will trigger the specified App Engine service based on the cron schedule.
In the DuploCloud Portal, navigate to Cloud Services -> Cloud Scheduler.
Click Add. The Create Scheduler Job pane displays.
Configure the Job settings:
Name: Provide a unique name for the job.
Schedule: Set the cron schedule (e.g., 0 12 * * *
for noon every day).
Description: Optionally, provide a description for the job.
Timezone: Select the desired time zone (default is UTC).
Target Type: Choose HTTP.
HTTP Method: Choose the HTTP method (e.g., GET, POST).
Cloud Function: If you have an existing Cloud Function that can be triggered by HTTP, select it here. If you do not have any Cloud Functions deployed, the dropdown will show Other as the only option.
Target URI: Enter the full URL of the target HTTP endpoint (e.g., https://example.com/api
).
Authentication Method: Choose the authentication method required for the target service (e.g., oauth token, oidc token, etc.).
HTTP Body: Optionally, enter the body of the HTTP request (e.g., { "order_id": 12345 }
for a POST request).
HTTP Headers: Optionally, add any necessary HTTP headers for the request.
Click Create. The job will make an HTTP request to the specified endpoint according to the cron schedule.
After creating the Cloud Scheduler job, you can create a that is subscribed to the Pub/Sub topic. The Cloud Function will automatically trigger when it receives a message from the Cloud Scheduler job, allowing you to automate tasks such as processing data or generating reports based on the message content.
Before creating the Cloud Scheduler job, ensure that you have already deployed a application with the relevant endpoint (e.g., /process-data
) that you want to trigger. The Cloud Scheduler job will send an HTTP request to this endpoint at the scheduled time.
Before creating the Cloud Scheduler job, ensure that you have already deployed either an HTTP-based service or a with the relevant endpoint (e.g., /process-orders
) that you want to trigger. The Cloud Scheduler job will send an HTTP request to this endpoint or invoke the Cloud Function at the scheduled time.