-
Re: Need to know more about using PI web api
Marcos Vainer LoeffJul 21, 2014 11:53 AM (in response to Flutura)
Hello Yogini,
As I said on other posts, PI Web API is a RESTful web service on top of the PI System. This works the same way that all RESTful web services works. Hence, if you are not familiar with this type of web service, Google would be the best place for you to start learning.
Once you have learning the basic concepts of RESTful web services, please download and install PI Web API beta. After PI Web API service is up and running, you will have access to the online help (whose address should be: https://webservername/piwebapi/help). It describes all the methods available for you.
If you want to test if PI Web API is working, you can access a similar link like: https://marc-web-sql/piwebapi.
You are supposed to receive an JSON answer like:
{ "Links": { "Self": "https://marc-web-sql/piwebapi/", "Asset Servers": "https://marc-web-sql/piwebapi/assetservers", "Data Servers": "https://marc-web-sql/piwebapi/dataservers", "Configuration": "https://marc-web-sql/piwebapi/configuration", "Version": "https://marc-web-sql/piwebapi/version" }, "HtmlHelp": "https://marc-web-sql/piwebapi/help" }
Hope it helps!
-
Re: Need to know more about using PI web api
Flutura Jul 24, 2014 12:40 PM (in response to Marcos Vainer Loeff)Hello,
Is there some way where I can programatically fetch data from this REST api. I am trying to access it from a JAVA code with the NuGreen example.
Any sample code would be of great help.
Regards,
Yogini
-
Re: Need to know more about using PI web api
Gregor Jul 24, 2014 1:52 PM (in response to Flutura)Hello Yogini,
Please have a look at Brad's blog post about PI Web API: Javascript Client.
-
Re: Need to know more about using PI web api
Marcos Vainer LoeffJul 27, 2014 6:51 PM (in response to Gregor)
Hello Yonigi,
Actually, we don't have an example using PI Web API with Java. But if you search for an example of a RESTful Java Client on the internet, I am sure you will find many examples. One of them would be this one.
I recommend you to use the Apache libraries as well as JSON. You only need to reference those two types of libraries in order to make your Java client application work properly with PI Web API.
Hope it helps!
-
Re: Need to know more about using PI web api
Flutura Aug 5, 2014 6:18 AM (in response to Marcos Vainer Loeff)Hello folks,
I have been able to get data in JSON format using the RESTful services. So far so good. Thanks for your help. One thing, though, is bothering me. I am developing this data pipeline for a system where the input will be from EMeters which might be sending values to the PI server with the frequency in milliseconds. I am worried if my "RESTful API to Java connection" would turn out to be a bottleneck for such a high frequency.
Any experiences?
Yogini, Flutura Solutions.
-
Re: Need to know more about using PI web api
Marcos Vainer LoeffAug 5, 2014 2:42 PM (in response to Flutura)
Hello Yogini,
According to the developer of the product, PI Web API isn’t built for this scenario yet, because we only support writing a single value at a time.
Adding the ability to write multiple values at a time is in the plan for the next release. Once this feature is available, the client application will be able to buffer values and send them in batches at a more reasonable frequency.
Hope it helps!
-
Re: Need to know more about using PI web api
Flutura Aug 6, 2014 9:19 AM (in response to Marcos Vainer Loeff)Hello Marcos,
Sorry, but I am not clear about what you mean by "a single value at a time". I am not looking for writing multiple values at a time. Suppose, I have a java code which is making calls to the Web API, do you think I would face issues if I am trying to fetch data at a very high frequency?
As of now, I am able to get all the "recorded data" values, from the NuGreen example, using the Web API in one go. And I didn't face any issues. But, if the data is a continuous stream, would it not be possible?
-
Re: Need to know more about using PI web api
mbrowningAug 6, 2014 1:50 PM (in response to Flutura)
Hi Yogini,
It sounded from your previous post like you were interested in writing values to PI with high frequency via the Web API. Marcos's reply addresses that situation.
If you have some other process that is writing values to PI with high frequency and are only using the PI Web API to read those values, the situation is different. My first suggestion is to consider whether you really need to read with the same frequency that you're writing. For example, if the values are being read for use in a display, even if they're being written every millisecond, it may be acceptable to read them every few seconds.
If you do need to make reads with very high frequency, then you will hit a limit when your application is adding requests to the PI Web API's queue faster than it can respond to them. In this case, the queue will grow until the server refuses to accept additional requests. Where this limit lies depends on several factors, including the complexity of the requests you're making, the latency between the Web API server and the AF and PI servers, and the specs of your server machines, and can only reliably be determined by profiling in your own environment. If you hit this limit with a single Web API server, you might explore scaling horizontally by using multiple Web API servers and load balancing between them.
-
Re: Need to know more about using PI web api
Flutura Aug 8, 2014 5:05 AM (in response to mbrowning)Thanks a lot Mark, that helped a lot. By the way, is there any video explaining how the PI web API works? That would be really great.
I would consider taking the approach that you suggested i.e "For example, if the values are being read for use in a display, even if they're being written every millisecond, it may be acceptable to read them every few seconds."
Cheers!
Yogini, Flutura Solutions
-
Re: Need to know more about using PI web api
Gregor Aug 11, 2014 4:11 PM (in response to Flutura)Hello Yogini,
Yogini Gulkotwar
is there any video explaining how the PI web API works?Can you please see if the recording of Builders's Café Webinar Series: Preview of PI Web API is what you are looking for or be more specific about what kind of information you are asking for? Is it that you like to know what data access method PI Web API is based on?
-
Re: Need to know more about using PI web api
Flutura Aug 12, 2014 9:20 AM (in response to Gregor)Hello Gregor,
"Is it that you like to know what data access method PI Web API is based on?"
Yes. Is there some video or tutorial which explains that?
Yogini Gulkotwar, Flutura Solutions.
-
Re: Need to know more about using PI web api
Gregor Aug 12, 2014 12:27 PM (in response to Flutura)Hello Yogini,
PI Web API 2014 Release Notes mention PI AF Client 2014 as prerequisite. Even PI SDK is installed along with the PI AF Client setup kit, my conclusion is that AF SDK 2.6.0.5843 is used.
-
-
-
-
-
-
-
-
-
-
-
-
Re: Need to know more about using PI web api
QasimGulzar Nov 12, 2015 11:27 AM (in response to Flutura)Hey,
I am trying to to write a REST client for PI WEB SDK i am facing problem while authentication , my authentication type is basic. can any one guide me in this regard.