Skip to content

Commit 77c1d98

Browse files
author
aws
committed
Release of Version 1.5.0
1 parent 71d3565 commit 77c1d98

25 files changed

+1835
-1740
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ The environment where Greengrass is running on needs to be able to run NodeJS 8.
1818
* When you untar the package downloaded from NodeJS website, you will find `node` file under `bin` directory.
1919
* Copy the file to _**/usr/bin**_ or _**/usr/local/bin**_ folder.
2020
* Rename the file to _**nodejs8.10**_
21-
* Make sure the file is not a symlink.
2221

2322
## Getting Started - Hello World
2423

@@ -105,12 +104,28 @@ As new features are added to AWS Greengrass, previous versions of the Greengrass
105104

106105
</tr>
107106

107+
<tr>
108+
109+
<td>1.10.x</td>
110+
111+
<td>1.0.x-1.5.x</td>
112+
113+
</tr>
114+
108115
</tbody>
109116

110117
</table>
111118

112119
</div>
113120

121+
<div class="Section" id="1.5.0updates">
122+
123+
## 1.5.0 Updates[](#1.5.0updates "Permalink to this headline")
124+
125+
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.
126+
127+
</div>
128+
114129
<div class="Section" id="1.4.0updates">
115130

116131
## 1.4.0 Updates[](#1.4.0updates "Permalink to this headline")

aws-greengrass-core-sdk/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*/
4-
exports.GreengrassInterfaceVersion = '1.3';
4+
exports.GreengrassInterfaceVersion = '1.4';
55
exports.Lambda = require('./lambda');
66
exports.IotData = require('./iotdata');
77
exports.SecretsManager = require('./secretsmanager');

aws-greengrass-core-sdk/iotdata.js

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class IotData {
2424
* @param {object} params object contains parameters for the call
2525
* REQUIRED: 'thingName' the name of the thing
2626
*/
27-
const thingName = Util.getRequiredParameter(params, 'thingName');
27+
const thingName = Util.getParameter(params, 'thingName');
2828
if (thingName === undefined) {
2929
callback(new Error('"thingName" is a required parameter.'), null);
3030
return;
@@ -41,13 +41,13 @@ class IotData {
4141
* REQUIRED: 'thingName' the name of the thing
4242
* 'payload' the state information in JSON format
4343
*/
44-
const thingName = Util.getRequiredParameter(params, 'thingName');
44+
const thingName = Util.getParameter(params, 'thingName');
4545
if (thingName === undefined) {
4646
callback(new Error('"thingName" is a required parameter.'), null);
4747
return;
4848
}
4949

50-
const payload = Util.getRequiredParameter(params, 'payload');
50+
const payload = Util.getParameter(params, 'payload');
5151
if (payload === undefined) {
5252
callback(new Error('"payload" is a required parameter.'), null);
5353
return;
@@ -62,7 +62,7 @@ class IotData {
6262
* @param {object} params object contains parameters for the call
6363
* REQUIRED: 'thingName' the name of the thing
6464
*/
65-
const thingName = Util.getRequiredParameter(params, 'thingName');
65+
const thingName = Util.getParameter(params, 'thingName');
6666
if (thingName === undefined) {
6767
callback(new Error('"thingName" is a required parameter.'), null);
6868
return;
@@ -78,26 +78,45 @@ class IotData {
7878
* @param {object} params object contains parameters for the call
7979
* REQUIRED: 'topic' the topic name to be published
8080
* 'payload' the state information in JSON format
81+
* OPTIONAL: 'queueFullPolicy' the policy for GGC to take when its internal queue is full
8182
*/
82-
const topic = Util.getRequiredParameter(params, 'topic');
83+
const topic = Util.getParameter(params, 'topic');
8384
if (topic === undefined) {
8485
callback(new Error('"topic" is a required parameter'), null);
8586
return;
8687
}
8788

88-
const payload = Util.getRequiredParameter(params, 'payload');
89+
const payload = Util.getParameter(params, 'payload');
8990
if (payload === undefined) {
9091
callback(new Error('"payload" is a required parameter'), null);
9192
return;
9293
}
9394

95+
// this is an optional parameter
96+
const queueFullPolicy = Util.getParameter(params, 'queueFullPolicy');
97+
9498
const context = {
9599
custom: {
96100
source: MY_FUNCTION_ARN,
97101
subject: topic,
102+
queueFullPolicy: '',
98103
},
99104
};
100105

106+
switch (queueFullPolicy) {
107+
case 'BestEffort':
108+
case 'AllOrError':
109+
context.custom.queueFullPolicy = queueFullPolicy;
110+
break;
111+
case '':
112+
case undefined:
113+
case null:
114+
break;
115+
default:
116+
callback(new Error(`queueFullPolicy "${queueFullPolicy}" is not supported`), null);
117+
break;
118+
}
119+
101120
const buff = Buffer.from(JSON.stringify(context));
102121
const clientContext = buff.toString('base64');
103122

aws-greengrass-core-sdk/lambda.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Lambda {
1717
}
1818

1919
invoke(params, callback) {
20-
const functionName = Util.getRequiredParameter(params, 'FunctionName');
20+
const functionName = Util.getParameter(params, 'FunctionName');
2121
if (functionName === undefined) {
2222
callback(new Error('"FunctionName" is a required parameter'), null);
2323
return;

aws-greengrass-core-sdk/secretsmanager.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ class SecretsManager {
2323
}
2424

2525
getSecretValue(params, callback) {
26-
const secretId = Util.getRequiredParameter(params, KEY_SECRET_ID);
27-
const versionId = Util.getRequiredParameter(params, KEY_VERSION_ID);
28-
const versionStage = Util.getRequiredParameter(params, KEY_VERSION_STAGE);
26+
const secretId = Util.getParameter(params, KEY_SECRET_ID);
27+
const versionId = Util.getParameter(params, KEY_VERSION_ID);
28+
const versionStage = Util.getParameter(params, KEY_VERSION_STAGE);
2929

3030
if (secretId === undefined) {
3131
callback(new Error(`"${KEY_SECRET_ID}" is a required parameter`), null);

aws-greengrass-core-sdk/util.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
66
const qualifierRegex = /(|[a-zA-Z0-9$_-]+)/;
77

8-
exports.getRequiredParameter = function _getRequiredParameter(params, requiredParam) {
9-
if (!Object.prototype.hasOwnProperty.call(params, requiredParam)) {
8+
exports.getParameter = function _getParameter(params, desiredParam) {
9+
if (!Object.prototype.hasOwnProperty.call(params, desiredParam)) {
1010
return;
1111
}
12-
return params[requiredParam];
12+
return params[desiredParam];
1313
};
1414

1515
exports.isValidJSON = function _isValidJSON(str) {

docs/.nojekyll

Whitespace-only changes.

0 commit comments

Comments
 (0)