From 77c1d98bacc712efd48d35fefdd2d85198069e70 Mon Sep 17 00:00:00 2001 From: aws Date: Mon, 25 Nov 2019 20:22:30 +0000 Subject: [PATCH] Release of Version 1.5.0 --- README.md | 17 +- aws-greengrass-core-sdk/index.js | 2 +- aws-greengrass-core-sdk/iotdata.js | 31 +- aws-greengrass-core-sdk/lambda.js | 2 +- aws-greengrass-core-sdk/secretsmanager.js | 6 +- aws-greengrass-core-sdk/util.js | 6 +- docs/.nojekyll | 0 {manual => docs}/AWS/IotData.html | 1374 +++++++++++---------- docs/AWS/Lambda.html | 441 +++++++ docs/AWS/SecretsManager.html | 291 +++++ docs/class_list.html | 98 ++ {manual => docs}/css/common.css | 0 {manual => docs}/css/full_list.css | 0 {manual => docs}/css/highlight.github.css | 0 {manual => docs}/css/style.css | 0 docs/index.html | 267 ++++ {manual => docs}/js/app.js | 0 {manual => docs}/js/full_list.js | 0 {manual => docs}/js/highlight.pack.js | 0 {manual => docs}/js/jquery.js | 0 greengrassExamples/HelloWorld/index.js | 1 + manual/AWS/Lambda.html | 406 ------ manual/AWS/SecretsManager.html | 288 ----- manual/class_list.html | 96 -- manual/index.html | 249 ---- 25 files changed, 1835 insertions(+), 1740 deletions(-) create mode 100644 docs/.nojekyll rename {manual => docs}/AWS/IotData.html (88%) create mode 100644 docs/AWS/Lambda.html create mode 100644 docs/AWS/SecretsManager.html create mode 100644 docs/class_list.html rename {manual => docs}/css/common.css (100%) rename {manual => docs}/css/full_list.css (100%) rename {manual => docs}/css/highlight.github.css (100%) rename {manual => docs}/css/style.css (100%) create mode 100644 docs/index.html rename {manual => docs}/js/app.js (100%) rename {manual => docs}/js/full_list.js (100%) rename {manual => docs}/js/highlight.pack.js (100%) rename {manual => docs}/js/jquery.js (100%) delete mode 100644 manual/AWS/Lambda.html delete mode 100644 manual/AWS/SecretsManager.html delete mode 100644 manual/class_list.html delete mode 100644 manual/index.html diff --git a/README.md b/README.md index 46803ad..68d73f6 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,6 @@ The environment where Greengrass is running on needs to be able to run NodeJS 8. * When you untar the package downloaded from NodeJS website, you will find `node` file under `bin` directory. * Copy the file to _**/usr/bin**_ or _**/usr/local/bin**_ folder. * Rename the file to _**nodejs8.10**_ -* Make sure the file is not a symlink. ## Getting Started - Hello World @@ -105,12 +104,28 @@ As new features are added to AWS Greengrass, previous versions of the Greengrass + + +1.10.x + +1.0.x-1.5.x + + + +
+ +## 1.5.0 Updates[¶](#1.5.0updates "Permalink to this headline") + +Added support for publish() parameter queueFullPolicy which can be set to 'AllOrError' to enforce that the published message is either delivered to all subscription destinations or delivered to no destinations and returns an error when Greengrass Core's internal work queue is full. + +
+
## 1.4.0 Updates[¶](#1.4.0updates "Permalink to this headline") diff --git a/aws-greengrass-core-sdk/index.js b/aws-greengrass-core-sdk/index.js index dd11906..9bdb902 100644 --- a/aws-greengrass-core-sdk/index.js +++ b/aws-greengrass-core-sdk/index.js @@ -1,7 +1,7 @@ /* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. */ -exports.GreengrassInterfaceVersion = '1.3'; +exports.GreengrassInterfaceVersion = '1.4'; exports.Lambda = require('./lambda'); exports.IotData = require('./iotdata'); exports.SecretsManager = require('./secretsmanager'); diff --git a/aws-greengrass-core-sdk/iotdata.js b/aws-greengrass-core-sdk/iotdata.js index c40c80e..753b3a2 100644 --- a/aws-greengrass-core-sdk/iotdata.js +++ b/aws-greengrass-core-sdk/iotdata.js @@ -24,7 +24,7 @@ class IotData { * @param {object} params object contains parameters for the call * REQUIRED: 'thingName' the name of the thing */ - const thingName = Util.getRequiredParameter(params, 'thingName'); + const thingName = Util.getParameter(params, 'thingName'); if (thingName === undefined) { callback(new Error('"thingName" is a required parameter.'), null); return; @@ -41,13 +41,13 @@ class IotData { * REQUIRED: 'thingName' the name of the thing * 'payload' the state information in JSON format */ - const thingName = Util.getRequiredParameter(params, 'thingName'); + const thingName = Util.getParameter(params, 'thingName'); if (thingName === undefined) { callback(new Error('"thingName" is a required parameter.'), null); return; } - const payload = Util.getRequiredParameter(params, 'payload'); + const payload = Util.getParameter(params, 'payload'); if (payload === undefined) { callback(new Error('"payload" is a required parameter.'), null); return; @@ -62,7 +62,7 @@ class IotData { * @param {object} params object contains parameters for the call * REQUIRED: 'thingName' the name of the thing */ - const thingName = Util.getRequiredParameter(params, 'thingName'); + const thingName = Util.getParameter(params, 'thingName'); if (thingName === undefined) { callback(new Error('"thingName" is a required parameter.'), null); return; @@ -78,26 +78,45 @@ class IotData { * @param {object} params object contains parameters for the call * REQUIRED: 'topic' the topic name to be published * 'payload' the state information in JSON format + * OPTIONAL: 'queueFullPolicy' the policy for GGC to take when its internal queue is full */ - const topic = Util.getRequiredParameter(params, 'topic'); + const topic = Util.getParameter(params, 'topic'); if (topic === undefined) { callback(new Error('"topic" is a required parameter'), null); return; } - const payload = Util.getRequiredParameter(params, 'payload'); + const payload = Util.getParameter(params, 'payload'); if (payload === undefined) { callback(new Error('"payload" is a required parameter'), null); return; } + // this is an optional parameter + const queueFullPolicy = Util.getParameter(params, 'queueFullPolicy'); + const context = { custom: { source: MY_FUNCTION_ARN, subject: topic, + queueFullPolicy: '', }, }; + switch (queueFullPolicy) { + case 'BestEffort': + case 'AllOrError': + context.custom.queueFullPolicy = queueFullPolicy; + break; + case '': + case undefined: + case null: + break; + default: + callback(new Error(`queueFullPolicy "${queueFullPolicy}" is not supported`), null); + break; + } + const buff = Buffer.from(JSON.stringify(context)); const clientContext = buff.toString('base64'); diff --git a/aws-greengrass-core-sdk/lambda.js b/aws-greengrass-core-sdk/lambda.js index 1380b93..4eed968 100644 --- a/aws-greengrass-core-sdk/lambda.js +++ b/aws-greengrass-core-sdk/lambda.js @@ -17,7 +17,7 @@ class Lambda { } invoke(params, callback) { - const functionName = Util.getRequiredParameter(params, 'FunctionName'); + const functionName = Util.getParameter(params, 'FunctionName'); if (functionName === undefined) { callback(new Error('"FunctionName" is a required parameter'), null); return; diff --git a/aws-greengrass-core-sdk/secretsmanager.js b/aws-greengrass-core-sdk/secretsmanager.js index 80a7c15..18aa173 100644 --- a/aws-greengrass-core-sdk/secretsmanager.js +++ b/aws-greengrass-core-sdk/secretsmanager.js @@ -23,9 +23,9 @@ class SecretsManager { } getSecretValue(params, callback) { - const secretId = Util.getRequiredParameter(params, KEY_SECRET_ID); - const versionId = Util.getRequiredParameter(params, KEY_VERSION_ID); - const versionStage = Util.getRequiredParameter(params, KEY_VERSION_STAGE); + const secretId = Util.getParameter(params, KEY_SECRET_ID); + const versionId = Util.getParameter(params, KEY_VERSION_ID); + const versionStage = Util.getParameter(params, KEY_VERSION_STAGE); if (secretId === undefined) { callback(new Error(`"${KEY_SECRET_ID}" is a required parameter`), null); diff --git a/aws-greengrass-core-sdk/util.js b/aws-greengrass-core-sdk/util.js index b02fa8e..b73fe3c 100644 --- a/aws-greengrass-core-sdk/util.js +++ b/aws-greengrass-core-sdk/util.js @@ -5,11 +5,11 @@ const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/; const qualifierRegex = /(|[a-zA-Z0-9$_-]+)/; -exports.getRequiredParameter = function _getRequiredParameter(params, requiredParam) { - if (!Object.prototype.hasOwnProperty.call(params, requiredParam)) { +exports.getParameter = function _getParameter(params, desiredParam) { + if (!Object.prototype.hasOwnProperty.call(params, desiredParam)) { return; } - return params[requiredParam]; + return params[desiredParam]; }; exports.isValidJSON = function _isValidJSON(str) { diff --git a/docs/.nojekyll b/docs/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/manual/AWS/IotData.html b/docs/AWS/IotData.html similarity index 88% rename from manual/AWS/IotData.html rename to docs/AWS/IotData.html index 3de5bc6..b2f6afa 100644 --- a/manual/AWS/IotData.html +++ b/docs/AWS/IotData.html @@ -1,686 +1,688 @@ - - - - - - - Class: AWS.IotData - - — AWS SDK for JavaScript - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- -

Class: AWS.IotData - - - -

-
- -
-
Identifier:
-
iotdata
-
-
-
API Version:
-
2017-09-20
-
- - - -
-
Defined in:
-
iotdata.js
-
- -
-

Overview

-
- -

Constructs a service interface object. Each API operation is exposed as a -function on service.

- -

Sending a Request Using IotData

- -
var iotdata = new GG.IotData();
-iotdata.getThingShadow(params, function (err, data) {
-  if (err) console.log(err, err.stack); // an error occurred
-  else     console.log(data);           // successful response
-});
-
- -

Constructor Summary - collapse -

- - - -

Method Summary - collapse -

- - - -
-

Constructor Details

- -
-

- - new GG.IotData() ⇒ Object - - - - - -

-
- -

Constructs a service object. This object has one method for each API operation.

- - -
-
-
- -
-

Examples:

- - -

Constructing a IotData object

-

- -
var iotdata = new GG.IotData();
- -
- -
-
- -
- -
-

Method Details

-
-

- - getThingShadow(params = {}, callback) - -

-
-

Gets the thing shadow for the specified thing.

- -
-
-
- -
-

Examples:

- - -

Calling the getThingShadow operation

-

- -
var params = {
-  thingName: 'STRING_VALUE' /* required */
-};
-iotdata.getThingShadow(params, function(err, data) {
-  if (err) console.log(err, err.stack); // an error occurred
-  else     console.log(data);           // successful response
-});
- -
-

Parameters:

-
    - -
  • - - params - - - (Object) - - - (defaults to: {}) - - - — -
      -
    • thingName — (String)

      The name of the thing.

    • -
    - -
    - -
  • - -
- - -

Callback (callback):

-
    -
  • - function(err, data) { ... } -
    -
    -

    Called when a response from the service is returned.

    - - -
    -
    -
    - -

    Parameters:

    -
      - -
    • - - err - - - (Error) - - - - — -

      the error object returned from the request. -Set to null if the request is successful.

      -
      - -
    • - -
    • - - data - - - (Object) - - - - — -

      the de-serialized data returned from -the request. Set to null if a request error occurs. -The data object has the following properties:

      - -
        -
      • payload — (Buffer, Typed Array, Blob, String)

        The state information, in JSON format.

      • -
      - -
      - -
    • - -
    - - - -
    -
  • -
- - -

Returns:

-
    - -
  • -

    Nothing

    -
    - -
  • - -
- -
-
- -
-

- - publish(params = {}, callback) - - - - - -

-
-

Publishes a message within Greengrass.

- -
-
-
- -
-

Examples:

- - -

Calling the publish operation

-

- -
var params = {
-  topic: 'STRING_VALUE', /* required */
-  payload: new Buffer('...') || 'STRING_VALUE'
-};
-iotdata.publish(params, function(err, data) {
-  if (err) console.log(err, err.stack); // an error occurred
-  else     console.log(data);           // successful response
-});
- -
-

Parameters:

-
    - -
  • - - params - - - (Object) - - - (defaults to: {}) - - - — -
      -
    • topic — (String)

      The name of the MQTT topic.

    • -
    • payload — (Buffer, Typed Array, Blob, String)
    • -
    - -
    - -
  • - -
- - -

Callback (callback):

-
    -
  • - function(err, data) { ... } -
    -
    -

    Called when a response from the service is returned.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - err - - - (Error) - - - - — -

      the error object returned from the request. -Set to null if the request is successful.

      -
      - -
    • - -
    • - - data - - - (Object) - - - - — -

      the de-serialized data returned from -the request. Set to null if a request error occurs.

      -
      - -
    • - -
    - - - -
    -
  • -
- - -

Returns:

-
    - -
  • -

    Nothing

    -
    - -
  • - -
- -
-
- -
-

- - updateThingShadow(params = {}, callback) ⇒ GG.Request - - - - - -

-
-

Updates the thing shadow for the specified thing.

- - -
-
-
- -
-

Examples:

- - -

Calling the updateThingShadow operation

-

- -
var params = {
-  payload: 'Proper JSON data', /* required */
-  thingName: 'STRING_VALUE' /* required */
-};
-iotdata.updateThingShadow(params, function(err, data) {
-  if (err) console.log(err, err.stack); // an error occurred
-  else     console.log(data);           // successful response
-});
- -
-

Parameters:

-
    - -
  • - - params - - - (Object) - - - (defaults to: {}) - - - — -
      -
    • thingName — (String)

      The name of the thing.

    • -
    • payload — (Proper JSON data)

      The state information, in JSON format.

    • -
    - -
    - -
  • - -
- - -

Callback (callback):

-
    -
  • - function(err, data) { ... } -
    -
    -

    Called when a response from the service is returned.

    - - -
    -
    -
    - -

    Parameters:

    -
      - -
    • - - err - - - (Error) - - - - — -

      the error object returned from the request. -Set to null if the request is successful.

      -
      - -
    • - -
    • - - data - - - (Object) - - - - — -

      the de-serialized data returned from -the request. Set to null if a request error occurs. -The data object has the following properties:

      - -
        -
      • payload — (Buffer, Typed Array, Blob, String)

        The state information, in JSON format.

      • -
      - -
      - -
    • - -
    - - - -
    -
  • -
- - -

Returns:

-
    - -
  • -

    Nothing

    -
    - -
  • - -
- -
-
- -
- - -
- - - - - - - - - - - - - - -
- - + + + + + + + Class: AWS.IotData + + — AWS SDK for JavaScript + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ +

Class: AWS.IotData + + + +

+
+ +
+
Identifier:
+
iotdata
+
+
+
API Version:
+
2017-09-20
+
+ + + +
+
Defined in:
+
iotdata.js
+
+ +
+

Overview

+
+ +

Constructs a service interface object. Each API operation is exposed as a +function on service.

+ +

Sending a Request Using IotData

+ +
var iotdata = new GG.IotData();
+iotdata.getThingShadow(params, function (err, data) {
+  if (err) console.log(err, err.stack); // an error occurred
+  else     console.log(data);           // successful response
+});
+
+ +

Constructor Summary + collapse +

+ + + +

Method Summary + collapse +

+ + + +
+

Constructor Details

+ +
+

+ + new GG.IotData() ⇒ Object + + + + + +

+
+ +

Constructs a service object. This object has one method for each API operation.

+ + +
+
+
+ +
+

Examples:

+ + +

Constructing a IotData object

+

+ +
var iotdata = new GG.IotData();
+ +
+ +
+
+ +
+ +
+

Method Details

+
+

+ + getThingShadow(params = {}, callback) + +

+
+

Gets the thing shadow for the specified thing.

+ +
+
+
+ +
+

Examples:

+ + +

Calling the getThingShadow operation

+

+ +
var params = {
+  thingName: 'STRING_VALUE' /* required */
+};
+iotdata.getThingShadow(params, function(err, data) {
+  if (err) console.log(err, err.stack); // an error occurred
+  else     console.log(data);           // successful response
+});
+ +
+

Parameters:

+
    + +
  • + + params + + + (Object) + + + (defaults to: {}) + + + — +
      +
    • thingName — (String)

      The name of the thing.

    • +
    + +
    + +
  • + +
+ + +

Callback (callback):

+
    +
  • + function(err, data) { ... } +
    +
    +

    Called when a response from the service is returned.

    + + +
    +
    +
    + +

    Parameters:

    +
      + +
    • + + err + + + (Error) + + + + — +

      the error object returned from the request. +Set to null if the request is successful.

      +
      + +
    • + +
    • + + data + + + (Object) + + + + — +

      the de-serialized data returned from +the request. Set to null if a request error occurs. +The data object has the following properties:

      + +
        +
      • payload — (Buffer, Typed Array, Blob, String)

        The state information, in JSON format.

      • +
      + +
      + +
    • + +
    + + + +
    +
  • +
+ + +

Returns:

+
    + +
  • +

    Nothing

    +
    + +
  • + +
+ +
+
+ +
+

+ + publish(params = {}, callback) + + + + + +

+
+

Publishes a message within Greengrass.

+ +
+
+
+ +
+

Examples:

+ + +

Calling the publish operation

+

+ +
var params = {
+  topic: 'STRING_VALUE', /* required */
+  payload: new Buffer('...') || 'STRING_VALUE',
+  queueFullPolicy: 'AllOrError' || 'BestEffort'
+};
+iotdata.publish(params, function(err, data) {
+  if (err) console.log(err, err.stack); // an error occurred
+  else     console.log(data);           // successful response
+});
+ +
+

Parameters:

+
    + +
  • + + params + + + (Object) + + + (defaults to: {}) + + + — +
      +
    • topic — (String)

      The name of the MQTT topic.

    • +
    • payload — (Buffer, Typed Array, Blob, String)
    • +
    • queueFullPolicy— (String)

      Specify whether to enforce message delivery to all destinations. Options are 'AllOrError' and 'BestEffort'. Defaults to 'BestEffort' when omitted.

    • +
    + +
    + +
  • + +
+ + +

Callback (callback):

+
    +
  • + function(err, data) { ... } +
    +
    +

    Called when a response from the service is returned.

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + err + + + (Error) + + + + — +

      the error object returned from the request. +Set to null if the request is successful.

      +
      + +
    • + +
    • + + data + + + (Object) + + + + — +

      the de-serialized data returned from +the request. Set to null if a request error occurs.

      +
      + +
    • + +
    + + + +
    +
  • +
+ + +

Returns:

+
    + +
  • +

    Nothing

    +
    + +
  • + +
+ +
+
+ +
+

+ + updateThingShadow(params = {}, callback) ⇒ GG.Request + + + + + +

+
+

Updates the thing shadow for the specified thing.

+ + +
+
+
+ +
+

Examples:

+ + +

Calling the updateThingShadow operation

+

+ +
var params = {
+  payload: 'Proper JSON data', /* required */
+  thingName: 'STRING_VALUE' /* required */
+};
+iotdata.updateThingShadow(params, function(err, data) {
+  if (err) console.log(err, err.stack); // an error occurred
+  else     console.log(data);           // successful response
+});
+ +
+

Parameters:

+
    + +
  • + + params + + + (Object) + + + (defaults to: {}) + + + — +
      +
    • thingName — (String)

      The name of the thing.

    • +
    • payload — (Proper JSON data)

      The state information, in JSON format.

    • +
    + +
    + +
  • + +
+ + +

Callback (callback):

+
    +
  • + function(err, data) { ... } +
    +
    +

    Called when a response from the service is returned.

    + + +
    +
    +
    + +

    Parameters:

    +
      + +
    • + + err + + + (Error) + + + + — +

      the error object returned from the request. +Set to null if the request is successful.

      +
      + +
    • + +
    • + + data + + + (Object) + + + + — +

      the de-serialized data returned from +the request. Set to null if a request error occurs. +The data object has the following properties:

      + +
        +
      • payload — (Buffer, Typed Array, Blob, String)

        The state information, in JSON format.

      • +
      + +
      + +
    • + +
    + + + +
    +
  • +
+ + +

Returns:

+
    + +
  • +

    Nothing

    +
    + +
  • + +
+ +
+
+ +
+ + +
+ + + + + + + + + + + + + + +
+ + diff --git a/docs/AWS/Lambda.html b/docs/AWS/Lambda.html new file mode 100644 index 0000000..62d0621 --- /dev/null +++ b/docs/AWS/Lambda.html @@ -0,0 +1,441 @@ + + + + + + + Class: AWS.Lambda + + — AWS SDK for JavaScript + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ +

Class: AWS.Lambda + + + +

+
+
+
Identifier:
+
lambda
+
+
+
API Version:
+
2017-09-20
+
+ + + +
+
Defined in:
+
lambda.js
+
+ +
+

Overview

+
+
+

Constructs a service interface object. Each API operation is exposed as a + function on service.

+ +

Constructor Summary + collapse +

+ + + +

Method Summary + collapse +

+ + + + + + + + +
+

Constructor Details

+ +
+

+ + new GG.Lambda() ⇒ Object + + + + + +

+
+
+

Constructs a service object. This object has one method for each + API operation.

+ + +
+
+
+ +
+

Examples:

+ + +

+

+

Constructing a Lambda object

+
+

+ +
var lambda = new GG.Lambda();
+ +
+ +
+
+ +
+ +
+

Method Details

+ +
+

+ + invoke(params = {}, callback) ⇒ AWS.Request + + + + + +

+
+
+

Invokes a specific Lambda function.

+ +

+

In Greengrass, version of the Lambda which you would like to invoke needs to be provided.

+

+ +
+

Service Reference:

+ +
+ + + +
+
+
+ +
+

Examples:

+ + +

+

+

To invoke a Lambda function

+
+

+ +

+/* This operation invokes a Lambda function */
+
+ var params = {
+  ClientContext: "MyApp",
+  FunctionName: "MyFunction",
+  InvocationType: "Event",
+  Payload: <json | binary>,
+  Qualifier: "1"
+ };
+ lambda.invoke(params, function(err, data) {
+   if (err) console.log(err, err.stack); // an error occurred
+   else     console.log(data);           // successful response
+ });
+ + +

+

+

Calling the invoke operation

+
+

+ +
var params = {
+  FunctionName: 'STRING_VALUE', /* required */
+  ClientContext: 'STRING_VALUE',
+  InvocationType: Event | RequestResponse,
+  Payload: <json | binary>,
+  Qualifier: 'STRING_VALUE'
+};
+lambda.invoke(params, function(err, data) {
+  if (err) console.log(err, err.stack); // an error occurred
+  else     console.log(data);           // successful response
+});
+ +
+

Parameters:

+
    + +
  • + + params + + + (Object) + + + (defaults to: {}) + + + — +
    +
      +
    • FunctionName — (String)

      The Lambda function name.

      +

      You can specify Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail).

    • +
    • InvocationType — (String)

      By default, the Invoke API assumes RequestResponse invocation type. You can optionally request asynchronous execution by specifying Event as the InvocationType.

      + Possible values include: + +
        +
      • "Event"
      • +
      • "RequestResponse"
      • +
      +
    • +
    • ClientContext — (String)

      Using the ClientContext you can pass client-specific information to the Lambda function you are invoking. You can then process the client information in your Lambda function as you choose through the context variable. For an example of a ClientContext JSON, see the main page or an example folder for an example.

      +

      The ClientContext JSON must be base64-encoded.

      +
    • +
    • Payload

      Payload that you want to provide to your Lambda function as input. Please refer to the main page or examples for proper formats.

      +
    • +
    • Qualifier — (String)

      You can use this optional parameter to specify a Lambda function version if it was not included in the FunctionName field. If you specify a function version, the API uses the qualified function ARN to invoke a specific Lambda function.

      +

      If you don't provide this parameter, then the API uses the FunctionName field only. If it does not have a version number of the target lambda, the call will fail.

      +
    • +
    + +
    + +
  • + +
+ + +

Callback (callback):

+
    +
  • + function(err, data) { ... } +
    +
    +

    Called when a response from the service is returned.

    + + +
    +
    +
    +

    Parameters:

    +
      + +
    • + + err + + + (Error) + + + + — +
      +

      the error object returned from the request. + Set to null if the request is successful.

      +
      + +
    • + +
    • + + data + + + (Object) + + + + — +
      +

      the de-serialized data returned from + the request. Set to null if a request error occurs. + The data object has the following properties:

      + +
        +
      • StatusCode — (Integer)

        The HTTP status code will be in the 200 range for successful request. For the RequestResponse invocation type this status code will be 200. For the Event invocation type this status code will be 202.

        +
      • +
      • FunctionError — (String)

        Indicates whether an error occurred while executing the Lambda function. If an error occurred this field will have one of two values; Handled or Unhandled. Handled errors are errors that are reported by the function while the Unhandled errors are those detected and reported by AWS Lambda. Unhandled errors include out of memory errors and function timeouts. For information about how to report an Handled error, see Programming Model.

        +
      • +
      • Payload — (Buffer, Typed Array, Blob, String)

        It is the result returned by the Lambda function. This is present only if the invocation type is RequestResponse.

        +

        In the event of a function error this field contains a message describing the error. For the Handled errors the Lambda function will report this message. For Unhandled errors AWS Lambda reports the message.

        +
      • +
      + +
      + +
    • + +
    + + + +
    +
  • +
+ +
+
+
+ + +
+ + + + + + + + + + + + + + +
+ + + diff --git a/docs/AWS/SecretsManager.html b/docs/AWS/SecretsManager.html new file mode 100644 index 0000000..118b1e7 --- /dev/null +++ b/docs/AWS/SecretsManager.html @@ -0,0 +1,291 @@ + + + + + + + Class: AWS.SecretsManager + — AWS SDK for JavaScript + + + + + + + + + + + + + +
+ + +
+ +

Class: AWS.SecretsManager +

+
+
+
Identifier:
+
SecretsManager
+
+
+
API Version:
+
2018-11-26
+
+
+
Defined in:
+
secretsmanager.js
+
+
+

Overview

+
+
+

Constructs a service interface object. Each API operation is exposed as a + function on service. +

+

Constructor Summary + collapse +

+ +

Method Summary + collapse +

+ +
+

Constructor Details

+
+

+ new GG.SecretsManager() ⇒ Object +

+
+
+

Constructs a service object. This object has one method for each + API operation. +

+
+
+
+
+

Examples:

+

+

+

Constructing a SecretsManager object

+
+

+
var secretsmanager = new GG.SecretsManager();
+
+
+
+
+
+

Method Details

+
+

+ getSecretValue(params = {}, callback) +

+
+
+

Retrieves a specific local secret value.

+
+
+
+
+

Examples:

+

+

+

Retrieving a local secret value

+
+

+

+/* This operation retrieves a local secret value */
+
+ var params = {
+   SecretId: "STRING_VALUE",
+   VersionStage: "STRING_VALUE"
+ };
+ secretsmanager.getSecretValue(params, function(err, data) {
+   if (err) console.log(err, err.stack); // an error occurred
+   else     console.log(data);           // successful response
+ });
+
+

Parameters:

+
    +
  • + params + (Object) + (defaults to: {}) + — +
    +
      +
    • + SecretId — (String) +

      Specifies the secret containing the version that you want to retrieve. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.

      +
    • +
    • + VersionStage — (String) +

      Specifies the secret version that you want to retrieve by the staging label attached to the version.

      +

      Staging labels are used to keep track of different versions during the rotation process.

      +
    • +
    +
    +
  • +
+

Callback(callback):

+
    +
  • + function(err, data) { ... } +
    +
    +

    Called when a response from the service is returned.

    +
    +
    +
    +

    Parameters:

    +
      +
    • + err + (Error) + — +
      +

      the error object returned from the request. + Set to null if the request is successful. +

      +
      +
    • +
    • + data + (Object) + — +
      +

      the de-serialized data returned from + the request. Set to null if a request error occurs. + The data object has the following properties: +

      +
        +
      • + ARN — (String) +

        The ARN of the secret.

        +
      • +
      • + Name — (String) +

        The friendly name of the secret.

        +
      • +
      • + VersionId — (String) +

        The unique identifier of this version of the secret.

        +
      • +
      • + SecretBinary — (Buffer, Typed Array, Blob, String) +

        The decrypted part of the protected secret information that was originally provided as binary data in the form of a byte array. The response parameter represents the binary data as a base64-encoded string.

        +
      • +
      • + SecretString — (String) +

        The decrypted part of the protected secret information that was originally provided as a string.

        +
      • +
      • + VersionStages — (Array<String>) +

        Specifies the secret version that you want to retrieve by the staging label attached to the version.

        +

        Staging labels are used to keep track of different versions during the rotation process.

        +
      • +
      +
      +
    • +
    +
    +
  • +
+

Returns:

+
    +
  • +
    +

    Nothing

    +
    +
  • +
+
+
+
+
+ + + + + + + + + + + +
+ + + diff --git a/docs/class_list.html b/docs/class_list.html new file mode 100644 index 0000000..56c493e --- /dev/null +++ b/docs/class_list.html @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + Class List + + + + +
+
+

Class List

+ + + +
+ + +
+ + + diff --git a/manual/css/common.css b/docs/css/common.css similarity index 100% rename from manual/css/common.css rename to docs/css/common.css diff --git a/manual/css/full_list.css b/docs/css/full_list.css similarity index 100% rename from manual/css/full_list.css rename to docs/css/full_list.css diff --git a/manual/css/highlight.github.css b/docs/css/highlight.github.css similarity index 100% rename from manual/css/highlight.github.css rename to docs/css/highlight.github.css diff --git a/manual/css/style.css b/docs/css/style.css similarity index 100% rename from manual/css/style.css rename to docs/css/style.css diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..430df96 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,267 @@ + + + + + + + File: README + + — AWS Greengrass Core SDK for JavaScript + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ +
+

AWS Greengrass Core SDK for JavaScript

+ +

The AWS Greengrass Core SDK for JavaScript allows developers to write JavaScript Lambda functions which will run within Greengrass.

+ +

Overview

+

This document provides instructions for preparing your Greengrass Core environment to run Lambda functions written in JavaScript. It also includes examples on how to develop a Lambda function in JavaScript as well as packaging and running an example Hello World file in JavaScript for your Greengrass core. + +

Preparing your Greengrass to run NodeJS Lambda functions

+ The environment where Greengrass is running on needs to be able to run NodeJS 8.10 applications. +
    +
  • Install NodeJS 8.10 for your platform. You can download the newest NodeJS from https://nodejs.org/en/download/. +
  • When you untar the package downloaded from NodeJS website, you will find node file under bin directory.
  • +
  • Copy the file to /usr/bin or /usr/local/bin folder.
  • +
  • Rename the file to nodejs8.10
  • +
  • Make sure the file is not a symlink.
  • +
+ +

Getting Started - Hello World

+
    +
  • Copy samples/HelloWorld folder to your workspace.
  • +
  • Create a folder node_modules under HelloWorld folder.
  • +
  • Unzip aws-greengrass-core-sdk-js.zip into the folder. It should create a folder HelloWorld/node_modules/aws-greengrass-core-sdk
  • +
  • Zip up the content of HelloWorld folder so that the index.js is on the top of the zip file structure.
  • +
  • Go to AWS Lambda Console.
  • +
  • Create a new function.
  • +
  • Choose the Runtime as Node.js 8.10
  • +
  • Upload the zip file in Lambda function code section.
  • +
  • Handler is index.handler
  • +
  • Choose any role as the role is not used within Greengrass.
  • +
  • After creating the function, publish the Lambda.
  • +
  • Create an Alias and point to the Published version (not $LATEST).
  • +
  • Go to your Greengrass Group and add the Lambda under Lambdas section.
  • +
  • Click on the Lambda and change the Lambda lifecycle to Make this function long-lived and keep it running indefinitely.
  • +
  • + Add a Subscription with the following configuration: +
      +
    • Source: Lambda which you just created and added to the group
    • +
    • Target: IoT Cloud
    • +
    • Topic: hello/world
    • +
    +
  • +
  • Deploy. A message from your Lambda should be published to the topic hello/world in the cloud every 5 seconds. You can check this by going to AWS IoT's Test page and subscribing to topic hello/world.
  • +
+ +

Including aws-greengrass-core-sdk with your function

+ Unzip the SDK into your node_modules folder of your function. This should create a aws-greengrass-core-sdk folder which includes the SDK. + +

Logging in NodeJS Lambdas

+

Your console.log operation will be logged as INFO. A console.error operation will be logged as ERROR. Currently, our NodeJS SDK only allows you to log at INFO or ERROR level only.

+ +

Supported Datatypes

+

From GGC version 1.5, you can send both JSON and binary data as a payload when you invoking other Lambdas or publishing a message using IotData service. In order to make your lambda be able to handle binary payload, you need to configure the lambda in Greengrass console to mark it using binary input payload so that GGC can know how to deal with the data.

+ +

Supported Context

+

In Greengrass, you can send a context object in a JSON format to be passed to another Lambda that is being invoked. The context format looks like this: + +{ + custom: { + customData: 'customData', + }, +} + +

+ + +

Compatibility

+
+
+

Compatibility

+

As new features are added to AWS Greengrass, previous versions of the Greengrass SDK will be incompatible with newer versions of the AWS Greengrass + core. The following table lists the compatible SDKs for all GGC releases.

+ + + + + + + + + + + + + + + + + + + + + + + +
GGC VersionCompatible SDK Versions
1.0.x-1.6.x1.0.x-1.2.x
1.7.x-1.8.x1.0.x-1.3.x
1.9.x1.0.x-1.4.x
1.10.x1.0.x-1.5.x
+ +
+ +
+

1.5.0 Updates

+

Added support for publish() parameter queueFullPolicy which can be set to 'AllOrError' to enforce that the published message is either delivered to all subscription destinations or delivered to no destinations and returns an error when Greengrass Core's internal work queue is full.

+
+ +
+

1.4.0 Updates

+

Added support for Node.js 8.10 Lambda runtime. Lambda functions that use Node.js 8.10 runtime can now run on an AWS IoT Greengrass core. (Existing Lambda functions that use Node.js 6.10 runtime can still run on Greengrass core, but they can’t be updated after 5/30/2019. Please refer to AWS Lambda Runtimes Support Policy.)

+
+ +
+

1.3.1 Updates

+

Improved log level granularity.

+
+ +
+

1.3.0 Updates

+

SDK supports SecretsManager client.

+
+ +
+

1.2.0 Updates

+

SDK and GGC compatibility check takes place in the background.

+
+ +
+

1.1.0 Updates

+

Lambda only accepted payload in JSON format. With this update, Invoking or publishing binary payload to a lambda is supported.

+
+ +
+

1.0.1 Updates

+

SShadow operations were not receiving responses from the local shadow properly. This has been fixed.

+

Lambda Invoke function's InvocationType's default value was Event. This has been changed to RequestResponse.

+
+ +

Getting Help

+ + + + +

License

+ Apache 2.0 +

+
+
+ + + + + + + + + + + + + + +
+ + + diff --git a/manual/js/app.js b/docs/js/app.js similarity index 100% rename from manual/js/app.js rename to docs/js/app.js diff --git a/manual/js/full_list.js b/docs/js/full_list.js similarity index 100% rename from manual/js/full_list.js rename to docs/js/full_list.js diff --git a/manual/js/highlight.pack.js b/docs/js/highlight.pack.js similarity index 100% rename from manual/js/highlight.pack.js rename to docs/js/highlight.pack.js diff --git a/manual/js/jquery.js b/docs/js/jquery.js similarity index 100% rename from manual/js/jquery.js rename to docs/js/jquery.js diff --git a/greengrassExamples/HelloWorld/index.js b/greengrassExamples/HelloWorld/index.js index 3f769eb..e2bc072 100644 --- a/greengrassExamples/HelloWorld/index.js +++ b/greengrassExamples/HelloWorld/index.js @@ -26,6 +26,7 @@ const myPlatform = util.format('%s-%s', os.platform(), os.release()); const pubOpt = { topic: 'hello/world', payload: JSON.stringify({ message: util.format('Hello world! Sent from Greengrass Core running on platform: %s using NodeJS', myPlatform) }), + queueFullPolicy: 'AllOrError', }; function greengrassHelloWorldRun() { diff --git a/manual/AWS/Lambda.html b/manual/AWS/Lambda.html deleted file mode 100644 index 069f148..0000000 --- a/manual/AWS/Lambda.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - - - - Class: AWS.Lambda - - — AWS SDK for JavaScript - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- -

Class: AWS.Lambda - - - -

-
-
-
Identifier:
-
lambda
-
-
-
API Version:
-
2017-09-20
-
- - - -
-
Defined in:
-
lambda.js
-
- -
-

Overview

-
-

Constructs a service interface object. Each API operation is exposed as a -function on service.

- -

Constructor Summary - collapse -

- - - -

Method Summary - collapse -

- - - - - - - - -
-

Constructor Details

- -
-

- - new GG.Lambda() ⇒ Object - - - - - -

-
-

Constructs a service object. This object has one method for each -API operation.

- - -
-
-
- -
-

Examples:

- - -

Constructing a Lambda object

-

- -
var lambda = new GG.Lambda();
- -
- -
-
- -
- -
-

Method Details

- -
-

- - invoke(params = {}, callback) ⇒ AWS.Request - - - - - -

-
-

Invokes a specific Lambda function.

- -

In Greengrass, version of the Lambda which you would like to invoke needs to be provided.

- -
-

Service Reference:

- -
- - - -
-
-
- -
-

Examples:

- - -

To invoke a Lambda function

-

- -

-/* This operation invokes a Lambda function */
-
- var params = {
-  ClientContext: "MyApp", 
-  FunctionName: "MyFunction", 
-  InvocationType: "Event", 
-  Payload: <json | binary>, 
-  Qualifier: "1"
- };
- lambda.invoke(params, function(err, data) {
-   if (err) console.log(err, err.stack); // an error occurred
-   else     console.log(data);           // successful response
- });
- - -

Calling the invoke operation

-

- -
var params = {
-  FunctionName: 'STRING_VALUE', /* required */
-  ClientContext: 'STRING_VALUE',
-  InvocationType: Event | RequestResponse,
-  Payload: <json | binary>,
-  Qualifier: 'STRING_VALUE'
-};
-lambda.invoke(params, function(err, data) {
-  if (err) console.log(err, err.stack); // an error occurred
-  else     console.log(data);           // successful response
-});
- -
-

Parameters:

-
    - -
  • - - params - - - (Object) - - - (defaults to: {}) - - - — -
      -
    • FunctionName — (String)

      The Lambda function name.

      You can specify Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail).

    • -
    • InvocationType — (String)

      By default, the Invoke API assumes RequestResponse invocation type. You can optionally request asynchronous execution by specifying Event as the InvocationType.

      - Possible values include: - -
        -
      • "Event"
      • -
      • "RequestResponse"
      • -
      -
    • -
    • ClientContext — (String)

      Using the ClientContext you can pass client-specific information to the Lambda function you are invoking. You can then process the client information in your Lambda function as you choose through the context variable. For an example of a ClientContext JSON, see the main page or an example folder for an example.

      The ClientContext JSON must be base64-encoded.

    • -
    • Payload

      Payload that you want to provide to your Lambda function as input. Please refer to the main page or examples for proper formats.

    • -
    • Qualifier — (String)

      You can use this optional parameter to specify a Lambda function version if it was not included in the FunctionName field. If you specify a function version, the API uses the qualified function ARN to invoke a specific Lambda function.

      If you don't provide this parameter, then the API uses the FunctionName field only. If it does not have a version number of the target lambda, the call will fail.

    • -
    - -
    - -
  • - -
- - -

Callback (callback):

-
    -
  • - function(err, data) { ... } -
    -
    -

    Called when a response from the service is returned.

    - - -
    -
    -
    -

    Parameters:

    -
      - -
    • - - err - - - (Error) - - - - — -

      the error object returned from the request. -Set to null if the request is successful.

      -
      - -
    • - -
    • - - data - - - (Object) - - - - — -

      the de-serialized data returned from -the request. Set to null if a request error occurs. -The data object has the following properties:

      - -
        -
      • StatusCode — (Integer)

        The HTTP status code will be in the 200 range for successful request. For the RequestResponse invocation type this status code will be 200. For the Event invocation type this status code will be 202.

      • -
      • FunctionError — (String)

        Indicates whether an error occurred while executing the Lambda function. If an error occurred this field will have one of two values; Handled or Unhandled. Handled errors are errors that are reported by the function while the Unhandled errors are those detected and reported by AWS Lambda. Unhandled errors include out of memory errors and function timeouts. For information about how to report an Handled error, see Programming Model.

      • -
      • Payload — (Buffer, Typed Array, Blob, String)

        It is the result returned by the Lambda function. This is present only if the invocation type is RequestResponse.

        In the event of a function error this field contains a message describing the error. For the Handled errors the Lambda function will report this message. For Unhandled errors AWS Lambda reports the message.

      • -
      - -
      - -
    • - -
    - - - -
    -
  • -
- -
-
-
- - -
- - - - - - - - - - - - - - -
- - diff --git a/manual/AWS/SecretsManager.html b/manual/AWS/SecretsManager.html deleted file mode 100644 index 76ae854..0000000 --- a/manual/AWS/SecretsManager.html +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - Class: AWS.SecretsManager - — AWS SDK for JavaScript - - - - - - - - - - - - -
- - -
- -

Class: AWS.SecretsManager -

-
-
-
Identifier:
-
SecretsManager
-
-
-
API Version:
-
2018-11-26
-
-
-
Defined in:
-
secretsmanager.js
-
-
-

Overview

-
-
-

Constructs a service interface object. Each API operation is exposed as a - function on service. -

-

Constructor Summary - collapse -

- -

Method Summary - collapse -

- -
-

Constructor Details

-
-

- new GG.SecretsManager() ⇒ Object -

-
-
-

Constructs a service object. This object has one method for each - API operation. -

-
-
-
-
-

Examples:

-

-

-

Constructing a SecretsManager object

-
-

-
var secretsmanager = new GG.SecretsManager();
-
-
-
-
-
-

Method Details

-
-

- getSecretValue(params = {}, callback) -

-
-
-

Retrieves a specific local secret value.

-
-
-
-
-

Examples:

-

-

-

Retrieving a local secret value

-
-

-

-/* This operation retrieves a local secret value */
-
- var params = {
-   SecretId: "STRING_VALUE", 
-   VersionStage: "STRING_VALUE"
- };
- secretsmanager.getSecretValue(params, function(err, data) {
-   if (err) console.log(err, err.stack); // an error occurred
-   else     console.log(data);           // successful response
- });
-
-

Parameters:

-
    -
  • - params - (Object) - (defaults to: {}) - — -
    -
      -
    • - SecretId — (String) -

      Specifies the secret containing the version that you want to retrieve. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.

      -
    • -
    • - VersionStage — (String) -

      Specifies the secret version that you want to retrieve by the staging label attached to the version.

      -

      Staging labels are used to keep track of different versions during the rotation process.

      -
    • -
    -
    -
  • -
-

Callback(callback):

-
    -
  • - function(err, data) { ... } -
    -
    -

    Called when a response from the service is returned.

    -
    -
    -
    -

    Parameters:

    -
      -
    • - err - (Error) - — -
      -

      the error object returned from the request. - Set to null if the request is successful. -

      -
      -
    • -
    • - data - (Object) - — -
      -

      the de-serialized data returned from - the request. Set to null if a request error occurs. - The data object has the following properties: -

      -
        -
      • - ARN — (String) -

        The ARN of the secret.

        -
      • -
      • - Name — (String) -

        The friendly name of the secret.

        -
      • -
      • - VersionId — (String) -

        The unique identifier of this version of the secret.

        -
      • -
      • - SecretBinary — (Buffer, Typed Array, Blob, String) -

        The decrypted part of the protected secret information that was originally provided as binary data in the form of a byte array. The response parameter represents the binary data as a base64-encoded string.

        -
      • -
      • - SecretString — (String) -

        The decrypted part of the protected secret information that was originally provided as a string.

        -
      • -
      • - VersionStages — (Array<String>) -

        Specifies the secret version that you want to retrieve by the staging label attached to the version.

        -

        Staging labels are used to keep track of different versions during the rotation process.

        -
      • -
      -
      -
    • -
    -
    -
  • -
-

Returns:

-
    -
  • -
    -

    Nothing

    -
    -
  • -
-
-
-
-
- - - - - - - - - - - -
- - diff --git a/manual/class_list.html b/manual/class_list.html deleted file mode 100644 index 2aeab2e..0000000 --- a/manual/class_list.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - Class List - - - -
-
-

Class List

- - - -
- - -
- - - diff --git a/manual/index.html b/manual/index.html deleted file mode 100644 index 73ab574..0000000 --- a/manual/index.html +++ /dev/null @@ -1,249 +0,0 @@ - - - - - - File: README - - — AWS Greengrass Core SDK for JavaScript - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- -

AWS Greengrass Core SDK for JavaScript

- -

The AWS Greengrass Core SDK for JavaScript allows developers to write JavaScript Lambda functions which will run within Greengrass.

- -

Overview

-

This document provides instructions for preparing your Greengrass Core environment to run Lambda functions written in JavaScript. It also includes examples on how to develop a Lambda function in JavaScript as well as packaging and running an example Hello World file in JavaScript for your Greengrass core. - -

Preparing your Greengrass to run NodeJS Lambda functions

-The environment where Greengrass is running on needs to be able to run NodeJS 8.10 applications. -
    -
  • Install NodeJS 8.10 for your platform. You can download the newest NodeJS from https://nodejs.org/en/download/. -
  • When you untar the package downloaded from NodeJS website, you will find node file under bin directory.
  • -
  • Copy the file to /usr/bin or /usr/local/bin folder.
  • -
  • Rename the file to nodejs8.10
  • -
  • Make sure the file is not a symlink.
  • -
- -

Getting Started - Hello World

-
    -
  • Copy samples/HelloWorld folder to your workspace.
  • -
  • Create a folder node_modules under HelloWorld folder.
  • -
  • Unzip aws-greengrass-core-sdk-js.zip into the folder. It should create a folder HelloWorld/node_modules/aws-greengrass-core-sdk
  • -
  • Zip up the content of HelloWorld folder so that the index.js is on the top of the zip file structure.
  • -
  • Go to AWS Lambda Console.
  • -
  • Create a new function.
  • -
  • Choose the Runtime as Node.js 8.10
  • -
  • Upload the zip file in Lambda function code section.
  • -
  • Handler is index.handler
  • -
  • Choose any role as the role is not used within Greengrass.
  • -
  • After creating the function, publish the Lambda.
  • -
  • Create an Alias and point to the Published version (not $LATEST).
  • -
  • Go to your Greengrass Group and add the Lambda under Lambdas section.
  • -
  • Click on the Lambda and change the Lambda lifecycle to Make this function long-lived and keep it running indefinitely.
  • -
  • -Add a Subscription with the following configuration: -
      -
    • Source: Lambda which you just created and added to the group
    • -
    • Target: IoT Cloud
    • -
    • Topic: hello/world
    • -
    -
  • -
  • Deploy. A message from your Lambda should be published to the topic hello/world in the cloud every 5 seconds. You can check this by going to AWS IoT's Test page and subscribing to topic hello/world.
  • -
- -

Including aws-greengrass-core-sdk with your function

-Unzip the SDK into your node_modules folder of your function. This should create a aws-greengrass-core-sdk folder which includes the SDK. - -

Logging in NodeJS Lambdas

-

Your console.log operation will be logged as INFO. A console.error operation will be logged as ERROR. Currently, our NodeJS SDK only allows you to log at INFO or ERROR level only.

- -

Supported Datatypes

-

From GGC version 1.5, you can send both JSON and binary data as a payload when you invoking other Lambdas or publishing a message using IotData service. In order to make your lambda be able to handle binary payload, you need to configure the lambda in Greengrass console to mark it using binary input payload so that GGC can know how to deal with the data.

- -

Supported Context

-

In Greengrass, you can send a context object in a JSON format to be passed to another Lambda that is being invoked. The context format looks like this: - -{ - custom: { - customData: 'customData', - }, -} - -

- - -

Compatibility

-
-
-

Compatibility

-

As new features are added to AWS Greengrass, previous versions of the Greengrass SDK will be incompatible with newer versions of the AWS Greengrass - core. The following table lists the compatible SDKs for all GGC releases.

- - - - - - - - - - - - - - - - - - - -
GGC VersionCompatible SDK Versions
1.0.x-1.6.x1.0.x-1.2.x
1.7.x-1.8.x1.0.x-1.3.x
1.9.x1.0.x-1.4.x
- -
-
-

1.4.0 Updates

-

Added support for Node.js 8.10 Lambda runtime. Lambda functions that use Node.js 8.10 runtime can now run on an AWS IoT Greengrass core. (Existing Lambda functions that use Node.js 6.10 runtime can still run on Greengrass core, but they can’t be updated after 5/30/2019. Please refer to AWS Lambda Runtimes Support Policy.)

-
- -
-

1.3.1 Updates

-

Improved log level granularity.

-
- -
-

1.3.0 Updates

-

SDK supports SecretsManager client.

-
- -
-

1.2.0 Updates

-

SDK and GGC compatibility check takes place in the background.

-
- -
-

1.1.0 Updates

-

Lambda only accepted payload in JSON format. With this update, Invoking or publishing binary payload to a lambda is supported.

-
- -
-

1.0.1 Updates

-

SShadow operations were not receiving responses from the local shadow properly. This has been fixed.

-

Lambda Invoke function's InvocationType's default value was Event. This has been changed to RequestResponse.

-
- -

Getting Help

- - - - -

License

-Apache 2.0 -

-
-
- - - - - - - - - - - - - - -
- -