Jira Legacy | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
As it is time-series data, it can be filtered based on three main criteria:
Datetime
- Data in last X hours
- Data after a particular Data after specified DateTime (To be supported in Istanbul Release)
- Data between a date rangebefore specified DateTime
- Last X records
DataTypes in CPS Core
...
No | Name | Type | Default | Purpose | Example | |
---|---|---|---|---|---|---|
1 | indexpage | int | 0 | 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. "indexpage" parameter represents the page number, starts with 0, and maxSize "limit" is the page size. | ||
2 | maxSizelimit | int | 1000 | |||
3 | pointInTime | Timestamp (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 | sortBysort | string | LATEST_FIRST | Possible values - OLDEST_FIRST & LATEST_FIRSTtimestamp: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 |
Assumptions
- Temporal database stores full information in the payload (CPS-192: Design data store for Temporal Service).
- Data in the response body will always contain the entire payload data.
...
- after - timestamp ( ISO Format) to consider data created after the specified Timestamp
- payload simplePayloadFilter - to define payload filtering criteria
- index page - to define the page number (required for pagination)
- maxSize limit - to limit the response size
- pointInTime - to consider data changed or added before this time.
- sortBy sort - to define the order of data in the result set
...
By Dataspace and Anchor
Endpoint Format A
URL: GET /dataspaces/{dataspace-name}/anchors/{anchor-name}
Example: GET /dataspaces/{dataspace-name}/anchors/{anchor-name}?after=2021-03-21T00:00:00-0:00&payloadsimplePayloadFilter={"idNearRTRIC":"1"}&maxSizelimit=500
Endpoint Format B
URL: GET /dataspaces/{dataspace-name}/anchor-data?anchor={anchor-name}
Example: GET /dataspaces/{dataspace-name}/anchor-data?anchor={anchor-name}&after=2021-03-21T00:00:00-0:00&payloadsimplePayloadFilter={"idNearRTRIC":"1"}&maxSizelimit=500
By Dataspace and Schema-set
Endpoint Format A
URL: GET /dataspaces/{dataspace-name}/anchors?schemaSet={schemaset-name}
Example: GET /dataspaces/{dataspace-name}/anchors?schemaSet={schemaset-name}&after=2021-03-21T00:00:00-0:00&payloadsimplePayloadFilter={"idNearRTRIC":"1"}
Endpoint Format B
URL: GET /dataspaces/{dataspace-name}/anchor-data?schemaSet={schemaset-name}
Example: GET /dataspaces/{dataspace-name}/anchor-data?schemaSet={schemaset-name}&after=2021-03-21T00:00:00-0:00&payloadsimplePayloadFilter={"idNearRTRIC":"1"}
Response Anchor responseBody responseBody
responseBody | |
responseBody |
name | type | |
---|---|---|
nextRecordsLink | string | added only if there are remaining records to be fetched for the query. |
previousRecordsLink | string | added only if it is not the first set of records. |
records | list | contains one record for each timestamp that meets filtering criteria. It contains header information along with data. |
...
Code Block |
---|
{ "nextRecordsLink": "cps-temporal/api/v1/dataspaces/{dataspace-name}/anchors/{anchor-name}?after=2021-03-21T00:00:00-0:00&payloadsimplePayloadFilter={"idNearRTRIC":"1"}&maxSizelimit=500&pointInTime=2021-04-21T00:00:00-0:00&indexpage=2", "previousRecordsLink": "cps-temporal/api/v1/dataspaces/{dataspace-name}/anchors/{anchor-name}?after=2021-03-21T00:00:00-0:00&payloadsimplePayloadFilter={"idNearRTRIC":"1"}&maxSizelimit=500&pointInTime=2021-04-21T00:00:00-0:00&indexpage=0", "records": [ { "timestamp": "2021-03-21T00:00:00-0:00", "dataspace": "my-dataspace", "schemaSet": "my-schema-set", "anchor": "my-anchor", "data": { "status" : "UP" } } ] } |
...