Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

NoNameTypeDefaultPurposeExample
1pagepageNumberint0

The query output can have many rows so it is important to limit the fetched data. To limit the number of records and to provide pagination, these two parameters can be used. 

pageNumber starts from "page" parameter represents the page number, starts with 0, and "limit" is the page size.0"

pageLimit can't be greater than the maximum value configured  in the application 


2pageLimit2limitint1000
3pointInTimeTimestamp (ISO Format)CurrentDateTime

When a user uses the APIs with pagination (by running several stateless requests), the result set can be impacted by new states stored while navigating. This can be a challenge to retrieve a consistent result set. 

This parameter must be used to avoid this issue. However, It will not provide a consistent result set if data, that meet search criteria, get deleted because of the cleanup triggered by the retention policy.


4

sort

string timestamp:desc

Data is by default returned sorted by the timestamp in descending order. It can be overridden and data can be sorted by multiple fields.

sort=timestamp:asc,anchor:desc

...

  1. after - timestamp ( ISO Format) to consider data created after the specified Timestamp
  2. simplePayloadFilter - to define payload filtering criteria
  3. page pageNumber - to define the page number (required for pagination)
  4. limit pageLimit - to limit the response size
  5. pointInTime - to consider data changed or added before this time.
  6. sort - to define the order of data in the result set

...

Example: GET /dataspaces/{dataspace-name}​/anchors/{anchor-name}​/history?after=2021-03-21T00:00:00-0:00&simplePayloadFilter={"idNearRTRIC":"1"}&limitpageLimit=500

By Dataspace and Schema-set

...

Code Block
{
  "nextRecordsLink": "cps-temporal/api/v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/history?after=2021-03-21T00:00:00-0:00&simplePayloadFilter={"idNearRTRIC":"1"}&limitpageLimit=500&pointInTime=2021-04-21T00:00:00-0:00&pagepageNumber=2",
  "previousRecordsLink": "cps-temporal/api/v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/history?after=2021-03-21T00:00:00-0:00&simplePayloadFilter={"idNearRTRIC":"1"}&limitpageLimit=500&pointInTime=2021-04-21T00:00:00-0:00&pagepageNumber=0",
  "records": [
    {
      "timestamp": "2021-03-21T00:00:00-0:00",
      "dataspace": "my-dataspace",
      "schemaSet": "my-schema-set",
      "anchor": "my-anchor",
      "data": {
        "status" : "UP"
      }
    }
  ]
}

...