Menu
AWS Greengrass
API Reference

/greengrass/definition/functions

GET

GET /greengrass/definition/functions

Operation ID: ListFunctionDefinitions

Retrieves a list of Lambda function definitions.

Produces: application/json

Query Parameters

MaxResults

The maximum number of results to be returned per request.

where used: query; required: false

type: integer

NextToken

The token for the next set of results, or null if there are no additional results.

where used: query; required: false

type: string

CLI

Copy
aws greengrass list-function-definitions \ [--max-results <value>] \ [--next-token <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

Copy
{ "MaxResults": "integer", "NextToken": "string" }

Responses

200 (ListFunctionDefinitionsResponse)

Success. The response contains the IDs of all the Greengrass Lambda function definitions in this account.

ListDefinitionsResponse

Copy
{ "Definitions": [ { "Name": "string", "Id": "string", "Arn": "string", "LastUpdatedTimestamp": "string", "CreationTimestamp": "string", "LatestVersion": "string", "LatestVersionArn": "string" } ], "NextToken": "string" }
ListDefinitionsResponse

A list of definitions.

type: object

Definitions

Information about a definition.

type: array

items: DefinitionInformation

DefinitionInformation

Information about a definition.

type: object

Name

The name of the definition.

type: string

Id

The ID of the definition.

type: string

Arn

The ARN of the definition.

type: string

LastUpdatedTimestamp

The time, in milliseconds since the epoch, when the definition was last updated.

type: string

CreationTimestamp

The time, in milliseconds since the epoch, when the definition was created.

type: string

LatestVersion

The latest version of the definition.

type: string

LatestVersionArn

The ARN of the latest version of the definition.

type: string

NextToken

The token for the next set of results, or null if there are no additional results.

type: string

POST

POST /greengrass/definition/functions

Operation ID: CreateFunctionDefinition

Creates a Lambda function definition which contains a list of Lambda functions and their configurations to be used in a group. You can create an initial version of the definition by providing a list of Lambda functions and their configurations now, or use CreateFunctionDefinitionVersion later.

Produces: application/json

Body Parameters

CreateFunctionDefinitionRequestBody

where used: body; required: true

Copy
{ "Name": "string", "InitialVersion": { "Functions": [ { "Id": "string", "FunctionArn": "string", "FunctionConfiguration": { "Pinned": true, "Executable": "string", "ExecArgs": "string", "MemorySize": 0, "Timeout": 0, "Environment": { "Variables": { "additionalProperty0": "string", "additionalProperty1": "string", "additionalProperty2": "string" }, "ResourceAccessPolicies": [ { "ResourceId": "string", "Permission": "ro|rw" } ], "AccessSysfs": true } } } ] } }
Name

The name of the function definition.

type: string

InitialVersion

Information about a function definition version.

type: object

Functions

A list of Lambda functions in this function definition version.

type: array

items: Function

Information about a Lambda function.

type: object

required: ["Id"]

Id

The ID of the Lambda function.

type: string

FunctionArn

The ARN of the Lambda function.

type: string

FunctionConfiguration

The configuration of the Lambda function.

type: object

Pinned

True if the function is pinned. Pinned means the function is long-lived and starts when the core starts.

type: boolean

Executable

The name of the function executable.

type: string

ExecArgs

The execution arguments.

type: string

MemorySize

The memory size, in KB, which the function requires.

type: integer

Timeout

The allowed function execution time, after which Lambda should terminate the function. This timeout still applies to pinned lambdas for each request.

type: integer

Environment

The environment configuration of the function.

type: object

Variables

Environment variables for the Lambda function's configuration.

type: object

additionalProperties: "type"=>"string"

ResourceAccessPolicies

A list of the resources, with their permissions, to which the Lambda function will be granted access.

type: array

items: ResourceAccessPolicy

ResourceAccessPolicy

A policy used by the function to access a resource.

type: object

required: ["ResourceId"]

ResourceId

The ID of the resource. (This ID is assigned to the resource when you create the resource definiton.)

type: string

Permission

The type of permission a function has to access a resource.

type: string

enum: ["ro", "rw"]

AccessSysfs

If true, the Lambda function is allowed to access the host's /sys folder. Use this when the Lambda function needs to read device information from /sys.

type: boolean

Header Parameters

X-Amzn-Client-Token

A client token used to correlate requests and responses.

where used: header; required: false

type: string

CLI

Copy
aws greengrass create-function-definition \ [--name <value>] \ [--initial-version <value>] \ [--amzn-client-token <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

Copy
{ "Name": "string", "InitialVersion": { "Functions": [ { "Id": "string", "FunctionArn": "string", "FunctionConfiguration": { "Pinned": "boolean", "Executable": "string", "ExecArgs": "string", "MemorySize": "integer", "Timeout": "integer", "Environment": { "Variables": { "additionalProperty0": "string", "additionalProperty1": "string", "additionalProperty2": "string" }, "ResourceAccessPolicies": [ { "ResourceId": "string", "Permission": "ro|rw" } ], "AccessSysfs": "boolean" } } } ] }, "AmznClientToken": "string" }

Responses

200 (CreateFunctionDefinitionResponse)

DefinitionInformation

Copy
{ "Name": "string", "Id": "string", "Arn": "string", "LastUpdatedTimestamp": "string", "CreationTimestamp": "string", "LatestVersion": "string", "LatestVersionArn": "string" }
DefinitionInformation

Information about a definition.

type: object

Name

The name of the definition.

type: string

Id

The ID of the definition.

type: string

Arn

The ARN of the definition.

type: string

LastUpdatedTimestamp

The time, in milliseconds since the epoch, when the definition was last updated.

type: string

CreationTimestamp

The time, in milliseconds since the epoch, when the definition was created.

type: string

LatestVersion

The latest version of the definition.

type: string

LatestVersionArn

The ARN of the latest version of the definition.

type: string

400

invalid request

GeneralError

Copy
{ "Message": "string", "ErrorDetails": [ { "DetailedErrorCode": "string", "DetailedErrorMessage": "string" } ] }
GeneralError

General error information.

type: object

required: ["Message"]

Message

A message containing information about the error.

type: string

ErrorDetails

A list of error details.

type: array

items: ErrorDetail

ErrorDetail

Details about the error.

type: object

DetailedErrorCode

A detailed error code.

type: string

DetailedErrorMessage

A detailed error message.

type: string

On this page: