Search code examples
google-cloud-platformgoogle-cloud-scheduler

Is it possible to schedule a Job using Google Scheduler API?


Using Google Cloud Scheduler, it is possible to create a Cloud Scheduler job with a Pub/Sub target. Is it possible to do the same using Cloud Scheduler API? I didnt find the schedule information in the Cloud Scheduler API documentation.


Solution

  • It appears that the answer is yes. Cloud Scheduler calls a scheduled piece of work a job. There is a REST API to create a Job that can be found documented here. If we read that page carefully we find that it is a POST request which takes a Job as a payload which contains a JSON description of what we want to describe which includes CRON based schedule and target parameters of what should be fired when the scheduler is reached. If we don't want to work at the REST level, there appears to be client API bindings at higher levels.