Returns a policy attached to the specified data stream or consumer. Request patterns can be one of the following:
Parameters:
-
resource_arn
(ResourceARN)
–
The Amazon Resource Name (ARN) of the data stream or consumer.
-
stream_id
(Optional[StreamId], default:
None
)
–
Not Implemented. Reserved for future use.
Raises:
-
AccessDeniedException
–
Specifies that you do not have the permissions required to perform this operation.
-
InvalidArgumentException
–
A specified parameter exceeds its restrictions, is not supported, or can't be used. For more information, see the returned message.
-
LimitExceededException
–
The requested resource exceeds the maximum number allowed, or the number of concurrent stream requests exceeds the maximum number allowed.
-
ResourceInUseException
–
The resource is not available for this operation. For successful operation, the resource must be in the ACTIVE state.
-
ResourceNotFoundException
–
The requested resource could not be found. The stream might not be specified correctly.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_kinesis/_services/kinesis.py
| def get_resource_policy(
self,
resource_arn: "capo_kinesis.types.resource_arn.ResourceARN",
*,
config_overrides: Optional[KinesisClientConfig] = None,
stream_id: Optional["capo_kinesis.types.stream_id.StreamId"] = None,
) -> "capo_kinesis.types.get_resource_policy_output.GetResourcePolicyOutput":
r"""<p>Returns a policy attached to the specified data stream or consumer. Request patterns can be one of the following:</p> <ul> <li> <p>Data stream pattern: <code>arn:aws.*:kinesis:.*:\d{12}:.*stream/\S+</code> </p> </li> <li> <p> Consumer pattern: <code>^(arn):aws.*:kinesis:.*:\d{12}:.*stream\/[a-zA-Z0-9_.-]+\/consumer\/[a-zA-Z0-9_.-]+:[0-9]+</code> </p> </li> </ul>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) of the data stream or consumer.</p>
stream_id: <p>Not Implemented. Reserved for future use.</p>
Raises:
capo_kinesis.errors.access_denied_exception.AccessDeniedException: <p>Specifies that you do not have the permissions required to perform this operation.</p>
capo_kinesis.errors.invalid_argument_exception.InvalidArgumentException: <p>A specified parameter exceeds its restrictions, is not supported, or can't be used. For more information, see the returned message.</p>
capo_kinesis.errors.limit_exceeded_exception.LimitExceededException: <p>The requested resource exceeds the maximum number allowed, or the number of concurrent stream requests exceeds the maximum number allowed. </p>
capo_kinesis.errors.resource_in_use_exception.ResourceInUseException: <p>The resource is not available for this operation. For successful operation, the resource must be in the <code>ACTIVE</code> state.</p>
capo_kinesis.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource could not be found. The stream might not be specified correctly.</p>
capo_kinesis.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_kinesis.types.get_resource_policy_input.GetResourcePolicyInput]",
) -> OperationResponse[
"capo_kinesis.types.get_resource_policy_output.GetResourcePolicyOutput"
]:
import capo_kinesis._operations.kinesis_20131202.get_resource_policy
output, http_response = (
capo_kinesis._operations.kinesis_20131202.get_resource_policy.get_resource_policy(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetResourcePolicy")
)
input_: capo_kinesis.types.get_resource_policy_input.GetResourcePolicyInput = {
"resource_arn": resource_arn
}
if stream_id is not None:
input_["stream_id"] = stream_id
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|