Scheduler in DataPower
Here in this blog, we will learn about Scheduler in DataPower.
What is scheduled processing?
Schedules the API gateway to automatically run a specific processing rule at a specific instance of time.
Why we need scheduled processing in IBM DataPower?
Schedulers in IBM DataPower serve a critical role in automating and orchestrating tasks and operations within the DataPower appliance. They allow you to schedule the execution of actions and services at specific times or on a recurring basis. Here are some common uses of schedulers in IBM DataPower:
- Regular Configuration Backup: You can schedule regular backups of the DataPower configuration. This helps in disaster recovery scenarios and ensures that you have a backup of your configuration at specific intervals.
- Certificate Renewal: When SSL/TLS certificates used for secure communications expire, you can use schedulers to automatically renew these certificates before they expire, reducing the risk of service interruptions.
- Security Token Expiration: If you are using security tokens, such as OAuth tokens, you can schedule the automatic refresh or rotation of these tokens to ensure uninterrupted access to protected resources.
- Data Retrieval: DataPower can fetch data from external sources on a scheduled basis. This is useful for data synchronization, fetching updated data from external APIs, or populating caches with fresh data.
- Log Management: Scheduled tasks can be used to manage and archive log files. For example, you can compress and archive log files at regular intervals to save disk space.
- Reporting: You can schedule the generation and delivery of reports, such as usage reports or security event logs, to specified destinations.
- Resource Cleanup: Schedule tasks to clean up temporary or obsolete resources, like old log files, cached data, or temporary files.
- Regular Testing: DataPower allows you to schedule tests of services, ensuring that they are operational at scheduled times.
- Automated Routing: You can use scheduling to route requests to different backend services based on time-specific criteria. For instance, route traffic to a backup server during maintenance windows.
- Custom Automation: Schedulers can execute custom GatewayScript or XSLT code to perform actions specific to your organization’s requirements.
- Health Checks: Implement health checks that periodically monitor the status of backend services and take actions based on the results.
- Regular Updates: Schedule the retrieval of software updates or security patches from IBM and automate the installation process.
Schedulers in DataPower allow you to automate tasks, reduce manual intervention, and maintain the health and security of your DataPower appliance and the services it provides. They can be configured to run tasks one time, at specific intervals, or based on a cron-like schedule, providing flexibility for a wide range of automation scenarios.
Objective: Getting STATISTICS OF DATAPOWER using Scheduler Flow
Build a Multi-protocol Gateway (MPGW) to invoke the appliance’s REST API interface in order to log certain statistics the appliance does not support out-of-box through the Log Target.
Implementation:
Login into Application domain where you want to develop the service.
MPGW Service Creation
- Configure the MPGW.
- Set the request and response type as non-xml.
- Configure the processing policy as follow.
Configuring user agent:
Give the datapower credentials in Basic-Auth Policy.
And Click on Apply.
Next you will see below page.
To write the output in log category automatically after every few mins or secs (30 seconds here) we must configure scheduled processing policy rule in xml manager
In the PolicyInterval_rule_0_xform_0 Rule action:
Configure it as Transform as XSL and place the following file in it in which the url of statistics service is called using xslt and set INPUT and OUTPUT as “NULL”.
Go to Log Target and Modify the Default Log Target Event Subscriptions as shown below :
Result:
The error logs will be written in system logs of IBM DataPower for every 30 Seconds with the help of scheduler processing.