Data Queries


PI Web API Basics.

Querying real-time and historical data



Challenges

Current Value Query

The snapshot value is the most recent value stored for a PI Point.

Objective

Get the snapshot (current) value for multiple points at once using the batch endpoint.

Query current values for points: P1DP300, P1DP301, P1DP302

Example

curl "http://challenge/piwebapi/streamsets/value?webId=P1DP300&webId=P1DP301&webId=P1DP302"

Connect with SSH

Link your SSH key, then connect with: ssh hacker@dojo.idg.ctf

Recorded Values

Retrieve historical recorded values for a PI Point within a time range.

Objective

Get recorded values for the last hour from point P1DP400.

Parameters

  • startTime: *-1h (one hour ago)
  • endTime: * (now)

Example

curl "http://challenge/piwebapi/streams/P1DP400/recorded?startTime=*-1h&endTime=*"

Connect with SSH

Link your SSH key, then connect with: ssh hacker@dojo.idg.ctf

Interpolated Values

Get evenly-spaced interpolated values at a specific interval.

Objective

Get interpolated values every 10 minutes for the last hour.

Parameters

  • startTime: *-1h
  • endTime: *
  • interval: 10m

Example

curl "http://challenge/piwebapi/streams/P1DP500/interpolated?startTime=*-1h&endTime=*&interval=10m"

Connect with SSH

Link your SSH key, then connect with: ssh hacker@dojo.idg.ctf

Summary Data

Calculate summary statistics over a time range.

Objective

Get the average, minimum, and maximum values for the last day.

Parameters

  • startTime: *-1d
  • endTime: *
  • summaryType: Average,Minimum,Maximum

Example

curl "http://challenge/piwebapi/streams/P1DP600/summary?startTime=*-1d&endTime=*&summaryType=Average&summaryType=Minimum&summaryType=Maximum"

Connect with SSH

Link your SSH key, then connect with: ssh hacker@dojo.idg.ctf

30-Day Scoreboard:

This scoreboard reflects solves for challenges in this module after the module launched in this dojo.

Rank Hacker Badges Score