1.0.4 • Published 6 years ago

green-discovery v1.0.4

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

green-discovery

A service discovery application for AWS Greengrass.

Green application CodeFactor

Current version: 1.0.3

Lead Maintainer: Halim Qarroum

Table of contents

Install

green add npm://green-discovery

Description

This application acts as a service discovery agent for AWS Greengrass that connects to every green application deployed on your Greengrass Cores. It exposes an Expressify API that allows applications to register themselves and to list available services on the local Greengrass Core.

This application is automatically deployed on all of your Greengrass Core(s) if you orchestrate your deployments using the green-cli command-line tool.

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
GET/applications200NoThe green-discovery application is able to list the available applications registered on the service discovery agent under the /applications resource using the GET method.
GET/applications/:name200/404NoThis application can also return the description of a given application under the /applications/:name resource, where the name placeholder is the name of the application.
POST/applications200/400YesTo register a new application on the service discovery agent, you can issue a POST request along with the payload of the green-app.json of the application against the /applications resource. The schema of the given payload will be validated before any registration.
DELETE/applications/:name200/400/404NoTo unregister an already registered application, you can issue a DELETE request against the /applications resource by giving the name of the application as a parameter.
SUBSCRIBE/applications200NoUsing this route, green applications can subscribe to changes impacting registrations and unregistrations of services.

Events

While application can retrieve on demand the currently available services running on a Greengrass core, they can also be advertised of any change in the registration or unregistration of services by listening, using Expressify, on the /applications resource as stated in the API section, which will emit a service.registred event upon the registration of a new service, and a service.unregistered event upon the unregistration of an existing service.

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

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago