green-alerts

    1.0.7 • Public • Published


    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.

    Method Resource Return code(s) Payload required Description
    POST /alerts 200/400 Yes This route allows green applications to publish alerts on green-alerts.
    GET /alerts 200 No This route allows green applications to retrieve currently stored by green-alerts.
    DELETE /alerts/:id 200/404 No This route allows green applications to remove a currently stored alert by green-alerts.
    SUBSCRIBE /alerts 200 No This 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

    Install

    npm i green-alerts

    DownloadsWeekly Downloads

    0

    Version

    1.0.7

    License

    MIT

    Unpacked Size

    48 kB

    Total Files

    7

    Last publish

    Collaborators

    • hqm