Jump to content

API Scheduler - running the utility has no effect


Recommended Posts

We have executed the API Scheduler with the '-dryrun' parameter set to 'true' and 'false' as well with no error messages. My colleague who carried out the necessary checks indicated that she does not think it worked.

Furthermore; The scheduled task that was set up to run the utility never stops running hence every time I execute the task; I always manually end the task else it runs indefinitely.

Link to comment
Share on other sites

Hi @Izu,

The API Scheduler is a self-contained scheduler utility, hence it running indefinitely. Its purpose is not to make one-off API calls, but to make API calls as part of a CRON schedule, so it's entirely possible that the schedule hasn't reached its defined point when the utility is being executed. More information can be found on the API Scheduler wiki page .

If you send me a copy of the configuration file you're using (with the API Key removed), and the schedule that you want to make the API calls, then I'll have a look at whats configured and will point you in the right direction.

Thanks,

Steve

Link to comment
Share on other sites

Hi @Izu,

Thanks for sending your config to Support. I've had a look, and it's configured to log a new Service Request at 9 am every day:

image.png

The executable should be left running, and if it's running at 9 am then the new Service Request should be logged as expected. If you want to test this at a time that isn't 9 am, just change the CronSchedule parameter as required for testing, run the executable, then kill the executable before resetting the CronSchedule and re-running it.

Let me know how you get on with this.

Steve

Link to comment
Share on other sites

Hi Steve,

I am unable to see a service request generated by the API Scheduler. I checked via a view and inputted the catalogue name  as a condition.

Please, could you have a look and let us know your feedback.

Rgds,

Izu  

Link to comment
Share on other sites

  • 2 weeks later...

Hi @Izu,

Are you allowing the scheduler to continue running in the background after it's been executed? As it does need to be running at the time when the Cron schedule is due.

If so, and the API calls are still not being made, could you email me a copy of your current configuration file & the latest log file from the tool, and I'll see if there's anything we've missed.

Thanks,

Steve

Link to comment
Share on other sites

Hi @Izu,

The issue is with the CronSchedule expression defined in your configuration:

"CronSchedule":"0 0 9 * * 1-7",

You have 1-7 defined as the days of the week to make the API call at - this is incorrect and is causing the scheduler to fail. It should be 0-6 to define every day of the week (with 0 being Sunday and 6 being Saturday) - or you could replace this with a *. Please see the following extract from the Cron package documentation for more information:

Field name   | Mandatory? | Allowed values  | Allowed special characters
----------   | ---------- | --------------  | --------------------------
Seconds      | Yes        | 0-59            | * / , -
Minutes      | Yes        | 0-59            | * / , -
Hours        | Yes        | 0-23            | * / , -
Day of month | Yes        | 1-31            | * / , - ?
Month        | Yes        | 1-12 or JAN-DEC | * / , -
Day of week  | Yes        | 0-6 or SUN-SAT  | * / , - ?

I'll also make a change to the API Scheduler tool to catch and throw errors for these type of configuration errors, I'll post back here once done.

Kind regards,

Steve

Link to comment
Share on other sites

Hi Steve,

I amended the cron schedule expression yesterday as suggested and I have had a look at the log file and the output has not changed. The fact is the API scheduler has always been running as a background process since last month but the issue is I cannot confirm that the request/task is being generated.

 

Rgds,

Izu

 

Link to comment
Share on other sites

Hi @Izu,

Once you'd fixed the cron expression, did you restart the executable? The config is only loaded when the executable first starts, so the executable will need to be killed and restarted to take the changes. Once a schedule is reached as defined in your expression, you will see a message to the console, and in the log, to state if the API call was successful or otherwise.

Thanks,

Steve

Link to comment
Share on other sites

Hi Steve,

Thanks for the feedback.

Yes, I got the feedback that the API call was successful but I am unable to see the generated request/task in Service Manager. Please, could you let me know how to check\confirm that the request/task has been created.

 

Rgds,

Izu

Link to comment
Share on other sites

Hi @Izu,

One way would be to create a custom view on your request list, filtered by the Status, Service and Catalog Item that you have defined in the API scheduler configuration. You should then have those requests listed.

I'll have a look at the tool and see if we can add the API response body to the log for a successful API call. It won't be particularly elegant, but you'll then be able to see in the log any params returned by each API call (including the Request Reference from your call to logServiceRequest). I'll reply to this thread once it's done,

Thanks,

Steve

Link to comment
Share on other sites

Hi @Izu,

I've added a debug mode to the API Scheduler tool, which when enabled will output the API call request and response payloads to the log file. This should help in working out what's going on with the API calls that are being made, or identify the new records being created.

This release (v1.2.0) can be downloaded from here: https://github.com/hornbill/goAPIScheduler/releases/download/1.2.0/goAPIScheduler_v1_2_0.zip

No change to your configuration is required, you just need to replace the executable with the relevant one in the release, then when running the executable add the -debug=true flag to the command.

Let me know how you get on.

Cheers,
Steve

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...