Creating ISD/REST service with pagination; data shaping
Posted: Wed Jan 04, 2017 6:03 am
Hi all,
We've created a couple of simple REST 2.0 services via ISD to retrieve data from a database via a DataStage job and have got them working.
We're now looking to see how we can implement the following and I'm looking for guidance/recommended approaches for doing this:
1. Pagination - When the underlying query returns more than a certain number of rows (e.g. 100), how can the resultset be paginated. REST practices recommend including a Limit/Offset or a next/previous link; however I'm curious as to the approaches members have taken with ISD and how they've been implemented.
2. Data shaping - for wide tables, how can the fields returned be controlled based on the fields required by the service consumer? For example, I have a customer table with 100's of fields, however, based on the list of fields specified via a query string parameter (e.g. ?fields=custName, custID,custCity), I'd like to return only the fields specified.
Thanks in advance.
We've created a couple of simple REST 2.0 services via ISD to retrieve data from a database via a DataStage job and have got them working.
We're now looking to see how we can implement the following and I'm looking for guidance/recommended approaches for doing this:
1. Pagination - When the underlying query returns more than a certain number of rows (e.g. 100), how can the resultset be paginated. REST practices recommend including a Limit/Offset or a next/previous link; however I'm curious as to the approaches members have taken with ISD and how they've been implemented.
2. Data shaping - for wide tables, how can the fields returned be controlled based on the fields required by the service consumer? For example, I have a customer table with 100's of fields, however, based on the list of fields specified via a query string parameter (e.g. ?fields=custName, custID,custCity), I'd like to return only the fields specified.
Thanks in advance.