Skip to content

Commit 7120ec9

Browse files
author
awstools
committed
feat(client-ssm): This release introduces a new API: DeleteOpsItem. This allows deletion of an OpsItem.
1 parent 963f743 commit 7120ec9

17 files changed

+633
-213
lines changed

clients/client-ssm/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ operations at scale.</p>
1515
</p>
1616
<ul>
1717
<li>
18-
<p>For information about each of the capabilities that comprise Systems Manager, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/what-is-systems-manager.html#systems-manager-capabilities">Systems Manager capabilities</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
18+
<p>For information about each of the capabilities that comprise Systems Manager, see <a href="https://docs.aws.amazon.com/systems-manager-automation-runbooks/latest/userguide/systems-manager-capabilities.html">Systems Manager capabilities</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
1919
</li>
2020
<li>
2121
<p>For details about predefined runbooks for Automation, a capability of Amazon Web Services Systems Manager, see the
@@ -381,6 +381,14 @@ DeleteMaintenanceWindow
381381

382382
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ssm/classes/deletemaintenancewindowcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ssm/interfaces/deletemaintenancewindowcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ssm/interfaces/deletemaintenancewindowcommandoutput.html)
383383

384+
</details>
385+
<details>
386+
<summary>
387+
DeleteOpsItem
388+
</summary>
389+
390+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ssm/classes/deleteopsitemcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ssm/interfaces/deleteopsitemcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ssm/interfaces/deleteopsitemcommandoutput.html)
391+
384392
</details>
385393
<details>
386394
<summary>

clients/client-ssm/src/SSM.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ import {
9292
DeleteMaintenanceWindowCommandInput,
9393
DeleteMaintenanceWindowCommandOutput,
9494
} from "./commands/DeleteMaintenanceWindowCommand";
95+
import {
96+
DeleteOpsItemCommand,
97+
DeleteOpsItemCommandInput,
98+
DeleteOpsItemCommandOutput,
99+
} from "./commands/DeleteOpsItemCommand";
95100
import {
96101
DeleteOpsMetadataCommand,
97102
DeleteOpsMetadataCommandInput,
@@ -701,6 +706,7 @@ const commands = {
701706
DeleteDocumentCommand,
702707
DeleteInventoryCommand,
703708
DeleteMaintenanceWindowCommand,
709+
DeleteOpsItemCommand,
704710
DeleteOpsMetadataCommand,
705711
DeleteParameterCommand,
706712
DeleteParametersCommand,
@@ -1109,6 +1115,17 @@ export interface SSM {
11091115
cb: (err: any, data?: DeleteMaintenanceWindowCommandOutput) => void
11101116
): void;
11111117

1118+
/**
1119+
* @see {@link DeleteOpsItemCommand}
1120+
*/
1121+
deleteOpsItem(args: DeleteOpsItemCommandInput, options?: __HttpHandlerOptions): Promise<DeleteOpsItemCommandOutput>;
1122+
deleteOpsItem(args: DeleteOpsItemCommandInput, cb: (err: any, data?: DeleteOpsItemCommandOutput) => void): void;
1123+
deleteOpsItem(
1124+
args: DeleteOpsItemCommandInput,
1125+
options: __HttpHandlerOptions,
1126+
cb: (err: any, data?: DeleteOpsItemCommandOutput) => void
1127+
): void;
1128+
11121129
/**
11131130
* @see {@link DeleteOpsMetadataCommand}
11141131
*/
@@ -3065,7 +3082,7 @@ export interface SSM {
30653082
* </p>
30663083
* <ul>
30673084
* <li>
3068-
* <p>For information about each of the capabilities that comprise Systems Manager, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/what-is-systems-manager.html#systems-manager-capabilities">Systems Manager capabilities</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
3085+
* <p>For information about each of the capabilities that comprise Systems Manager, see <a href="https://docs.aws.amazon.com/systems-manager-automation-runbooks/latest/userguide/systems-manager-capabilities.html">Systems Manager capabilities</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
30693086
* </li>
30703087
* <li>
30713088
* <p>For details about predefined runbooks for Automation, a capability of Amazon Web Services Systems Manager, see the

clients/client-ssm/src/SSMClient.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ import {
8989
DeleteMaintenanceWindowCommandInput,
9090
DeleteMaintenanceWindowCommandOutput,
9191
} from "./commands/DeleteMaintenanceWindowCommand";
92+
import { DeleteOpsItemCommandInput, DeleteOpsItemCommandOutput } from "./commands/DeleteOpsItemCommand";
9293
import { DeleteOpsMetadataCommandInput, DeleteOpsMetadataCommandOutput } from "./commands/DeleteOpsMetadataCommand";
9394
import { DeleteParameterCommandInput, DeleteParameterCommandOutput } from "./commands/DeleteParameterCommand";
9495
import { DeleteParametersCommandInput, DeleteParametersCommandOutput } from "./commands/DeleteParametersCommand";
@@ -497,6 +498,7 @@ export type ServiceInputTypes =
497498
| DeleteDocumentCommandInput
498499
| DeleteInventoryCommandInput
499500
| DeleteMaintenanceWindowCommandInput
501+
| DeleteOpsItemCommandInput
500502
| DeleteOpsMetadataCommandInput
501503
| DeleteParameterCommandInput
502504
| DeleteParametersCommandInput
@@ -640,6 +642,7 @@ export type ServiceOutputTypes =
640642
| DeleteDocumentCommandOutput
641643
| DeleteInventoryCommandOutput
642644
| DeleteMaintenanceWindowCommandOutput
645+
| DeleteOpsItemCommandOutput
643646
| DeleteOpsMetadataCommandOutput
644647
| DeleteParameterCommandOutput
645648
| DeleteParametersCommandOutput
@@ -942,7 +945,7 @@ export interface SSMClientResolvedConfig extends SSMClientResolvedConfigType {}
942945
* </p>
943946
* <ul>
944947
* <li>
945-
* <p>For information about each of the capabilities that comprise Systems Manager, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/what-is-systems-manager.html#systems-manager-capabilities">Systems Manager capabilities</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
948+
* <p>For information about each of the capabilities that comprise Systems Manager, see <a href="https://docs.aws.amazon.com/systems-manager-automation-runbooks/latest/userguide/systems-manager-capabilities.html">Systems Manager capabilities</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
946949
* </li>
947950
* <li>
948951
* <p>For details about predefined runbooks for Automation, a capability of Amazon Web Services Systems Manager, see the

clients/client-ssm/src/commands/AssociateOpsItemRelatedItemCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ export interface AssociateOpsItemRelatedItemCommandOutput
7171
* @throws {@link InternalServerError} (server fault)
7272
* <p>An error occurred on the server side.</p>
7373
*
74+
* @throws {@link OpsItemConflictException} (client fault)
75+
* <p>The specified OpsItem is in the process of being deleted.</p>
76+
*
7477
* @throws {@link OpsItemInvalidParameterException} (client fault)
7578
* <p>A specified parameter argument isn't valid. Verify the available arguments and try
7679
* again.</p>
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
5+
import { Command as $Command } from "@smithy/smithy-client";
6+
import {
7+
FinalizeHandlerArguments,
8+
Handler,
9+
HandlerExecutionContext,
10+
HttpHandlerOptions as __HttpHandlerOptions,
11+
MetadataBearer as __MetadataBearer,
12+
MiddlewareStack,
13+
SerdeContext as __SerdeContext,
14+
SMITHY_CONTEXT_KEY,
15+
} from "@smithy/types";
16+
17+
import { DeleteOpsItemRequest, DeleteOpsItemResponse } from "../models/models_0";
18+
import { de_DeleteOpsItemCommand, se_DeleteOpsItemCommand } from "../protocols/Aws_json1_1";
19+
import { ServiceInputTypes, ServiceOutputTypes, SSMClientResolvedConfig } from "../SSMClient";
20+
21+
/**
22+
* @public
23+
*/
24+
export { __MetadataBearer, $Command };
25+
/**
26+
* @public
27+
*
28+
* The input for {@link DeleteOpsItemCommand}.
29+
*/
30+
export interface DeleteOpsItemCommandInput extends DeleteOpsItemRequest {}
31+
/**
32+
* @public
33+
*
34+
* The output of {@link DeleteOpsItemCommand}.
35+
*/
36+
export interface DeleteOpsItemCommandOutput extends DeleteOpsItemResponse, __MetadataBearer {}
37+
38+
/**
39+
* @public
40+
* <p>Delete an OpsItem. You must have permission in Identity and Access Management (IAM) to
41+
* delete an OpsItem. </p>
42+
* <important>
43+
* <p>Note the following important information about this operation.</p>
44+
* <ul>
45+
* <li>
46+
* <p>Deleting an OpsItem is irreversible. You can't restore a deleted OpsItem.</p>
47+
* </li>
48+
* <li>
49+
* <p>This operation uses an <i>eventual consistency model</i>, which means the
50+
* system can take a few minutes to complete this operation. If you delete an OpsItem and
51+
* immediately call, for example, <a>GetOpsItem</a>, the deleted OpsItem might still
52+
* appear in the response. </p>
53+
* </li>
54+
* <li>
55+
* <p>This operation is idempotent. The system doesn't throw an exception if you repeatedly
56+
* call this operation for the same OpsItem. If the first call is successful, all additional calls
57+
* return the same successful response as the first call.</p>
58+
* </li>
59+
* <li>
60+
* <p>This operation doesn't support cross-account calls. A delegated administrator or
61+
* management account can't delete OpsItems in other accounts, even if OpsCenter has been set up for
62+
* cross-account administration. For more information about cross-account administration, see
63+
* <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setting-up-cross-account.html">Setting up
64+
* OpsCenter to centrally manage OpsItems across accounts</a> in the <i>Systems Manager User Guide</i>.</p>
65+
* </li>
66+
* </ul>
67+
* </important>
68+
* @example
69+
* Use a bare-bones client and the command you need to make an API call.
70+
* ```javascript
71+
* import { SSMClient, DeleteOpsItemCommand } from "@aws-sdk/client-ssm"; // ES Modules import
72+
* // const { SSMClient, DeleteOpsItemCommand } = require("@aws-sdk/client-ssm"); // CommonJS import
73+
* const client = new SSMClient(config);
74+
* const input = { // DeleteOpsItemRequest
75+
* OpsItemId: "STRING_VALUE", // required
76+
* };
77+
* const command = new DeleteOpsItemCommand(input);
78+
* const response = await client.send(command);
79+
* // {};
80+
*
81+
* ```
82+
*
83+
* @param DeleteOpsItemCommandInput - {@link DeleteOpsItemCommandInput}
84+
* @returns {@link DeleteOpsItemCommandOutput}
85+
* @see {@link DeleteOpsItemCommandInput} for command's `input` shape.
86+
* @see {@link DeleteOpsItemCommandOutput} for command's `response` shape.
87+
* @see {@link SSMClientResolvedConfig | config} for SSMClient's `config` shape.
88+
*
89+
* @throws {@link InternalServerError} (server fault)
90+
* <p>An error occurred on the server side.</p>
91+
*
92+
* @throws {@link OpsItemInvalidParameterException} (client fault)
93+
* <p>A specified parameter argument isn't valid. Verify the available arguments and try
94+
* again.</p>
95+
*
96+
* @throws {@link SSMServiceException}
97+
* <p>Base exception class for all service exceptions from SSM service.</p>
98+
*
99+
*/
100+
export class DeleteOpsItemCommand extends $Command<
101+
DeleteOpsItemCommandInput,
102+
DeleteOpsItemCommandOutput,
103+
SSMClientResolvedConfig
104+
> {
105+
// Start section: command_properties
106+
// End section: command_properties
107+
108+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
109+
return {
110+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
111+
Endpoint: { type: "builtInParams", name: "endpoint" },
112+
Region: { type: "builtInParams", name: "region" },
113+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
114+
};
115+
}
116+
117+
/**
118+
* @public
119+
*/
120+
constructor(readonly input: DeleteOpsItemCommandInput) {
121+
// Start section: command_constructor
122+
super();
123+
// End section: command_constructor
124+
}
125+
126+
/**
127+
* @internal
128+
*/
129+
resolveMiddleware(
130+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
131+
configuration: SSMClientResolvedConfig,
132+
options?: __HttpHandlerOptions
133+
): Handler<DeleteOpsItemCommandInput, DeleteOpsItemCommandOutput> {
134+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
135+
this.middlewareStack.use(getEndpointPlugin(configuration, DeleteOpsItemCommand.getEndpointParameterInstructions()));
136+
137+
const stack = clientStack.concat(this.middlewareStack);
138+
139+
const { logger } = configuration;
140+
const clientName = "SSMClient";
141+
const commandName = "DeleteOpsItemCommand";
142+
const handlerExecutionContext: HandlerExecutionContext = {
143+
logger,
144+
clientName,
145+
commandName,
146+
inputFilterSensitiveLog: (_: any) => _,
147+
outputFilterSensitiveLog: (_: any) => _,
148+
[SMITHY_CONTEXT_KEY]: {
149+
service: "AmazonSSM",
150+
operation: "DeleteOpsItem",
151+
},
152+
};
153+
const { requestHandler } = configuration;
154+
return stack.resolve(
155+
(request: FinalizeHandlerArguments<any>) =>
156+
requestHandler.handle(request.request as __HttpRequest, options || {}),
157+
handlerExecutionContext
158+
);
159+
}
160+
161+
/**
162+
* @internal
163+
*/
164+
private serialize(input: DeleteOpsItemCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
165+
return se_DeleteOpsItemCommand(input, context);
166+
}
167+
168+
/**
169+
* @internal
170+
*/
171+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DeleteOpsItemCommandOutput> {
172+
return de_DeleteOpsItemCommand(output, context);
173+
}
174+
175+
// Start section: command_body_extra
176+
// End section: command_body_extra
177+
}

clients/client-ssm/src/commands/DescribeMaintenanceWindowTasksCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import {
1414
SMITHY_CONTEXT_KEY,
1515
} from "@smithy/types";
1616

17+
import { DescribeMaintenanceWindowTasksRequest } from "../models/models_0";
1718
import {
18-
DescribeMaintenanceWindowTasksRequest,
1919
DescribeMaintenanceWindowTasksResult,
2020
DescribeMaintenanceWindowTasksResultFilterSensitiveLog,
21-
} from "../models/models_0";
21+
} from "../models/models_1";
2222
import {
2323
de_DescribeMaintenanceWindowTasksCommand,
2424
se_DescribeMaintenanceWindowTasksCommand,

clients/client-ssm/src/commands/DisassociateOpsItemRelatedItemCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ export interface DisassociateOpsItemRelatedItemCommandOutput
7070
* @throws {@link InternalServerError} (server fault)
7171
* <p>An error occurred on the server side.</p>
7272
*
73+
* @throws {@link OpsItemConflictException} (client fault)
74+
* <p>The specified OpsItem is in the process of being deleted.</p>
75+
*
7376
* @throws {@link OpsItemInvalidParameterException} (client fault)
7477
* <p>A specified parameter argument isn't valid. Verify the available arguments and try
7578
* again.</p>

clients/client-ssm/src/commands/UnlabelParameterVersionCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
SMITHY_CONTEXT_KEY,
1515
} from "@smithy/types";
1616

17-
import { UnlabelParameterVersionRequest, UnlabelParameterVersionResult } from "../models/models_1";
17+
import { UnlabelParameterVersionRequest, UnlabelParameterVersionResult } from "../models/models_2";
1818
import { de_UnlabelParameterVersionCommand, se_UnlabelParameterVersionCommand } from "../protocols/Aws_json1_1";
1919
import { ServiceInputTypes, ServiceOutputTypes, SSMClientResolvedConfig } from "../SSMClient";
2020

clients/client-ssm/src/commands/UpdateOpsItemCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ export interface UpdateOpsItemCommandOutput extends UpdateOpsItemResponse, __Met
105105
* @throws {@link OpsItemAlreadyExistsException} (client fault)
106106
* <p>The OpsItem already exists.</p>
107107
*
108+
* @throws {@link OpsItemConflictException} (client fault)
109+
* <p>The specified OpsItem is in the process of being deleted.</p>
110+
*
108111
* @throws {@link OpsItemInvalidParameterException} (client fault)
109112
* <p>A specified parameter argument isn't valid. Verify the available arguments and try
110113
* again.</p>

clients/client-ssm/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export * from "./DeleteAssociationCommand";
1717
export * from "./DeleteDocumentCommand";
1818
export * from "./DeleteInventoryCommand";
1919
export * from "./DeleteMaintenanceWindowCommand";
20+
export * from "./DeleteOpsItemCommand";
2021
export * from "./DeleteOpsMetadataCommand";
2122
export * from "./DeleteParameterCommand";
2223
export * from "./DeleteParametersCommand";

0 commit comments

Comments
 (0)