Riptide Cloud API.
Project description
Riptide Cloud API
Installing
riptide-cloud is available using pip.
pip install riptide-cloud
Introduction
The APIs provided as part of the riptide-cloud package 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 to read information from the
Riptide cloud. No write/create is allowed (except watch where you are
allowed to create one-or-more watches to monitor points at the real-time).
The request and response payload are in JSON format. So the content-type
in the header would be application/json.
RiptideCloudApp
Create a JSON file with the following contents:
{
"auth": "Basic",
"username": "<username>",
"password": "<password>"
}
username and password should be a valid username and password provided
to you for accessing Riptide cloud.
Say you save this file as riptide.json and the full path to this file is
/tmp/riptide.json.
Create an instance of RiptideCloudApp with config_file=/tmp/riptide.json
from riptide.cloud.app import RiptideCloudApp
rca = RiptideCloudApp(config_file="/tmp/riptide.json")
NOTE: For all interactions with riptide cloud, you will use the
RiptideCloudApp instance rca.
Entity
Entity 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 as Riptide Entity URI. Riptide
uses uri (Uniform Resource Identifier) to represent site, equipments
and points in 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/Temperature
customer-nameisMcDonaldssite-nameisSan Bernardinoequipment-nameisWeatherproperty-typeisAIproperty-nameisTemperature
/McDonalds/San Bernardino/HVAC/Outdoor Unit - 05/properties/AI/Target Condensing Temperature
customer-nameisMcDonaldssite-nameisSan Bernardinopath-to-equipmentisHVACequipment-nameisOutdoor Unit - 05property-typeisAIproperty-nameisTarget Condensing Temperature
/McDonalds/San Bernardino/HVAC/Indoor Unit - 11/properties/AO/Set Temperature/priorityArray/10
customer-nameisMcDonaldssite-nameisSan Bernardinopath-to-equipmentisHVACequipment-nameisIndoor Unit - 11property-typeisAOproperty-nameisSet Temperaturepriority-levelis10
The 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 RECOMMENDED
Most of the entity APIs takes the entity url as input. The output of these
APIs varies based on the entity url.
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.3
Alarm
Alarm 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)
History
Riptide 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 of
identifiersthat 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)
Watch
You 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)
Support
For any support, please reach out to support@riptideio.com
END
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file riptide-cloud-0.0.2.tar.gz.
File metadata
- Download URL: riptide-cloud-0.0.2.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e4343049301d08b00ee8683f4f757061ea302ffaea5207a2737f6726c38fed0
|
|
| MD5 |
3191861fbaf6c145cdba8b9c24ff42ce
|
|
| BLAKE2b-256 |
64dc32008c42885ed2a1bf5766b65c7f5420a0b8b0961d0dc0cb5ec30f28cf5b
|
File details
Details for the file riptide_cloud-0.0.2-py3-none-any.whl.
File metadata
- Download URL: riptide_cloud-0.0.2-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d518a34947d8bc55eb88d386c5c34334ce16e0f7d9c1bfa8b7d200bcb6ca06a3
|
|
| MD5 |
c5b1a39ed0b2537137d3a75f8b0a7099
|
|
| BLAKE2b-256 |
c689845a38a49bd3c8a40a1fca6583029560d8697ae6178d5a793a2ad5bc5c02
|