Skip to content

Commit 4a7a81d

Browse files
author
awstools
committed
feat(client-ssm-sap): Added support for application-aware start/stop of SAP applications running on EC2 instances, with SSM for SAP
1 parent 629ed6e commit 4a7a81d

File tree

12 files changed

+1166
-2
lines changed

12 files changed

+1166
-2
lines changed

clients/client-ssm-sap/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,14 @@ ListDatabases
284284

285285
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ssm-sap/command/ListDatabasesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ssm-sap/Interface/ListDatabasesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ssm-sap/Interface/ListDatabasesCommandOutput/)
286286

287+
</details>
288+
<details>
289+
<summary>
290+
ListOperationEvents
291+
</summary>
292+
293+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ssm-sap/command/ListOperationEventsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ssm-sap/Interface/ListOperationEventsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ssm-sap/Interface/ListOperationEventsCommandOutput/)
294+
287295
</details>
288296
<details>
289297
<summary>
@@ -316,6 +324,14 @@ RegisterApplication
316324

317325
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ssm-sap/command/RegisterApplicationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ssm-sap/Interface/RegisterApplicationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ssm-sap/Interface/RegisterApplicationCommandOutput/)
318326

327+
</details>
328+
<details>
329+
<summary>
330+
StartApplication
331+
</summary>
332+
333+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ssm-sap/command/StartApplicationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ssm-sap/Interface/StartApplicationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ssm-sap/Interface/StartApplicationCommandOutput/)
334+
319335
</details>
320336
<details>
321337
<summary>
@@ -324,6 +340,14 @@ StartApplicationRefresh
324340

325341
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ssm-sap/command/StartApplicationRefreshCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ssm-sap/Interface/StartApplicationRefreshCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ssm-sap/Interface/StartApplicationRefreshCommandOutput/)
326342

343+
</details>
344+
<details>
345+
<summary>
346+
StopApplication
347+
</summary>
348+
349+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ssm-sap/command/StopApplicationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ssm-sap/Interface/StopApplicationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ssm-sap/Interface/StopApplicationCommandOutput/)
350+
327351
</details>
328352
<details>
329353
<summary>

clients/client-ssm-sap/src/SsmSap.ts

+66
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ import {
4848
ListDatabasesCommandInput,
4949
ListDatabasesCommandOutput,
5050
} from "./commands/ListDatabasesCommand";
51+
import {
52+
ListOperationEventsCommand,
53+
ListOperationEventsCommandInput,
54+
ListOperationEventsCommandOutput,
55+
} from "./commands/ListOperationEventsCommand";
5156
import {
5257
ListOperationsCommand,
5358
ListOperationsCommandInput,
@@ -68,11 +73,21 @@ import {
6873
RegisterApplicationCommandInput,
6974
RegisterApplicationCommandOutput,
7075
} from "./commands/RegisterApplicationCommand";
76+
import {
77+
StartApplicationCommand,
78+
StartApplicationCommandInput,
79+
StartApplicationCommandOutput,
80+
} from "./commands/StartApplicationCommand";
7181
import {
7282
StartApplicationRefreshCommand,
7383
StartApplicationRefreshCommandInput,
7484
StartApplicationRefreshCommandOutput,
7585
} from "./commands/StartApplicationRefreshCommand";
86+
import {
87+
StopApplicationCommand,
88+
StopApplicationCommandInput,
89+
StopApplicationCommandOutput,
90+
} from "./commands/StopApplicationCommand";
7691
import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
7792
import {
7893
UntagResourceCommand,
@@ -97,11 +112,14 @@ const commands = {
97112
ListApplicationsCommand,
98113
ListComponentsCommand,
99114
ListDatabasesCommand,
115+
ListOperationEventsCommand,
100116
ListOperationsCommand,
101117
ListTagsForResourceCommand,
102118
PutResourcePermissionCommand,
103119
RegisterApplicationCommand,
120+
StartApplicationCommand,
104121
StartApplicationRefreshCommand,
122+
StopApplicationCommand,
105123
TagResourceCommand,
106124
UntagResourceCommand,
107125
UpdateApplicationSettingsCommand,
@@ -253,6 +271,23 @@ export interface SsmSap {
253271
cb: (err: any, data?: ListDatabasesCommandOutput) => void
254272
): void;
255273

274+
/**
275+
* @see {@link ListOperationEventsCommand}
276+
*/
277+
listOperationEvents(
278+
args: ListOperationEventsCommandInput,
279+
options?: __HttpHandlerOptions
280+
): Promise<ListOperationEventsCommandOutput>;
281+
listOperationEvents(
282+
args: ListOperationEventsCommandInput,
283+
cb: (err: any, data?: ListOperationEventsCommandOutput) => void
284+
): void;
285+
listOperationEvents(
286+
args: ListOperationEventsCommandInput,
287+
options: __HttpHandlerOptions,
288+
cb: (err: any, data?: ListOperationEventsCommandOutput) => void
289+
): void;
290+
256291
/**
257292
* @see {@link ListOperationsCommand}
258293
*/
@@ -318,6 +353,23 @@ export interface SsmSap {
318353
cb: (err: any, data?: RegisterApplicationCommandOutput) => void
319354
): void;
320355

356+
/**
357+
* @see {@link StartApplicationCommand}
358+
*/
359+
startApplication(
360+
args: StartApplicationCommandInput,
361+
options?: __HttpHandlerOptions
362+
): Promise<StartApplicationCommandOutput>;
363+
startApplication(
364+
args: StartApplicationCommandInput,
365+
cb: (err: any, data?: StartApplicationCommandOutput) => void
366+
): void;
367+
startApplication(
368+
args: StartApplicationCommandInput,
369+
options: __HttpHandlerOptions,
370+
cb: (err: any, data?: StartApplicationCommandOutput) => void
371+
): void;
372+
321373
/**
322374
* @see {@link StartApplicationRefreshCommand}
323375
*/
@@ -335,6 +387,20 @@ export interface SsmSap {
335387
cb: (err: any, data?: StartApplicationRefreshCommandOutput) => void
336388
): void;
337389

390+
/**
391+
* @see {@link StopApplicationCommand}
392+
*/
393+
stopApplication(
394+
args: StopApplicationCommandInput,
395+
options?: __HttpHandlerOptions
396+
): Promise<StopApplicationCommandOutput>;
397+
stopApplication(args: StopApplicationCommandInput, cb: (err: any, data?: StopApplicationCommandOutput) => void): void;
398+
stopApplication(
399+
args: StopApplicationCommandInput,
400+
options: __HttpHandlerOptions,
401+
cb: (err: any, data?: StopApplicationCommandOutput) => void
402+
): void;
403+
338404
/**
339405
* @see {@link TagResourceCommand}
340406
*/

clients/client-ssm-sap/src/SsmSapClient.ts

+12
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ import {
7272
import { ListApplicationsCommandInput, ListApplicationsCommandOutput } from "./commands/ListApplicationsCommand";
7373
import { ListComponentsCommandInput, ListComponentsCommandOutput } from "./commands/ListComponentsCommand";
7474
import { ListDatabasesCommandInput, ListDatabasesCommandOutput } from "./commands/ListDatabasesCommand";
75+
import {
76+
ListOperationEventsCommandInput,
77+
ListOperationEventsCommandOutput,
78+
} from "./commands/ListOperationEventsCommand";
7579
import { ListOperationsCommandInput, ListOperationsCommandOutput } from "./commands/ListOperationsCommand";
7680
import {
7781
ListTagsForResourceCommandInput,
@@ -85,10 +89,12 @@ import {
8589
RegisterApplicationCommandInput,
8690
RegisterApplicationCommandOutput,
8791
} from "./commands/RegisterApplicationCommand";
92+
import { StartApplicationCommandInput, StartApplicationCommandOutput } from "./commands/StartApplicationCommand";
8893
import {
8994
StartApplicationRefreshCommandInput,
9095
StartApplicationRefreshCommandOutput,
9196
} from "./commands/StartApplicationRefreshCommand";
97+
import { StopApplicationCommandInput, StopApplicationCommandOutput } from "./commands/StopApplicationCommand";
9298
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
9399
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
94100
import {
@@ -120,11 +126,14 @@ export type ServiceInputTypes =
120126
| ListApplicationsCommandInput
121127
| ListComponentsCommandInput
122128
| ListDatabasesCommandInput
129+
| ListOperationEventsCommandInput
123130
| ListOperationsCommandInput
124131
| ListTagsForResourceCommandInput
125132
| PutResourcePermissionCommandInput
126133
| RegisterApplicationCommandInput
134+
| StartApplicationCommandInput
127135
| StartApplicationRefreshCommandInput
136+
| StopApplicationCommandInput
128137
| TagResourceCommandInput
129138
| UntagResourceCommandInput
130139
| UpdateApplicationSettingsCommandInput;
@@ -143,11 +152,14 @@ export type ServiceOutputTypes =
143152
| ListApplicationsCommandOutput
144153
| ListComponentsCommandOutput
145154
| ListDatabasesCommandOutput
155+
| ListOperationEventsCommandOutput
146156
| ListOperationsCommandOutput
147157
| ListTagsForResourceCommandOutput
148158
| PutResourcePermissionCommandOutput
149159
| RegisterApplicationCommandOutput
160+
| StartApplicationCommandOutput
150161
| StartApplicationRefreshCommandOutput
162+
| StopApplicationCommandOutput
151163
| TagResourceCommandOutput
152164
| UntagResourceCommandOutput
153165
| UpdateApplicationSettingsCommandOutput;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { ListOperationEventsInput, ListOperationEventsOutput } from "../models/models_0";
9+
import { de_ListOperationEventsCommand, se_ListOperationEventsCommand } from "../protocols/Aws_restJson1";
10+
import { ServiceInputTypes, ServiceOutputTypes, SsmSapClientResolvedConfig } from "../SsmSapClient";
11+
12+
/**
13+
* @public
14+
*/
15+
export { __MetadataBearer, $Command };
16+
/**
17+
* @public
18+
*
19+
* The input for {@link ListOperationEventsCommand}.
20+
*/
21+
export interface ListOperationEventsCommandInput extends ListOperationEventsInput {}
22+
/**
23+
* @public
24+
*
25+
* The output of {@link ListOperationEventsCommand}.
26+
*/
27+
export interface ListOperationEventsCommandOutput extends ListOperationEventsOutput, __MetadataBearer {}
28+
29+
/**
30+
* <p>Returns a list of operations events.</p>
31+
* <p>Available parameters include <code>OperationID</code>, as well as optional parameters
32+
* <code>MaxResults</code>, <code>NextToken</code>, and
33+
* <code>Filters</code>.</p>
34+
* @example
35+
* Use a bare-bones client and the command you need to make an API call.
36+
* ```javascript
37+
* import { SsmSapClient, ListOperationEventsCommand } from "@aws-sdk/client-ssm-sap"; // ES Modules import
38+
* // const { SsmSapClient, ListOperationEventsCommand } = require("@aws-sdk/client-ssm-sap"); // CommonJS import
39+
* const client = new SsmSapClient(config);
40+
* const input = { // ListOperationEventsInput
41+
* OperationId: "STRING_VALUE", // required
42+
* MaxResults: Number("int"),
43+
* NextToken: "STRING_VALUE",
44+
* Filters: [ // FilterList
45+
* { // Filter
46+
* Name: "STRING_VALUE", // required
47+
* Value: "STRING_VALUE", // required
48+
* Operator: "Equals" || "GreaterThanOrEquals" || "LessThanOrEquals", // required
49+
* },
50+
* ],
51+
* };
52+
* const command = new ListOperationEventsCommand(input);
53+
* const response = await client.send(command);
54+
* // { // ListOperationEventsOutput
55+
* // OperationEvents: [ // OperationEventList
56+
* // { // OperationEvent
57+
* // Description: "STRING_VALUE",
58+
* // Resource: { // Resource
59+
* // ResourceArn: "STRING_VALUE",
60+
* // ResourceType: "STRING_VALUE",
61+
* // },
62+
* // Status: "IN_PROGRESS" || "COMPLETED" || "FAILED",
63+
* // StatusMessage: "STRING_VALUE",
64+
* // Timestamp: new Date("TIMESTAMP"),
65+
* // },
66+
* // ],
67+
* // NextToken: "STRING_VALUE",
68+
* // };
69+
*
70+
* ```
71+
*
72+
* @param ListOperationEventsCommandInput - {@link ListOperationEventsCommandInput}
73+
* @returns {@link ListOperationEventsCommandOutput}
74+
* @see {@link ListOperationEventsCommandInput} for command's `input` shape.
75+
* @see {@link ListOperationEventsCommandOutput} for command's `response` shape.
76+
* @see {@link SsmSapClientResolvedConfig | config} for SsmSapClient's `config` shape.
77+
*
78+
* @throws {@link InternalServerException} (server fault)
79+
* <p>An internal error has occurred.</p>
80+
*
81+
* @throws {@link ValidationException} (client fault)
82+
* <p>The input fails to satisfy the constraints specified by an AWS service. </p>
83+
*
84+
* @throws {@link SsmSapServiceException}
85+
* <p>Base exception class for all service exceptions from SsmSap service.</p>
86+
*
87+
* @public
88+
*/
89+
export class ListOperationEventsCommand extends $Command
90+
.classBuilder<
91+
ListOperationEventsCommandInput,
92+
ListOperationEventsCommandOutput,
93+
SsmSapClientResolvedConfig,
94+
ServiceInputTypes,
95+
ServiceOutputTypes
96+
>()
97+
.ep({
98+
...commonParams,
99+
})
100+
.m(function (this: any, Command: any, cs: any, config: SsmSapClientResolvedConfig, o: any) {
101+
return [
102+
getSerdePlugin(config, this.serialize, this.deserialize),
103+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
104+
];
105+
})
106+
.s("SsmSap", "ListOperationEvents", {})
107+
.n("SsmSapClient", "ListOperationEventsCommand")
108+
.f(void 0, void 0)
109+
.ser(se_ListOperationEventsCommand)
110+
.de(de_ListOperationEventsCommand)
111+
.build() {}

0 commit comments

Comments
 (0)