Package: riptide-cloud
Riptide Cloud APIInstallingriptide-cloudis available using pip.pip install riptide-cloudIntroductionThe APIs provided as part of theriptide-cloudpackage can be used to read
the following information.entity(likesite,equipments,points, etc),alarms(a.k.a.alerts),history(past data about any entity),watch(list of entities that you are interested in watching), etc.Please note that the APIs can only be used toreadinformation from the
Riptide cloud. Nowrite/createis allowed (exceptwatchwhere you are
allowed tocreateone-or-more watches to monitor points at the real-time).The request and response payload are inJSONformat. So thecontent-typein the header would beapplication/json.RiptideCloudAppCreate aJSONfile with the following contents:{"auth":"Basic","username":"<username>","password":"<password>"}usernameandpasswordshould be a valid username and password provided
to you for accessing Riptide cloud.Say you save this file asriptide.jsonand the full path to this file is/tmp/riptide.json.Create an instance ofRiptideCloudAppwithconfig_file=/tmp/riptide.jsonfromriptide.cloud.appimportRiptideCloudApprca=RiptideCloudApp(config_file="/tmp/riptide.json")NOTE: For all interactions with riptide cloud, you will use theRiptideCloudAppinstancerca.EntityEntity APIs can be invoked as follows:rca.entity.get_entity(uri=<uri>)rca.entity.get_entity_tag(uri=<uri>, name=<tag-name>)rca.entity.get_entity_tags(uri=<uri>)rca.entity.entity_read_override(uri=<uri>)rca.entity.entity_read_override_at(uri=<uri>, level=<priority-level>)<uri>in the above API calls are called asRiptide Entity URI. Riptide
usesuri(Uniform Resource Identifier) to representsite,equipmentsandpointsin the following way./<customer-name>/<site-name>[/<path-to-equipment>]/<equipment-name>/properties/<property-type>/<property-name>[/presentValue | priorityArray[/<priorityLevel>]]The following are some of the examples./McDonalds/San Bernardino/Weather/properties/AI/Temperaturecustomer-nameisMcDonaldssite-nameisSan Bernardinoequipment-nameisWeatherproperty-typeisAIproperty-nameisTemperature/McDonalds/San Bernardino/HVAC/Outdoor Unit - 05/properties/AI/Target Condensing Temperaturecustomer-nameisMcDonaldssite-nameisSan Bernardinopath-to-equipmentisHVACequipment-nameisOutdoor Unit - 05property-typeisAIproperty-nameisTarget Condensing Temperature/McDonalds/San Bernardino/HVAC/Indoor Unit - 11/properties/AO/Set Temperature/priorityArray/10customer-nameisMcDonaldssite-nameisSan Bernardinopath-to-equipmentisHVACequipment-nameisIndoor Unit - 11property-typeisAOproperty-nameisSet Temperaturepriority-levelis10The following are syntactically valid examples./McDonalds/San Bernardino/HVAC/Indoor Unit - 11/properties/AO/Set Temperature/priorityArray/10/McDonalds/San Bernardino/HVAC/Indoor Unit - 11/properties/AO/Set Temperature/priorityArray/McDonalds/San Bernardino/HVAC/Indoor Unit - 11/properties/AO/Set Temperature/presentValue/McDonalds/San Bernardino/HVAC/Indoor Unit - 11/properties/AO/Set Temperature/McDonalds/San Bernardino/HVAC/Indoor Unit - 11/McDonalds/San Bernardino/HVAC/McDonalds/San Bernardino*/McDonalds** -> NOT RECOMMENDEDMost of theentityAPIs takes the entity url as input. The output of these
APIs varies based on the entityurl.For example:/priorityArraywould give the following output.{'1':None,'10':None,'11':None,'12':None,'13':None,'14':73,'15':None,'16':None,'2':None,'3':None,'4':None,'5':None,'6':73.5,'7':None,'8':None,'9':75,'relinquish':None}/presentValuewould give the following output.21.3AlarmAlarm APIs can be invoked as follows:rca.alarms.get_alarm(uuids, context)rca.alarms.get_alarm_history(uuids, context, start, end)To get more help on these APIs, you could type the following in your Python
terminal.help(rca.alarms.get_alarm)help(rca.alarms.get_alarm_history)HistoryRiptide cloud offers the following flavors of historic data.Raw Historic Data: The value of a point as recorded at the site at
various instances of time.Interpolated Historic Data: The value of a point as recorded at the site
at various instances of time and also the estimated or interpolated values
of the point for the missing periods by using re-sampling technique.Rolled-up Historic Data: The value of point condensed for a time period
(e.g. 1 day, 10 days, 1 week and so on).Digested Historic Data: The value of a point summarized over a period of
period of time (e.g. mean, sum, median and so on). This also allows user
to apply a function on every value of a point like say add, subtract etc.History APIs can be invoked as follows:rca.history.get_history(identifiers=[uri1, uri2 ... ], start=<datetime>, stop=<datetime>)Few important points to NOTE:identifiersare entity property uri's. It must not be site or equipment
uri's but only point uri's.Maximum number ofidentifiersthat are allowed per API call is 50.startandendaccepts onlydatetimeobjects;startshould be
lesser-than-or-equal-toendbut must not exceed 31 days.To get more help on the above API, you could type the following in your
Python terminal.help(rca.history.get_history)WatchYou can create a watch and then interacts with that watch to obtain the
latest readings associated with a group of entity properties.Watch APIs can be invoked as follows:rca.watch.create_watch(identifiers=[uri1, uri2 ... ])rca.watch.get_watches()rca.watch.poll_watch(watch_id=<watch-id>)rca.watch.poll_watch_changed(watch_id=<watch-id>)rca.watch.delete_watch(watch_id=<watch-id>)rca.watch.read_present_value(identifier=<entity-property-uri>)To get more help on the above API, you could type the following in your
Python terminal.help(rca.watch.create_watch)help(rca.watch.get_watches)help(rca.watch.poll_watch)help(rca.watch.poll_watch_changed)help(rca.watch.delete_watch)help(rca.watch.read_present_value)SupportFor any support, please reach out tosupport@riptideio.comEND