Struct aws_sdk_synthetics::client::Client
source · [−]pub struct Client<C = DynConnector, M = DefaultMiddleware, R = Standard> { /* private fields */ }Expand description
Client for Synthetics
Client for invoking operations on Synthetics. Each operation on Synthetics is a method on this
this struct. .send() MUST be invoked on the generated operations to dispatch the request to the service.
Examples
Constructing a client and invoking an operation
// create a shared configuration. This can be used & shared between multiple service clients.
let shared_config = aws_config::load_from_env().await;
let client = aws_sdk_synthetics::Client::new(&shared_config);
// invoke an operation
/* let rsp = client
.<operation_name>().
.<param>("some value")
.send().await; */Constructing a client with custom configuration
use aws_config::RetryConfig;
let shared_config = aws_config::load_from_env().await;
let config = aws_sdk_synthetics::config::Builder::from(&shared_config)
.retry_config(RetryConfig::disabled())
.build();
let client = aws_sdk_synthetics::Client::from_conf(config);Implementations
impl<C, M, R> Client<C, M, R> where
C: SmithyConnector,
M: SmithyMiddleware<C>,
R: NewRequestPolicy,
impl<C, M, R> Client<C, M, R> where
C: SmithyConnector,
M: SmithyMiddleware<C>,
R: NewRequestPolicy,
Constructs a fluent builder for the CreateCanary operation.
- The fluent builder is configurable:
name(impl Into<String>)/set_name(Option<String>):The name for this canary. Be sure to give it a descriptive name that distinguishes it from other canaries in your account.
Do not include secrets or proprietary information in your canary names. The canary name makes up part of the canary ARN, and the ARN is included in outbound calls over the internet. For more information, see Security Considerations for Synthetics Canaries.
code(CanaryCodeInput)/set_code(Option<CanaryCodeInput>):A structure that includes the entry point from which the canary should start running your script. If the script is stored in an S3 bucket, the bucket name, key, and version are also included.
artifact_s3_location(impl Into<String>)/set_artifact_s3_location(Option<String>):The location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary. Artifacts include the log file, screenshots, and HAR files. The name of the S3 bucket can’t include a period (.).
execution_role_arn(impl Into<String>)/set_execution_role_arn(Option<String>):The ARN of the IAM role to be used to run the canary. This role must already exist, and must include
lambda.amazonaws.comas a principal in the trust policy. The role must also have the following permissions:-
s3:PutObject -
s3:GetBucketLocation -
s3:ListAllMyBuckets -
cloudwatch:PutMetricData -
logs:CreateLogGroup -
logs:CreateLogStream -
logs:PutLogEvents
-
schedule(CanaryScheduleInput)/set_schedule(Option<CanaryScheduleInput>):A structure that contains information about how often the canary is to run and when these test runs are to stop.
run_config(CanaryRunConfigInput)/set_run_config(Option<CanaryRunConfigInput>):A structure that contains the configuration for individual canary runs, such as timeout value.
success_retention_period_in_days(i32)/set_success_retention_period_in_days(Option<i32>):The number of days to retain data about successful runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days.
failure_retention_period_in_days(i32)/set_failure_retention_period_in_days(Option<i32>):The number of days to retain data about failed runs of this canary. If you omit this field, the default of 31 days is used. The valid range is 1 to 455 days.
runtime_version(impl Into<String>)/set_runtime_version(Option<String>):Specifies the runtime version to use for the canary. For a list of valid runtime versions and more information about runtime versions, see Canary Runtime Versions.
vpc_config(VpcConfigInput)/set_vpc_config(Option<VpcConfigInput>):If this canary is to test an endpoint in a VPC, this structure contains information about the subnet and security groups of the VPC endpoint. For more information, see Running a Canary in a VPC.
tags(HashMap<String, String>)/set_tags(Option<HashMap<String, String>>):A list of key-value pairs to associate with the canary. You can associate as many as 50 tags with a canary.
Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only the resources that have certain tag values.
artifact_config(ArtifactConfigInput)/set_artifact_config(Option<ArtifactConfigInput>):A structure that contains the configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3.
- On success, responds with
CreateCanaryOutputwith field(s):canary(Option<Canary>):The full details about the canary you have created.
- On failure, responds with
SdkError<CreateCanaryError>
Constructs a fluent builder for the DeleteCanary operation.
- The fluent builder is configurable:
name(impl Into<String>)/set_name(Option<String>):The name of the canary that you want to delete. To find the names of your canaries, use DescribeCanaries.
- On success, responds with
DeleteCanaryOutput - On failure, responds with
SdkError<DeleteCanaryError>
Constructs a fluent builder for the DescribeCanaries operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
next_token(impl Into<String>)/set_next_token(Option<String>):A token that indicates that there is more data available. You can use this token in a subsequent operation to retrieve the next set of results.
max_results(i32)/set_max_results(Option<i32>):Specify this parameter to limit how many canaries are returned each time you use the
DescribeCanariesoperation. If you omit this parameter, the default of 100 is used.
- On success, responds with
DescribeCanariesOutputwith field(s):canaries(Option<Vec<Canary>>):Returns an array. Each item in the array contains the full information about one canary.
next_token(Option<String>):A token that indicates that there is more data available. You can use this token in a subsequent
DescribeCanariesoperation to retrieve the next set of results.
- On failure, responds with
SdkError<DescribeCanariesError>
Constructs a fluent builder for the DescribeCanariesLastRun operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
next_token(impl Into<String>)/set_next_token(Option<String>):A token that indicates that there is more data available. You can use this token in a subsequent
DescribeCanariesoperation to retrieve the next set of results.max_results(i32)/set_max_results(Option<i32>):Specify this parameter to limit how many runs are returned each time you use the
DescribeLastRunoperation. If you omit this parameter, the default of 100 is used.
- On success, responds with
DescribeCanariesLastRunOutputwith field(s):canaries_last_run(Option<Vec<CanaryLastRun>>):An array that contains the information from the most recent run of each canary.
next_token(Option<String>):A token that indicates that there is more data available. You can use this token in a subsequent
DescribeCanariesLastRunoperation to retrieve the next set of results.
- On failure, responds with
SdkError<DescribeCanariesLastRunError>
Constructs a fluent builder for the DescribeRuntimeVersions operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
next_token(impl Into<String>)/set_next_token(Option<String>):A token that indicates that there is more data available. You can use this token in a subsequent
DescribeRuntimeVersionsoperation to retrieve the next set of results.max_results(i32)/set_max_results(Option<i32>):Specify this parameter to limit how many runs are returned each time you use the
DescribeRuntimeVersionsoperation. If you omit this parameter, the default of 100 is used.
- On success, responds with
DescribeRuntimeVersionsOutputwith field(s):runtime_versions(Option<Vec<RuntimeVersion>>):An array of objects that display the details about each Synthetics canary runtime version.
next_token(Option<String>):A token that indicates that there is more data available. You can use this token in a subsequent
DescribeRuntimeVersionsoperation to retrieve the next set of results.
- On failure, responds with
SdkError<DescribeRuntimeVersionsError>
Constructs a fluent builder for the GetCanary operation.
- The fluent builder is configurable:
name(impl Into<String>)/set_name(Option<String>):The name of the canary that you want details for.
- On success, responds with
GetCanaryOutputwith field(s):canary(Option<Canary>):A strucure that contains the full information about the canary.
- On failure, responds with
SdkError<GetCanaryError>
Constructs a fluent builder for the GetCanaryRuns operation.
This operation supports pagination; See into_paginator().
- The fluent builder is configurable:
name(impl Into<String>)/set_name(Option<String>):The name of the canary that you want to see runs for.
next_token(impl Into<String>)/set_next_token(Option<String>):A token that indicates that there is more data available. You can use this token in a subsequent
GetCanaryRunsoperation to retrieve the next set of results.max_results(i32)/set_max_results(Option<i32>):Specify this parameter to limit how many runs are returned each time you use the
GetCanaryRunsoperation. If you omit this parameter, the default of 100 is used.
- On success, responds with
GetCanaryRunsOutputwith field(s):canary_runs(Option<Vec<CanaryRun>>):An array of structures. Each structure contains the details of one of the retrieved canary runs.
next_token(Option<String>):A token that indicates that there is more data available. You can use this token in a subsequent
GetCanaryRunsoperation to retrieve the next set of results.
- On failure, responds with
SdkError<GetCanaryRunsError>
Constructs a fluent builder for the ListTagsForResource operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)/set_resource_arn(Option<String>):The ARN of the canary that you want to view tags for.
The ARN format of a canary is
arn:aws:synthetics:Region:account-id:canary:canary-name.
- On success, responds with
ListTagsForResourceOutputwith field(s):tags(Option<HashMap<String, String>>):The list of tag keys and values associated with the canary that you specified.
- On failure, responds with
SdkError<ListTagsForResourceError>
Constructs a fluent builder for the StartCanary operation.
- The fluent builder is configurable:
name(impl Into<String>)/set_name(Option<String>):The name of the canary that you want to run. To find canary names, use DescribeCanaries.
- On success, responds with
StartCanaryOutput - On failure, responds with
SdkError<StartCanaryError>
Constructs a fluent builder for the StopCanary operation.
- The fluent builder is configurable:
name(impl Into<String>)/set_name(Option<String>):The name of the canary that you want to stop. To find the names of your canaries, use DescribeCanaries.
- On success, responds with
StopCanaryOutput - On failure, responds with
SdkError<StopCanaryError>
Constructs a fluent builder for the TagResource operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)/set_resource_arn(Option<String>):The ARN of the canary that you’re adding tags to.
The ARN format of a canary is
arn:aws:synthetics:Region:account-id:canary:canary-name.tags(HashMap<String, String>)/set_tags(Option<HashMap<String, String>>):The list of key-value pairs to associate with the canary.
- On success, responds with
TagResourceOutput - On failure, responds with
SdkError<TagResourceError>
Constructs a fluent builder for the UntagResource operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)/set_resource_arn(Option<String>):The ARN of the canary that you’re removing tags from.
The ARN format of a canary is
arn:aws:synthetics:Region:account-id:canary:canary-name.tag_keys(Vec<String>)/set_tag_keys(Option<Vec<String>>):The list of tag keys to remove from the resource.
- On success, responds with
UntagResourceOutput - On failure, responds with
SdkError<UntagResourceError>
Constructs a fluent builder for the UpdateCanary operation.
- The fluent builder is configurable:
name(impl Into<String>)/set_name(Option<String>):The name of the canary that you want to update. To find the names of your canaries, use DescribeCanaries.
You cannot change the name of a canary that has already been created.
code(CanaryCodeInput)/set_code(Option<CanaryCodeInput>):A structure that includes the entry point from which the canary should start running your script. If the script is stored in an S3 bucket, the bucket name, key, and version are also included.
execution_role_arn(impl Into<String>)/set_execution_role_arn(Option<String>):The ARN of the IAM role to be used to run the canary. This role must already exist, and must include
lambda.amazonaws.comas a principal in the trust policy. The role must also have the following permissions:-
s3:PutObject -
s3:GetBucketLocation -
s3:ListAllMyBuckets -
cloudwatch:PutMetricData -
logs:CreateLogGroup -
logs:CreateLogStream -
logs:CreateLogStream
-
runtime_version(impl Into<String>)/set_runtime_version(Option<String>):Specifies the runtime version to use for the canary. For a list of valid runtime versions and for more information about runtime versions, see Canary Runtime Versions.
schedule(CanaryScheduleInput)/set_schedule(Option<CanaryScheduleInput>):A structure that contains information about how often the canary is to run, and when these runs are to stop.
run_config(CanaryRunConfigInput)/set_run_config(Option<CanaryRunConfigInput>):A structure that contains the timeout value that is used for each individual run of the canary.
success_retention_period_in_days(i32)/set_success_retention_period_in_days(Option<i32>):The number of days to retain data about successful runs of this canary.
failure_retention_period_in_days(i32)/set_failure_retention_period_in_days(Option<i32>):The number of days to retain data about failed runs of this canary.
vpc_config(VpcConfigInput)/set_vpc_config(Option<VpcConfigInput>):If this canary is to test an endpoint in a VPC, this structure contains information about the subnet and security groups of the VPC endpoint. For more information, see Running a Canary in a VPC.
visual_reference(VisualReferenceInput)/set_visual_reference(Option<VisualReferenceInput>):Defines the screenshots to use as the baseline for comparisons during visual monitoring comparisons during future runs of this canary. If you omit this parameter, no changes are made to any baseline screenshots that the canary might be using already.
Visual monitoring is supported only on canaries running the syn-puppeteer-node-3.2 runtime or later. For more information, see Visual monitoring and Visual monitoring blueprint
artifact_s3_location(impl Into<String>)/set_artifact_s3_location(Option<String>):The location in Amazon S3 where Synthetics stores artifacts from the test runs of this canary. Artifacts include the log file, screenshots, and HAR files. The name of the S3 bucket can’t include a period (.).
artifact_config(ArtifactConfigInput)/set_artifact_config(Option<ArtifactConfigInput>):A structure that contains the configuration for canary artifacts, including the encryption-at-rest settings for artifacts that the canary uploads to Amazon S3.
- On success, responds with
UpdateCanaryOutput - On failure, responds with
SdkError<UpdateCanaryError>
Creates a client with the given service config and connector override.
Trait Implementations
Auto Trait Implementations
impl<C = DynConnector, M = DefaultMiddleware, R = Standard> !RefUnwindSafe for Client<C, M, R>
impl<C = DynConnector, M = DefaultMiddleware, R = Standard> !UnwindSafe for Client<C, M, R>
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more