Shield.Client¶A low-level client representing AWS Shield:
client = session.create_client('shield')
These are the available methods:
can_paginate()create_protection()create_subscription()delete_protection()delete_subscription()describe_attack()describe_protection()describe_subscription()generate_presigned_url()get_paginator()get_waiter()list_attacks()list_protections()can_paginate(operation_name)¶Check if an operation can be paginated.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Returns: | True if the operation can be paginated,
False otherwise. |
create_protection(**kwargs)¶Enables AWS Shield Advanced for a specific AWS resource. The resource can be an Amazon CloudFront distribution, Elastic Load Balancing load balancer, or an Amazon Route 53 hosted zone.
See also: AWS API Documentation
Request Syntax
response = client.create_protection(
Name='string',
ResourceArn='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ProtectionId': 'string'
}
Response Structure
|
create_subscription()¶Activates AWS Shield Advanced for an account.
See also: AWS API Documentation
Request Syntax
response = client.create_subscription()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{}
Response Structure
|
delete_protection(**kwargs)¶Deletes an AWS Shield Advanced Protection .
See also: AWS API Documentation
Request Syntax
response = client.delete_protection(
ProtectionId='string'
)
| Parameters: | ProtectionId (string) – [REQUIRED] The unique identifier (ID) for the Protection object to be deleted. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{}
Response Structure
|
delete_subscription()¶Removes AWS Shield Advanced from an account.
See also: AWS API Documentation
Request Syntax
response = client.delete_subscription()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{}
Response Structure
|
describe_attack(**kwargs)¶Describes the details of a DDoS attack.
See also: AWS API Documentation
Request Syntax
response = client.describe_attack(
AttackId='string'
)
| Parameters: | AttackId (string) – [REQUIRED] The unique identifier (ID) for the attack that to be described. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'Attack': {
'AttackId': 'string',
'ResourceArn': 'string',
'SubResources': [
{
'Type': 'IP'|'URL',
'Id': 'string',
'AttackVectors': [
{
'VectorType': 'string',
'VectorCounters': [
{
'Name': 'string',
'Max': 123.0,
'Average': 123.0,
'Sum': 123.0,
'N': 123,
'Unit': 'string'
},
]
},
],
'Counters': [
{
'Name': 'string',
'Max': 123.0,
'Average': 123.0,
'Sum': 123.0,
'N': 123,
'Unit': 'string'
},
]
},
],
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1),
'AttackCounters': [
{
'Name': 'string',
'Max': 123.0,
'Average': 123.0,
'Sum': 123.0,
'N': 123,
'Unit': 'string'
},
],
'Mitigations': [
{
'MitigationName': 'string'
},
]
}
}
Response Structure
|
describe_protection(**kwargs)¶Lists the details of a Protection object.
See also: AWS API Documentation
Request Syntax
response = client.describe_protection(
ProtectionId='string'
)
| Parameters: | ProtectionId (string) – [REQUIRED] The unique identifier (ID) for the Protection object that is described. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'Protection': {
'Id': 'string',
'Name': 'string',
'ResourceArn': 'string'
}
}
Response Structure
|
describe_subscription()¶Provides details about the AWS Shield Advanced subscription for an account.
See also: AWS API Documentation
Request Syntax
response = client.describe_subscription()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'Subscription': {
'StartTime': datetime(2015, 1, 1),
'TimeCommitmentInSeconds': 123
}
}
Response Structure
|
generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)¶Generate a presigned url given a client, its method, and arguments
| Parameters: |
|
|---|---|
| Returns: | The presigned url |
get_paginator(operation_name)¶Create a paginator for an operation.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Raises: | OperationNotPageableError – Raised if the operation is not
pageable. You can use the client.can_paginate method to
check if an operation is pageable. |
| Return type: | L{botocore.paginate.Paginator} |
| Returns: | A paginator object. |
get_waiter(waiter_name)¶list_attacks(**kwargs)¶Returns all ongoing DDoS attacks or all DDoS attacks during a specified time period.
See also: AWS API Documentation
Request Syntax
response = client.list_attacks(
ResourceArns=[
'string',
],
StartTime={
'FromInclusive': datetime(2015, 1, 1),
'ToExclusive': datetime(2015, 1, 1)
},
EndTime={
'FromInclusive': datetime(2015, 1, 1),
'ToExclusive': datetime(2015, 1, 1)
},
NextToken='string',
MaxResults=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'AttackSummaries': [
{
'AttackId': 'string',
'ResourceArn': 'string',
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1),
'AttackVectors': [
{
'VectorType': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
|
list_protections(**kwargs)¶Lists all Protection objects for the account.
See also: AWS API Documentation
Request Syntax
response = client.list_protections(
NextToken='string',
MaxResults=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Protections': [
{
'Id': 'string',
'Name': 'string',
'ResourceArn': 'string'
},
],
'NextToken': 'string'
}
Response Structure
|