ResilienceHubV2 / Client / list_test_run_source_events
list_test_run_source_events¶
- ResilienceHubV2.Client.list_test_run_source_events(**kwargs)¶
Lists the state-change events observed for a test run monitoring source. Events are returned for one source per call, in chronological order.
See also: AWS API Documentation
Request Syntax
response = client.list_test_run_source_events( testRunId='string', serviceArn='string', sourceArn='string', maxResults=123, nextToken='string' )
- Parameters:
testRunId (string) –
[REQUIRED]
The identifier of the test run to list source events for.
serviceArn (string) –
[REQUIRED]
The ARN of the service the test run belongs to.
sourceArn (string) –
[REQUIRED]
The ARN of the monitoring source to list events for, such as the ARN of a CloudWatch alarm. If the source was not monitored during the test run, the response is an empty list.
maxResults (integer) – Pagination page size.
nextToken (string) – Pagination token.
- Return type:
dict
- Returns:
Response Syntax
{ 'testRunSourceEvents': [ { 'timestamp': datetime(2015, 1, 1), 'sourceArn': 'string', 'eventType': 'ALARM', 'detail': { 'alarmStateChange': { 'state': 'OK'|'ALARM'|'INSUFFICIENT_DATA', 'previousState': 'OK'|'ALARM'|'INSUFFICIENT_DATA', 'reason': 'string' }, 'error': { 'errorCode': 'ACCESS_DENIED'|'INTERNAL_ERROR', 'errorMessage': 'string' } } }, ], 'nextToken': 'string' }
Response Structure
(dict) –
testRunSourceEvents (list) –
The list of source events, in chronological order.
(dict) –
A state-change event observed for a test run monitoring source.
timestamp (datetime) –
The timestamp when the event occurred.
sourceArn (string) –
The ARN of the monitoring source the event belongs to.
eventType (string) –
The type of the event. ALARM indicates an event from a CloudWatch alarm source; the detail member carries either the alarm state change or a collection error.
detail (dict) –
The event payload.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set:
alarmStateChange,error. If a client receives an unknown member it will setSDK_UNKNOWN_MEMBERas the top level key, which maps to the name or tag of the unknown member. The structure ofSDK_UNKNOWN_MEMBERis as follows:'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
alarmStateChange (dict) –
A CloudWatch alarm state change.
state (string) –
The state the alarm transitioned to.
previousState (string) –
The state the alarm transitioned from. Absent on the initial event, which records the alarm’s state when collection began.
reason (string) –
A human-readable explanation of the state change, as reported by CloudWatch.
error (dict) –
An error that prevented event collection from the source.
errorCode (string) –
The error code.
errorMessage (string) –
A human-readable description of the error.
nextToken (string) –
Pagination token.
Exceptions
ResilienceHubV2.Client.exceptions.InternalServerExceptionResilienceHubV2.Client.exceptions.ResourceNotFoundExceptionResilienceHubV2.Client.exceptions.ValidationExceptionResilienceHubV2.Client.exceptions.AccessDeniedException