green-connectivity v1.0.4
green-connectivity
A connectivity manager agent for AWS Greengrass.
Current version: 1.0.2
Lead Maintainer: Halim Qarroum
Table of contents
Install
green add npm://green-connectivity
Description
This application acts as a connectivity monitoring agent for AWS Greengrass applications. It exposes an event-based API that can return information about the state of network connectivity associated with an AWS Greengrass Core. It also publishes events on the Greengrass local message broker about state changes related to the network connectivity.
Green applications can use green-connectivity
to get informed when Internet connectivity is lost or regained in order to cope with an Internet-less situation.
API
This application exposes an Expressify API which is accessible from any green application locally, but also from the AWS IoT Core service from the cloud remotely. The available API endpoints are documented and described below.
Method | Resource | Return code(s) | Payload required | Description |
---|---|---|---|---|
GET | /status | 200 | No | Using this route, green applications can query the green-connectivity application for the current connectivity status. |
SUBSCRIBE | /status | 200 | No | Using this route, green applications can subscribe to changes impacting the current connectivity status. |
Events
While application can retrieve on demand the current connectivity status, they can also be advertised of any change in the connectivity state by listening, using Expressify, on the /status
resource as stated in the API section, which will emit a connectivity.state.change
event whenever the connectivity state has changed.
For more information on how to call an Expressify endpoint and subsribe to resources, please read the documentation associated with the expressify
framework, and its associated expressify-mqtt
strategy which is used in green applications.
See also
- The green-cli command-line tool.
- The green-sdk software development kit for green applications.
- The Expressify framework.