Skip to content

get_resource_policy

get_resource_policy(
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    resource_arn: Optional[GlueResourceArn] = None,
) -> GetResourcePolicyResponse

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/glue.py
def get_resource_policy(
    self,
    *,
    config_overrides: Optional[GlueClientConfig] = 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.
    """

    def _handler(
        req: "OperationRequest[capo_glue.types.get_resource_policy_request.GetResourcePolicyRequest]",
    ) -> OperationResponse[
        "capo_glue.types.get_resource_policy_response.GetResourcePolicyResponse"
    ]:
        import capo_glue._operations.aws_glue.get_resource_policy

        output, http_response = (
            capo_glue._operations.aws_glue.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_glue.types.get_resource_policy_request.GetResourcePolicyRequest = {}
    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