4 Using the SDK
4.6 Scheduling
The Business Intelligence platform RESTful web service SDK enables you to perform basic scheduling.
Note
Only schedulable objects can be used with the scheduling API. Schedulable resources include documents, for example Crystal reports and WebI reports.
You can set the following scheduling properties:
● The time to schedule the resource.
● The recurrence properties of the resource, including the start time, end time, and recurrence interval.
For example, a report could be scheduled to recur every Monday morning for the next year.
● The number of retries allowed and the retry interval.
For example, if scheduling fails, you could allow up to three retries at hourly intervals.
4.6.1 To discover the scheduling URLs for an object
Before you can discover the URLs for scheduling an object, you must have a valid logon token and know the base URL for RESTful web service requests.
To get a list of URLs that can be used to schedule an object, append /scheduleForms to the end of a request for a schedulable resource. Schedulable resources include documents, for example Crystal reports and WebI reports.
1. Create a new HTTP request.
2. Add the X-SAP-LogonToken attribute to the request header and set its value to a valid logon token.
3. Add the Accept attribute to the request header and set its value to application/xml.
4. Use the GET method to send a request to the http://<baseURL>/biprws/infostore/<id>/
scheduleForms URL.
Replace <baseURL> with the base URL for RESTful web service requests, and replace <id> with the ID or CUID of a schedulable resource.
GET http://localhost:6405/biprws/infostore/4738/scheduleForms
The response contains a feed of entries that show the links for scheduling the resource. The following example shows links that you can use to schedule a report with the following recurrence:
○ now
○ once
○ hourly
○ daily
○ weekly
○ monthly
○ NthDayOfMonth
Note
If the resource is not schedulable, an error is returned.
<feed xmlns="http://www.w3.org/2005/Atom">
<title type="text">now</title><id>tag:sap.com,2010:bip-rs/
ASb6ObslHktFnk3uF8.g3tw/now</id>
<link href="http://localhost:6405/biprws/infostore/5177/scheduleForms/now"
rel="alternate"></link>
</entry>
<entry>
<title type="text">once</title>
<id>tag:sap.com,2010:bip-rs/ASb6ObslHktFnk3uF8.g3tw/once</id>
<link href="http://localhost:6405/biprws/infostore/5177/scheduleForms/once"
rel="alternate"></link>
</entry>
<entry>
<title type="text">hourly</title>
<id>tag:sap.com,2010:bip-rs/ASb6ObslHktFnk3uF8.g3tw/hourly</id>
<link href="http://localhost:6405/biprws/infostore/5177/scheduleForms/
hourly" rel="alternate"></link>
</entry>
<entry>
<title type="text">daily</title>
<id>tag:sap.com,2010:bip-rs/ASb6ObslHktFnk3uF8.g3tw/daily</id>
<link href="http://localhost:6405/biprws/infostore/5177/scheduleForms/daily"
rel="alternate"></link>
</entry>
<entry>
<title type="text">weekly</title>
<id>tag:sap.com,2010:bip-rs/ASb6ObslHktFnk3uF8.g3tw/weekly</id>
<link href="http://localhost:6405/biprws/infostore/5177/scheduleForms/
weekly" rel="alternate"></link>
</entry>
<entry>
<title type="text">monthly</title>
<id>tag:sap.com,2010:bip-rs/ASb6ObslHktFnk3uF8.g3tw/monthly</id>
<link href="http://localhost:6405/biprws/infostore/5177/scheduleForms/
monthly" rel="alternate"></link>
</entry>
<entry><title type="text">NthDayOfMonth</title>
<id>tag:sap.com,2010:bip-rs/ASb6ObslHktFnk3uF8.g3tw/NthDayOfMonth</id>
<link href="http://localhost:6405/biprws/infostore/5177/scheduleForms/
NthDayOfMonth" rel="alternate"></link>
</entry>
</feed>
Related Information
/scheduleForms [page 99]
4.6.2 To schedule a resource
Before you can schedule a resource, you must have obtained a valid logon token and know the base URL for RESTful web service requests.
The Business Intelligence platform RESTful web service SDK allows for basic scheduling, including setting the time to schedule the resource and recurrence information.
Note
The scheduling APIs only work with objects that are schedulable. Schedulable resources include documents, for example Crystal reports and WebI reports.
1. Create a new HTTP request.
2. Add the X-SAP-LogonToken attribute to the request header and set its value to be a valid logon token.
3. Add the Accept attribute to the request header and set its value to application/xml.
4. Use the GET method to send a request to the http://<baseURL>/biprws/infostore/<id>/
scheduleForms/<form> URL.
Replace <baseURL> with the base URL for RESTful web service requests, and replace <ID> with the ID or cuid_CUID of the resource. Replace <form> with the frequency of scheduling to perform, for example, now, daily, weekly, or once.
GET http://localhost:6405/biprws/infostore/4738/scheduleForms/now
The response contains an XML template that you can use to populate the request body of a request to schedule the resource.
<entry xmlns="http://www.w3.org/2005/Atom">
<author>
<name>Administrator</name>
<uri>http://localhost:6405/biprws/infostore/12</uri>
</author>
<id>tag:sap.com,2010:bip-rs/ASb6ObslHktFnk3uF8.g3tw/scheduleForms/now</id>
<title type="text">Schedule Drilldown now</title>
<updated>2011-05-18T10:31:30.092Z</updated>
<content type="application/xml">
<attrs xmlns="http://www.sap.com/rws/bip">
<attr name="retriesAllowed" type="int32">0</attr>
<attr name="retryIntervalInSeconds" type="int32">1800</attr>
</attrs>
</content>
</entry>
5. Create a new HTTP request.
6. Add the X-SAP-LogonToken attribute to the request header and set its value to a valid logon token.
7. Add the Accept attribute to the request header and set its value to application/xml.
8. Add the Content-Type attribute to the request header and set its value to application/xml.
9. Fill out the template received from the GET request, and add it to the new request body.
In this example, 3 retries are allowed in intervals of 1800 seconds.
<entry xmlns="http://www.w3.org/2005/Atom">
<author>
<name>Administrator</name>
<uri>http://localhost:6405/biprws/infostore/12</uri>
</author>
<id>tag:sap.com,2010:bip-rs/ASb6ObslHktFnk3uF8.g3tw/scheduleForms/now</id>
<title type="text">Schedule Drilldown now</title>
<updated>2011-05-18T10:31:30.092Z</updated>
<content type="application/xml">
<attrs xmlns="http://www.sap.com/rws/bip">
<attr name="retriesAllowed" type="int32">3</attr>
<attr name="retryIntervalInSeconds" type="int32">1800</attr>
</attrs>
</content>
</entry>
10. Use the POST method to send the request to the scheduling URL.
POST http://localhost:6405/biprws/infostore/4738/scheduleForms/now
If the resource is scheduled successfully, the response header contains the status code 201 Created, and provides a link to the location of the scheduled instance.
Location: http://localhost:6405/biprws/infostore/5619
Related Information
/scheduleForms/<form> [page 100]