Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Creates a component. Components are software that run on Greengrass core devices. After you develop and test a component on your core device, you can use this operation to upload your component to IoT Greengrass. Then, you can deploy the component to other core devices.
You can use this operation to do the following:
Create components from recipes
Create a component from a recipe, which is a file that defines the component's metadata, parameters, dependencies, lifecycle, artifacts, and platform capability. For more information, see IoT Greengrass component recipe reference in the IoT Greengrass V2 Developer Guide.
To create a component from a recipe, specify
inlineRecipe
when you call this operation.Create components from Lambda functions
Create a component from an Lambda function that runs on IoT Greengrass. This creates a recipe and artifacts from the Lambda function's deployment package. You can use this operation to migrate Lambda functions from IoT Greengrass V1 to IoT Greengrass V2.
This function only accepts Lambda functions that use the following runtimes:
- Python 2.7 –
python2.7
- Python 3.7 –
python3.7
- Python 3.8 –
python3.8
- Java 8 –
java8
- Node.js 10 –
nodejs10.x
- Node.js 12 –
nodejs12.x
To create a component from a Lambda function, specify
lambdaFunction
when you call this operation.- Python 2.7 –
Synopsis
- data CreateComponentVersion = CreateComponentVersion' {}
- newCreateComponentVersion :: CreateComponentVersion
- createComponentVersion_clientToken :: Lens' CreateComponentVersion (Maybe Text)
- createComponentVersion_inlineRecipe :: Lens' CreateComponentVersion (Maybe ByteString)
- createComponentVersion_lambdaFunction :: Lens' CreateComponentVersion (Maybe LambdaFunctionRecipeSource)
- createComponentVersion_tags :: Lens' CreateComponentVersion (Maybe (HashMap Text Text))
- data CreateComponentVersionResponse = CreateComponentVersionResponse' {}
- newCreateComponentVersionResponse :: Int -> Text -> Text -> UTCTime -> CloudComponentStatus -> CreateComponentVersionResponse
- createComponentVersionResponse_arn :: Lens' CreateComponentVersionResponse (Maybe Text)
- createComponentVersionResponse_httpStatus :: Lens' CreateComponentVersionResponse Int
- createComponentVersionResponse_componentName :: Lens' CreateComponentVersionResponse Text
- createComponentVersionResponse_componentVersion :: Lens' CreateComponentVersionResponse Text
- createComponentVersionResponse_creationTimestamp :: Lens' CreateComponentVersionResponse UTCTime
- createComponentVersionResponse_status :: Lens' CreateComponentVersionResponse CloudComponentStatus
Creating a Request
data CreateComponentVersion Source #
See: newCreateComponentVersion
smart constructor.
CreateComponentVersion' | |
|
Instances
newCreateComponentVersion :: CreateComponentVersion Source #
Create a value of CreateComponentVersion
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:clientToken:CreateComponentVersion'
, createComponentVersion_clientToken
- A unique, case-sensitive identifier that you can provide to ensure that
the request is idempotent. Idempotency means that the request is
successfully processed only once, even if you send the request multiple
times. When a request succeeds, and you specify the same client token
for subsequent successful requests, the IoT Greengrass V2 service
returns the successful response that it caches from the previous
request. IoT Greengrass V2 caches successful responses for idempotent
requests for up to 8 hours.
$sel:inlineRecipe:CreateComponentVersion'
, createComponentVersion_inlineRecipe
- The recipe to use to create the component. The recipe defines the
component's metadata, parameters, dependencies, lifecycle, artifacts,
and platform compatibility.
You must specify either inlineRecipe
or lambdaFunction
.--
-- Note: This Lens
automatically encodes and decodes Base64 data.
-- The underlying isomorphism will encode to Base64 representation during
-- serialisation, and decode from Base64 representation during deserialisation.
-- This Lens
accepts and returns only raw unencoded data.
$sel:lambdaFunction:CreateComponentVersion'
, createComponentVersion_lambdaFunction
- The parameters to create a component from a Lambda function.
You must specify either inlineRecipe
or lambdaFunction
.
$sel:tags:CreateComponentVersion'
, createComponentVersion_tags
- A list of key-value pairs that contain metadata for the resource. For
more information, see
Tag your resources
in the IoT Greengrass V2 Developer Guide.
Request Lenses
createComponentVersion_clientToken :: Lens' CreateComponentVersion (Maybe Text) Source #
A unique, case-sensitive identifier that you can provide to ensure that the request is idempotent. Idempotency means that the request is successfully processed only once, even if you send the request multiple times. When a request succeeds, and you specify the same client token for subsequent successful requests, the IoT Greengrass V2 service returns the successful response that it caches from the previous request. IoT Greengrass V2 caches successful responses for idempotent requests for up to 8 hours.
createComponentVersion_inlineRecipe :: Lens' CreateComponentVersion (Maybe ByteString) Source #
The recipe to use to create the component. The recipe defines the component's metadata, parameters, dependencies, lifecycle, artifacts, and platform compatibility.
You must specify either inlineRecipe
or lambdaFunction
.--
-- Note: This Lens
automatically encodes and decodes Base64 data.
-- The underlying isomorphism will encode to Base64 representation during
-- serialisation, and decode from Base64 representation during deserialisation.
-- This Lens
accepts and returns only raw unencoded data.
createComponentVersion_lambdaFunction :: Lens' CreateComponentVersion (Maybe LambdaFunctionRecipeSource) Source #
The parameters to create a component from a Lambda function.
You must specify either inlineRecipe
or lambdaFunction
.
createComponentVersion_tags :: Lens' CreateComponentVersion (Maybe (HashMap Text Text)) Source #
A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources in the IoT Greengrass V2 Developer Guide.
Destructuring the Response
data CreateComponentVersionResponse Source #
See: newCreateComponentVersionResponse
smart constructor.
CreateComponentVersionResponse' | |
|
Instances
newCreateComponentVersionResponse Source #
:: Int | |
-> Text | |
-> Text | |
-> UTCTime | |
-> CloudComponentStatus | |
-> CreateComponentVersionResponse |
Create a value of CreateComponentVersionResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:arn:CreateComponentVersionResponse'
, createComponentVersionResponse_arn
- The
ARN
of the component version.
$sel:httpStatus:CreateComponentVersionResponse'
, createComponentVersionResponse_httpStatus
- The response's http status code.
$sel:componentName:CreateComponentVersionResponse'
, createComponentVersionResponse_componentName
- The name of the component.
$sel:componentVersion:CreateComponentVersionResponse'
, createComponentVersionResponse_componentVersion
- The version of the component.
$sel:creationTimestamp:CreateComponentVersionResponse'
, createComponentVersionResponse_creationTimestamp
- The time at which the component was created, expressed in ISO 8601
format.
$sel:status:CreateComponentVersionResponse'
, createComponentVersionResponse_status
- The status of the component version in IoT Greengrass V2. This status is
different from the status of the component on a core device.
Response Lenses
createComponentVersionResponse_arn :: Lens' CreateComponentVersionResponse (Maybe Text) Source #
The ARN of the component version.
createComponentVersionResponse_httpStatus :: Lens' CreateComponentVersionResponse Int Source #
The response's http status code.
createComponentVersionResponse_componentName :: Lens' CreateComponentVersionResponse Text Source #
The name of the component.
createComponentVersionResponse_componentVersion :: Lens' CreateComponentVersionResponse Text Source #
The version of the component.
createComponentVersionResponse_creationTimestamp :: Lens' CreateComponentVersionResponse UTCTime Source #
The time at which the component was created, expressed in ISO 8601 format.
createComponentVersionResponse_status :: Lens' CreateComponentVersionResponse CloudComponentStatus Source #
The status of the component version in IoT Greengrass V2. This status is different from the status of the component on a core device.