How to set programmatically AFAnalysis backfill in web api

Dear all,

 

I'm trying to set backfill programmatically for selected AF element/analyses.

I found very good forum discussion here Re: Get Results from Analysis without defining an Output Attribute

 

I have two questions:

1. In pi explorer creating backfill is easy, you set start date and end date and click start:


pastedImage_2.png.png

But it seems sdk doesn't give an easy high level api to do this, and aforementioned example confirms it. You need to calculate intervals manually and then run calculation for each interval...

Is it correct, maybe there is some other approach?

 

2. If we are talking about web api. Say I'd like to expose method in the web api which creates backfill data for particular element/analyses.Here  always rely on time (of execution) when response is sent back to the caller, and most important is the time limited by timeout settings. For example if I want to get backfill for recent 2 years with interval 15 minutes, as a caller I'll never get a result, since either timeout happens or something else can go wrong during super long call.  What is the right way to provide backfill functionality in the web api?

 

Thank you in advance.

 

Maxim.

Parents
  • The AF Team is adding recalculation capability to the AF SDK. What will actually happen under the hood is that the AF SDK will invoke the recalculation but the PI Analysis Service will do the work. It's a more scalable solution than having individual AF SDK clients do it. The PI Analysis Service will also take into account calculation dependency chains. This feature should be released this fall with AF Asset Analytics 2016 R2. After this feature is released, the PI Web API team will add the equivalent feature as a REST service.

  • Thank you Raymond,

     

    It is great that these features will be available soon. But what can we do now?

    In my opinion, the only way how to achieve it, is to expose low level sdk methods in web api, the problem with this approach is every call will require new connection to pisdk, fetching the same elements/templates/attributes/time rules and etc - as a consequence methods will be very slow.

Reply Children
  • Even though the PI Web API's REST services are stateless from the client's point of view, we do cache connections and some AF data in the server. When the same user returns to the server with a subsequent operation request, we take advantage of the cached information. So, we don't have to re-read the elements, templates and attributes if they are already available. When we add PI Analytics features, the same will be true. We don't expect the PI Web API itself to introduce a bottleneck.