Functions on Oracle Cloud are an important element in any cloud native application architectures. Functions are typically small, well contained and fairly independent pieces of logic to carry out specific tasks. These tasks can be executed upon reception and handling of HTTP requests – a very common use case – or processing of other events. A function can also provide the implementation of a job that should be executed according to a time schedule – and therefore be triggered by time events.
At this point, Oracle Cloud Infrastructure does not provide a native mechanism for defining time based schedules for executing jobs. Scheduling a Function for execution according to a time schedule can be done in a very round about away using a Kubernetes CronJob resource running on OKE (Oracle Kubernetes Engine) as I described in this article earlier this year. This works well – but it is almost silly to start a container (CronJob) in order to invoke a function. Why not do the work the function performs in the container? And of course it requires an OKE cluster to even schedule that CronJob on.
Because functions can be triggered by OCI Cloud Events – such as the creation of a file – we could probably find a way to trigger a function as a result of periodically uploading a file to OCI Object Storage. Again, a fairly convoluted way to trigger a function.
With the recent introduction of API Gateway on Oracle Cloud Infrastructure and its ability to publish Functions on a public endpoint making the function accessible to regular HTTP client, we suddenly have many more options to trigger a Function ojn a time schedule. Perhaps the easiest one if through the use of an IFTTT Applet: Read the complete article here.
For regular information become a member in the Developer Partner Community please register here.