-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-synthetics): This release introduces Group feature, which…
… enables users to group cross-region canaries.
- Loading branch information
awstools
committed
Jul 6, 2022
1 parent
8ed0e09
commit 5e37998
Showing
26 changed files
with
3,676 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
clients/client-synthetics/src/commands/AssociateResourceCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
// smithy-typescript generated code | ||
import { getSerdePlugin } from "@aws-sdk/middleware-serde"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { Command as $Command } from "@aws-sdk/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
SerdeContext as __SerdeContext, | ||
} from "@aws-sdk/types"; | ||
|
||
import { AssociateResourceRequest, AssociateResourceResponse } from "../models/models_0"; | ||
import { | ||
deserializeAws_restJson1AssociateResourceCommand, | ||
serializeAws_restJson1AssociateResourceCommand, | ||
} from "../protocols/Aws_restJson1"; | ||
import { ServiceInputTypes, ServiceOutputTypes, SyntheticsClientResolvedConfig } from "../SyntheticsClient"; | ||
|
||
export interface AssociateResourceCommandInput extends AssociateResourceRequest {} | ||
export interface AssociateResourceCommandOutput extends AssociateResourceResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Associates a canary with a group. Using groups can help you with | ||
* managing and automating your canaries, and you can also view aggregated run results and statistics | ||
* for all canaries in a group. </p> | ||
* <p>You must run this operation in the Region where the canary exists.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { SyntheticsClient, AssociateResourceCommand } from "@aws-sdk/client-synthetics"; // ES Modules import | ||
* // const { SyntheticsClient, AssociateResourceCommand } = require("@aws-sdk/client-synthetics"); // CommonJS import | ||
* const client = new SyntheticsClient(config); | ||
* const command = new AssociateResourceCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link AssociateResourceCommandInput} for command's `input` shape. | ||
* @see {@link AssociateResourceCommandOutput} for command's `response` shape. | ||
* @see {@link SyntheticsClientResolvedConfig | config} for SyntheticsClient's `config` shape. | ||
* | ||
*/ | ||
export class AssociateResourceCommand extends $Command< | ||
AssociateResourceCommandInput, | ||
AssociateResourceCommandOutput, | ||
SyntheticsClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
constructor(readonly input: AssociateResourceCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: SyntheticsClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<AssociateResourceCommandInput, AssociateResourceCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "SyntheticsClient"; | ||
const commandName = "AssociateResourceCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: AssociateResourceRequest.filterSensitiveLog, | ||
outputFilterSensitiveLog: AssociateResourceResponse.filterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: AssociateResourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_restJson1AssociateResourceCommand(input, context); | ||
} | ||
|
||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<AssociateResourceCommandOutput> { | ||
return deserializeAws_restJson1AssociateResourceCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
clients/client-synthetics/src/commands/CreateGroupCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
// smithy-typescript generated code | ||
import { getSerdePlugin } from "@aws-sdk/middleware-serde"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { Command as $Command } from "@aws-sdk/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
SerdeContext as __SerdeContext, | ||
} from "@aws-sdk/types"; | ||
|
||
import { CreateGroupRequest, CreateGroupResponse } from "../models/models_0"; | ||
import { | ||
deserializeAws_restJson1CreateGroupCommand, | ||
serializeAws_restJson1CreateGroupCommand, | ||
} from "../protocols/Aws_restJson1"; | ||
import { ServiceInputTypes, ServiceOutputTypes, SyntheticsClientResolvedConfig } from "../SyntheticsClient"; | ||
|
||
export interface CreateGroupCommandInput extends CreateGroupRequest {} | ||
export interface CreateGroupCommandOutput extends CreateGroupResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Creates a group which you can use to associate canaries with each other, including cross-Region | ||
* canaries. Using groups can help you with | ||
* managing and automating your canaries, and you can also view aggregated run results and statistics | ||
* for all canaries in a group. </p> | ||
* <p>Groups are global resources. When you create a group, it is replicated across Amazon Web Services Regions, and | ||
* you can view it and add canaries to it from any Region. | ||
* Although the group ARN format reflects the Region name where it was created, a group is not constrained to any Region. | ||
* This means that you can put canaries from multiple Regions into the same group, and then use | ||
* that group to view and manage all of those canaries in a single view.</p> | ||
* <p>Groups are supported in all Regions except the Regions that are disabled by default. For more information | ||
* about these Regions, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande-manage.html#rande-manage-enable">Enabling a Region</a>.</p> | ||
* <p>Each group can contain as many as 10 canaries. You can have as many as 20 groups in your account. Any single canary | ||
* can be a member of up to 10 groups.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { SyntheticsClient, CreateGroupCommand } from "@aws-sdk/client-synthetics"; // ES Modules import | ||
* // const { SyntheticsClient, CreateGroupCommand } = require("@aws-sdk/client-synthetics"); // CommonJS import | ||
* const client = new SyntheticsClient(config); | ||
* const command = new CreateGroupCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link CreateGroupCommandInput} for command's `input` shape. | ||
* @see {@link CreateGroupCommandOutput} for command's `response` shape. | ||
* @see {@link SyntheticsClientResolvedConfig | config} for SyntheticsClient's `config` shape. | ||
* | ||
*/ | ||
export class CreateGroupCommand extends $Command< | ||
CreateGroupCommandInput, | ||
CreateGroupCommandOutput, | ||
SyntheticsClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
constructor(readonly input: CreateGroupCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: SyntheticsClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<CreateGroupCommandInput, CreateGroupCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "SyntheticsClient"; | ||
const commandName = "CreateGroupCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: CreateGroupRequest.filterSensitiveLog, | ||
outputFilterSensitiveLog: CreateGroupResponse.filterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: CreateGroupCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_restJson1CreateGroupCommand(input, context); | ||
} | ||
|
||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<CreateGroupCommandOutput> { | ||
return deserializeAws_restJson1CreateGroupCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.