Retrieves a specified resource policy.
Parameters:
-
resource_arn
(Optional[GlueResourceArn], default:
None
)
–
The ARN of the Glue resource for which to retrieve the resource policy. If not supplied, the Data Catalog resource policy is returned. Use GetResourcePolicies to view all existing resource policies. For more information see Specifying Glue Resource ARNs.
Raises:
Source code in docs_src/capo_glue/_services/async_glue.py
| async def get_resource_policy(
self,
*,
config_overrides: Optional[AsyncGlueClientConfig] = None,
resource_arn: Optional[
"capo_glue.types.glue_resource_arn.GlueResourceArn"
] = None,
) -> "capo_glue.types.get_resource_policy_response.GetResourcePolicyResponse":
"""<p>Retrieves a specified resource policy.</p>
Args:
resource_arn: <p>The ARN of the Glue resource for which to retrieve the resource policy. If not supplied, the Data Catalog resource policy is returned. Use <code>GetResourcePolicies</code> to view all existing resource policies. For more information see <a href="https://docs.aws.amazon.com/glue/latest/dg/glue-specifying-resource-arns.html">Specifying Glue Resource ARNs</a>. </p>
Raises:
capo_glue.errors.entity_not_found_exception.EntityNotFoundException: <p>A specified entity does not exist</p>
capo_glue.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
capo_glue.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
capo_glue.errors.operation_timeout_exception.OperationTimeoutException: <p>The operation timed out.</p>
capo_glue.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_glue.types.get_resource_policy_request.GetResourcePolicyRequest]",
) -> AsyncOperationResponse[
"capo_glue.types.get_resource_policy_response.GetResourcePolicyResponse"
]:
import capo_glue._operations.aws_glue.get_resource_policy
(
output,
http_response,
) = await capo_glue._operations.aws_glue.get_resource_policy.async_get_resource_policy(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetResourcePolicy")
)
input_: capo_glue.types.get_resource_policy_request.GetResourcePolicyRequest = {}
if resource_arn is not None:
input_["resource_arn"] = resource_arn
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|