Working with Data in the Cloud

A key aspect of Octave is the ability to write cloud-side logic, and this is done by implementing a Cloud Action.

A Cloud Action transforms Events and routes them between Streams or to your own cloud endpoint. Transformations are done via JavaScript that you embed your Cloud Actions.

Cloud Actions work similarly to Edge Actions, in that their logic exists as JavaScript functions, but the "trigger" is an Event being created in a Cloud Stream. The underlying Stream source for a Cloud Action can be a "single Stream" (i.e., from a device or manually created), or a Tag + a stream name. The latter is used for processing data from multiple tagged devices in the same fashion, and is a key way to aggregate device data before sending it to a third-party cloud service.

Just as an Edge Action can read data from the Resources in the edge context, Cloud Actions can read, process, and write data in the cloud context. In the cloud, they have access to read and write data from other Streams as well as the ability to publish or consume data from external services using REST requests (i.e., making HTTP GET/POST requests to read/write using third-party APIs).

A Cloud Action can return Events to a static Stream (e.g., to track the status of a process) or to a dynamically-generated Stream (typically a specific device command Stream to send data to a given device).

The following topics describe how to manage, transform, and work with data from an Octave Edge Device in the cloud using a Cloud Action:

  1. Cloud Actions Getting started videos: videos that provide an overview of Cloud Actions.
  2. Creating a Cloud Action: write cloud-side logic to handle Events.
  3. Adding a new Stream: create a stream to store data on the cloud side.
  4. Setting a Value From a Cloud Action: set the value on an Octave edge device from the cloud.
  5. Simple Forwarding: forward/create events in another Stream.
  6. Transforming Events: create a new Event using the data from an existing Event.
  7. Using Events from Other Streams: methods to find information about one or more events.
  8. Aggregating Events with Tag Actions: use the same Cloud Action logic on a given stream across multiple Octave edge devices.
  9. Cloud Initiated Streams: sending new Events in Streams from the cloud.

You can also use the following methods to work with data in the cloud:

  • Cloud Connectors: use a Cloud Connector to push Events to an external system. A Cloud Connector is like a Cloud Action, but is used purely to send Event data to specific types of external systems (e.g., REST end points, Azure IoT Hub, etc.) while transforming events into (JSON) messages that can be understood by those systems, and providing resiliency (I.e., the ability to retry when the external system is down). For more information see Pushing Events via Cloud Connectors.
  • Tasks: use a Task to periodically pull data from external systems and "inject" it into Octave as Events.