Component Feed Resource

The component feed resource is used to GET or DELETE a range of component stream interval data for all streams of a single component or for a single component stream. For feeds that span components see the Batch Feed resource.

Each GET will also return:

  • lastValue: The value of the lastest interval.
  • completedDate: The completed date. Typically the end datetime of the latest interval but if this is a derivation stream and it is derived from streams with smaller interval cycles it will be the earliest end datetime of all the dependent streams.
  • lastValueType: The data type of the last value (the stream's data type)
  • lastUpdated: The datetime (epoch millis)  the stream feed was updated.


GET component/{componentUid}/feed



Returns a collection of feeds for a component. One feed for each of the components streams.
Resource Information
Rate Limited? No
session, oauth and org tokens compatible? Yes
api_key token token compatible? Yes

Resource URL

http://grovestreams.com/api/component{componentUid}/feed

Parameters

startDate mandatory The start datetime (epoch millis) of the range request - inclusive. GroveStreams will round to the start of the interval it falls within.
endDate mandatory The end datetime (epoch mills) of the range request - exclusive. GroveStreams will round to the end of the interval it falls within for interval streams. 
intvlDates optional If set to "return" then arrays containing the start and end datetimes for each interval will be returned (epoch millis) for interval streams. Sample times for random streams will be returned.
cycle optional The cycle being requested. If this argument is not included and the requested stream is an interval stream, then the stream's base cycle intervals will be returned. If set to a cycle uid that is not the stream's base cycle (for interval streams) and the stats argument is missing then the streams default rollup method will be used to determine the set of statistics to retrieve.
stats
optional
If requesting a rollup cycle then include one or more stats to be returned. Comma delimited list.
  • FIRST
  • LAST
  • MIN
  • MAX
  • AVG
  • SUM
  • MINOCCURRENCE
  • MAXOCCURRENCE
  • GAPCOUNT
  • NONGAPCOUNT
  • INTVLCOUNT
  • MILLISECCOUNT
  • NONGAPMILLISECCOUNT
flatten
optional
Set to true or false. If true, the component layer is flattened and results are returned in the same order they were requested.
requestTimeZoneId
optional
The time zone id of the request. Mandatory if the cycle and numIntvls parameters are passed in.
numIntvls
optional
If numIntvls is passed in then the endDate will be derived using the  passed in cycle and startDate. If startDate is missing then it will be derived using numIntvls, cycle, and endDate.

Example Requests

Return base interval feeds for a component with three streams.

http://grovestreams.com/api/component/c7782a07-d12b-45d1-845a-5ec2e2160696/feed?startDate=1319047920000&endDate=1319047980000&&intvlDates=return

Response Body
{
  "message": "",
  "feed": {
    "requestStartDate": 1319047920000,
    "component": [
      {
        "stream": [
          {
            "statistic": [
              {
                "name": "BASE",
                "data": [
                  11.800000190734863,
                  14.199999809265137,
                  13.699999809265137
                ],
                "type": "FLOAT"
              }
            ],
            "intvlStartDate": [
              1319047920000,
              1319047940000,
              1319047960000
            ],
            "completedDate": 1319048160000,
            "cycleUid": "b2a4da07-5182-4b2e-a1d4-e092e75a82ec",
            "lastValueType": "FLOAT",
            "intvlEndDate": [
              1319047940000,
              1319047960000,
              1319047980000
            ],
            "streamType" : "intvl_stream",
            "streamUid": "7039044e-055f-40d5-b92c-5f2171434cd1",
            "lastUpdated": 1319048148438,
            "lastValue": 12.300000190734863
          },
          {
            "statistic": [
              {
                "name": "BASE",
                "data": [
                  78.19999694824219,
                  64.30000305175781,
                  63.599998474121094
                ],
                "type": "FLOAT"
              }
            ],
            "intvlStartDate": [
              1319047920000,
              1319047940000,
              1319047960000
            ],
            "completedDate": 1319048160000,
            "cycleUid": "b2a4da07-5182-4b2e-a1d4-e092e75a82ec",
            "lastValueType": "FLOAT",
            "intvlEndDate": [
              1319047940000,
              1319047960000,
              1319047980000
            ],
             "streamType" : "intvl_stream",
            "streamUid": "2e3c0ce3-af64-4ae2-a976-d9a97c2df2d6",
            "lastUpdated": 1319048148438,
            "lastValue": 64
          },
          {
            "statistic": [
              {
                "name": "BASE",
                "data": [
                  1.100000023841858,
                  1.100000023841858,
                  null
                ],
                "type": "FLOAT"
              }
            ],
            "intvlStartDate": [
              1319047920000,
              1319047940000,
              1319047960000
            ],
            "completedDate": 1319048160000,
            "cycleUid": "b2a4da07-5182-4b2e-a1d4-e092e75a82ec",
            "lastValueType": "FLOAT",
            "intvlEndDate": [
              1319047940000,
              1319047960000,
              1319047980000
            ],
            "streamType" : "intvl_stream",
            "streamUid": "2d60edc0-8ccf-4a4a-b325-aeef7c235e7d",
            "lastUpdated": 1319048148438,
            "lastValue": null
          }
        ],
        "componentUid": "c7782a07-d12b-45d1-845a-5ec2e2160696"
      }
    ],
    "requestEndDate": 1319047980000
  },
  "success": true
}


Return a rollup statistic (average) for a specific cycle:

http://grovestreams.com:80/api/component/c7782a07-d12b-45d1-845a-5ec2e2160696/feed?startDate=1319048100000&endDate=1319049000000&cycle=75ee104d-a73c-4633-88aa-476e46240d95&intvlDates=return&stats=AVG

Response Body
{
  "message": "",
  "feed": {
    "requestStartDate": 1319048100000,
    "component": [
      {
        "stream": [
          {
            "statistic": [
              {
                "name": "AVG",
                "data": [
                  11.830769230769231,
                  12.654545454545454,
                  16.6625
                ],
                "type": "DOUBLE"
              }
            ],
            "intvlStartDate": [
              1319048100000,
              1319048400000,
              1319048700000
            ],
            "completedDate": 1319049100000,
            "cycleUid": "75ee104d-a73c-4633-88aa-476e46240d95",
            "lastValueType": "FLOAT",
            "intvlEndDate": [
              1319048400000,
              1319048700000,
              1319049000000
            ],
            "streamType" : "intvl_stream",
            "streamUid": "7039044e-055f-40d5-b92c-5f2171434cd1",
            "lastUpdated": 1319049093424,
            "lastValue": 24.399999618530273
          },
          {
            "statistic": [
              {
                "name": "AVG",
                "data": [
                  1.6875,
                  1.5,
                  1.5666666666666667
                ],
                "type": "DOUBLE"
              }
            ],
            "intvlStartDate": [
              1319048100000,
              1319048400000,
              1319048700000
            ],
            "completedDate": 1319049100000,
            "cycleUid": "75ee104d-a73c-4633-88aa-476e46240d95",
            "lastValueType": "FLOAT",
            "intvlEndDate": [
              1319048400000,
              1319048700000,
              1319049000000
            ],
            "streamType" : "intvl_stream",
            "streamUid": "3e82a87d-a5df-4e95-b961-9c2e0908bce1",
            "lastUpdated": 1319049093438,
            "lastValue": 1
          },
          {
            "statistic": [
              {
                "name": "AVG",
                "data": [
                  80.86153846153846,
                  85.45454545454545,
                  81.15
                ],
                "type": "DOUBLE"
              }
            ],
            "intvlStartDate": [
              1319048100000,
              1319048400000,
              1319048700000
            ],
            "completedDate": 1319049100000,
            "cycleUid": "75ee104d-a73c-4633-88aa-476e46240d95",
            "lastValueType": "FLOAT",
            "intvlEndDate": [
              1319048400000,
              1319048700000,
              1319049000000
            ],
            "streamType" : "intvl_stream",
            "streamUid": "2e3c0ce3-af64-4ae2-a976-d9a97c2df2d6",
            "lastUpdated": 1319049093406,
            "lastValue": 74.0999984741211
          }
        ],
        "componentUid": "c7782a07-d12b-45d1-845a-5ec2e2160696"
      }
    ],
    "requestEndDate": 1319049000000
  },
  "success": true
}

GET component/{componentUid}/feed/{streamUid}



Returns a specific stream feed for a component.
Resource Information
Rate Limited?
No
session, oauth and org tokens compatible?
Yes
api_key token compatible?
Yes


Resource URL

http://grovestreams.com/api/component/{componentUid}/feed/{streamUid}

Parameters




startDate
mandatory*
The start datetime (epoch millis) of the range request. GroveStreams will round to the start of the interval it falls within.
endDate
mandatory*
The end datetime (epoch mills) of the range request. GroveStreams will round to the end of the interval it falls within.
intvlDates
mandatory
If set to "return" then arrays containing the start and end datetimes for each interval will be returned (epoch millis).
cycle
optional
The cycle being requested. If this argument is not included then the stream's base cycle intervals will be returned. If set to a cycle uid that is not the stream's base cycle and the stats argument is missing then the streams default rollup method will be used to determine the set of statistics to retrieve.
stats
optional
If requesting a rollup cycle then include one or more stats to be returned. Comma delimited list.
  • FIRST
  • LAST
  • MIN
  • MAX
  • AVG
  • SUM
  • MINOCCURRENCE
  • MAXOCCURRENCE
  • GAPCOUNT
  • NONGAPCOUNT
  • INTVLCOUNT
  • MILLISECCOUNT
  • NONGAPMILLISECCOUNT
flatten
optional
Set to true or false. If true, the component layer is flattened.
requestTimeZoneId
optional
The time zone of the request. Mandatory if the cycle and numIntvls parameters are passed in.
numIntvls
optional
If numIntvls is passed in then the endDate will be derived using the  passed in cycle and startDate. If startDate is missing then it will be derived using numIntvls, cycle, and endDate.

Example Requests

http://grovestreams.com:80/api/component/c7782a07-d12b-45d1-845a-5ec2e2160696/feed/7039044e-055f-40d5-b92c-5f2171434cd1/?startDate=1319048100000&endDate=1319049000000&intvlDates=return&stats=AVG

Response Body
{
  "message": "",
  "feed": {
    "requestStartDate": 1319048100000,
    "component": [
      {
        "stream": [
          {
            "statistic": [
              {
                "name": "AVG",
                "data": [
                  11.830769230769231,
                  12.654545454545454,
                  16.6625
                ],
                "type": "DOUBLE"
              }
            ],
            "intvlStartDate": [
              1319048100000,
              1319048400000,
              1319048700000
            ],
            "completedDate": 1319049100000,
            "cycleUid": "75ee104d-a73c-4633-88aa-476e46240d95",
            "lastValueType": "FLOAT",
            "intvlEndDate": [
              1319048400000,
              1319048700000,
              1319049000000
            ],
             "streamType" : "intvl_stream",
            "streamUid": "7039044e-055f-40d5-b92c-5f2171434cd1",
            "lastUpdated": 1319049093424,
            "lastValue": 24.399999618530273
          }
        ],
        "componentUid": "c7782a07-d12b-45d1-845a-5ec2e2160696"
      }
    ],
    "requestEndDate": 1319049000000
  },
  "success": true
}


DELETE component/{componentUid}/feed



Deletes a range of intervals for all streams of a component.

The range can be any range even if it falls outside the range of existing interval data. No errors will be returned even if this occurs.
Resource Information
Rate Limited?

session, oauth and org tokens compatible?
Yes
api_key token compatible
Yes


Resource URL

http://grovestreams.com/api/component/{componentUid}/feed

Parameters

startDate
optional
The start datetime (epoch millis) of the range request - inclusive. GroveStreams will round to the start of the interval it falls within.
endDate
optional
The end datetime (epoch mills) of the range request - exclusive. GroveStreams will round to the end of the interval it falls within for interval streams.

If both startDate and endDate parameters are missing then all intervals will be deleted.

Example Requests

/component/54a0a38a-5dbe-4610-a4b5-1645fe2ead57/feed?startDate=1316667600000&endDate=1316668500319

Response Body
{
  "message": "",
  "success": true
}



DELETE component/{componentUid}/feed/{streamUid}



Deletes a range of intervals for a component stream.

The range can be any range even if it falls outside the range of existing interval data. No errors will be returned even if this occurs.
Resource Information
Rate Limited?

session, oauth and org tokens compatible?
Yes
api_key token compatible
Yes


Resource URL

http://grovestreams.com/api/component/{componentUid}/feed/{streamUid}

Parameters

startDate
optional
The start datetime (epoch millis) of the range request - inclusive. GroveStreams will round to the start of the interval it falls within.
endDate
optional
The end datetime (epoch mills) of the range request - exclusive. GroveStreams will round to the end of the interval it falls within.

If both startDate and endDate parameters are missing then all intervals will be deleted.

Example Requests

/component/54a0a38a-5dbe-4610-a4b5-1645fe2ead57/feed/988f36fe-8ec5-49bb-a7d5-157a85e5e94d?startDate=1316667600000&endDate=1316668500319

Response Body
{
  "message": "",
  "success": true
}