Constructor
new Lambda()
Constructs a service object. This object has one method for each API operation.
Example
var lambda = new GG.Lambda();
Methods
invoke(params, callback)
Invokes a specific Lambda function.
In Greengrass, version of the Lambda which you would like to invoke needs to be provided.
In Greengrass, version of the Lambda which you would like to invoke needs to be provided.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
||||||||||||||||||||||||
callback |
lambdaCallback | The callback. |
Examples
//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
});
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
});