Skip to content

Commit f71b730

Browse files
author
awstools
committed
feat(client-fis): This release adds safety levers, a new mechanism to stop all running experiments and prevent new experiments from starting.
1 parent 3d2c2fa commit f71b730

12 files changed

+535
-4
lines changed

clients/client-fis/README.md

+16
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,14 @@ GetExperimentTemplate
267267

268268
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/fis/command/GetExperimentTemplateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-fis/Interface/GetExperimentTemplateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-fis/Interface/GetExperimentTemplateCommandOutput/)
269269

270+
</details>
271+
<details>
272+
<summary>
273+
GetSafetyLever
274+
</summary>
275+
276+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/fis/command/GetSafetyLeverCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-fis/Interface/GetSafetyLeverCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-fis/Interface/GetSafetyLeverCommandOutput/)
277+
270278
</details>
271279
<details>
272280
<summary>
@@ -387,6 +395,14 @@ UpdateExperimentTemplate
387395

388396
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/fis/command/UpdateExperimentTemplateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-fis/Interface/UpdateExperimentTemplateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-fis/Interface/UpdateExperimentTemplateCommandOutput/)
389397

398+
</details>
399+
<details>
400+
<summary>
401+
UpdateSafetyLeverState
402+
</summary>
403+
404+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/fis/command/UpdateSafetyLeverStateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-fis/Interface/UpdateSafetyLeverStateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-fis/Interface/UpdateSafetyLeverStateCommandOutput/)
405+
390406
</details>
391407
<details>
392408
<summary>

clients/client-fis/src/Fis.ts

+43
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ import {
3838
GetExperimentTemplateCommandInput,
3939
GetExperimentTemplateCommandOutput,
4040
} from "./commands/GetExperimentTemplateCommand";
41+
import {
42+
GetSafetyLeverCommand,
43+
GetSafetyLeverCommandInput,
44+
GetSafetyLeverCommandOutput,
45+
} from "./commands/GetSafetyLeverCommand";
4146
import {
4247
GetTargetAccountConfigurationCommand,
4348
GetTargetAccountConfigurationCommandInput,
@@ -105,6 +110,11 @@ import {
105110
UpdateExperimentTemplateCommandInput,
106111
UpdateExperimentTemplateCommandOutput,
107112
} from "./commands/UpdateExperimentTemplateCommand";
113+
import {
114+
UpdateSafetyLeverStateCommand,
115+
UpdateSafetyLeverStateCommandInput,
116+
UpdateSafetyLeverStateCommandOutput,
117+
} from "./commands/UpdateSafetyLeverStateCommand";
108118
import {
109119
UpdateTargetAccountConfigurationCommand,
110120
UpdateTargetAccountConfigurationCommandInput,
@@ -121,6 +131,7 @@ const commands = {
121131
GetExperimentCommand,
122132
GetExperimentTargetAccountConfigurationCommand,
123133
GetExperimentTemplateCommand,
134+
GetSafetyLeverCommand,
124135
GetTargetAccountConfigurationCommand,
125136
GetTargetResourceTypeCommand,
126137
ListActionsCommand,
@@ -136,6 +147,7 @@ const commands = {
136147
TagResourceCommand,
137148
UntagResourceCommand,
138149
UpdateExperimentTemplateCommand,
150+
UpdateSafetyLeverStateCommand,
139151
UpdateTargetAccountConfigurationCommand,
140152
};
141153

@@ -264,6 +276,20 @@ export interface Fis {
264276
cb: (err: any, data?: GetExperimentTemplateCommandOutput) => void
265277
): void;
266278

279+
/**
280+
* @see {@link GetSafetyLeverCommand}
281+
*/
282+
getSafetyLever(
283+
args: GetSafetyLeverCommandInput,
284+
options?: __HttpHandlerOptions
285+
): Promise<GetSafetyLeverCommandOutput>;
286+
getSafetyLever(args: GetSafetyLeverCommandInput, cb: (err: any, data?: GetSafetyLeverCommandOutput) => void): void;
287+
getSafetyLever(
288+
args: GetSafetyLeverCommandInput,
289+
options: __HttpHandlerOptions,
290+
cb: (err: any, data?: GetSafetyLeverCommandOutput) => void
291+
): void;
292+
267293
/**
268294
* @see {@link GetTargetAccountConfigurationCommand}
269295
*/
@@ -496,6 +522,23 @@ export interface Fis {
496522
cb: (err: any, data?: UpdateExperimentTemplateCommandOutput) => void
497523
): void;
498524

525+
/**
526+
* @see {@link UpdateSafetyLeverStateCommand}
527+
*/
528+
updateSafetyLeverState(
529+
args: UpdateSafetyLeverStateCommandInput,
530+
options?: __HttpHandlerOptions
531+
): Promise<UpdateSafetyLeverStateCommandOutput>;
532+
updateSafetyLeverState(
533+
args: UpdateSafetyLeverStateCommandInput,
534+
cb: (err: any, data?: UpdateSafetyLeverStateCommandOutput) => void
535+
): void;
536+
updateSafetyLeverState(
537+
args: UpdateSafetyLeverStateCommandInput,
538+
options: __HttpHandlerOptions,
539+
cb: (err: any, data?: UpdateSafetyLeverStateCommandOutput) => void
540+
): void;
541+
499542
/**
500543
* @see {@link UpdateTargetAccountConfigurationCommand}
501544
*/

clients/client-fis/src/FisClient.ts

+9
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ import {
7979
GetExperimentTemplateCommandInput,
8080
GetExperimentTemplateCommandOutput,
8181
} from "./commands/GetExperimentTemplateCommand";
82+
import { GetSafetyLeverCommandInput, GetSafetyLeverCommandOutput } from "./commands/GetSafetyLeverCommand";
8283
import {
8384
GetTargetAccountConfigurationCommandInput,
8485
GetTargetAccountConfigurationCommandOutput,
@@ -121,6 +122,10 @@ import {
121122
UpdateExperimentTemplateCommandInput,
122123
UpdateExperimentTemplateCommandOutput,
123124
} from "./commands/UpdateExperimentTemplateCommand";
125+
import {
126+
UpdateSafetyLeverStateCommandInput,
127+
UpdateSafetyLeverStateCommandOutput,
128+
} from "./commands/UpdateSafetyLeverStateCommand";
124129
import {
125130
UpdateTargetAccountConfigurationCommandInput,
126131
UpdateTargetAccountConfigurationCommandOutput,
@@ -148,6 +153,7 @@ export type ServiceInputTypes =
148153
| GetExperimentCommandInput
149154
| GetExperimentTargetAccountConfigurationCommandInput
150155
| GetExperimentTemplateCommandInput
156+
| GetSafetyLeverCommandInput
151157
| GetTargetAccountConfigurationCommandInput
152158
| GetTargetResourceTypeCommandInput
153159
| ListActionsCommandInput
@@ -163,6 +169,7 @@ export type ServiceInputTypes =
163169
| TagResourceCommandInput
164170
| UntagResourceCommandInput
165171
| UpdateExperimentTemplateCommandInput
172+
| UpdateSafetyLeverStateCommandInput
166173
| UpdateTargetAccountConfigurationCommandInput;
167174

168175
/**
@@ -177,6 +184,7 @@ export type ServiceOutputTypes =
177184
| GetExperimentCommandOutput
178185
| GetExperimentTargetAccountConfigurationCommandOutput
179186
| GetExperimentTemplateCommandOutput
187+
| GetSafetyLeverCommandOutput
180188
| GetTargetAccountConfigurationCommandOutput
181189
| GetTargetResourceTypeCommandOutput
182190
| ListActionsCommandOutput
@@ -192,6 +200,7 @@ export type ServiceOutputTypes =
192200
| TagResourceCommandOutput
193201
| UntagResourceCommandOutput
194202
| UpdateExperimentTemplateCommandOutput
203+
| UpdateSafetyLeverStateCommandOutput
195204
| UpdateTargetAccountConfigurationCommandOutput;
196205

197206
/**

clients/client-fis/src/commands/GetExperimentCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export interface GetExperimentCommandOutput extends GetExperimentResponse, __Met
4747
* // experimentTemplateId: "STRING_VALUE",
4848
* // roleArn: "STRING_VALUE",
4949
* // state: { // ExperimentState
50-
* // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed",
50+
* // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed" || "cancelled",
5151
* // reason: "STRING_VALUE",
5252
* // error: { // ExperimentError
5353
* // accountId: "STRING_VALUE",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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 { FisClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../FisClient";
9+
import { GetSafetyLeverRequest, GetSafetyLeverResponse } from "../models/models_0";
10+
import { de_GetSafetyLeverCommand, se_GetSafetyLeverCommand } from "../protocols/Aws_restJson1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link GetSafetyLeverCommand}.
21+
*/
22+
export interface GetSafetyLeverCommandInput extends GetSafetyLeverRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link GetSafetyLeverCommand}.
27+
*/
28+
export interface GetSafetyLeverCommandOutput extends GetSafetyLeverResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>
32+
* Gets information about the specified safety lever.
33+
* </p>
34+
* @example
35+
* Use a bare-bones client and the command you need to make an API call.
36+
* ```javascript
37+
* import { FisClient, GetSafetyLeverCommand } from "@aws-sdk/client-fis"; // ES Modules import
38+
* // const { FisClient, GetSafetyLeverCommand } = require("@aws-sdk/client-fis"); // CommonJS import
39+
* const client = new FisClient(config);
40+
* const input = { // GetSafetyLeverRequest
41+
* id: "STRING_VALUE", // required
42+
* };
43+
* const command = new GetSafetyLeverCommand(input);
44+
* const response = await client.send(command);
45+
* // { // GetSafetyLeverResponse
46+
* // safetyLever: { // SafetyLever
47+
* // id: "STRING_VALUE",
48+
* // arn: "STRING_VALUE",
49+
* // state: { // SafetyLeverState
50+
* // status: "disengaged" || "engaged" || "engaging",
51+
* // reason: "STRING_VALUE",
52+
* // },
53+
* // },
54+
* // };
55+
*
56+
* ```
57+
*
58+
* @param GetSafetyLeverCommandInput - {@link GetSafetyLeverCommandInput}
59+
* @returns {@link GetSafetyLeverCommandOutput}
60+
* @see {@link GetSafetyLeverCommandInput} for command's `input` shape.
61+
* @see {@link GetSafetyLeverCommandOutput} for command's `response` shape.
62+
* @see {@link FisClientResolvedConfig | config} for FisClient's `config` shape.
63+
*
64+
* @throws {@link ResourceNotFoundException} (client fault)
65+
* <p>The specified resource cannot be found.</p>
66+
*
67+
* @throws {@link FisServiceException}
68+
* <p>Base exception class for all service exceptions from Fis service.</p>
69+
*
70+
* @public
71+
*/
72+
export class GetSafetyLeverCommand extends $Command
73+
.classBuilder<
74+
GetSafetyLeverCommandInput,
75+
GetSafetyLeverCommandOutput,
76+
FisClientResolvedConfig,
77+
ServiceInputTypes,
78+
ServiceOutputTypes
79+
>()
80+
.ep({
81+
...commonParams,
82+
})
83+
.m(function (this: any, Command: any, cs: any, config: FisClientResolvedConfig, o: any) {
84+
return [
85+
getSerdePlugin(config, this.serialize, this.deserialize),
86+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
87+
];
88+
})
89+
.s("FaultInjectionSimulator", "GetSafetyLever", {})
90+
.n("FisClient", "GetSafetyLeverCommand")
91+
.f(void 0, void 0)
92+
.ser(se_GetSafetyLeverCommand)
93+
.de(de_GetSafetyLeverCommand)
94+
.build() {}

clients/client-fis/src/commands/ListExperimentsCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export interface ListExperimentsCommandOutput extends ListExperimentsResponse, _
4949
* // arn: "STRING_VALUE",
5050
* // experimentTemplateId: "STRING_VALUE",
5151
* // state: { // ExperimentState
52-
* // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed",
52+
* // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed" || "cancelled",
5353
* // reason: "STRING_VALUE",
5454
* // error: { // ExperimentError
5555
* // accountId: "STRING_VALUE",

clients/client-fis/src/commands/StartExperimentCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export interface StartExperimentCommandOutput extends StartExperimentResponse, _
5454
* // experimentTemplateId: "STRING_VALUE",
5555
* // roleArn: "STRING_VALUE",
5656
* // state: { // ExperimentState
57-
* // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed",
57+
* // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed" || "cancelled",
5858
* // reason: "STRING_VALUE",
5959
* // error: { // ExperimentError
6060
* // accountId: "STRING_VALUE",

clients/client-fis/src/commands/StopExperimentCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export interface StopExperimentCommandOutput extends StopExperimentResponse, __M
4747
* // experimentTemplateId: "STRING_VALUE",
4848
* // roleArn: "STRING_VALUE",
4949
* // state: { // ExperimentState
50-
* // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed",
50+
* // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed" || "cancelled",
5151
* // reason: "STRING_VALUE",
5252
* // error: { // ExperimentError
5353
* // accountId: "STRING_VALUE",

0 commit comments

Comments
 (0)