Skip to content

Commit

Permalink
feat(client-greengrassv2): Mark ComponentVersion in ComponentDeployme…
Browse files Browse the repository at this point in the history
…ntSpecification as required.
  • Loading branch information
awstools committed May 10, 2024
1 parent 0f5cee8 commit d56a60a
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,45 +50,9 @@ export interface CreateComponentVersionCommandOutput extends CreateComponentVers
* <p>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.</p>
* <p>This function only accepts Lambda functions that use the following runtimes:</p>
* <ul>
* <li>
* <p>Python 2.7 – <code>python2.7</code>
* </p>
* </li>
* <li>
* <p>Python 3.7 – <code>python3.7</code>
* </p>
* </li>
* <li>
* <p>Python 3.8 – <code>python3.8</code>
* </p>
* </li>
* <li>
* <p>Python 3.9 – <code>python3.9</code>
* </p>
* </li>
* <li>
* <p>Java 8 – <code>java8</code>
* </p>
* </li>
* <li>
* <p>Java 11 – <code>java11</code>
* </p>
* </li>
* <li>
* <p>Node.js 10 – <code>nodejs10.x</code>
* </p>
* </li>
* <li>
* <p>Node.js 12 – <code>nodejs12.x</code>
* </p>
* </li>
* <li>
* <p>Node.js 14 – <code>nodejs14.x</code>
* </p>
* </li>
* </ul>
* <p>This function accepts Lambda functions in all supported versions of Python, Node.js,
* and Java runtimes. IoT Greengrass doesn't apply any additional restrictions on deprecated Lambda
* runtime versions.</p>
* <p>To create a component from a Lambda function, specify <code>lambdaFunction</code> when
* you call this operation.</p>
* <note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export interface CreateDeploymentCommandOutput extends CreateDeploymentResponse,
* deploymentName: "STRING_VALUE",
* components: { // ComponentDeploymentSpecifications
* "<keys>": { // ComponentDeploymentSpecification
* componentVersion: "STRING_VALUE",
* componentVersion: "STRING_VALUE", // required
* configurationUpdate: { // ComponentConfigurationUpdate
* merge: "STRING_VALUE",
* reset: [ // ComponentConfigurationPathList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export interface GetComponentVersionArtifactCommandOutput
* const input = { // GetComponentVersionArtifactRequest
* arn: "STRING_VALUE", // required
* artifactName: "STRING_VALUE", // required
* s3EndpointType: "REGIONAL" || "GLOBAL",
* iotEndpointType: "fips" || "standard",
* };
* const command = new GetComponentVersionArtifactCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export interface GetDeploymentCommandOutput extends GetDeploymentResponse, __Met
* // iotJobArn: "STRING_VALUE",
* // components: { // ComponentDeploymentSpecifications
* // "<keys>": { // ComponentDeploymentSpecification
* // componentVersion: "STRING_VALUE",
* // componentVersion: "STRING_VALUE", // required
* // configurationUpdate: { // ComponentConfigurationUpdate
* // merge: "STRING_VALUE",
* // reset: [ // ComponentConfigurationPathList
Expand Down
53 changes: 50 additions & 3 deletions clients/client-greengrassv2/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ export interface ComponentDeploymentSpecification {
* <p>The version of the component.</p>
* @public
*/
componentVersion?: string;
componentVersion: string | undefined;

/**
* <p>The configuration updates to deploy for the component. You can define
Expand Down Expand Up @@ -2275,6 +2275,34 @@ export interface GetComponentResponse {
tags?: Record<string, string>;
}

/**
* @public
* @enum
*/
export const IotEndpointType = {
fips: "fips",
standard: "standard",
} as const;

/**
* @public
*/
export type IotEndpointType = (typeof IotEndpointType)[keyof typeof IotEndpointType];

/**
* @public
* @enum
*/
export const S3EndpointType = {
GLOBAL: "GLOBAL",
REGIONAL: "REGIONAL",
} as const;

/**
* @public
*/
export type S3EndpointType = (typeof S3EndpointType)[keyof typeof S3EndpointType];

/**
* @public
*/
Expand All @@ -2295,6 +2323,23 @@ export interface GetComponentVersionArtifactRequest {
* @public
*/
artifactName: string | undefined;

/**
* <p>Specifies the endpoint to use when getting Amazon S3 pre-signed URLs.</p>
* <p>All Amazon Web Services Regions except US East (N. Virginia) use <code>REGIONAL</code> in all cases.
* In the US East (N. Virginia) Region the default is <code>GLOBAL</code>, but you can change it
* to <code>REGIONAL</code> with this parameter.</p>
* @public
*/
s3EndpointType?: S3EndpointType;

/**
* <p>Determines if the Amazon S3 URL returned is a FIPS pre-signed URL endpoint.
* Specify <code>fips</code> if you want the returned Amazon S3 pre-signed URL to point to
* an Amazon S3 FIPS endpoint. If you don't specify a value, the default is <code>standard</code>.</p>
* @public
*/
iotEndpointType?: IotEndpointType;
}

/**
Expand Down Expand Up @@ -2760,6 +2805,8 @@ export interface ListDeploymentsRequest {

/**
* <p>The maximum number of results to be returned per paginated request.</p>
* <p>Default: <code>50</code>
* </p>
* @public
*/
maxResults?: number;
Expand Down Expand Up @@ -2964,8 +3011,8 @@ export interface InstalledComponent {

/**
* <p>The most recent deployment source that brought the component to the Greengrass core device. For
* a thing group deployment or thing deployment, the source will be the The ID of the deployment. and for
* local deployments it will be <code>LOCAL</code>.</p>
* a thing group deployment or thing deployment, the source will be the ID of the last deployment
* that contained the component. For local deployments it will be <code>LOCAL</code>.</p>
* <note>
* <p>Any deployment will attempt to reinstall currently broken components on the device,
* which will update the last installation source.</p>
Expand Down
12 changes: 10 additions & 2 deletions clients/client-greengrassv2/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,17 @@ export const se_GetComponentVersionArtifactCommand = async (
context: __SerdeContext
): Promise<__HttpRequest> => {
const b = rb(input, context);
const headers: any = {};
const headers: any = map({}, isSerializableHeaderValue, {
[_xaiet]: input[_iET]!,
});
b.bp("/greengrass/v2/components/{arn}/artifacts/{artifactName+}");
b.p("arn", () => input.arn!, "{arn}", false);
b.p("artifactName", () => input.artifactName!, "{artifactName+}", true);
const query: any = map({
[_sET]: [, input[_sET]!],
});
let body: any;
b.m("GET").h(headers).b(body);
b.m("GET").h(headers).q(query).b(body);
return b.build();
};

Expand Down Expand Up @@ -2178,15 +2183,18 @@ const isSerializableHeaderValue = (value: any): boolean =>
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);

const _hF = "historyFilter";
const _iET = "iotEndpointType";
const _mR = "maxResults";
const _nT = "nextToken";
const _pTA = "parentTargetArn";
const _rAS = "retryAfterSeconds";
const _rOF = "recipeOutputFormat";
const _ra = "retry-after";
const _s = "scope";
const _sET = "s3EndpointType";
const _st = "status";
const _tA = "targetArn";
const _tF = "topologyFilter";
const _tGA = "thingGroupArn";
const _tK = "tagKeys";
const _xaiet = "x-amz-iot-endpoint-type";
61 changes: 55 additions & 6 deletions codegen/sdk-codegen/aws-models/greengrassv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,8 @@
"componentVersion": {
"target": "com.amazonaws.greengrassv2#ComponentVersionString",
"traits": {
"smithy.api#documentation": "<p>The version of the component.</p>"
"smithy.api#documentation": "<p>The version of the component.</p>",
"smithy.api#required": {}
}
},
"configurationUpdate": {
Expand Down Expand Up @@ -1045,7 +1046,7 @@
}
],
"traits": {
"smithy.api#documentation": "<p>Creates a component. Components are software that run on Greengrass core devices. After you\n develop and test a component on your core device, you can use this operation to upload your\n component to IoT Greengrass. Then, you can deploy the component to other core devices.</p>\n <p>You can use this operation to do the following:</p>\n <ul>\n <li>\n <p>\n <b>Create components from recipes</b>\n </p>\n <p>Create a component from a recipe, which is a file that defines the component's\n metadata, parameters, dependencies, lifecycle, artifacts, and platform capability. For\n more information, see <a href=\"https://docs.aws.amazon.com/greengrass/v2/developerguide/component-recipe-reference.html\">IoT Greengrass component recipe\n reference</a> in the <i>IoT Greengrass V2 Developer Guide</i>.</p>\n <p>To create a component from a recipe, specify <code>inlineRecipe</code> when you call\n this operation.</p>\n </li>\n <li>\n <p>\n <b>Create components from Lambda functions</b>\n </p>\n <p>Create a component from an Lambda function that runs on IoT Greengrass. This creates a recipe\n and artifacts from the Lambda function's deployment package. You can use this operation to\n migrate Lambda functions from IoT Greengrass V1 to IoT Greengrass V2.</p>\n <p>This function only accepts Lambda functions that use the following runtimes:</p>\n <ul>\n <li>\n <p>Python 2.7 – <code>python2.7</code>\n </p>\n </li>\n <li>\n <p>Python 3.7 – <code>python3.7</code>\n </p>\n </li>\n <li>\n <p>Python 3.8 – <code>python3.8</code>\n </p>\n </li>\n <li>\n <p>Python 3.9 – <code>python3.9</code>\n </p>\n </li>\n <li>\n <p>Java 8 – <code>java8</code>\n </p>\n </li>\n <li>\n <p>Java 11 – <code>java11</code>\n </p>\n </li>\n <li>\n <p>Node.js 10 – <code>nodejs10.x</code>\n </p>\n </li>\n <li>\n <p>Node.js 12 – <code>nodejs12.x</code>\n </p>\n </li>\n <li>\n <p>Node.js 14 – <code>nodejs14.x</code>\n </p>\n </li>\n </ul>\n <p>To create a component from a Lambda function, specify <code>lambdaFunction</code> when\n you call this operation.</p>\n <note>\n <p>IoT Greengrass currently supports Lambda functions on only Linux core devices.</p>\n </note>\n </li>\n </ul>",
"smithy.api#documentation": "<p>Creates a component. Components are software that run on Greengrass core devices. After you\n develop and test a component on your core device, you can use this operation to upload your\n component to IoT Greengrass. Then, you can deploy the component to other core devices.</p>\n <p>You can use this operation to do the following:</p>\n <ul>\n <li>\n <p>\n <b>Create components from recipes</b>\n </p>\n <p>Create a component from a recipe, which is a file that defines the component's\n metadata, parameters, dependencies, lifecycle, artifacts, and platform capability. For\n more information, see <a href=\"https://docs.aws.amazon.com/greengrass/v2/developerguide/component-recipe-reference.html\">IoT Greengrass component recipe\n reference</a> in the <i>IoT Greengrass V2 Developer Guide</i>.</p>\n <p>To create a component from a recipe, specify <code>inlineRecipe</code> when you call\n this operation.</p>\n </li>\n <li>\n <p>\n <b>Create components from Lambda functions</b>\n </p>\n <p>Create a component from an Lambda function that runs on IoT Greengrass. This creates a recipe\n and artifacts from the Lambda function's deployment package. You can use this operation to\n migrate Lambda functions from IoT Greengrass V1 to IoT Greengrass V2.</p>\n <p>This function accepts Lambda functions in all supported versions of Python, Node.js,\n and Java runtimes. IoT Greengrass doesn't apply any additional restrictions on deprecated Lambda\n runtime versions.</p>\n <p>To create a component from a Lambda function, specify <code>lambdaFunction</code> when\n you call this operation.</p>\n <note>\n <p>IoT Greengrass currently supports Lambda functions on only Linux core devices.</p>\n </note>\n </li>\n </ul>",
"smithy.api#http": {
"method": "POST",
"uri": "/greengrass/v2/createComponentVersion",
Expand Down Expand Up @@ -2249,6 +2250,20 @@
"smithy.api#httpLabel": {},
"smithy.api#required": {}
}
},
"s3EndpointType": {
"target": "com.amazonaws.greengrassv2#S3EndpointType",
"traits": {
"smithy.api#documentation": "<p>Specifies the endpoint to use when getting Amazon S3 pre-signed URLs.</p>\n <p>All Amazon Web Services Regions except US East (N. Virginia) use <code>REGIONAL</code> in all cases.\n In the US East (N. Virginia) Region the default is <code>GLOBAL</code>, but you can change it\n to <code>REGIONAL</code> with this parameter.</p>",
"smithy.api#httpQuery": "s3EndpointType"
}
},
"iotEndpointType": {
"target": "com.amazonaws.greengrassv2#IotEndpointType",
"traits": {
"smithy.api#documentation": "<p>Determines if the Amazon S3 URL returned is a FIPS pre-signed URL endpoint. \n Specify <code>fips</code> if you want the returned Amazon S3 pre-signed URL to point to \n an Amazon S3 FIPS endpoint. If you don't specify a value, the default is <code>standard</code>.</p>",
"smithy.api#httpHeader": "x-amz-iot-endpoint-type"
}
}
},
"traits": {
Expand Down Expand Up @@ -2724,7 +2739,7 @@
"sdkId": "GreengrassV2",
"arnNamespace": "greengrass",
"cloudFormationName": "GreengrassV2",
"cloudTrailEventSource": "greengrassv2.amazonaws.com",
"cloudTrailEventSource": "greengrass.amazonaws.com",
"endpointPrefix": "greengrass"
},
"aws.auth#sigv4": {
Expand Down Expand Up @@ -3717,7 +3732,7 @@
"lastInstallationSource": {
"target": "com.amazonaws.greengrassv2#NonEmptyString",
"traits": {
"smithy.api#documentation": "<p>The most recent deployment source that brought the component to the Greengrass core device. For\n a thing group deployment or thing deployment, the source will be the The ID of the deployment. and for\n local deployments it will be <code>LOCAL</code>.</p>\n <note>\n <p>Any deployment will attempt to reinstall currently broken components on the device,\n which will update the last installation source.</p>\n </note>"
"smithy.api#documentation": "<p>The most recent deployment source that brought the component to the Greengrass core device. For\n a thing group deployment or thing deployment, the source will be the ID of the last deployment\n that contained the component. For local deployments it will be <code>LOCAL</code>.</p>\n <note>\n <p>Any deployment will attempt to reinstall currently broken components on the device,\n which will update the last installation source.</p>\n </note>"
}
},
"lifecycleStatusCodes": {
Expand Down Expand Up @@ -4115,6 +4130,23 @@
}
}
},
"com.amazonaws.greengrassv2#IotEndpointType": {
"type": "enum",
"members": {
"fips": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "fips"
}
},
"standard": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "standard"
}
}
}
},
"com.amazonaws.greengrassv2#IsLatestForTarget": {
"type": "boolean",
"traits": {
Expand Down Expand Up @@ -4930,7 +4962,7 @@
"maxResults": {
"target": "com.amazonaws.greengrassv2#DefaultMaxResults",
"traits": {
"smithy.api#documentation": "<p>The maximum number of results to be returned per paginated request.</p>",
"smithy.api#documentation": "<p>The maximum number of results to be returned per paginated request.</p>\n <p>Default: <code>50</code>\n </p>",
"smithy.api#httpQuery": "maxResults"
}
},
Expand Down Expand Up @@ -5217,7 +5249,7 @@
"smithy.api#default": 0,
"smithy.api#range": {
"min": 0,
"max": 9223372036854772000
"max": 9223372036854771712
}
}
},
Expand Down Expand Up @@ -5465,6 +5497,23 @@
"smithy.api#default": 0
}
},
"com.amazonaws.greengrassv2#S3EndpointType": {
"type": "enum",
"members": {
"REGIONAL": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "REGIONAL"
}
},
"GLOBAL": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "GLOBAL"
}
}
}
},
"com.amazonaws.greengrassv2#ServiceQuotaExceededException": {
"type": "structure",
"members": {
Expand Down

0 comments on commit d56a60a

Please sign in to comment.