IBM InfoSphere Streams Version 4.1.1

View items

This collection resource provides access to the tuple data that is buffered by a view. For example, you can use the REST API to display the buffered tuple data in a custom application or a third-party charting tool. In addition, the collection resource provides information about the data, such as the time it was collected.

Universal Resource Identifier (URI) pattern

https://server:port/streams/rest/instances/{restid}/views/{restid}/viewitems
Note: The following URI is deprecated:
https://server:port/streams/rest/instances/{restid}/activeviews/{restid}/viewitems

Properties

This collection resource has the following properties:
next
A string that identifies the URI for the next page in the list. This property is not present if the list is not paged or if the current page is the last page.
previous
A string that identifies the URI for the previous page in the list. This property is not present if the list is not paged or if the current page is the first page.
resourceType
A string that identifies the REST resource type, which is viewItemList.
total
A number that identifies the total number of objects in the list. If the list is filtered, the total corresponds to the total number of items that match the filter parameters.
view
A string that identifies the URI that you can use to access information about the view.
viewItems
An array that provides the following information for each tuple that is buffered for the view:
channel
A number that identifies the channel of the parallel region that the tuple was routed through. This property is not present if the operator that is associated with the view is not part of a parallel region.
collectionTime
A number that identifies the time that the data was retrieved. The unit of time is milliseconds since the epoch, which was midnight Greenwich mean time (GMT) on January 1, 1970. By default, view item resources are sorted according to this property value.
data
An object that contains a member for each attribute that is specified in the view. The data member value type varies based on the attribute type. The following table lists possible SPL data types for attribute and the data member value types that they are mapped to in JavaScript Object Notation (JSON):
Table 1. Mapping between SPL data types and JSON data types
SPL type JSON type Example
boolean true or false true
int8, int16, int32, int64, float32, float64, decimal32, decimal64, decimal128 number 4
uint8, uint16, uint32, uint64 number (unsigned) 9
rstring, ustring, bstring string hello
timestamp number 9999100055
enum string trace
tuple object, with attribute names as member names and attribute values as member values
{   
 "age": 23,
 "name": "Joe" 
}
map, bmap object, with map keys as member names and map values as member values
{
 "1": "hello",
 "2": "good bye"
}
list, blist, set, bset array
[   
 3.5,   
 89.6 
]
blob string, with each byte as a hexadecimal string and a space operator between the bytes for up to the first 16 bytes 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
xml string <b>hello</b>
complex32 string in Cartesian form (real component + imaginary componenti) using the default Java™ NumberFormat 13 + 14i
complex64 1 + 12i
Note: If the SPL timestamp contains a value that is relative to the epoch, the JSON value is the number of milliseconds since the epoch.
resourceType
A string that identifies the REST resource type, which in this case is viewItem.

Resource retrieval

You can use the following HTTP methods and query parameters to retrieve this resource:
HTTP methods
GET
Query parameters
This collection resource supports the standard query parameters for collection resources.
HTTP headers

Last-Modified: This response header is returned as part of the resource retrieval response. The value contains the time of the latest tuple that was returned in the response content.

If-Modified-Since: Include this request header to retrieve the data that was collected since a specified time. To retrieve only the data that was collected after the last tuples were retrieved, set this header value to the time that was returned by the Last-Modified response header from the previous request.