ResilienceHubV2 / Client / list_policy_events

list_policy_events

ResilienceHubV2.Client.list_policy_events(**kwargs)

Lists events for a resilience policy, including services that started or stopped using it, changes to cross-account sharing, and deletion of the policy.

See also: AWS API Documentation

Request Syntax

response = client.list_policy_events(
    policyArn='string',
    eventTypes=[
        'POLICY_ATTACHED_TO_SERVICE'|'POLICY_DETACHED_FROM_SERVICE'|'POLICY_SHARING_REVOKED'|'POLICY_DELETED',
    ],
    startTime=datetime(2015, 1, 1),
    endTime=datetime(2015, 1, 1),
    maxResults=123,
    nextToken='string'
)
Parameters:
  • policyArn (string) –

    [REQUIRED]

    ARN identifier.

  • eventTypes (list) –

    The type of events to include in the results.

    • (string) –

  • startTime (datetime) – The start time for filtering events.

  • endTime (datetime) – The end time for filtering events.

  • maxResults (integer) – Pagination page size.

  • nextToken (string) – Pagination token.

Return type:

dict

Returns:

Response Syntax

{
    'events': [
        {
            'eventId': 'string',
            'timestamp': datetime(2015, 1, 1),
            'eventType': 'POLICY_ATTACHED_TO_SERVICE'|'POLICY_DETACHED_FROM_SERVICE'|'POLICY_SHARING_REVOKED'|'POLICY_DELETED',
            'policyArn': 'string',
            'actor': {
                'type': 'USER'|'SYSTEM',
                'principalId': 'string',
                'accountId': 'string',
                'userName': 'string'
            },
            'eventDetails': {
                'title': 'string',
                'description': 'string',
                'eventMetadata': {
                    'policyAttachedToService': {
                        'serviceArn': 'string',
                        'accountId': 'string'
                    },
                    'policyDetachedFromService': {
                        'serviceArn': 'string',
                        'accountId': 'string'
                    },
                    'policySharingRevoked': {
                        'affectedServiceCount': 123
                    },
                    'policyDeleted': {
                        'affectedServiceCount': 123
                    }
                }
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • events (list) –

      The list of policy events.

      • (dict) –

        An event on the timeline of a resilience policy.

        • eventId (string) –

          The identifier of the event.

        • timestamp (datetime) –

          The time the event occurred.

        • eventType (string) –

          The type of the event.

        • policyArn (string) –

          ARN identifier.

        • actor (dict) –

          Identifies the actor that triggered an event.

          • type (string) –

            The type of actor, either USER or SYSTEM.

          • principalId (string) –

            The principal ID of the actor.

          • accountId (string) –

            The AWS account ID of the actor.

          • userName (string) –

            The user name of the actor.

        • eventDetails (dict) –

          The details of the event.

          • title (string) –

            A short summary of the event.

          • description (string) –

            A description of the event.

          • eventMetadata (dict) –

            The event-specific metadata, with one member populated according to the event type.

            Note

            This is a Tagged Union structure. Only one of the following top level keys will be set: policyAttachedToService, policyDetachedFromService, policySharingRevoked, policyDeleted. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

            'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
            
            • policyAttachedToService (dict) –

              Contains details about the service that started using the policy, such as the account that owns the service.

              • serviceArn (string) –

                ARN identifier.

              • accountId (string) –

                The account that owns the service.

            • policyDetachedFromService (dict) –

              Contains details about the service that stopped using the policy, such as the account that owns the service.

              • serviceArn (string) –

                ARN identifier.

              • accountId (string) –

                The account that owns the service.

            • policySharingRevoked (dict) –

              Contains details about a policy for which organization sharing was revoked, including the number of services that were affected.

              • affectedServiceCount (integer) –

                The number of services that were using the policy when sharing was revoked.

            • policyDeleted (dict) –

              Contains details about a policy that was deleted, including the number of services that were affected.

              • affectedServiceCount (integer) –

                The number of services that were using the policy when it was deleted.

    • nextToken (string) –

      Pagination token.

Exceptions

  • ResilienceHubV2.Client.exceptions.InternalServerException

  • ResilienceHubV2.Client.exceptions.ResourceNotFoundException

  • ResilienceHubV2.Client.exceptions.ValidationException

  • ResilienceHubV2.Client.exceptions.AccessDeniedException