cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
plk Regular Visitor
Regular Visitor

Cache refresh plans and API

Is there a way to attache a cache refresh plan to a report with the new REST API? I can see how to upload a report, create a refresh plan, delete existing plans on a report but not how to attach a cache refresh plan to a report?

8 REPLIES 8
v-yulgu-msft Super Contributor
Super Contributor

Re: Cache refresh plans and API

Hi @plk,

 

All available REST APIs are listed on SwaggerHub, including how to create and execute a cache refresh plan, please have a look at below links:

Power BI Report Server REST API

SQL Server 2017 Reporting Services REST API

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
plk Regular Visitor
Regular Visitor

Re: Cache refresh plans and API

Yes, I know the docs but it is not clear which call to use to associate a refresh plan with a catalog item like a report or dataset?

plk Regular Visitor
Regular Visitor

Re: Cache refresh plans and API

Any ideas about this? How does one attach a refresh plan to a report?

Power BI Team mgmeyer
Power BI Team

Re: Cache refresh plans and API

You use a POST on this API:

 

http://server/reports/api/v2.0/CacheRefreshPlans

 

inside the payload you can specify the CatalogItem you want to associate with the schedule.

plk Regular Visitor
Regular Visitor

Re: Cache refresh plans and API

Ok, I will try this but the documentation says that the CatalogItemPath in the payload is the path to the "item that represents the CacheRefreshPlan" which is somewhat confusing.

plk Regular Visitor
Regular Visitor

Re: Cache refresh plans and API

Can you give an example? I cannot get this to work at all, not the PUT/DELETE or POST.  The Path seems to want the path of the the plan but it is not clear what this is.

 

If I try:

 

Invoke-RESTMethod -Uri "$restroot/CacheRefreshPlans(Path='/replib/cache')" -Method DELETE -UseDefaultCredentials

 

Where /replib/cache is a .rdl report with a cache defined, I just get a 404 error, for example.

Power BI Team mgmeyer
Power BI Team

Re: Cache refresh plans and API

The CachRefreshPlans route does not except a Path argument only and ID for the specific schedule. If you know the report that you want to get the schedules for you use this API:

 

http://server/reports/api/v2.0/reports(Path='/reportName')/CacheRefreshPlans

 

that should get you all the schedules associated with that report. If your looking for a specific one you can use OData $filter operation in the URL.

plk Regular Visitor
Regular Visitor

Re: Cache refresh plans and API

I found the issue - the datasource for the report was misconfigured but the errors dont' mention this. You can't set a cache if the report won't actually run.

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 182 members 1,842 guests
Please welcome our newest community members: