awsiot

package
v0.5.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2019 License: BSD-3-Clause Imports: 8 Imported by: 0

README


title: AWS IoT weight: 4605

AWS IoT

This activity allows you to update a device shadow on AWS.

Installation

Flogo Web

This activity comes out of the box with the Flogo Web UI

Flogo CLI

flogo add activity github.com/TIBCOSoftware/flogo-contrib/activity/awsiot

Schema

Inputs and Outputs:

{
  "input":[
    {
      "name": "thingName",
      "type": "string",
      "required": true
    },
    {
      "name": "awsEndpoint",
      "type": "string",
      "required": true
    },
    {
      "name": "desired",
      "type": "params"
    },
    {
      "name": "reported",
      "type": "params"
    }
  ]
}

Settings

Setting Required Description
thingName True The name of the "thing" in Aws IoT
awsEndpoint True The Aws Iot Endpoint for the account
desired False The desired state to update
reported False The reported state to update

Configuration

Certificate Installation

The activity looks for the AWS device certificates in a "things" directory relative to where the engine was started. Download the root CA certificate file and save it as "things/root-CA.pem.crt". Now place the cert and private key generated by Aws IoT for your thing under "things/[thingName]" as device.pem.crt and device.pem.key respectively.

Flow Configuration

Configure a task in flow to update the device shadow of 'raspberry-pi' with a reported temp of "50".

{
  "id": "awsiot_1",
  "name": "Update AWS Device Shadow",
  "description": "Simple AWS IoT",
  "activity": {
    "ref": "github.com/TIBCOSoftware/flogo-contrib/activity/awsiot",
    "input": {
      "thingName": "raspberry-pi",
      "awsEndpoint": "A3CWMRYOWXFD7I.iot.us-west-2.amazonaws.com",
      "reported": { "temp":"50" }
    }
  }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewActivity

func NewActivity(metadata *activity.Metadata) activity.Activity

NewActivity creates a new AwsIoT activity

func NewTLSConfig

func NewTLSConfig(thingName string) *tls.Config

NewTLSConfig creates a TLS configuration for the specified 'thing'

func Publish

func Publish(client MQTT.Client, topic string, qos int, input string) error

Publish publishes a client message

Types

type AwsIoT

type AwsIoT struct {
	// contains filtered or unexported fields
}

AwsIoT is an Activity that is used to update an Aws IoT device shadow inputs : {method,uri,params} outputs: {result}

func (*AwsIoT) Eval

func (a *AwsIoT) Eval(context activity.Context) (done bool, err error)

Eval implements api.Activity.Eval - Invokes a Aws Iot Shadow Update

func (*AwsIoT) Metadata

func (a *AwsIoT) Metadata() *activity.Metadata

Metadata returns the activity's metadata

type ShadowRequest

type ShadowRequest struct {
	State *ShadowState `json:"state"`
}

ShadowRequest is a simple structure representing a Aws Shadow Update Request

type ShadowState

type ShadowState struct {
	Desired  map[string]string `json:"desired,omitempty"`
	Reported map[string]string `json:"reported,omitempty"`
}

ShadowState is the state to be updated

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL