Skip to content

Commit fe02b18

Browse files
author
awstools
committed
feat(client-greengrassv2): This release adds the new DeleteDeployment API operation that you can use to delete deployment resources. This release also adds support for discontinued AWS-provided components, so AWS can communicate when a component has any issues that you should consider before you deploy it.
1 parent 3fe961f commit fe02b18

12 files changed

+648
-50
lines changed

Diff for: clients/client-greengrassv2/src/GreengrassV2.ts

+126-2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ import {
4141
DeleteCoreDeviceCommandInput,
4242
DeleteCoreDeviceCommandOutput,
4343
} from "./commands/DeleteCoreDeviceCommand";
44+
import {
45+
DeleteDeploymentCommand,
46+
DeleteDeploymentCommandInput,
47+
DeleteDeploymentCommandOutput,
48+
} from "./commands/DeleteDeploymentCommand";
4449
import {
4550
DescribeComponentCommand,
4651
DescribeComponentCommandInput,
@@ -344,17 +349,29 @@ export class GreengrassV2 extends GreengrassV2Client {
344349
* </p>
345350
* </li>
346351
* <li>
352+
* <p>Python 3.9 – <code>python3.9</code>
353+
* </p>
354+
* </li>
355+
* <li>
347356
* <p>Java 8 – <code>java8</code>
348357
* </p>
349358
* </li>
350359
* <li>
360+
* <p>Java 11 – <code>java11</code>
361+
* </p>
362+
* </li>
363+
* <li>
351364
* <p>Node.js 10 – <code>nodejs10.x</code>
352365
* </p>
353366
* </li>
354367
* <li>
355368
* <p>Node.js 12 – <code>nodejs12.x</code>
356369
* </p>
357370
* </li>
371+
* <li>
372+
* <p>Node.js 14 – <code>nodejs14.x</code>
373+
* </p>
374+
* </li>
358375
* </ul>
359376
* <p>To create a component from a Lambda function, specify <code>lambdaFunction</code>
360377
* when you call this operation.</p>
@@ -508,6 +525,42 @@ export class GreengrassV2 extends GreengrassV2Client {
508525
}
509526
}
510527

528+
/**
529+
* <p>Deletes a deployment. To delete an active deployment, you must first cancel it. For more
530+
* information, see <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_CancelDeployment.html">CancelDeployment</a>.</p>
531+
* <p>Deleting a deployment doesn't affect core devices that run that deployment, because core
532+
* devices store the deployment's configuration on the device. Additionally, core devices can
533+
* roll back to a previous deployment that has been deleted.</p>
534+
*/
535+
public deleteDeployment(
536+
args: DeleteDeploymentCommandInput,
537+
options?: __HttpHandlerOptions
538+
): Promise<DeleteDeploymentCommandOutput>;
539+
public deleteDeployment(
540+
args: DeleteDeploymentCommandInput,
541+
cb: (err: any, data?: DeleteDeploymentCommandOutput) => void
542+
): void;
543+
public deleteDeployment(
544+
args: DeleteDeploymentCommandInput,
545+
options: __HttpHandlerOptions,
546+
cb: (err: any, data?: DeleteDeploymentCommandOutput) => void
547+
): void;
548+
public deleteDeployment(
549+
args: DeleteDeploymentCommandInput,
550+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DeleteDeploymentCommandOutput) => void),
551+
cb?: (err: any, data?: DeleteDeploymentCommandOutput) => void
552+
): Promise<DeleteDeploymentCommandOutput> | void {
553+
const command = new DeleteDeploymentCommand(args);
554+
if (typeof optionsOrCb === "function") {
555+
this.send(command, optionsOrCb);
556+
} else if (typeof cb === "function") {
557+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
558+
this.send(command, optionsOrCb || {}, cb);
559+
} else {
560+
return this.send(command, optionsOrCb);
561+
}
562+
}
563+
511564
/**
512565
* <p>Retrieves metadata for a version of a component.</p>
513566
*/
@@ -606,7 +659,7 @@ export class GreengrassV2 extends GreengrassV2Client {
606659
}
607660

608661
/**
609-
* <p>Gets the pre-signed URL to download a public component artifact. Core devices call this
662+
* <p>Gets the pre-signed URL to download a public or a Lambda component artifact. Core devices call this
610663
* operation to identify the URL that they can use to download an artifact to install.</p>
611664
*/
612665
public getComponentVersionArtifact(
@@ -678,6 +731,29 @@ export class GreengrassV2 extends GreengrassV2Client {
678731

679732
/**
680733
* <p>Retrieves metadata for a Greengrass core device.</p>
734+
* <note>
735+
* <p>IoT Greengrass relies on individual devices to send status updates to the Amazon Web Services Cloud. If the IoT Greengrass Core
736+
* software isn't running on the device, or if device isn't connected to the Amazon Web Services Cloud, then
737+
* the reported status of that device might not reflect its current status. The status timestamp
738+
* indicates when the device status was last updated.</p>
739+
* <p>Core devices send status updates at the following times:</p>
740+
* <ul>
741+
* <li>
742+
* <p>When the IoT Greengrass Core software starts</p>
743+
* </li>
744+
* <li>
745+
* <p>When the core device receives a deployment from the Amazon Web Services Cloud</p>
746+
* </li>
747+
* <li>
748+
* <p>When the status of any component on the core device becomes <code>BROKEN</code>
749+
* </p>
750+
* </li>
751+
* <li>
752+
* <p>At a <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html#greengrass-nucleus-component-configuration-fss">regular interval
753+
* that you can configure</a>, which defaults to 24 hours</p>
754+
* </li>
755+
* </ul>
756+
* </note>
681757
*/
682758
public getCoreDevice(
683759
args: GetCoreDeviceCommandInput,
@@ -877,6 +953,29 @@ export class GreengrassV2 extends GreengrassV2Client {
877953

878954
/**
879955
* <p>Retrieves a paginated list of Greengrass core devices.</p>
956+
* <note>
957+
* <p>IoT Greengrass relies on individual devices to send status updates to the Amazon Web Services Cloud. If the IoT Greengrass Core
958+
* software isn't running on the device, or if device isn't connected to the Amazon Web Services Cloud, then
959+
* the reported status of that device might not reflect its current status. The status timestamp
960+
* indicates when the device status was last updated.</p>
961+
* <p>Core devices send status updates at the following times:</p>
962+
* <ul>
963+
* <li>
964+
* <p>When the IoT Greengrass Core software starts</p>
965+
* </li>
966+
* <li>
967+
* <p>When the core device receives a deployment from the Amazon Web Services Cloud</p>
968+
* </li>
969+
* <li>
970+
* <p>When the status of any component on the core device becomes <code>BROKEN</code>
971+
* </p>
972+
* </li>
973+
* <li>
974+
* <p>At a <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html#greengrass-nucleus-component-configuration-fss">regular interval
975+
* that you can configure</a>, which defaults to 24 hours</p>
976+
* </li>
977+
* </ul>
978+
* </note>
880979
*/
881980
public listCoreDevices(
882981
args: ListCoreDevicesCommandInput,
@@ -973,7 +1072,32 @@ export class GreengrassV2 extends GreengrassV2Client {
9731072
}
9741073

9751074
/**
976-
* <p>Retrieves a paginated list of the components that a Greengrass core device runs.</p>
1075+
* <p>Retrieves a paginated list of the components that a Greengrass core device runs.
1076+
* This list doesn't include components that are deployed from local deployments or
1077+
* components that are deployed as dependencies of other components.</p>
1078+
* <note>
1079+
* <p>IoT Greengrass relies on individual devices to send status updates to the Amazon Web Services Cloud. If the IoT Greengrass Core
1080+
* software isn't running on the device, or if device isn't connected to the Amazon Web Services Cloud, then
1081+
* the reported status of that device might not reflect its current status. The status timestamp
1082+
* indicates when the device status was last updated.</p>
1083+
* <p>Core devices send status updates at the following times:</p>
1084+
* <ul>
1085+
* <li>
1086+
* <p>When the IoT Greengrass Core software starts</p>
1087+
* </li>
1088+
* <li>
1089+
* <p>When the core device receives a deployment from the Amazon Web Services Cloud</p>
1090+
* </li>
1091+
* <li>
1092+
* <p>When the status of any component on the core device becomes <code>BROKEN</code>
1093+
* </p>
1094+
* </li>
1095+
* <li>
1096+
* <p>At a <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html#greengrass-nucleus-component-configuration-fss">regular interval
1097+
* that you can configure</a>, which defaults to 24 hours</p>
1098+
* </li>
1099+
* </ul>
1100+
* </note>
9771101
*/
9781102
public listInstalledComponents(
9791103
args: ListInstalledComponentsCommandInput,

Diff for: clients/client-greengrassv2/src/GreengrassV2Client.ts

+3
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ import {
7272
import { CreateDeploymentCommandInput, CreateDeploymentCommandOutput } from "./commands/CreateDeploymentCommand";
7373
import { DeleteComponentCommandInput, DeleteComponentCommandOutput } from "./commands/DeleteComponentCommand";
7474
import { DeleteCoreDeviceCommandInput, DeleteCoreDeviceCommandOutput } from "./commands/DeleteCoreDeviceCommand";
75+
import { DeleteDeploymentCommandInput, DeleteDeploymentCommandOutput } from "./commands/DeleteDeploymentCommand";
7576
import { DescribeComponentCommandInput, DescribeComponentCommandOutput } from "./commands/DescribeComponentCommand";
7677
import {
7778
DisassociateServiceRoleFromAccountCommandInput,
@@ -136,6 +137,7 @@ export type ServiceInputTypes =
136137
| CreateDeploymentCommandInput
137138
| DeleteComponentCommandInput
138139
| DeleteCoreDeviceCommandInput
140+
| DeleteDeploymentCommandInput
139141
| DescribeComponentCommandInput
140142
| DisassociateServiceRoleFromAccountCommandInput
141143
| GetComponentCommandInput
@@ -166,6 +168,7 @@ export type ServiceOutputTypes =
166168
| CreateDeploymentCommandOutput
167169
| DeleteComponentCommandOutput
168170
| DeleteCoreDeviceCommandOutput
171+
| DeleteDeploymentCommandOutput
169172
| DescribeComponentCommandOutput
170173
| DisassociateServiceRoleFromAccountCommandOutput
171174
| GetComponentCommandOutput

Diff for: clients/client-greengrassv2/src/commands/CreateComponentVersionCommand.ts

+12
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,29 @@ export interface CreateComponentVersionCommandOutput extends CreateComponentVers
6161
* </p>
6262
* </li>
6363
* <li>
64+
* <p>Python 3.9 – <code>python3.9</code>
65+
* </p>
66+
* </li>
67+
* <li>
6468
* <p>Java 8 – <code>java8</code>
6569
* </p>
6670
* </li>
6771
* <li>
72+
* <p>Java 11 – <code>java11</code>
73+
* </p>
74+
* </li>
75+
* <li>
6876
* <p>Node.js 10 – <code>nodejs10.x</code>
6977
* </p>
7078
* </li>
7179
* <li>
7280
* <p>Node.js 12 – <code>nodejs12.x</code>
7381
* </p>
7482
* </li>
83+
* <li>
84+
* <p>Node.js 14 – <code>nodejs14.x</code>
85+
* </p>
86+
* </li>
7587
* </ul>
7688
* <p>To create a component from a Lambda function, specify <code>lambdaFunction</code>
7789
* when you call this operation.</p>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
SerdeContext as __SerdeContext,
13+
} from "@aws-sdk/types";
14+
15+
import { GreengrassV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GreengrassV2Client";
16+
import { DeleteDeploymentRequest } from "../models/models_0";
17+
import {
18+
deserializeAws_restJson1DeleteDeploymentCommand,
19+
serializeAws_restJson1DeleteDeploymentCommand,
20+
} from "../protocols/Aws_restJson1";
21+
22+
export interface DeleteDeploymentCommandInput extends DeleteDeploymentRequest {}
23+
export interface DeleteDeploymentCommandOutput extends __MetadataBearer {}
24+
25+
/**
26+
* <p>Deletes a deployment. To delete an active deployment, you must first cancel it. For more
27+
* information, see <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_CancelDeployment.html">CancelDeployment</a>.</p>
28+
* <p>Deleting a deployment doesn't affect core devices that run that deployment, because core
29+
* devices store the deployment's configuration on the device. Additionally, core devices can
30+
* roll back to a previous deployment that has been deleted.</p>
31+
* @example
32+
* Use a bare-bones client and the command you need to make an API call.
33+
* ```javascript
34+
* import { GreengrassV2Client, DeleteDeploymentCommand } from "@aws-sdk/client-greengrassv2"; // ES Modules import
35+
* // const { GreengrassV2Client, DeleteDeploymentCommand } = require("@aws-sdk/client-greengrassv2"); // CommonJS import
36+
* const client = new GreengrassV2Client(config);
37+
* const command = new DeleteDeploymentCommand(input);
38+
* const response = await client.send(command);
39+
* ```
40+
*
41+
* @see {@link DeleteDeploymentCommandInput} for command's `input` shape.
42+
* @see {@link DeleteDeploymentCommandOutput} for command's `response` shape.
43+
* @see {@link GreengrassV2ClientResolvedConfig | config} for GreengrassV2Client's `config` shape.
44+
*
45+
*/
46+
export class DeleteDeploymentCommand extends $Command<
47+
DeleteDeploymentCommandInput,
48+
DeleteDeploymentCommandOutput,
49+
GreengrassV2ClientResolvedConfig
50+
> {
51+
// Start section: command_properties
52+
// End section: command_properties
53+
54+
constructor(readonly input: DeleteDeploymentCommandInput) {
55+
// Start section: command_constructor
56+
super();
57+
// End section: command_constructor
58+
}
59+
60+
/**
61+
* @internal
62+
*/
63+
resolveMiddleware(
64+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
65+
configuration: GreengrassV2ClientResolvedConfig,
66+
options?: __HttpHandlerOptions
67+
): Handler<DeleteDeploymentCommandInput, DeleteDeploymentCommandOutput> {
68+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
69+
70+
const stack = clientStack.concat(this.middlewareStack);
71+
72+
const { logger } = configuration;
73+
const clientName = "GreengrassV2Client";
74+
const commandName = "DeleteDeploymentCommand";
75+
const handlerExecutionContext: HandlerExecutionContext = {
76+
logger,
77+
clientName,
78+
commandName,
79+
inputFilterSensitiveLog: DeleteDeploymentRequest.filterSensitiveLog,
80+
outputFilterSensitiveLog: (output: any) => output,
81+
};
82+
const { requestHandler } = configuration;
83+
return stack.resolve(
84+
(request: FinalizeHandlerArguments<any>) =>
85+
requestHandler.handle(request.request as __HttpRequest, options || {}),
86+
handlerExecutionContext
87+
);
88+
}
89+
90+
private serialize(input: DeleteDeploymentCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
91+
return serializeAws_restJson1DeleteDeploymentCommand(input, context);
92+
}
93+
94+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DeleteDeploymentCommandOutput> {
95+
return deserializeAws_restJson1DeleteDeploymentCommand(output, context);
96+
}
97+
98+
// Start section: command_body_extra
99+
// End section: command_body_extra
100+
}

Diff for: clients/client-greengrassv2/src/commands/GetComponentVersionArtifactCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface GetComponentVersionArtifactCommandOutput
2525
__MetadataBearer {}
2626

2727
/**
28-
* <p>Gets the pre-signed URL to download a public component artifact. Core devices call this
28+
* <p>Gets the pre-signed URL to download a public or a Lambda component artifact. Core devices call this
2929
* operation to identify the URL that they can use to download an artifact to install.</p>
3030
* @example
3131
* Use a bare-bones client and the command you need to make an API call.

Diff for: clients/client-greengrassv2/src/commands/GetCoreDeviceCommand.ts

+23
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,29 @@ export interface GetCoreDeviceCommandOutput extends GetCoreDeviceResponse, __Met
2424

2525
/**
2626
* <p>Retrieves metadata for a Greengrass core device.</p>
27+
* <note>
28+
* <p>IoT Greengrass relies on individual devices to send status updates to the Amazon Web Services Cloud. If the IoT Greengrass Core
29+
* software isn't running on the device, or if device isn't connected to the Amazon Web Services Cloud, then
30+
* the reported status of that device might not reflect its current status. The status timestamp
31+
* indicates when the device status was last updated.</p>
32+
* <p>Core devices send status updates at the following times:</p>
33+
* <ul>
34+
* <li>
35+
* <p>When the IoT Greengrass Core software starts</p>
36+
* </li>
37+
* <li>
38+
* <p>When the core device receives a deployment from the Amazon Web Services Cloud</p>
39+
* </li>
40+
* <li>
41+
* <p>When the status of any component on the core device becomes <code>BROKEN</code>
42+
* </p>
43+
* </li>
44+
* <li>
45+
* <p>At a <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html#greengrass-nucleus-component-configuration-fss">regular interval
46+
* that you can configure</a>, which defaults to 24 hours</p>
47+
* </li>
48+
* </ul>
49+
* </note>
2750
* @example
2851
* Use a bare-bones client and the command you need to make an API call.
2952
* ```javascript

0 commit comments

Comments
 (0)