Component Template Resource

A component_template resource is used to create many components that have the same attributes. For example, an organization might be installing many smart plug sensors. They don't want to manually create a component resource for every smart plug. They can create one component_template resource and create all smart plug component instances from that template.


Today, once a component is created from a component_template it is not linked to that component_template. Changes to the component_template will not be applied to all components that were created from it.

GET component_template



Returns a list of component_template resources. Component templates can also be referenced by a component_template_folder folder. Use the component_template_folder resource to add or remove a template from a folder. Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token token compatible? Yes

Resource URL

http://grovestreams.com/api/component_template

Parameters

none


Example Requests

/component_templateResponse Body
{
  "message": "",
  "component_template": [
    {
      "uid": "0419e300-c04f-4fac-9764-10b611ced91e",
      "name": "Acme light sensor template",
    },
    {
      "uid": "0f30fb84-edc6-46e7-8003-f1192663a5f2",
      "name": "GroveStreams computer resource monitoring template",
    },
    {
      "uid": "23870361-ae59-4622-9938-2df3da07b06c",
      "name": "Electric Meter Model 143A2 template",
    }
  ],
  "totalCount": 3,
  "success": true
}


GET component_template/{component_templateUid}



Returns a component_template with the specified uid.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token compatible? Yes

Resource URL

http://grovestreams.com/api/component_template/{component_templateUid}

Parameters

none


Example Requests

/component_template/3851c1e5-5c58-490a-825c-8590632434b1

Response Body
{
  "message": "",
  "success": true,
  "component": {
    "id": "MAC_123",
    "uid": "900d6a66-fed5-4a48-a251-b0477661da50",
    "creationDate": 0,
    "stream": [
      {
        "baseCycle": {
          "cycle_range": [
           
          ],
          "referenceDate": "2011-01-01T00:00:00",
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2",
          "intvlSizeType": "SECOND",
          "description": "cycle description",
          "numSizeTypesPerIntvl": 1,
          "name": "Seconds",
          "estimatedIntervalSize": 1000,
          "timeZoneId": ""
        },
        "uid": "b01585b2-dca7-4c3e-9683-b980ce72d8c4",
        "startDate": 0,
        "rollup_calendar": {
          "uid": "11b0a967-a445-43b5-9af8-4f2a1bddd8c5",
          "name": "Years, Quarters, Months, Days, Hour, FiveMin"
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": "",
            "name": ""
          }
        },
        "devicePermType": "GET",
        "endDate": 0,
        "gap_filling": {
          "maxGapsToFill": 0,
          "gapFillType": "NONE"
        },
        "delete_profile": {
          "uid": "",
          "name": ""
        },
        "id": "",
        "unit": {
          "uid": "2f1f8839-ec0d-4dfc-9564-e04bf01ca05b",
          "symbol": " nm",
          "numberFormat": "0,000.00",
          "name": "Brightness",
          "booleanStyle": "ON_OFF",
          "symbolLocation": "AFTER"
        },
        "rollupMethod": "AVG",
        "completedDate": 0,
        "streamDerivationType": "NONE",
        "description": "",
        "name": "light",
        "valueType": "FLOAT",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        },
        "timeZoneId": "UTC"
      },
      {
        "baseCycle": {
          "cycle_range": [
           
          ],
          "referenceDate": "2011-01-01T00:00:00",
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2",
          "intvlSizeType": "SECOND",
          "description": "cycle description",
          "numSizeTypesPerIntvl": 1,
          "name": "Seconds",
          "estimatedIntervalSize": 1000,
          "timeZoneId": ""
        },
        "uid": "036d9dde-b410-43dc-8a4d-785940528c9f",
        "startDate": 0,
        "rollup_calendar": {
          "uid": "11b0a967-a445-43b5-9af8-4f2a1bddd8c5",
          "name": "Years, Quarters, Months, Days, Hour, FiveMin"
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": "",
            "name": ""
          }
        },
        "devicePermType": "GET",
        "endDate": 0,
        "gap_filling": {
          "maxGapsToFill": 0,
          "gapFillType": "NONE"
        },
        "delete_profile": {
          "uid": "",
          "name": ""
        },
        "id": "",
        "unit": {
          "uid": "8efe14fa-8d0f-4d66-8633-520cadfb7080",
          "symbol": "C",
          "numberFormat": "0,000.00",
          "name": "Celsius",
          "booleanStyle": "ON_OFF",
          "symbolLocation": "AFTER"
        },
        "rollupMethod": "AVG",
        "completedDate": 0,
        "streamDerivationType": "NONE",
        "description": "",
        "name": "temperature",
        "valueType": "FLOAT",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        },
        "timeZoneId": "UTC"
      },
      {
        "baseCycle": {
          "cycle_range": [
           
          ],
          "referenceDate": "2011-01-01T00:00:00",
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2",
          "intvlSizeType": "SECOND",
          "description": "cycle description",
          "numSizeTypesPerIntvl": 1,
          "name": "Seconds",
          "estimatedIntervalSize": 1000,
          "timeZoneId": ""
        },
        "uid": "78fa2d43-816d-41d0-a379-300bd6e936ca",
        "startDate": 0,
        "rollup_calendar": {
          "uid": "",
          "name": ""
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": "",
            "name": ""
          }
        },
        "devicePermType": "GET",
        "endDate": 0,
        "gap_filling": {
          "maxGapsToFill": 0,
          "gapFillType": "NONE"
        },
        "delete_profile": {
          "uid": "",
          "name": ""
        },
        "id": "",
        "unit": {
          "uid": "3b160a5e-73d2-46c6-ac5e-a1dbf0430687",
          "symbol": "",
          "numberFormat": "0,000.00",
          "name": "No Symbol",
          "booleanStyle": "ON_OFF",
          "symbolLocation": "AFTER"
        },
        "rollupMethod": "AVG",
        "completedDate": 0,
        "streamDerivationType": "NONE",
        "description": "",
        "name": "low_battery",
        "valueType": "BOOLEAN",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        },
        "timeZoneId": "UTC"
      }
    ],
    "location": {
      "postalCode": "20024-3210",
      "hasAltitude": false,
      "description": "",
      "altitude": 0,
      "street": "300 E Street SW",
      "stateOrProvince": "DC",
      "longitude": -94.15644,
      "latitude": 47.196342,
      "country": "United States",
      "city": "Washington"
    },
    "description": "",
    "name": "light and humidity sensor",
    "ownerUser": {
      "uid": "89ec79e6-4d0b-4abd-9172-2296f4703812",
      "name": "Fred Flintstone"
    },
    "disposition": "FIXED",
    "timeZoneId": "US/Eastern"
  }
}

GET component_template/{component_templateId}



Returns a component_template with the specified id. Ensure component_templateId is encoded.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token compatible? Yes

Resource URL

http://grovestreams.com/api/component_template/{component_templateId}

Parameters

none


Example Requests

/component_template/Acme light sensor template

Response Body
{
  "message": "",
  "success": true,
  "component_template": {
    "id": "MAC_123",
    "uid": "900d6a66-fed5-4a48-a251-b0477661da50",
    "version": "0",
    "creationDate": 0,
    "stream": [
      {
        "baseCycle": {
          "cycle_range": [
           
          ],
          "referenceDate": "2011-01-01T00:00:00",
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2",
          "intvlSizeType": "SECOND",
          "description": "cycle description",
          "numSizeTypesPerIntvl": 1,
          "name": "Seconds",
          "estimatedIntervalSize": 1000,
          "timeZoneId": ""
        },
        "uid": "b01585b2-dca7-4c3e-9683-b980ce72d8c4",
        "startDate": 0,
        "rollup_calendar": {
          "uid": "11b0a967-a445-43b5-9af8-4f2a1bddd8c5",
          "name": "Years, Quarters, Months, Days, Hour, FiveMin"
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": "",
            "name": ""
          }
        },
        "devicePermType": "GET",
        "endDate": 0,
        "gap_filling": {
          "maxGapsToFill": 0,
          "gapFillType": "NONE"
        },
        "delete_profile": {
          "uid": "",
          "name": ""
        },
        "id": "",
        "unit": {
          "uid": "2f1f8839-ec0d-4dfc-9564-e04bf01ca05b",
          "symbol": " nm",
          "numberFormat": "0,000.00",
          "name": "Brightness",
          "booleanStyle": "ON_OFF",
          "symbolLocation": "AFTER"
        },
        "rollupMethod": "AVG",
        "completedDate": 0,
        "streamDerivationType": "NONE",
        "description": "",
        "name": "light",
        "valueType": "FLOAT",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        },
        "timeZoneId": "UTC"
      },
      {
        "baseCycle": {
          "cycle_range": [
           
          ],
          "referenceDate": "2011-01-01T00:00:00",
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2",
          "intvlSizeType": "SECOND",
          "description": "cycle description",
          "numSizeTypesPerIntvl": 1,
          "name": "Seconds",
          "estimatedIntervalSize": 1000,
          "timeZoneId": ""
        },
        "uid": "036d9dde-b410-43dc-8a4d-785940528c9f",
        "startDate": 0,
        "rollup_calendar": {
          "uid": "11b0a967-a445-43b5-9af8-4f2a1bddd8c5",
          "name": "Years, Quarters, Months, Days, Hour, FiveMin"
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": "",
            "name": ""
          }
        },
        "devicePermType": "GET",
        "endDate": 0,
        "gap_filling": {
          "maxGapsToFill": 0,
          "gapFillType": "NONE"
        },
        "delete_profile": {
          "uid": "",
          "name": ""
        },
        "id": "",
        "unit": {
          "uid": "8efe14fa-8d0f-4d66-8633-520cadfb7080",
          "symbol": "C",
          "numberFormat": "0,000.00",
          "name": "Celsius",
          "booleanStyle": "ON_OFF",
          "symbolLocation": "AFTER"
        },
        "rollupMethod": "AVG",
        "completedDate": 0,
        "streamDerivationType": "NONE",
        "description": "",
        "name": "temperature",
        "valueType": "FLOAT",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        },
        "timeZoneId": "UTC"
      },
      {
        "baseCycle": {
          "cycle_range": [
           
          ],
          "referenceDate": "2011-01-01T00:00:00",
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2",
          "intvlSizeType": "SECOND",
          "description": "cycle description",
          "numSizeTypesPerIntvl": 1,
          "name": "Seconds",
          "estimatedIntervalSize": 1000,
          "timeZoneId": ""
        },
        "uid": "78fa2d43-816d-41d0-a379-300bd6e936ca",
        "startDate": 0,
        "rollup_calendar": {
          "uid": "",
          "name": ""
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": "",
            "name": ""
          }
        },
        "devicePermType": "GET",
        "endDate": 0,
        "gap_filling": {
          "maxGapsToFill": 0,
          "gapFillType": "NONE"
        },
        "delete_profile": {
          "uid": "",
          "name": ""
        },
        "id": "",
        "unit": {
          "uid": "3b160a5e-73d2-46c6-ac5e-a1dbf0430687",
          "symbol": "",
          "numberFormat": "0,000.00",
          "name": "No Symbol",
          "booleanStyle": "ON_OFF",
          "symbolLocation": "AFTER"
        },
        "rollupMethod": "AVG",
        "completedDate": 0,
        "streamDerivationType": "NONE",
        "description": "",
        "name": "low_battery",
        "valueType": "BOOLEAN",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        },
        "timeZoneId": "UTC"
      }
    ],
    "location": {
      "postalCode": "20024-3210",
      "hasAltitude": false,
      "description": "",
      "altitude": 0,
      "street": "300 E Street SW",
      "stateOrProvince": "DC",
      "longitude": -94.15644,
      "latitude": 47.196342,
      "country": "United States",
      "city": "Washington"
    },
    "description": "",
    "name": "light and humidity sensor",
    "ownerUser": {
      "uid": "89ec79e6-4d0b-4abd-9172-2296f4703812",
      "name": "Fred Flintstone"
    },
    "disposition": "FIXED",
    "timeZoneId": "US/Eastern"
  }
}

GET component_template/new



Returns a default component_template with a unique UID. Does not persist the new component_template in the store. It's the callers responsibility to PUT the new component_template and register it.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token compatible Yes

Resource URL

http://grovestreams.com/api/component_template/new

Parameters

none

Example Requests

/component_template/new

Response Body
{
  "message": "",
  "success": true,
  "component_template": {
    "uid": "9f53ea01-070d-401e-a708-25726a249d2d",
    "stream": [
     
    ],
    "location": {
      "postalCode": "",
      "hasAltitude": false,
      "description": "",
      "altitude": 0,
      "street": "",
      "stateOrProvince": "",
      "longitude": 0,
      "latitude": 0,
      "country": "",
      "city": ""
    },
    "ownerUser": {
      "uid": "",
      "name": ""
    },
    "version": 0,
    "id": "",
    "creationDate": 1316462069063,
    "description": "",
    "name": "",
    "disposition": "FIXED",
    "timeZoneId": ""
  }
}




PUT component_template



Inserts a new component_template.

The uid of the component_template can be blank. If it is blank a uid will be created on the server and the response body will contain the new uid.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token compatible Yes

Resource URL

http://grovestreams.com/api/component_template

Parameters

parentFolderUid optional
The UID of the tools content repository folder to place this new component_template into. The new component_template will be placed into the root folder if this parameter is missing.

Example Requests

/component_template

Request Body
{
  "component_template": {
    "id": "MAC_1234",
    "uid": "fd1e1906-1049-4aaf-8e58-2630b607bf07",
    "creationDate": 0,
    "stream": [
      {
        "baseCycle": {
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2"
        },
        "uid": "c62c4098-3a84-4088-a3dd-b0dc3514cbf5"
        "rollup_calendar": {
          "uid": "11b0a967-a445-43b5-9af8-4f2a1bddd8c5"
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": ""
          }
        },
        "devicePermType": "GET",
        "gap_filling": {
          "maxGapsToFill": 100,
          "gapFillType": "PREVIOUS_VAL"
        },
        "delete_profile": {
          "uid": ""
        },
        "id": "",
        "unit": {
          "uid": "2f1f8839-ec0d-4dfc-9564-e04bf01ca05b"
        },
        "rollupMethod": "AVG",
        "streamDerivationType": "NONE",
        "description": "",
        "name": "light",
        "valueType": "FLOAT",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        }
      },
      {
        "baseCycle": {
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2""
        },
        "uid": "20747785-068f-4fc2-beb1-82835a46b245"
        "rollup_calendar": {
          "uid": "11b0a967-a445-43b5-9af8-4f2a1bddd8c5"
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": ""
          }
        },
        "devicePermType": "GET",
        "gap_filling": {
          "maxGapsToFill": 50,
          "gapFillType": "AVG"
        },
        "delete_profile": {
          "uid": ""
        },
        "id": "",
        "unit": {
          "uid": "8efe14fa-8d0f-4d66-8633-520cadfb7080"
        },
        "rollupMethod": "AVG",
        "streamDerivationType": "NONE",
        "description": "",
        "name": "temperature",
        "valueType": "FLOAT",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        }
      },
      {
        "baseCycle": {
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2"
        },
        "uid": "c1475a99-ec85-4b08-9cde-1b3270e470a9",
        "rollup_calendar": {
          "uid": "11b0a967-a445-43b5-9af8-4f2a1bddd8c5"
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": ""
          }
        },
        "devicePermType": "GET",
        "gap_filling": {
          "maxGapsToFill": 3,
          "gapFillType": "MAX"
        },
        "delete_profile": {
          "uid": ""
        },
        "id": "",
        "unit": {
          "uid": "dd47299c-5649-46e4-aa10-28febbc5cd1a"
        },
        "rollupMethod": "AVG",
        "streamDerivationType": "NONE",
        "description": "",
        "name": "current",
        "valueType": "FLOAT",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        }
      },
      {
        "baseCycle": {
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2"
        },
        "uid": "688f2f6b-db43-44f8-8b4d-7e01d6bb517f",
        "rollup_calendar": {
          "uid": "11b0a967-a445-43b5-9af8-4f2a1bddd8c5"
        },
        "intvl_expression": {
          "expression": "(current * 120 / (3600 * 1000)) * costPerKwh",
          "dependent": [
            {
              "dependentUid": "c1475a99-ec85-4b08-9cde-1b3270e470a9",
              "dependentName": "",
              "streamIntvlOffset": 0,
              "cycleName": "",
              "componentName": "",
              "cycleUid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2",
              "dependentType": "stream",
              "functionType": "NONE",
              "name": "current",
              "componentUid": "fd1e1906-1049-4aaf-8e58-2630b607bf07",
              "time_filter": [
               
              ]
            },
            {
              "dependentUid": "9b73dd8d-3c28-493b-9295-a5d78321cd2a",
              "dependentName": "",
              "streamIntvlOffset": 0,
              "cycleName": "",
              "componentName": "",
              "cycleUid": "",
              "dependentType": "stream",
              "functionType": "NONE",
              "name": "costPerKwh",
              "componentUid": "fd1e1906-1049-4aaf-8e58-2630b607bf07",
              "time_filter": [
               
              ]
            }
          ],
          "effectiveDate": 1316391359973
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": ""
          }
        },
        "devicePermType": "GET"
        "gap_filling": {
          "maxGapsToFill": 0,
          "gapFillType": "NONE"
        },
        "delete_profile": {
          "uid": ""
        },
        "id": "",
        "unit": {
          "uid": "ec7d4c63-2caf-4d84-8fc3-e4bec3a2ede1"
        },
        "rollupMethod": "AVG",
        "streamDerivationType": "FROM_EXPRESSION",
        "description": "",
        "name": "cost",
        "valueType": "FLOAT",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        }
      },
      {
        "baseCycle": {
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2"
        },
        "uid": "362973e4-0350-4d66-bbd1-8ff46c47ca46",
        "rollup_calendar": {
          "uid": "11b0a967-a445-43b5-9af8-4f2a1bddd8c5"
        },
        "intvl_expression": {
          "expression": "(if(isNull(currentMinus0), 0, currentMinus0) + if(isNull(currentMinus1), 0, currentMinus1) + if(isNull(currentMinus2), 0, currentMinus2))/3",
          "dependent": [
            {
              "dependentUid": "c1475a99-ec85-4b08-9cde-1b3270e470a9",
              "dependentName": "",
              "streamIntvlOffset": 0,
              "cycleName": "",
              "componentName": "",
              "cycleUid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2",
              "dependentType": "stream",
              "functionType": "NONE",
              "name": "currentMinus0",
              "componentUid": "fd1e1906-1049-4aaf-8e58-2630b607bf07",
              "time_filter": [
               
              ]
            },
            {
              "dependentUid": "c1475a99-ec85-4b08-9cde-1b3270e470a9",
              "dependentName": "",
              "streamIntvlOffset": -1,
              "cycleName": "",
              "componentName": "",
              "cycleUid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2",
              "dependentType": "stream",
              "functionType": "NONE",
              "name": "currentMinus1",
              "componentUid": "fd1e1906-1049-4aaf-8e58-2630b607bf07",
              "time_filter": [
               
              ]
            },
            {
              "dependentUid": "c1475a99-ec85-4b08-9cde-1b3270e470a9",
              "dependentName": "",
              "streamIntvlOffset": -2,
              "cycleName": "",
              "componentName": "",
              "cycleUid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2",
              "dependentType": "stream",
              "functionType": "NONE",
              "name": "currentMinus2",
              "componentUid": "fd1e1906-1049-4aaf-8e58-2630b607bf07",
              "time_filter": [
               
              ]
            }
          ],
          "effectiveDate": 1316391300973,
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": ""
          }
        },
        "devicePermType": "GET",
        "gap_filling": {
          "maxGapsToFill": 0,
          "gapFillType": "NONE"
        },
        "delete_profile": {
          "uid": ""
        },
        "id": "",
        "unit": {
          "uid": "dd47299c-5649-46e4-aa10-28febbc5cd1a"
        },
        "rollupMethod": "AVG",
        "streamDerivationType": "FROM_EXPRESSION",
        "description": "",
        "name": "current - Rolling 3pt Avg",
        "valueType": "FLOAT",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        }
      },
      {
        "baseCycle": {
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2"
        },
        "uid": "9dbfbc11-50f6-4991-a83c-fd4daded6595",
        "rollup_calendar": {
          "uid": "11b0a967-a445-43b5-9af8-4f2a1bddd8c5"
        },
        "intvl_expression": {
          "expression": "cost / sqFeet",
          "dependent": [
            {
              "dependentUid": "688f2f6b-db43-44f8-8b4d-7e01d6bb517f",
              "dependentName": "",
              "streamIntvlOffset": 0,
              "cycleName": "",
              "componentName": "",
              "cycleUid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2",
              "dependentType": "stream",
              "functionType": "NONE",
              "name": "cost",
              "componentUid": "fd1e1906-1049-4aaf-8e58-2630b607bf07",
              "time_filter": [
               
              ]
            },
            {
              "dependentUid": "2e473282-cf8e-451b-9476-d8f430ed5a33",
              "dependentName": "",
              "streamIntvlOffset": 0,
              "cycleName": "",
              "componentName": "",
              "cycleUid": "",
              "dependentType": "stream",
              "functionType": "NONE",
              "name": "sqFeet",
              "componentUid": "fd1e1906-1049-4aaf-8e58-2630b607bf07",
              "time_filter": [
               
              ]
            }
          ],
          "effectiveDate": 1316391300973
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": ""
          }
        },
        "devicePermType": "GET",
        "gap_filling": {
          "maxGapsToFill": 0,
          "gapFillType": "NONE"
        },
        "delete_profile": {
          "uid": ""
        },
        "id": "",
        "unit": {
          "uid": "ec7d4c63-2caf-4d84-8fc3-e4bec3a2ede1"
        },
        "rollupMethod": "AVG",
        "streamDerivationType": "FROM_EXPRESSION",
        "description": "",
        "name": "cost per sq feet",
        "valueType": "FLOAT",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        }
      },
      {
        "baseCycle": {
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2"
        },
        "uid": "90c5b3c4-ce8a-4169-ba45-57ef1b0019f1",
        "rollup_calendar": {
          "uid": ""
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": ""
          }
        },
        "devicePermType": "SET",
        "gap_filling": {
          "maxGapsToFill": 0,
          "gapFillType": "NONE"
        },
        "delete_profile": {
          "uid": ""
        },
        "id": "",
        "unit": {
          "uid": "3b160a5e-73d2-46c6-ac5e-a1dbf0430687"
        },
        "rollupMethod": "AVG",
        "streamDerivationType": "NONE",
        "description": "",
        "name": "power_on",
        "valueType": "BOOLEAN",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        }
      }
    ],
    "location": {
      "postalCode": "",
      "hasAltitude": false,
      "description": "Cabin Refridgerator",
      "altitude": 0,
      "street": "",
      "stateOrProvince": "",
      "longitude": -94.25591776794431,
      "latitude": 47.262320232064745,
      "country": "",
      "city": ""
    },
    "description": "Smart Plug that measures light, temp, current. Cost and rolling 3pt Avg are derived.",
    "name": "smartplug",
    "ownerUser": {
      "uid": "89ec79e6-4d0b-4abd-9172-2296f4703812"
    },
    "disposition": "FIXED",
    "timeZoneId": "US/Central"
  }
}


POST component_template



Used to update an existing component_template.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token compatible Yes

Resource URL

http://grovestreams.com/api/component_template

Parameters

none

Example Requests

/component_template

Request Body
{
  "component_template": {
    "id": "MAC_1234",
    "uid": "fd1e1906-1049-4aaf-8e58-2630b607bf07",
    "creationDate": 0,
    "stream": [
      {
        "baseCycle": {
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2"
        },
        "uid": "c62c4098-3a84-4088-a3dd-b0dc3514cbf5"
        "rollup_calendar": {
          "uid": "11b0a967-a445-43b5-9af8-4f2a1bddd8c5"
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": ""
          }
        },
        "devicePermType": "GET",
        "gap_filling": {
          "maxGapsToFill": 100,
          "gapFillType": "PREVIOUS_VAL"
        },
        "delete_profile": {
          "uid": ""
        },
        "id": "",
        "unit": {
          "uid": "2f1f8839-ec0d-4dfc-9564-e04bf01ca05b"
        },
        "rollupMethod": "AVG",
        "streamDerivationType": "NONE",
        "description": "",
        "name": "light",
        "valueType": "FLOAT",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        }
      },
      {
        "baseCycle": {
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2""
        },
        "uid": "20747785-068f-4fc2-beb1-82835a46b245"
        "rollup_calendar": {
          "uid": "11b0a967-a445-43b5-9af8-4f2a1bddd8c5"
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": ""
          }
        },
        "devicePermType": "GET",
        "gap_filling": {
          "maxGapsToFill": 50,
          "gapFillType": "AVG"
        },
        "delete_profile": {
          "uid": ""
        },
        "id": "",
        "unit": {
          "uid": "8efe14fa-8d0f-4d66-8633-520cadfb7080"
        },
        "rollupMethod": "AVG",
        "streamDerivationType": "NONE",
        "description": "",
        "name": "temperature",
        "valueType": "FLOAT",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        }
      },
      {
        "baseCycle": {
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2"
        },
        "uid": "c1475a99-ec85-4b08-9cde-1b3270e470a9",
        "rollup_calendar": {
          "uid": "11b0a967-a445-43b5-9af8-4f2a1bddd8c5"
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": ""
          }
        },
        "devicePermType": "GET",
        "gap_filling": {
          "maxGapsToFill": 3,
          "gapFillType": "MAX"
        },
        "delete_profile": {
          "uid": ""
        },
        "id": "",
        "unit": {
          "uid": "dd47299c-5649-46e4-aa10-28febbc5cd1a"
        },
        "rollupMethod": "AVG",
        "streamDerivationType": "NONE",
        "description": "",
        "name": "current",
        "valueType": "FLOAT",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        }
      },
      {
        "baseCycle": {
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2"
        },
        "uid": "688f2f6b-db43-44f8-8b4d-7e01d6bb517f",
        "rollup_calendar": {
          "uid": "11b0a967-a445-43b5-9af8-4f2a1bddd8c5"
        },
        "intvl_expression": {
          "expression": "(current * 120 / (3600 * 1000)) * costPerKwh",
          "dependent": [
            {
              "dependentUid": "c1475a99-ec85-4b08-9cde-1b3270e470a9",
              "dependentName": "",
              "streamIntvlOffset": 0,
              "cycleName": "",
              "componentName": "",
              "cycleUid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2",
              "dependentType": "stream",
              "functionType": "NONE",
              "name": "current",
              "componentUid": "fd1e1906-1049-4aaf-8e58-2630b607bf07",
              "time_filter": [
               
              ]
            },
            {
              "dependentUid": "9b73dd8d-3c28-493b-9295-a5d78321cd2a",
              "dependentName": "",
              "streamIntvlOffset": 0,
              "cycleName": "",
              "componentName": "",
              "cycleUid": "",
              "dependentType": "stream",
              "functionType": "NONE",
              "name": "costPerKwh",
              "componentUid": "fd1e1906-1049-4aaf-8e58-2630b607bf07",
              "time_filter": [
               
              ]
            }
          ],
          "effectiveDate": 1316391359973
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": ""
          }
        },
        "devicePermType": "GET"
        "gap_filling": {
          "maxGapsToFill": 0,
          "gapFillType": "NONE"
        },
        "delete_profile": {
          "uid": ""
        },
        "id": "",
        "unit": {
          "uid": "ec7d4c63-2caf-4d84-8fc3-e4bec3a2ede1"
        },
        "rollupMethod": "AVG",
        "streamDerivationType": "FROM_EXPRESSION",
        "description": "",
        "name": "cost",
        "valueType": "FLOAT",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        }
      },
      {
        "baseCycle": {
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2"
        },
        "uid": "362973e4-0350-4d66-bbd1-8ff46c47ca46",
        "rollup_calendar": {
          "uid": "11b0a967-a445-43b5-9af8-4f2a1bddd8c5"
        },
        "intvl_expression": {
          "expression": "(if(isNull(currentMinus0), 0, currentMinus0) + if(isNull(currentMinus1), 0, currentMinus1) + if(isNull(currentMinus2), 0, currentMinus2))/3",
          "dependent": [
            {
              "dependentUid": "c1475a99-ec85-4b08-9cde-1b3270e470a9",
              "dependentName": "",
              "streamIntvlOffset": 0,
              "cycleName": "",
              "componentName": "",
              "cycleUid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2",
              "dependentType": "stream",
              "functionType": "NONE",
              "name": "currentMinus0",
              "componentUid": "fd1e1906-1049-4aaf-8e58-2630b607bf07",
              "time_filter": [
               
              ]
            },
            {
              "dependentUid": "c1475a99-ec85-4b08-9cde-1b3270e470a9",
              "dependentName": "",
              "streamIntvlOffset": -1,
              "cycleName": "",
              "componentName": "",
              "cycleUid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2",
              "dependentType": "stream",
              "functionType": "NONE",
              "name": "currentMinus1",
              "componentUid": "fd1e1906-1049-4aaf-8e58-2630b607bf07",
              "time_filter": [
               
              ]
            },
            {
              "dependentUid": "c1475a99-ec85-4b08-9cde-1b3270e470a9",
              "dependentName": "",
              "streamIntvlOffset": -2,
              "cycleName": "",
              "componentName": "",
              "cycleUid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2",
              "dependentType": "stream",
              "functionType": "NONE",
              "name": "currentMinus2",
              "componentUid": "fd1e1906-1049-4aaf-8e58-2630b607bf07",
              "time_filter": [
               
              ]
            }
          ],
          "effectiveDate": 1316391300973,
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": ""
          }
        },
        "devicePermType": "GET",
        "gap_filling": {
          "maxGapsToFill": 0,
          "gapFillType": "NONE"
        },
        "delete_profile": {
          "uid": ""
        },
        "id": "",
        "unit": {
          "uid": "dd47299c-5649-46e4-aa10-28febbc5cd1a"
        },
        "rollupMethod": "AVG",
        "streamDerivationType": "FROM_EXPRESSION",
        "description": "",
        "name": "current - Rolling 3pt Avg",
        "valueType": "FLOAT",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        }
      },
      {
        "baseCycle": {
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2"
        },
        "uid": "9dbfbc11-50f6-4991-a83c-fd4daded6595",
        "rollup_calendar": {
          "uid": "11b0a967-a445-43b5-9af8-4f2a1bddd8c5"
        },
        "intvl_expression": {
          "expression": "cost / sqFeet",
          "dependent": [
            {
              "dependentUid": "688f2f6b-db43-44f8-8b4d-7e01d6bb517f",
              "dependentName": "",
              "streamIntvlOffset": 0,
              "cycleName": "",
              "componentName": "",
              "cycleUid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2",
              "dependentType": "stream",
              "functionType": "NONE",
              "name": "cost",
              "componentUid": "fd1e1906-1049-4aaf-8e58-2630b607bf07",
              "time_filter": [
               
              ]
            },
            {
              "dependentUid": "2e473282-cf8e-451b-9476-d8f430ed5a33",
              "dependentName": "",
              "streamIntvlOffset": 0,
              "cycleName": "",
              "componentName": "",
              "cycleUid": "",
              "dependentType": "stream",
              "functionType": "NONE",
              "name": "sqFeet",
              "componentUid": "fd1e1906-1049-4aaf-8e58-2630b607bf07",
              "time_filter": [
               
              ]
            }
          ],
          "effectiveDate": 1316391300973
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": ""
          }
        },
        "devicePermType": "GET",
        "gap_filling": {
          "maxGapsToFill": 0,
          "gapFillType": "NONE"
        },
        "delete_profile": {
          "uid": ""
        },
        "id": "",
        "unit": {
          "uid": "ec7d4c63-2caf-4d84-8fc3-e4bec3a2ede1"
        },
        "rollupMethod": "AVG",
        "streamDerivationType": "FROM_EXPRESSION",
        "description": "",
        "name": "cost per sq feet",
        "valueType": "FLOAT",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        }
      },
      {
        "baseCycle": {
          "uid": "6ff373a2-8efb-4ea7-9ec7-2d770bb980b2"
        },
        "uid": "90c5b3c4-ce8a-4169-ba45-57ef1b0019f1",
        "rollup_calendar": {
          "uid": ""
        },
        "constraints": {
          "min": 1,
          "minMaxHandlerType": "ADJUST_TO_GAP",
          "max": 1.7976931348623157E308,
          "rollupPercentSetToGap": 100,
          "time_filter": {
            "uid": ""
          }
        },
        "devicePermType": "SET",
        "gap_filling": {
          "maxGapsToFill": 0,
          "gapFillType": "NONE"
        },
        "delete_profile": {
          "uid": ""
        },
        "id": "",
        "unit": {
          "uid": "3b160a5e-73d2-46c6-ac5e-a1dbf0430687"
        },
        "rollupMethod": "AVG",
        "streamDerivationType": "NONE",
        "description": "",
        "name": "power_on",
        "valueType": "BOOLEAN",
        "visuals": {
          "defaultChartType": "COL_CHART",
          "hasAxisMinMax": false,
          "chartAxisMax": 200,
          "offset": 0,
          "multiplier": 1,
          "chartAxisMin": -200
        }
      }
    ],
    "location": {
      "postalCode": "",
      "hasAltitude": false,
      "description": "Cabin Refridgerator",
      "altitude": 0,
      "street": "",
      "stateOrProvince": "",
      "longitude": -94.25591776794431,
      "latitude": 47.262320232064745,
      "country": "",
      "city": ""
    },
    "description": "Smart Plug that measures light, temp, current. Cost and rolling 3pt Avg are derived.",
    "name": "smartplug",
    "ownerUser": {
      "uid": "89ec79e6-4d0b-4abd-9172-2296f4703812"
    },
    "disposition": "FIXED",
    "timeZoneId": "US/Central"
  }
}

DELETE component_template/{component_templateUid}



Deletes a component_template.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token compatible Yes

Resource URL

http://grovestreams.com/api/component_template/{component_templateUid}

Parameters

none

Example Requests

/component_template/d251a8f2-f7b9-4df7-886d-b24c7f4929d4

Response Body
{
    "message" : "Deleted component_template with uid 'd251a8f2-f7b9-4df7-886d-b24c7f4929d4'",
    "success" : true
}