Skip to content

Commit

Permalink
feat(client-fis): This release adds safety levers, a new mechanism to…
Browse files Browse the repository at this point in the history
… stop all running experiments and prevent new experiments from starting.
  • Loading branch information
awstools committed Sep 4, 2024
1 parent 3d2c2fa commit f71b730
Show file tree
Hide file tree
Showing 12 changed files with 535 additions and 4 deletions.
16 changes: 16 additions & 0 deletions clients/client-fis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,14 @@ GetExperimentTemplate

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

</details>
<details>
<summary>
GetSafetyLever
</summary>

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

</details>
<details>
<summary>
Expand Down Expand Up @@ -387,6 +395,14 @@ UpdateExperimentTemplate

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

</details>
<details>
<summary>
UpdateSafetyLeverState
</summary>

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

</details>
<details>
<summary>
Expand Down
43 changes: 43 additions & 0 deletions clients/client-fis/src/Fis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ import {
GetExperimentTemplateCommandInput,
GetExperimentTemplateCommandOutput,
} from "./commands/GetExperimentTemplateCommand";
import {
GetSafetyLeverCommand,
GetSafetyLeverCommandInput,
GetSafetyLeverCommandOutput,
} from "./commands/GetSafetyLeverCommand";
import {
GetTargetAccountConfigurationCommand,
GetTargetAccountConfigurationCommandInput,
Expand Down Expand Up @@ -105,6 +110,11 @@ import {
UpdateExperimentTemplateCommandInput,
UpdateExperimentTemplateCommandOutput,
} from "./commands/UpdateExperimentTemplateCommand";
import {
UpdateSafetyLeverStateCommand,
UpdateSafetyLeverStateCommandInput,
UpdateSafetyLeverStateCommandOutput,
} from "./commands/UpdateSafetyLeverStateCommand";
import {
UpdateTargetAccountConfigurationCommand,
UpdateTargetAccountConfigurationCommandInput,
Expand All @@ -121,6 +131,7 @@ const commands = {
GetExperimentCommand,
GetExperimentTargetAccountConfigurationCommand,
GetExperimentTemplateCommand,
GetSafetyLeverCommand,
GetTargetAccountConfigurationCommand,
GetTargetResourceTypeCommand,
ListActionsCommand,
Expand All @@ -136,6 +147,7 @@ const commands = {
TagResourceCommand,
UntagResourceCommand,
UpdateExperimentTemplateCommand,
UpdateSafetyLeverStateCommand,
UpdateTargetAccountConfigurationCommand,
};

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

/**
* @see {@link GetSafetyLeverCommand}
*/
getSafetyLever(
args: GetSafetyLeverCommandInput,
options?: __HttpHandlerOptions
): Promise<GetSafetyLeverCommandOutput>;
getSafetyLever(args: GetSafetyLeverCommandInput, cb: (err: any, data?: GetSafetyLeverCommandOutput) => void): void;
getSafetyLever(
args: GetSafetyLeverCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetSafetyLeverCommandOutput) => void
): void;

/**
* @see {@link GetTargetAccountConfigurationCommand}
*/
Expand Down Expand Up @@ -496,6 +522,23 @@ export interface Fis {
cb: (err: any, data?: UpdateExperimentTemplateCommandOutput) => void
): void;

/**
* @see {@link UpdateSafetyLeverStateCommand}
*/
updateSafetyLeverState(
args: UpdateSafetyLeverStateCommandInput,
options?: __HttpHandlerOptions
): Promise<UpdateSafetyLeverStateCommandOutput>;
updateSafetyLeverState(
args: UpdateSafetyLeverStateCommandInput,
cb: (err: any, data?: UpdateSafetyLeverStateCommandOutput) => void
): void;
updateSafetyLeverState(
args: UpdateSafetyLeverStateCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: UpdateSafetyLeverStateCommandOutput) => void
): void;

/**
* @see {@link UpdateTargetAccountConfigurationCommand}
*/
Expand Down
9 changes: 9 additions & 0 deletions clients/client-fis/src/FisClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ import {
GetExperimentTemplateCommandInput,
GetExperimentTemplateCommandOutput,
} from "./commands/GetExperimentTemplateCommand";
import { GetSafetyLeverCommandInput, GetSafetyLeverCommandOutput } from "./commands/GetSafetyLeverCommand";
import {
GetTargetAccountConfigurationCommandInput,
GetTargetAccountConfigurationCommandOutput,
Expand Down Expand Up @@ -121,6 +122,10 @@ import {
UpdateExperimentTemplateCommandInput,
UpdateExperimentTemplateCommandOutput,
} from "./commands/UpdateExperimentTemplateCommand";
import {
UpdateSafetyLeverStateCommandInput,
UpdateSafetyLeverStateCommandOutput,
} from "./commands/UpdateSafetyLeverStateCommand";
import {
UpdateTargetAccountConfigurationCommandInput,
UpdateTargetAccountConfigurationCommandOutput,
Expand Down Expand Up @@ -148,6 +153,7 @@ export type ServiceInputTypes =
| GetExperimentCommandInput
| GetExperimentTargetAccountConfigurationCommandInput
| GetExperimentTemplateCommandInput
| GetSafetyLeverCommandInput
| GetTargetAccountConfigurationCommandInput
| GetTargetResourceTypeCommandInput
| ListActionsCommandInput
Expand All @@ -163,6 +169,7 @@ export type ServiceInputTypes =
| TagResourceCommandInput
| UntagResourceCommandInput
| UpdateExperimentTemplateCommandInput
| UpdateSafetyLeverStateCommandInput
| UpdateTargetAccountConfigurationCommandInput;

/**
Expand All @@ -177,6 +184,7 @@ export type ServiceOutputTypes =
| GetExperimentCommandOutput
| GetExperimentTargetAccountConfigurationCommandOutput
| GetExperimentTemplateCommandOutput
| GetSafetyLeverCommandOutput
| GetTargetAccountConfigurationCommandOutput
| GetTargetResourceTypeCommandOutput
| ListActionsCommandOutput
Expand All @@ -192,6 +200,7 @@ export type ServiceOutputTypes =
| TagResourceCommandOutput
| UntagResourceCommandOutput
| UpdateExperimentTemplateCommandOutput
| UpdateSafetyLeverStateCommandOutput
| UpdateTargetAccountConfigurationCommandOutput;

/**
Expand Down
2 changes: 1 addition & 1 deletion clients/client-fis/src/commands/GetExperimentCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface GetExperimentCommandOutput extends GetExperimentResponse, __Met
* // experimentTemplateId: "STRING_VALUE",
* // roleArn: "STRING_VALUE",
* // state: { // ExperimentState
* // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed",
* // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed" || "cancelled",
* // reason: "STRING_VALUE",
* // error: { // ExperimentError
* // accountId: "STRING_VALUE",
Expand Down
94 changes: 94 additions & 0 deletions clients/client-fis/src/commands/GetSafetyLeverCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { FisClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../FisClient";
import { GetSafetyLeverRequest, GetSafetyLeverResponse } from "../models/models_0";
import { de_GetSafetyLeverCommand, se_GetSafetyLeverCommand } from "../protocols/Aws_restJson1";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link GetSafetyLeverCommand}.
*/
export interface GetSafetyLeverCommandInput extends GetSafetyLeverRequest {}
/**
* @public
*
* The output of {@link GetSafetyLeverCommand}.
*/
export interface GetSafetyLeverCommandOutput extends GetSafetyLeverResponse, __MetadataBearer {}

/**
* <p>
* Gets information about the specified safety lever.
* </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { FisClient, GetSafetyLeverCommand } from "@aws-sdk/client-fis"; // ES Modules import
* // const { FisClient, GetSafetyLeverCommand } = require("@aws-sdk/client-fis"); // CommonJS import
* const client = new FisClient(config);
* const input = { // GetSafetyLeverRequest
* id: "STRING_VALUE", // required
* };
* const command = new GetSafetyLeverCommand(input);
* const response = await client.send(command);
* // { // GetSafetyLeverResponse
* // safetyLever: { // SafetyLever
* // id: "STRING_VALUE",
* // arn: "STRING_VALUE",
* // state: { // SafetyLeverState
* // status: "disengaged" || "engaged" || "engaging",
* // reason: "STRING_VALUE",
* // },
* // },
* // };
*
* ```
*
* @param GetSafetyLeverCommandInput - {@link GetSafetyLeverCommandInput}
* @returns {@link GetSafetyLeverCommandOutput}
* @see {@link GetSafetyLeverCommandInput} for command's `input` shape.
* @see {@link GetSafetyLeverCommandOutput} for command's `response` shape.
* @see {@link FisClientResolvedConfig | config} for FisClient's `config` shape.
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The specified resource cannot be found.</p>
*
* @throws {@link FisServiceException}
* <p>Base exception class for all service exceptions from Fis service.</p>
*
* @public
*/
export class GetSafetyLeverCommand extends $Command
.classBuilder<
GetSafetyLeverCommandInput,
GetSafetyLeverCommandOutput,
FisClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep({
...commonParams,
})
.m(function (this: any, Command: any, cs: any, config: FisClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("FaultInjectionSimulator", "GetSafetyLever", {})
.n("FisClient", "GetSafetyLeverCommand")
.f(void 0, void 0)
.ser(se_GetSafetyLeverCommand)
.de(de_GetSafetyLeverCommand)
.build() {}
2 changes: 1 addition & 1 deletion clients/client-fis/src/commands/ListExperimentsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export interface ListExperimentsCommandOutput extends ListExperimentsResponse, _
* // arn: "STRING_VALUE",
* // experimentTemplateId: "STRING_VALUE",
* // state: { // ExperimentState
* // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed",
* // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed" || "cancelled",
* // reason: "STRING_VALUE",
* // error: { // ExperimentError
* // accountId: "STRING_VALUE",
Expand Down
2 changes: 1 addition & 1 deletion clients/client-fis/src/commands/StartExperimentCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface StartExperimentCommandOutput extends StartExperimentResponse, _
* // experimentTemplateId: "STRING_VALUE",
* // roleArn: "STRING_VALUE",
* // state: { // ExperimentState
* // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed",
* // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed" || "cancelled",
* // reason: "STRING_VALUE",
* // error: { // ExperimentError
* // accountId: "STRING_VALUE",
Expand Down
2 changes: 1 addition & 1 deletion clients/client-fis/src/commands/StopExperimentCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface StopExperimentCommandOutput extends StopExperimentResponse, __M
* // experimentTemplateId: "STRING_VALUE",
* // roleArn: "STRING_VALUE",
* // state: { // ExperimentState
* // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed",
* // status: "pending" || "initiating" || "running" || "completed" || "stopping" || "stopped" || "failed" || "cancelled",
* // reason: "STRING_VALUE",
* // error: { // ExperimentError
* // accountId: "STRING_VALUE",
Expand Down
Loading

0 comments on commit f71b730

Please sign in to comment.