Skip to content

get_investigation_group_policy

get_investigation_group_policy(
    identifier: InvestigationGroupIdentifier,
    *,
    config_overrides: Optional[AIOpsClientConfig] = None,
) -> GetInvestigationGroupPolicyResponse

Returns the JSON of the IAM resource policy associated with the specified investigation group in a string. For example, {\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"aiops.alarms.cloudwatch.amazonaws.com\"},\"Action\":[\"aiops:CreateInvestigation\",\"aiops:CreateInvestigationEvent\"],\"Resource\":\"*\",\"Condition\":{\"StringEquals\":{\"aws:SourceAccount\":\"111122223333\"},\"ArnLike\":{\"aws:SourceArn\":\"arn:aws:cloudwatch:us-east-1:111122223333:alarm:*\"}}}]}.

Parameters:

  • identifier (InvestigationGroupIdentifier) –

    Specify either the name or the ARN of the investigation group that you want to view the policy of.

Raises:

Source code in docs_src/capo_aiops/_services/ai_ops.py
def get_investigation_group_policy(
    self,
    identifier: "capo_aiops.types.investigation_group_identifier.InvestigationGroupIdentifier",
    *,
    config_overrides: Optional[AIOpsClientConfig] = None,
) -> "capo_aiops.types.get_investigation_group_policy_response.GetInvestigationGroupPolicyResponse":
    r"""<p>Returns the JSON of the IAM resource policy associated with the specified investigation group in a string. For example, <code>{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"aiops.alarms.cloudwatch.amazonaws.com\"},\"Action\":[\"aiops:CreateInvestigation\",\"aiops:CreateInvestigationEvent\"],\"Resource\":\"*\",\"Condition\":{\"StringEquals\":{\"aws:SourceAccount\":\"111122223333\"},\"ArnLike\":{\"aws:SourceArn\":\"arn:aws:cloudwatch:us-east-1:111122223333:alarm:*\"}}}]}</code>.</p>

    Args:
        identifier: <p>Specify either the name or the ARN of the investigation group that you want to view the policy of.</p>

    Raises:
        capo_aiops.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permissions to perform this action.</p>
        capo_aiops.errors.conflict_exception.ConflictException: <p>This operation couldn't be completed because of a conflict in resource states.</p>
        capo_aiops.errors.forbidden_exception.ForbiddenException: <p>Access id denied for this operation, or this operation is not valid for the specified resource.</p>
        capo_aiops.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. You can try again later.</p>
        capo_aiops.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource doesn't exist.</p>
        capo_aiops.errors.validation_exception.ValidationException: <p>This operation or its parameters aren't formatted correctly.</p>
        capo_aiops.errors.throttling_exception.ThrottlingException: <p>The request was throttled because of quota limits. You can try again later.</p>
        capo_aiops.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_aiops.types.get_investigation_group_policy_request.GetInvestigationGroupPolicyRequest]",
    ) -> OperationResponse[
        "capo_aiops.types.get_investigation_group_policy_response.GetInvestigationGroupPolicyResponse"
    ]:
        import capo_aiops._operations.ai_ops.get_investigation_group_policy

        output, http_response = (
            capo_aiops._operations.ai_ops.get_investigation_group_policy.get_investigation_group_policy(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetInvestigationGroupPolicy")
    )
    input_: capo_aiops.types.get_investigation_group_policy_request.GetInvestigationGroupPolicyRequest = {
        "identifier": identifier
    }

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