pub struct Client { /* private fields */ }
Expand description
Client for AWS Shield
Client for invoking operations on AWS Shield. Each operation on AWS Shield is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
§Constructing a Client
A Config
is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env()
, since this will resolve an SdkConfig
which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env()
instead, which returns a ConfigLoader
that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_shield::Client::new(&config);
Occasionally, SDKs may have additional service-specific values that can be set on the Config
that
is absent from SdkConfig
, or slightly different settings for a specific client may be desired.
The Builder
struct implements From<&SdkConfig>
, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_shield::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();
See the aws-config
docs and Config
for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
§Using the Client
A client has a function for every operation that can be performed by the service.
For example, the AssociateDRTLogBucket
operation has
a Client::associate_drt_log_bucket
, function which returns a builder for that operation.
The fluent builder ultimately has a send()
function that returns an async future that
returns a result, as illustrated below:
let result = client.associate_drt_log_bucket()
.log_bucket("example")
.send()
.await;
The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize
module for more
information.
Implementations§
Source§impl Client
impl Client
Sourcepub fn associate_drt_log_bucket(&self) -> AssociateDRTLogBucketFluentBuilder
pub fn associate_drt_log_bucket(&self) -> AssociateDRTLogBucketFluentBuilder
Constructs a fluent builder for the AssociateDRTLogBucket
operation.
- The fluent builder is configurable:
log_bucket(impl Into<String>)
/set_log_bucket(Option<String>)
:
required: trueThe Amazon S3 bucket that contains the logs that you want to share.
- On success, responds with
AssociateDrtLogBucketOutput
- On failure, responds with
SdkError<AssociateDRTLogBucketError>
Source§impl Client
impl Client
Sourcepub fn associate_drt_role(&self) -> AssociateDRTRoleFluentBuilder
pub fn associate_drt_role(&self) -> AssociateDRTRoleFluentBuilder
Constructs a fluent builder for the AssociateDRTRole
operation.
- The fluent builder is configurable:
role_arn(impl Into<String>)
/set_role_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the role the SRT will use to access your Amazon Web Services account.
Prior to making the
AssociateDRTRole
request, you must attach the AWSShieldDRTAccessPolicy managed policy to this role. For more information see Attaching and Detaching IAM Policies.
- On success, responds with
AssociateDrtRoleOutput
- On failure, responds with
SdkError<AssociateDRTRoleError>
Source§impl Client
impl Client
Sourcepub fn associate_health_check(&self) -> AssociateHealthCheckFluentBuilder
pub fn associate_health_check(&self) -> AssociateHealthCheckFluentBuilder
Constructs a fluent builder for the AssociateHealthCheck
operation.
- The fluent builder is configurable:
protection_id(impl Into<String>)
/set_protection_id(Option<String>)
:
required: trueThe unique identifier (ID) for the
Protection
object to add the health check association to.health_check_arn(impl Into<String>)
/set_health_check_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the health check to associate with the protection.
- On success, responds with
AssociateHealthCheckOutput
- On failure, responds with
SdkError<AssociateHealthCheckError>
Source§impl Client
impl Client
Sourcepub fn associate_proactive_engagement_details(
&self,
) -> AssociateProactiveEngagementDetailsFluentBuilder
pub fn associate_proactive_engagement_details( &self, ) -> AssociateProactiveEngagementDetailsFluentBuilder
Constructs a fluent builder for the AssociateProactiveEngagementDetails
operation.
- The fluent builder is configurable:
emergency_contact_list(EmergencyContact)
/set_emergency_contact_list(Option<Vec::<EmergencyContact>>)
:
required: trueA list of email addresses and phone numbers that the Shield Response Team (SRT) can use to contact you for escalations to the SRT and to initiate proactive customer support.
To enable proactive engagement, the contact list must include at least one phone number.
The contacts that you provide here replace any contacts that were already defined. If you already have contacts defined and want to use them, retrieve the list using
DescribeEmergencyContactSettings
and then provide it here.
- On success, responds with
AssociateProactiveEngagementDetailsOutput
- On failure, responds with
SdkError<AssociateProactiveEngagementDetailsError>
Source§impl Client
impl Client
Sourcepub fn create_protection(&self) -> CreateProtectionFluentBuilder
pub fn create_protection(&self) -> CreateProtectionFluentBuilder
Constructs a fluent builder for the CreateProtection
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueFriendly name for the
Protection
you are creating.resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe ARN (Amazon Resource Name) of the resource to be protected.
The ARN should be in one of the following formats:
-
For an Application Load Balancer:
arn:aws:elasticloadbalancing:region:account-id:loadbalancer/app/load-balancer-name/load-balancer-id
-
For an Elastic Load Balancer (Classic Load Balancer):
arn:aws:elasticloadbalancing:region:account-id:loadbalancer/load-balancer-name
-
For an Amazon CloudFront distribution:
arn:aws:cloudfront::account-id:distribution/distribution-id
-
For an Global Accelerator standard accelerator:
arn:aws:globalaccelerator::account-id:accelerator/accelerator-id
-
For Amazon Route 53:
arn:aws:route53:::hostedzone/hosted-zone-id
-
For an Elastic IP address:
arn:aws:ec2:region:account-id:eip-allocation/allocation-id
-
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: falseOne or more tag key-value pairs for the
Protection
object that is created.
- On success, responds with
CreateProtectionOutput
with field(s):protection_id(Option<String>)
:The unique identifier (ID) for the
Protection
object that is created.
- On failure, responds with
SdkError<CreateProtectionError>
Source§impl Client
impl Client
Sourcepub fn create_protection_group(&self) -> CreateProtectionGroupFluentBuilder
pub fn create_protection_group(&self) -> CreateProtectionGroupFluentBuilder
Constructs a fluent builder for the CreateProtectionGroup
operation.
- The fluent builder is configurable:
protection_group_id(impl Into<String>)
/set_protection_group_id(Option<String>)
:
required: trueThe name of the protection group. You use this to identify the protection group in lists and to manage the protection group, for example to update, delete, or describe it.
aggregation(ProtectionGroupAggregation)
/set_aggregation(Option<ProtectionGroupAggregation>)
:
required: trueDefines how Shield combines resource data for the group in order to detect, mitigate, and report events.
-
Sum - Use the total traffic across the group. This is a good choice for most cases. Examples include Elastic IP addresses for EC2 instances that scale manually or automatically.
-
Mean - Use the average of the traffic across the group. This is a good choice for resources that share traffic uniformly. Examples include accelerators and load balancers.
-
Max - Use the highest traffic from each resource. This is useful for resources that don’t share traffic and for resources that share that traffic in a non-uniform way. Examples include Amazon CloudFront and origin resources for CloudFront distributions.
-
pattern(ProtectionGroupPattern)
/set_pattern(Option<ProtectionGroupPattern>)
:
required: trueThe criteria to use to choose the protected resources for inclusion in the group. You can include all resources that have protections, provide a list of resource Amazon Resource Names (ARNs), or include all resources of a specified resource type.
resource_type(ProtectedResourceType)
/set_resource_type(Option<ProtectedResourceType>)
:
required: falseThe resource type to include in the protection group. All protected resources of this type are included in the protection group. Newly protected resources of this type are automatically added to the group. You must set this when you set
Pattern
toBY_RESOURCE_TYPE
and you must not set it for any otherPattern
setting.members(impl Into<String>)
/set_members(Option<Vec::<String>>)
:
required: falseThe Amazon Resource Names (ARNs) of the resources to include in the protection group. You must set this when you set
Pattern
toARBITRARY
and you must not set it for any otherPattern
setting.tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: falseOne or more tag key-value pairs for the protection group.
- On success, responds with
CreateProtectionGroupOutput
- On failure, responds with
SdkError<CreateProtectionGroupError>
Source§impl Client
impl Client
Sourcepub fn create_subscription(&self) -> CreateSubscriptionFluentBuilder
pub fn create_subscription(&self) -> CreateSubscriptionFluentBuilder
Constructs a fluent builder for the CreateSubscription
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
CreateSubscriptionOutput
- On failure, responds with
SdkError<CreateSubscriptionError>
Source§impl Client
impl Client
Sourcepub fn delete_protection(&self) -> DeleteProtectionFluentBuilder
pub fn delete_protection(&self) -> DeleteProtectionFluentBuilder
Constructs a fluent builder for the DeleteProtection
operation.
- The fluent builder is configurable:
protection_id(impl Into<String>)
/set_protection_id(Option<String>)
:
required: trueThe unique identifier (ID) for the
Protection
object to be deleted.
- On success, responds with
DeleteProtectionOutput
- On failure, responds with
SdkError<DeleteProtectionError>
Source§impl Client
impl Client
Sourcepub fn delete_protection_group(&self) -> DeleteProtectionGroupFluentBuilder
pub fn delete_protection_group(&self) -> DeleteProtectionGroupFluentBuilder
Constructs a fluent builder for the DeleteProtectionGroup
operation.
- The fluent builder is configurable:
protection_group_id(impl Into<String>)
/set_protection_group_id(Option<String>)
:
required: trueThe name of the protection group. You use this to identify the protection group in lists and to manage the protection group, for example to update, delete, or describe it.
- On success, responds with
DeleteProtectionGroupOutput
- On failure, responds with
SdkError<DeleteProtectionGroupError>
Source§impl Client
impl Client
Sourcepub fn delete_subscription(&self) -> DeleteSubscriptionFluentBuilder
👎Deprecated
pub fn delete_subscription(&self) -> DeleteSubscriptionFluentBuilder
Constructs a fluent builder for the DeleteSubscription
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
DeleteSubscriptionOutput
- On failure, responds with
SdkError<DeleteSubscriptionError>
Source§impl Client
impl Client
Sourcepub fn describe_attack(&self) -> DescribeAttackFluentBuilder
pub fn describe_attack(&self) -> DescribeAttackFluentBuilder
Constructs a fluent builder for the DescribeAttack
operation.
- The fluent builder is configurable:
attack_id(impl Into<String>)
/set_attack_id(Option<String>)
:
required: trueThe unique identifier (ID) for the attack.
- On success, responds with
DescribeAttackOutput
with field(s):attack(Option<AttackDetail>)
:The attack that you requested.
- On failure, responds with
SdkError<DescribeAttackError>
Source§impl Client
impl Client
Sourcepub fn describe_attack_statistics(
&self,
) -> DescribeAttackStatisticsFluentBuilder
pub fn describe_attack_statistics( &self, ) -> DescribeAttackStatisticsFluentBuilder
Constructs a fluent builder for the DescribeAttackStatistics
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
DescribeAttackStatisticsOutput
with field(s):time_range(Option<TimeRange>)
:The time range of the attack.
data_items(Vec::<AttackStatisticsDataItem>)
:The data that describes the attacks detected during the time period.
- On failure, responds with
SdkError<DescribeAttackStatisticsError>
Source§impl Client
impl Client
Sourcepub fn describe_drt_access(&self) -> DescribeDRTAccessFluentBuilder
pub fn describe_drt_access(&self) -> DescribeDRTAccessFluentBuilder
Constructs a fluent builder for the DescribeDRTAccess
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
DescribeDrtAccessOutput
with field(s):role_arn(Option<String>)
:The Amazon Resource Name (ARN) of the role the SRT used to access your Amazon Web Services account.
log_bucket_list(Option<Vec::<String>>)
:The list of Amazon S3 buckets accessed by the SRT.
- On failure, responds with
SdkError<DescribeDRTAccessError>
Source§impl Client
impl Client
Sourcepub fn describe_emergency_contact_settings(
&self,
) -> DescribeEmergencyContactSettingsFluentBuilder
pub fn describe_emergency_contact_settings( &self, ) -> DescribeEmergencyContactSettingsFluentBuilder
Constructs a fluent builder for the DescribeEmergencyContactSettings
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
DescribeEmergencyContactSettingsOutput
with field(s):emergency_contact_list(Option<Vec::<EmergencyContact>>)
:A list of email addresses and phone numbers that the Shield Response Team (SRT) can use to contact you if you have proactive engagement enabled, for escalations to the SRT and to initiate proactive customer support.
- On failure, responds with
SdkError<DescribeEmergencyContactSettingsError>
Source§impl Client
impl Client
Sourcepub fn describe_protection(&self) -> DescribeProtectionFluentBuilder
pub fn describe_protection(&self) -> DescribeProtectionFluentBuilder
Constructs a fluent builder for the DescribeProtection
operation.
- The fluent builder is configurable:
protection_id(impl Into<String>)
/set_protection_id(Option<String>)
:
required: falseThe unique identifier (ID) for the
Protection
object to describe. You must provide either theResourceArn
of the protected resource or theProtectionID
of the protection, but not both.resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: falseThe ARN (Amazon Resource Name) of the protected Amazon Web Services resource. You must provide either the
ResourceArn
of the protected resource or theProtectionID
of the protection, but not both.
- On success, responds with
DescribeProtectionOutput
with field(s):protection(Option<Protection>)
:The
Protection
that you requested.
- On failure, responds with
SdkError<DescribeProtectionError>
Source§impl Client
impl Client
Sourcepub fn describe_protection_group(&self) -> DescribeProtectionGroupFluentBuilder
pub fn describe_protection_group(&self) -> DescribeProtectionGroupFluentBuilder
Constructs a fluent builder for the DescribeProtectionGroup
operation.
- The fluent builder is configurable:
protection_group_id(impl Into<String>)
/set_protection_group_id(Option<String>)
:
required: trueThe name of the protection group. You use this to identify the protection group in lists and to manage the protection group, for example to update, delete, or describe it.
- On success, responds with
DescribeProtectionGroupOutput
with field(s):protection_group(Option<ProtectionGroup>)
:A grouping of protected resources that you and Shield Advanced can monitor as a collective. This resource grouping improves the accuracy of detection and reduces false positives.
- On failure, responds with
SdkError<DescribeProtectionGroupError>
Source§impl Client
impl Client
Sourcepub fn describe_subscription(&self) -> DescribeSubscriptionFluentBuilder
pub fn describe_subscription(&self) -> DescribeSubscriptionFluentBuilder
Constructs a fluent builder for the DescribeSubscription
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
DescribeSubscriptionOutput
with field(s):subscription(Option<Subscription>)
:The Shield Advanced subscription details for an account.
- On failure, responds with
SdkError<DescribeSubscriptionError>
Source§impl Client
impl Client
Sourcepub fn disable_application_layer_automatic_response(
&self,
) -> DisableApplicationLayerAutomaticResponseFluentBuilder
pub fn disable_application_layer_automatic_response( &self, ) -> DisableApplicationLayerAutomaticResponseFluentBuilder
Constructs a fluent builder for the DisableApplicationLayerAutomaticResponse
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe ARN (Amazon Resource Name) of the protected resource.
- On success, responds with
DisableApplicationLayerAutomaticResponseOutput
- On failure, responds with
SdkError<DisableApplicationLayerAutomaticResponseError>
Source§impl Client
impl Client
Sourcepub fn disable_proactive_engagement(
&self,
) -> DisableProactiveEngagementFluentBuilder
pub fn disable_proactive_engagement( &self, ) -> DisableProactiveEngagementFluentBuilder
Constructs a fluent builder for the DisableProactiveEngagement
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
DisableProactiveEngagementOutput
- On failure, responds with
SdkError<DisableProactiveEngagementError>
Source§impl Client
impl Client
Sourcepub fn disassociate_drt_log_bucket(
&self,
) -> DisassociateDRTLogBucketFluentBuilder
pub fn disassociate_drt_log_bucket( &self, ) -> DisassociateDRTLogBucketFluentBuilder
Constructs a fluent builder for the DisassociateDRTLogBucket
operation.
- The fluent builder is configurable:
log_bucket(impl Into<String>)
/set_log_bucket(Option<String>)
:
required: trueThe Amazon S3 bucket that contains the logs that you want to share.
- On success, responds with
DisassociateDrtLogBucketOutput
- On failure, responds with
SdkError<DisassociateDRTLogBucketError>
Source§impl Client
impl Client
Sourcepub fn disassociate_drt_role(&self) -> DisassociateDRTRoleFluentBuilder
pub fn disassociate_drt_role(&self) -> DisassociateDRTRoleFluentBuilder
Constructs a fluent builder for the DisassociateDRTRole
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
DisassociateDrtRoleOutput
- On failure, responds with
SdkError<DisassociateDRTRoleError>
Source§impl Client
impl Client
Sourcepub fn disassociate_health_check(&self) -> DisassociateHealthCheckFluentBuilder
pub fn disassociate_health_check(&self) -> DisassociateHealthCheckFluentBuilder
Constructs a fluent builder for the DisassociateHealthCheck
operation.
- The fluent builder is configurable:
protection_id(impl Into<String>)
/set_protection_id(Option<String>)
:
required: trueThe unique identifier (ID) for the
Protection
object to remove the health check association from.health_check_arn(impl Into<String>)
/set_health_check_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the health check that is associated with the protection.
- On success, responds with
DisassociateHealthCheckOutput
- On failure, responds with
SdkError<DisassociateHealthCheckError>
Source§impl Client
impl Client
Sourcepub fn enable_application_layer_automatic_response(
&self,
) -> EnableApplicationLayerAutomaticResponseFluentBuilder
pub fn enable_application_layer_automatic_response( &self, ) -> EnableApplicationLayerAutomaticResponseFluentBuilder
Constructs a fluent builder for the EnableApplicationLayerAutomaticResponse
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe ARN (Amazon Resource Name) of the protected resource.
action(ResponseAction)
/set_action(Option<ResponseAction>)
:
required: trueSpecifies the action setting that Shield Advanced should use in the WAF rules that it creates on behalf of the protected resource in response to DDoS attacks. You specify this as part of the configuration for the automatic application layer DDoS mitigation feature, when you enable or update automatic mitigation. Shield Advanced creates the WAF rules in a Shield Advanced-managed rule group, inside the web ACL that you have associated with the resource.
- On success, responds with
EnableApplicationLayerAutomaticResponseOutput
- On failure, responds with
SdkError<EnableApplicationLayerAutomaticResponseError>
Source§impl Client
impl Client
Sourcepub fn enable_proactive_engagement(
&self,
) -> EnableProactiveEngagementFluentBuilder
pub fn enable_proactive_engagement( &self, ) -> EnableProactiveEngagementFluentBuilder
Constructs a fluent builder for the EnableProactiveEngagement
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
EnableProactiveEngagementOutput
- On failure, responds with
SdkError<EnableProactiveEngagementError>
Source§impl Client
impl Client
Sourcepub fn get_subscription_state(&self) -> GetSubscriptionStateFluentBuilder
pub fn get_subscription_state(&self) -> GetSubscriptionStateFluentBuilder
Constructs a fluent builder for the GetSubscriptionState
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
GetSubscriptionStateOutput
with field(s):subscription_state(SubscriptionState)
:The status of the subscription.
- On failure, responds with
SdkError<GetSubscriptionStateError>
Source§impl Client
impl Client
Sourcepub fn list_attacks(&self) -> ListAttacksFluentBuilder
pub fn list_attacks(&self) -> ListAttacksFluentBuilder
Constructs a fluent builder for the ListAttacks
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
resource_arns(impl Into<String>)
/set_resource_arns(Option<Vec::<String>>)
:
required: falseThe ARNs (Amazon Resource Names) of the resources that were attacked. If you leave this blank, all applicable resources for this account will be included.
start_time(TimeRange)
/set_start_time(Option<TimeRange>)
:
required: falseThe start of the time period for the attacks. This is a
timestamp
type. The request syntax listing for this call indicates anumber
type, but you can provide the time in any valid timestamp format setting.end_time(TimeRange)
/set_end_time(Option<TimeRange>)
:
required: falseThe end of the time period for the attacks. This is a
timestamp
type. The request syntax listing for this call indicates anumber
type, but you can provide the time in any valid timestamp format setting.next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseWhen you request a list of objects from Shield Advanced, if the response does not include all of the remaining available objects, Shield Advanced includes a
NextToken
value in the response. You can retrieve the next batch of objects by requesting the list again and providing the token that was returned by the prior call in your request.You can indicate the maximum number of objects that you want Shield Advanced to return for a single call with the
MaxResults
setting. Shield Advanced will not return more thanMaxResults
objects, but may return fewer, even if more objects are still available.Whenever more objects remain that Shield Advanced has not yet returned to you, the response will include a
NextToken
value.On your first call to a list operation, leave this setting empty.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe greatest number of objects that you want Shield Advanced to return to the list request. Shield Advanced might return fewer objects than you indicate in this setting, even if more objects are available. If there are more objects remaining, Shield Advanced will always also return a
NextToken
value in the response.The default setting is 20.
- On success, responds with
ListAttacksOutput
with field(s):attack_summaries(Option<Vec::<AttackSummary>>)
:The attack information for the specified time range.
next_token(Option<String>)
:When you request a list of objects from Shield Advanced, if the response does not include all of the remaining available objects, Shield Advanced includes a
NextToken
value in the response. You can retrieve the next batch of objects by requesting the list again and providing the token that was returned by the prior call in your request.You can indicate the maximum number of objects that you want Shield Advanced to return for a single call with the
MaxResults
setting. Shield Advanced will not return more thanMaxResults
objects, but may return fewer, even if more objects are still available.Whenever more objects remain that Shield Advanced has not yet returned to you, the response will include a
NextToken
value.
- On failure, responds with
SdkError<ListAttacksError>
Source§impl Client
impl Client
Sourcepub fn list_protection_groups(&self) -> ListProtectionGroupsFluentBuilder
pub fn list_protection_groups(&self) -> ListProtectionGroupsFluentBuilder
Constructs a fluent builder for the ListProtectionGroups
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseWhen you request a list of objects from Shield Advanced, if the response does not include all of the remaining available objects, Shield Advanced includes a
NextToken
value in the response. You can retrieve the next batch of objects by requesting the list again and providing the token that was returned by the prior call in your request.You can indicate the maximum number of objects that you want Shield Advanced to return for a single call with the
MaxResults
setting. Shield Advanced will not return more thanMaxResults
objects, but may return fewer, even if more objects are still available.Whenever more objects remain that Shield Advanced has not yet returned to you, the response will include a
NextToken
value.On your first call to a list operation, leave this setting empty.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe greatest number of objects that you want Shield Advanced to return to the list request. Shield Advanced might return fewer objects than you indicate in this setting, even if more objects are available. If there are more objects remaining, Shield Advanced will always also return a
NextToken
value in the response.The default setting is 20.
inclusion_filters(InclusionProtectionGroupFilters)
/set_inclusion_filters(Option<InclusionProtectionGroupFilters>)
:
required: falseNarrows the set of protection groups that the call retrieves. You can retrieve a single protection group by its name and you can retrieve all protection groups that are configured with specific pattern or aggregation settings. You can provide up to one criteria per filter type. Shield Advanced returns the protection groups that exactly match all of the search criteria that you provide.
- On success, responds with
ListProtectionGroupsOutput
with field(s):protection_groups(Vec::<ProtectionGroup>)
:next_token(Option<String>)
:When you request a list of objects from Shield Advanced, if the response does not include all of the remaining available objects, Shield Advanced includes a
NextToken
value in the response. You can retrieve the next batch of objects by requesting the list again and providing the token that was returned by the prior call in your request.You can indicate the maximum number of objects that you want Shield Advanced to return for a single call with the
MaxResults
setting. Shield Advanced will not return more thanMaxResults
objects, but may return fewer, even if more objects are still available.Whenever more objects remain that Shield Advanced has not yet returned to you, the response will include a
NextToken
value.
- On failure, responds with
SdkError<ListProtectionGroupsError>
Source§impl Client
impl Client
Sourcepub fn list_protections(&self) -> ListProtectionsFluentBuilder
pub fn list_protections(&self) -> ListProtectionsFluentBuilder
Constructs a fluent builder for the ListProtections
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseWhen you request a list of objects from Shield Advanced, if the response does not include all of the remaining available objects, Shield Advanced includes a
NextToken
value in the response. You can retrieve the next batch of objects by requesting the list again and providing the token that was returned by the prior call in your request.You can indicate the maximum number of objects that you want Shield Advanced to return for a single call with the
MaxResults
setting. Shield Advanced will not return more thanMaxResults
objects, but may return fewer, even if more objects are still available.Whenever more objects remain that Shield Advanced has not yet returned to you, the response will include a
NextToken
value.On your first call to a list operation, leave this setting empty.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe greatest number of objects that you want Shield Advanced to return to the list request. Shield Advanced might return fewer objects than you indicate in this setting, even if more objects are available. If there are more objects remaining, Shield Advanced will always also return a
NextToken
value in the response.The default setting is 20.
inclusion_filters(InclusionProtectionFilters)
/set_inclusion_filters(Option<InclusionProtectionFilters>)
:
required: falseNarrows the set of protections that the call retrieves. You can retrieve a single protection by providing its name or the ARN (Amazon Resource Name) of its protected resource. You can also retrieve all protections for a specific resource type. You can provide up to one criteria per filter type. Shield Advanced returns protections that exactly match all of the filter criteria that you provide.
- On success, responds with
ListProtectionsOutput
with field(s):protections(Option<Vec::<Protection>>)
:The array of enabled
Protection
objects.next_token(Option<String>)
:When you request a list of objects from Shield Advanced, if the response does not include all of the remaining available objects, Shield Advanced includes a
NextToken
value in the response. You can retrieve the next batch of objects by requesting the list again and providing the token that was returned by the prior call in your request.You can indicate the maximum number of objects that you want Shield Advanced to return for a single call with the
MaxResults
setting. Shield Advanced will not return more thanMaxResults
objects, but may return fewer, even if more objects are still available.Whenever more objects remain that Shield Advanced has not yet returned to you, the response will include a
NextToken
value.
- On failure, responds with
SdkError<ListProtectionsError>
Source§impl Client
impl Client
Sourcepub fn list_resources_in_protection_group(
&self,
) -> ListResourcesInProtectionGroupFluentBuilder
pub fn list_resources_in_protection_group( &self, ) -> ListResourcesInProtectionGroupFluentBuilder
Constructs a fluent builder for the ListResourcesInProtectionGroup
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
protection_group_id(impl Into<String>)
/set_protection_group_id(Option<String>)
:
required: trueThe name of the protection group. You use this to identify the protection group in lists and to manage the protection group, for example to update, delete, or describe it.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseWhen you request a list of objects from Shield Advanced, if the response does not include all of the remaining available objects, Shield Advanced includes a
NextToken
value in the response. You can retrieve the next batch of objects by requesting the list again and providing the token that was returned by the prior call in your request.You can indicate the maximum number of objects that you want Shield Advanced to return for a single call with the
MaxResults
setting. Shield Advanced will not return more thanMaxResults
objects, but may return fewer, even if more objects are still available.Whenever more objects remain that Shield Advanced has not yet returned to you, the response will include a
NextToken
value.On your first call to a list operation, leave this setting empty.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseThe greatest number of objects that you want Shield Advanced to return to the list request. Shield Advanced might return fewer objects than you indicate in this setting, even if more objects are available. If there are more objects remaining, Shield Advanced will always also return a
NextToken
value in the response.The default setting is 20.
- On success, responds with
ListResourcesInProtectionGroupOutput
with field(s):resource_arns(Vec::<String>)
:The Amazon Resource Names (ARNs) of the resources that are included in the protection group.
next_token(Option<String>)
:When you request a list of objects from Shield Advanced, if the response does not include all of the remaining available objects, Shield Advanced includes a
NextToken
value in the response. You can retrieve the next batch of objects by requesting the list again and providing the token that was returned by the prior call in your request.You can indicate the maximum number of objects that you want Shield Advanced to return for a single call with the
MaxResults
setting. Shield Advanced will not return more thanMaxResults
objects, but may return fewer, even if more objects are still available.Whenever more objects remain that Shield Advanced has not yet returned to you, the response will include a
NextToken
value.
- On failure, responds with
SdkError<ListResourcesInProtectionGroupError>
Source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource to get tags for.
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Option<Vec::<Tag>>)
:A list of tag key and value pairs associated with the specified resource.
- On failure, responds with
SdkError<ListTagsForResourceError>
Source§impl Client
impl Client
Sourcepub fn tag_resource(&self) -> TagResourceFluentBuilder
pub fn tag_resource(&self) -> TagResourceFluentBuilder
Constructs a fluent builder for the TagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource that you want to add or update tags for.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: trueThe tags that you want to modify or add to the resource.
- On success, responds with
TagResourceOutput
- On failure, responds with
SdkError<TagResourceError>
Source§impl Client
impl Client
Sourcepub fn untag_resource(&self) -> UntagResourceFluentBuilder
pub fn untag_resource(&self) -> UntagResourceFluentBuilder
Constructs a fluent builder for the UntagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource that you want to remove tags from.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueThe tag key for each tag that you want to remove from the resource.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
Source§impl Client
impl Client
Sourcepub fn update_application_layer_automatic_response(
&self,
) -> UpdateApplicationLayerAutomaticResponseFluentBuilder
pub fn update_application_layer_automatic_response( &self, ) -> UpdateApplicationLayerAutomaticResponseFluentBuilder
Constructs a fluent builder for the UpdateApplicationLayerAutomaticResponse
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe ARN (Amazon Resource Name) of the resource.
action(ResponseAction)
/set_action(Option<ResponseAction>)
:
required: trueSpecifies the action setting that Shield Advanced should use in the WAF rules that it creates on behalf of the protected resource in response to DDoS attacks. You specify this as part of the configuration for the automatic application layer DDoS mitigation feature, when you enable or update automatic mitigation. Shield Advanced creates the WAF rules in a Shield Advanced-managed rule group, inside the web ACL that you have associated with the resource.
- On success, responds with
UpdateApplicationLayerAutomaticResponseOutput
- On failure, responds with
SdkError<UpdateApplicationLayerAutomaticResponseError>
Source§impl Client
impl Client
Sourcepub fn update_emergency_contact_settings(
&self,
) -> UpdateEmergencyContactSettingsFluentBuilder
pub fn update_emergency_contact_settings( &self, ) -> UpdateEmergencyContactSettingsFluentBuilder
Constructs a fluent builder for the UpdateEmergencyContactSettings
operation.
- The fluent builder is configurable:
emergency_contact_list(EmergencyContact)
/set_emergency_contact_list(Option<Vec::<EmergencyContact>>)
:
required: falseA list of email addresses and phone numbers that the Shield Response Team (SRT) can use to contact you if you have proactive engagement enabled, for escalations to the SRT and to initiate proactive customer support.
If you have proactive engagement enabled, the contact list must include at least one phone number.
- On success, responds with
UpdateEmergencyContactSettingsOutput
- On failure, responds with
SdkError<UpdateEmergencyContactSettingsError>
Source§impl Client
impl Client
Sourcepub fn update_protection_group(&self) -> UpdateProtectionGroupFluentBuilder
pub fn update_protection_group(&self) -> UpdateProtectionGroupFluentBuilder
Constructs a fluent builder for the UpdateProtectionGroup
operation.
- The fluent builder is configurable:
protection_group_id(impl Into<String>)
/set_protection_group_id(Option<String>)
:
required: trueThe name of the protection group. You use this to identify the protection group in lists and to manage the protection group, for example to update, delete, or describe it.
aggregation(ProtectionGroupAggregation)
/set_aggregation(Option<ProtectionGroupAggregation>)
:
required: trueDefines how Shield combines resource data for the group in order to detect, mitigate, and report events.
-
Sum - Use the total traffic across the group. This is a good choice for most cases. Examples include Elastic IP addresses for EC2 instances that scale manually or automatically.
-
Mean - Use the average of the traffic across the group. This is a good choice for resources that share traffic uniformly. Examples include accelerators and load balancers.
-
Max - Use the highest traffic from each resource. This is useful for resources that don’t share traffic and for resources that share that traffic in a non-uniform way. Examples include Amazon CloudFront distributions and origin resources for CloudFront distributions.
-
pattern(ProtectionGroupPattern)
/set_pattern(Option<ProtectionGroupPattern>)
:
required: trueThe criteria to use to choose the protected resources for inclusion in the group. You can include all resources that have protections, provide a list of resource Amazon Resource Names (ARNs), or include all resources of a specified resource type.
resource_type(ProtectedResourceType)
/set_resource_type(Option<ProtectedResourceType>)
:
required: falseThe resource type to include in the protection group. All protected resources of this type are included in the protection group. You must set this when you set
Pattern
toBY_RESOURCE_TYPE
and you must not set it for any otherPattern
setting.members(impl Into<String>)
/set_members(Option<Vec::<String>>)
:
required: falseThe Amazon Resource Names (ARNs) of the resources to include in the protection group. You must set this when you set
Pattern
toARBITRARY
and you must not set it for any otherPattern
setting.
- On success, responds with
UpdateProtectionGroupOutput
- On failure, responds with
SdkError<UpdateProtectionGroupError>
Source§impl Client
impl Client
Sourcepub fn update_subscription(&self) -> UpdateSubscriptionFluentBuilder
pub fn update_subscription(&self) -> UpdateSubscriptionFluentBuilder
Constructs a fluent builder for the UpdateSubscription
operation.
- The fluent builder is configurable:
auto_renew(AutoRenew)
/set_auto_renew(Option<AutoRenew>)
:
required: falseWhen you initally create a subscription,
AutoRenew
is set toENABLED
. IfENABLED
, the subscription will be automatically renewed at the end of the existing subscription period. You can change this by submitting anUpdateSubscription
request. If theUpdateSubscription
request does not included a value forAutoRenew
, the existing value forAutoRenew
remains unchanged.
- On success, responds with
UpdateSubscriptionOutput
- On failure, responds with
SdkError<UpdateSubscriptionError>
Source§impl Client
impl Client
Sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
§Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
Source§impl Client
impl Client
Sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
§Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it. - This method will panic if no
BehaviorVersion
is provided. If you experience this panic, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);