LATEST VERSION: 1.1 - CHANGELOG
Scheduler for PCF v1.1

Scheduling Calls

This topic provides instructions for managing outbound HTTP calls in Scheduler for Pivotal Cloud Foundry (PCF).

Manage Calls

You can use Scheduler for PCF to schedule execution of HTTP calls to external HTTP services. See the following sections to learn more about creating, running, and scheduling calls and viewing call history.

Note: If you want to use the Cloud Foundry Command Line Interface (cf CLI) for managing calls, you must install the Scheduler for PCF CLI plugin on your local machine. This plugin is packaged with the Scheduler for PCF tile on Pivotal Network. For more information, see the Prerequisites section of the Using Scheduler for PCF topic.

Create a Call

To execute tasks related to an app, create a call by running the cf create-call APP-NAME CALL-NAME URL command, where:

  • APP-NAME is the app you want to execute a task against.
  • CALL-NAME is the name for your call.
  • URL is the URL to execute a HTTP POST call against.

Execute a Call

You can execute a call manually by running the cf run-call CALL-NAME command. This is often useful to test the configuration of a call prior to scheduling it for recurring execution.

See the following example:

$ cf run-call my-call
Enqueuing call my-call for app my-app in org my-org / space my-space as user@example.com... OK

Schedule a Call

You can schedule a call to execute at any time using a schedule expression. Scheduler for PCF requires Cron expressions in the MIN HOUR DAY-OF-MONTH MONTH DAY-OF-WEEK format.

For example, to execute a call at noon every day, run the following command:

$ cf schedule-call my-call "0 12 ? * * "

A single call can have multiple schedules. Each schedule has a GUID to distinguish it from similar schedules.

View Calls

You can use the cf CLI to list all calls in a space by running cf calls. See the following example:

$ cf calls
Listing calls for org my-org / space my-space as user@example.com... Call Name App Name URL my-call my-app https://example.com OK

View Schedules for Calls

You can review schedules for all calls in a space by running cf call-schedules. See the following example:

$ cf call-schedules 
Getting scheduled calls for org my-org / space my-space as user@example.com... App Name: my-app my-call 2b69e0c2-9664-46bb-4817-54afcedbb65d 0 12 ? * * OK

View Call History

You can review call history by running cf call-history CALL-NAME. See the following example:

$ cf call-history my-call
Getting scheduled call history for my-call in org my-org / space my-space as user@example.com... 1 - 1 of 1 Total Results Execution GUID Execution State Scheduled Time Execution Start Time Execution End Time Exit Message d288a4ba-e0bc-48c9-969c-6ee79e380b20 SUCCEEDED Mon, 16 Oct 2017 12:10:55 UTC Mon, 16 Oct 2017 12:10:55 UTC Mon, 16 Oct 2017 12:10:55 UTC 201 - Created

Delete a Call

You can delete a call by running cf delete-call CALL-NAME. See the following example:

$ cf delete-call my-call
Really delete the call my-call with url https://example.com and all associated schedules and history?> [yN]:y OK

Delete a Call Schedule

You can delete a specific schedule by running cf delete-call-schedule SCHEDULE-GUID, where SCHEDULE-GUID is the GUID found in the output of the cf call-schedules command. See the following example:

$ cf delete-call-schedule 2b69e0c2-9664-46bb-4817-54afcedbb65d
Really delete the schedule 2b69e0c2-9664-46bb-4817-54afcedbb65d / 0 12 ? * * and all associated history?> [yN]: y OK
Create a pull request or raise an issue on the source for this page in GitHub