1.0.7 • Published 6 years ago

green-alerts v1.0.7

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

green-alerts

An alerting managemement hub for AWS Greengrass.

Green application CodeFactor

Current version: 1.0.7

Lead Maintainer: Halim Qarroum

Table of contents

Install

green add npm://green-alerts

Features

  • Centralizes the alerts emitted by green applications.
  • Exposes the registered alerts to green applications, or the cloud.
  • Works offline, and syncs the alerts with AWS IoT when Internet connectivity is available.
  • Notifies listeners of newly created alerts

Description

The alerting agent for AWS Greengrass is built to receive, store and expose alerts from third party applications over Expressify and to buffer them internally. Upon reception of these metrics, they will be emitted on AWS IoT broker on the greengrass/<thing-name>/alerts/advertisement topic.

If no Internet connectivity is available, green-alerts will buffer the data in memory until the Internet connectvity is available again.

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.

MethodResourceReturn code(s)Payload requiredDescription
POST/alerts200/400YesThis route allows green applications to publish alerts on green-alerts.
GET/alerts200NoThis route allows green applications to retrieve currently stored by green-alerts.
DELETE/alerts/:id200/404NoThis route allows green applications to remove a currently stored alert by green-alerts.
SUBSCRIBE/alerts200NoThis route allows green applications to subscribe to newly created alerts.

Schema

You will find below the Joi schema definition of an alert.

Joi.object().keys({
  // The alert unique identifier.
  id: Joi.string().optional(),
  // A human-readable identifier of the alert.
  name: Joi.string().required(),
  // A detailed description of the alert.
  description: Joi.string().required(),
  // An optional payload object to associated with the alert.
  payload: Joi.object().optional(),
  // The name of the application having emitted the alert.
  application: Joi.string().required(),
  // The UNIX timestamp at which the alert has been created.
  timestamp: Joi.date().timestamp('unix'),
  // The type associated with the alert.
  type: Joi.string().valid(['information', 'warning', 'alert', 'danger']).required()
}).required();

See also

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.0

6 years ago