Inspector.Client.list_event_subscriptions(**kwargs)¶Lists all the event subscriptions for the assessment template that is specified by the ARN of the assessment template. For more information, see SubscribeToEvent and UnsubscribeFromEvent.
See also: AWS API Documentation
Request Syntax
response = client.list_event_subscriptions(
resourceArn='string',
nextToken='string',
maxResults=123
)
dict
Response Syntax
{
'subscriptions': [
{
'resourceArn': 'string',
'topicArn': 'string',
'eventSubscriptions': [
{
'event': 'ASSESSMENT_RUN_STARTED'|'ASSESSMENT_RUN_COMPLETED'|'ASSESSMENT_RUN_STATE_CHANGED'|'FINDING_REPORTED'|'OTHER',
'subscribedAt': datetime(2015, 1, 1)
},
]
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
subscriptions (list) --
Details of the returned event subscriptions.
(dict) --
This data type is used as a response element in the ListEventSubscriptions action.
resourceArn (string) --
The ARN of the assessment template that is used during the event for which the SNS notification is sent.
topicArn (string) --
The ARN of the Amazon Simple Notification Service (SNS) topic to which the SNS notifications are sent.
eventSubscriptions (list) --
The list of existing event subscriptions.
(dict) --
This data type is used in the Subscription data type.
event (string) --
The event for which Amazon Simple Notification Service (SNS) notifications are sent.
subscribedAt (datetime) --
The time at which SubscribeToEvent is called.
nextToken (string) --
When a response is generated, if there is more data to be listed, this parameter is present in the response and contains the value to use for the nextToken parameter in a subsequent pagination request. If there is no more data to be listed, this parameter is set to null.
Exceptions
Inspector.Client.exceptions.InternalExceptionInspector.Client.exceptions.InvalidInputExceptionInspector.Client.exceptions.AccessDeniedExceptionInspector.Client.exceptions.NoSuchEntityExceptionExamples
Lists all the event subscriptions for the assessment template that is specified by the ARN of the assessment template.
response = client.list_event_subscriptions(
maxResults=123,
resourceArn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0',
)
print(response)
Expected Output:
{
'nextToken': '1',
'subscriptions': [
{
'eventSubscriptions': [
{
'event': 'ASSESSMENT_RUN_COMPLETED',
'subscribedAt': datetime(2016, 3, 31, 20, 17, 20, 3, 91, 0),
},
],
'resourceArn': 'arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0',
'topicArn': 'arn:aws:sns:us-west-2:123456789012:exampletopic',
},
],
'ResponseMetadata': {
'...': '...',
},
}