Skip to content

Commit

Permalink
feat(client-ssm): This release introduces a new API: DeleteOpsItem. T…
Browse files Browse the repository at this point in the history
…his allows deletion of an OpsItem.
  • Loading branch information
awstools committed Oct 20, 2023
1 parent 963f743 commit 7120ec9
Show file tree
Hide file tree
Showing 17 changed files with 633 additions and 213 deletions.
10 changes: 9 additions & 1 deletion clients/client-ssm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ operations at scale.</p>
</p>
<ul>
<li>
<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>
<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>
</li>
<li>
<p>For details about predefined runbooks for Automation, a capability of Amazon Web Services Systems Manager, see the
Expand Down Expand Up @@ -381,6 +381,14 @@ DeleteMaintenanceWindow

[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)

</details>
<details>
<summary>
DeleteOpsItem
</summary>

[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)

</details>
<details>
<summary>
Expand Down
19 changes: 18 additions & 1 deletion clients/client-ssm/src/SSM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ import {
DeleteMaintenanceWindowCommandInput,
DeleteMaintenanceWindowCommandOutput,
} from "./commands/DeleteMaintenanceWindowCommand";
import {
DeleteOpsItemCommand,
DeleteOpsItemCommandInput,
DeleteOpsItemCommandOutput,
} from "./commands/DeleteOpsItemCommand";
import {
DeleteOpsMetadataCommand,
DeleteOpsMetadataCommandInput,
Expand Down Expand Up @@ -701,6 +706,7 @@ const commands = {
DeleteDocumentCommand,
DeleteInventoryCommand,
DeleteMaintenanceWindowCommand,
DeleteOpsItemCommand,
DeleteOpsMetadataCommand,
DeleteParameterCommand,
DeleteParametersCommand,
Expand Down Expand Up @@ -1109,6 +1115,17 @@ export interface SSM {
cb: (err: any, data?: DeleteMaintenanceWindowCommandOutput) => void
): void;

/**
* @see {@link DeleteOpsItemCommand}
*/
deleteOpsItem(args: DeleteOpsItemCommandInput, options?: __HttpHandlerOptions): Promise<DeleteOpsItemCommandOutput>;
deleteOpsItem(args: DeleteOpsItemCommandInput, cb: (err: any, data?: DeleteOpsItemCommandOutput) => void): void;
deleteOpsItem(
args: DeleteOpsItemCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DeleteOpsItemCommandOutput) => void
): void;

/**
* @see {@link DeleteOpsMetadataCommand}
*/
Expand Down Expand Up @@ -3065,7 +3082,7 @@ export interface SSM {
* </p>
* <ul>
* <li>
* <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>
* <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>
* </li>
* <li>
* <p>For details about predefined runbooks for Automation, a capability of Amazon Web Services Systems Manager, see the
Expand Down
5 changes: 4 additions & 1 deletion clients/client-ssm/src/SSMClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ import {
DeleteMaintenanceWindowCommandInput,
DeleteMaintenanceWindowCommandOutput,
} from "./commands/DeleteMaintenanceWindowCommand";
import { DeleteOpsItemCommandInput, DeleteOpsItemCommandOutput } from "./commands/DeleteOpsItemCommand";
import { DeleteOpsMetadataCommandInput, DeleteOpsMetadataCommandOutput } from "./commands/DeleteOpsMetadataCommand";
import { DeleteParameterCommandInput, DeleteParameterCommandOutput } from "./commands/DeleteParameterCommand";
import { DeleteParametersCommandInput, DeleteParametersCommandOutput } from "./commands/DeleteParametersCommand";
Expand Down Expand Up @@ -497,6 +498,7 @@ export type ServiceInputTypes =
| DeleteDocumentCommandInput
| DeleteInventoryCommandInput
| DeleteMaintenanceWindowCommandInput
| DeleteOpsItemCommandInput
| DeleteOpsMetadataCommandInput
| DeleteParameterCommandInput
| DeleteParametersCommandInput
Expand Down Expand Up @@ -640,6 +642,7 @@ export type ServiceOutputTypes =
| DeleteDocumentCommandOutput
| DeleteInventoryCommandOutput
| DeleteMaintenanceWindowCommandOutput
| DeleteOpsItemCommandOutput
| DeleteOpsMetadataCommandOutput
| DeleteParameterCommandOutput
| DeleteParametersCommandOutput
Expand Down Expand Up @@ -942,7 +945,7 @@ export interface SSMClientResolvedConfig extends SSMClientResolvedConfigType {}
* </p>
* <ul>
* <li>
* <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>
* <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>
* </li>
* <li>
* <p>For details about predefined runbooks for Automation, a capability of Amazon Web Services Systems Manager, see the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ export interface AssociateOpsItemRelatedItemCommandOutput
* @throws {@link InternalServerError} (server fault)
* <p>An error occurred on the server side.</p>
*
* @throws {@link OpsItemConflictException} (client fault)
* <p>The specified OpsItem is in the process of being deleted.</p>
*
* @throws {@link OpsItemInvalidParameterException} (client fault)
* <p>A specified parameter argument isn't valid. Verify the available arguments and try
* again.</p>
Expand Down
177 changes: 177 additions & 0 deletions clients/client-ssm/src/commands/DeleteOpsItemCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { Command as $Command } from "@smithy/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
SMITHY_CONTEXT_KEY,
} from "@smithy/types";

import { DeleteOpsItemRequest, DeleteOpsItemResponse } from "../models/models_0";
import { de_DeleteOpsItemCommand, se_DeleteOpsItemCommand } from "../protocols/Aws_json1_1";
import { ServiceInputTypes, ServiceOutputTypes, SSMClientResolvedConfig } from "../SSMClient";

/**
* @public
*/
export { __MetadataBearer, $Command };
/**
* @public
*
* The input for {@link DeleteOpsItemCommand}.
*/
export interface DeleteOpsItemCommandInput extends DeleteOpsItemRequest {}
/**
* @public
*
* The output of {@link DeleteOpsItemCommand}.
*/
export interface DeleteOpsItemCommandOutput extends DeleteOpsItemResponse, __MetadataBearer {}

/**
* @public
* <p>Delete an OpsItem. You must have permission in Identity and Access Management (IAM) to
* delete an OpsItem. </p>
* <important>
* <p>Note the following important information about this operation.</p>
* <ul>
* <li>
* <p>Deleting an OpsItem is irreversible. You can't restore a deleted OpsItem.</p>
* </li>
* <li>
* <p>This operation uses an <i>eventual consistency model</i>, which means the
* system can take a few minutes to complete this operation. If you delete an OpsItem and
* immediately call, for example, <a>GetOpsItem</a>, the deleted OpsItem might still
* appear in the response. </p>
* </li>
* <li>
* <p>This operation is idempotent. The system doesn't throw an exception if you repeatedly
* call this operation for the same OpsItem. If the first call is successful, all additional calls
* return the same successful response as the first call.</p>
* </li>
* <li>
* <p>This operation doesn't support cross-account calls. A delegated administrator or
* management account can't delete OpsItems in other accounts, even if OpsCenter has been set up for
* cross-account administration. For more information about cross-account administration, see
* <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setting-up-cross-account.html">Setting up
* OpsCenter to centrally manage OpsItems across accounts</a> in the <i>Systems Manager User Guide</i>.</p>
* </li>
* </ul>
* </important>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { SSMClient, DeleteOpsItemCommand } from "@aws-sdk/client-ssm"; // ES Modules import
* // const { SSMClient, DeleteOpsItemCommand } = require("@aws-sdk/client-ssm"); // CommonJS import
* const client = new SSMClient(config);
* const input = { // DeleteOpsItemRequest
* OpsItemId: "STRING_VALUE", // required
* };
* const command = new DeleteOpsItemCommand(input);
* const response = await client.send(command);
* // {};
*
* ```
*
* @param DeleteOpsItemCommandInput - {@link DeleteOpsItemCommandInput}
* @returns {@link DeleteOpsItemCommandOutput}
* @see {@link DeleteOpsItemCommandInput} for command's `input` shape.
* @see {@link DeleteOpsItemCommandOutput} for command's `response` shape.
* @see {@link SSMClientResolvedConfig | config} for SSMClient's `config` shape.
*
* @throws {@link InternalServerError} (server fault)
* <p>An error occurred on the server side.</p>
*
* @throws {@link OpsItemInvalidParameterException} (client fault)
* <p>A specified parameter argument isn't valid. Verify the available arguments and try
* again.</p>
*
* @throws {@link SSMServiceException}
* <p>Base exception class for all service exceptions from SSM service.</p>
*
*/
export class DeleteOpsItemCommand extends $Command<
DeleteOpsItemCommandInput,
DeleteOpsItemCommandOutput,
SSMClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

/**
* @public
*/
constructor(readonly input: DeleteOpsItemCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: SSMClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<DeleteOpsItemCommandInput, DeleteOpsItemCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(getEndpointPlugin(configuration, DeleteOpsItemCommand.getEndpointParameterInstructions()));

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "SSMClient";
const commandName = "DeleteOpsItemCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
[SMITHY_CONTEXT_KEY]: {
service: "AmazonSSM",
operation: "DeleteOpsItem",
},
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

/**
* @internal
*/
private serialize(input: DeleteOpsItemCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return se_DeleteOpsItemCommand(input, context);
}

/**
* @internal
*/
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DeleteOpsItemCommandOutput> {
return de_DeleteOpsItemCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import {
SMITHY_CONTEXT_KEY,
} from "@smithy/types";

import { DescribeMaintenanceWindowTasksRequest } from "../models/models_0";
import {
DescribeMaintenanceWindowTasksRequest,
DescribeMaintenanceWindowTasksResult,
DescribeMaintenanceWindowTasksResultFilterSensitiveLog,
} from "../models/models_0";
} from "../models/models_1";
import {
de_DescribeMaintenanceWindowTasksCommand,
se_DescribeMaintenanceWindowTasksCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ export interface DisassociateOpsItemRelatedItemCommandOutput
* @throws {@link InternalServerError} (server fault)
* <p>An error occurred on the server side.</p>
*
* @throws {@link OpsItemConflictException} (client fault)
* <p>The specified OpsItem is in the process of being deleted.</p>
*
* @throws {@link OpsItemInvalidParameterException} (client fault)
* <p>A specified parameter argument isn't valid. Verify the available arguments and try
* again.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
SMITHY_CONTEXT_KEY,
} from "@smithy/types";

import { UnlabelParameterVersionRequest, UnlabelParameterVersionResult } from "../models/models_1";
import { UnlabelParameterVersionRequest, UnlabelParameterVersionResult } from "../models/models_2";
import { de_UnlabelParameterVersionCommand, se_UnlabelParameterVersionCommand } from "../protocols/Aws_json1_1";
import { ServiceInputTypes, ServiceOutputTypes, SSMClientResolvedConfig } from "../SSMClient";

Expand Down
3 changes: 3 additions & 0 deletions clients/client-ssm/src/commands/UpdateOpsItemCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ export interface UpdateOpsItemCommandOutput extends UpdateOpsItemResponse, __Met
* @throws {@link OpsItemAlreadyExistsException} (client fault)
* <p>The OpsItem already exists.</p>
*
* @throws {@link OpsItemConflictException} (client fault)
* <p>The specified OpsItem is in the process of being deleted.</p>
*
* @throws {@link OpsItemInvalidParameterException} (client fault)
* <p>A specified parameter argument isn't valid. Verify the available arguments and try
* again.</p>
Expand Down
1 change: 1 addition & 0 deletions clients/client-ssm/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export * from "./DeleteAssociationCommand";
export * from "./DeleteDocumentCommand";
export * from "./DeleteInventoryCommand";
export * from "./DeleteMaintenanceWindowCommand";
export * from "./DeleteOpsItemCommand";
export * from "./DeleteOpsMetadataCommand";
export * from "./DeleteParameterCommand";
export * from "./DeleteParametersCommand";
Expand Down
Loading

0 comments on commit 7120ec9

Please sign in to comment.