Skip to content

get_resource_policy

get_resource_policy(
    name: AppMonitorName, *, config_overrides: Optional[RUMClientConfig] = None
) -> GetResourcePolicyResponse

Use this operation to retrieve information about a resource-based policy that is attached to an app monitor.

Parameters:

  • name (AppMonitorName) –

    The name of the app monitor that is associated with the resource-based policy that you want to view.

Raises:

Source code in docs_src/capo_rum/_services/rum.py
def get_resource_policy(
    self,
    name: "capo_rum.types.app_monitor_name.AppMonitorName",
    *,
    config_overrides: Optional[RUMClientConfig] = None,
) -> "capo_rum.types.get_resource_policy_response.GetResourcePolicyResponse":
    """<p>Use this operation to retrieve information about a resource-based policy that is attached to an app monitor.</p>

    Args:
        name: <p>The name of the app monitor that is associated with the resource-based policy that you want to view.</p>

    Raises:
        capo_rum.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permissions to perform this action.</p>
        capo_rum.errors.conflict_exception.ConflictException: <p>This operation attempted to create a resource that already exists.</p>
        capo_rum.errors.internal_server_exception.InternalServerException: <p>Internal service exception.</p>
        capo_rum.errors.policy_not_found_exception.PolicyNotFoundException: <p>The resource-based policy doesn't exist on this app monitor.</p>
        capo_rum.errors.resource_not_found_exception.ResourceNotFoundException: <p>Resource not found.</p>
        capo_rum.errors.throttling_exception.ThrottlingException: <p>The request was throttled because of quota limits.</p>
        capo_rum.errors.validation_exception.ValidationException: <p>One of the arguments for the request is not valid.</p>
        capo_rum.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        output, http_response = (
            capo_rum._operations.rum.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_rum.types.get_resource_policy_request.GetResourcePolicyRequest = {
        "name": name
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output