Lists the details of a Protection object.
Parameters:
-
protection_id
(Optional[ProtectionId], default:
None
)
–
The unique identifier (ID) for the Protection object to describe. You must provide either the ResourceArn of the protected resource or the ProtectionID of the protection, but not both.
-
resource_arn
(Optional[ResourceArn], default:
None
)
–
The ARN (Amazon Resource Name) of the protected Amazon Web Services resource. You must provide either the ResourceArn of the protected resource or the ProtectionID of the protection, but not both.
Raises:
-
InternalErrorException
–
Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.
-
InvalidParameterException
–
Exception that indicates that the parameters passed to the API are invalid. If available, this exception includes details in additional properties.
-
ResourceNotFoundException
–
Exception indicating the specified resource does not exist. If available, this exception includes details in additional properties.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_shield/_services/shield.py
| def describe_protection(
self,
*,
config_overrides: Optional[ShieldClientConfig] = None,
protection_id: Optional["capo_shield.types.protection_id.ProtectionId"] = None,
resource_arn: Optional["capo_shield.types.resource_arn.ResourceArn"] = None,
) -> "capo_shield.types.describe_protection_response.DescribeProtectionResponse":
"""<p>Lists the details of a <a>Protection</a> object.</p>
Args:
protection_id: <p>The unique identifier (ID) for the <a>Protection</a> object to describe. You must provide either the <code>ResourceArn</code> of the protected resource or the <code>ProtectionID</code> of the protection, but not both.</p>
resource_arn: <p>The ARN (Amazon Resource Name) of the protected Amazon Web Services resource. You must provide either the <code>ResourceArn</code> of the protected resource or the <code>ProtectionID</code> of the protection, but not both.</p>
Raises:
capo_shield.errors.internal_error_exception.InternalErrorException: <p>Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.</p>
capo_shield.errors.invalid_parameter_exception.InvalidParameterException: <p>Exception that indicates that the parameters passed to the API are invalid. If available, this exception includes details in additional properties. </p>
capo_shield.errors.resource_not_found_exception.ResourceNotFoundException: <p>Exception indicating the specified resource does not exist. If available, this exception includes details in additional properties. </p>
capo_shield.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_shield.types.describe_protection_request.DescribeProtectionRequest]",
) -> OperationResponse[
"capo_shield.types.describe_protection_response.DescribeProtectionResponse"
]:
import capo_shield._operations.aws_shield_20160616.describe_protection
output, http_response = (
capo_shield._operations.aws_shield_20160616.describe_protection.describe_protection(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DescribeProtection")
)
input_: capo_shield.types.describe_protection_request.DescribeProtectionRequest = {}
if protection_id is not None:
input_["protection_id"] = protection_id
if resource_arn is not None:
input_["resource_arn"] = resource_arn
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|