2 Replies Latest reply on Apr 18, 2016 11:50 PM by bshang

    PI Web API Streamsets - specify subset of attributes to retrieve

    ckarras

      I'm querying an AF element's values using the "streamsets" web API. The element has several attributes but I only need a small subset of these attributes. Is there are a way to specify the list of attributes I want to retrieve?

       

      Using the "nameFilter" query string parameter, I can select a single attribute, but I could not find a way to specify a list of attributes.

        • Re: PI Web API Streamsets - specify subset of attributes to retrieve
          Lonnie Bowling

          Hi Christos,

           

          I had the same question a few months ago, here is the answer:

           

          Retrieving a subset of attribute values using the PI Web API

           

          In short, it is not possible using the nameFilter, it is good for one attribute only. You can use the new batch feature, but it is in CTP right now, so could change. I have not tried it yet, but it does look a little messy. Scanning the documentation, it looks like I will have to create a call for each attribute I want to see, pack them up in a batch call, then unpack them in the return results. When I get some time I'm going to test the performance of this, as that is my biggest issue. What I would really like to see is the ability to send a list of attributes and have a nice clean data set come back. Batch is good, but pretty generic. I think wanting a subset of attributes is a very common scenario that could warrant an expansion to the getsteamset(s) capabilities.

           

          Lonnie

          • Re: PI Web API Streamsets - specify subset of attributes to retrieve
            bshang

            If the subset of attributes is pre-defined, then you can look into using the streamsetsadhoc endpoint. The downside is if these attributes are discovered during runtime via search filters, then this endpoint can't be used.

             

            We'll be making the batch feature as part of the core services for the next release (so promoted from CTP). Also, this next release will allow you to perform value queries on attributes found during runtime (via a nameFilter for example) so it's no longer limited to pre-defined attribute lists. This should help reduce the number of client-to-web api server calls in cases where values for subsets of attributes are desired.