ResilienceHubV2 / Client / get_test_run
get_test_run¶
- ResilienceHubV2.Client.get_test_run(**kwargs)¶
Retrieves a test run by ID, including its status, results, and the configuration snapshotted when the run started.
See also: AWS API Documentation
Request Syntax
response = client.get_test_run( testRunId='string', serviceArn='string' )
- Parameters:
testRunId (string) –
[REQUIRED]
The identifier of the test run to retrieve.
serviceArn (string) –
[REQUIRED]
The ARN of the service the test run belongs to.
- Return type:
dict
- Returns:
Response Syntax
{ 'testRun': { 'testRunId': 'string', 'testId': 'string', 'status': 'INITIALIZING'|'RUNNING'|'STOPPING'|'PASSED'|'FAILED'|'STOPPED'|'ERROR', 'serviceArn': 'string', 'startedAt': datetime(2015, 1, 1), 'endedAt': datetime(2015, 1, 1), 'experiments': [ { 'experimentArn': 'string', 'details': 'string' }, ], 'eventCount': 123, 'parameters': { 'string': [ 'string', ] }, 'errorMessage': 'string', 'stopConditions': [ { 'source': 'aws:cloudwatch:alarm'|'none', 'value': 'string' }, ], 'loggingConfiguration': { 's3BucketName': 'string', 'cloudWatchLogGroupArn': 'string', 'logSchemaVersion': 'string' }, 'roleName': 'string', 'testTemplateArn': 'string', 'reportConfiguration': { 'reportOutput': [ { 's3': { 'bucketPath': 'string', 'bucketOwner': 'string' } }, ] }, 'policy': { 'policyArn': 'string', 'name': 'string', 'availabilitySlo': { 'target': 123.0 }, 'multiAz': { 'rtoInMinutes': 123, 'rpoInMinutes': 123, 'disasterRecoveryApproach': 'ACTIVE_ACTIVE'|'HOT_STANDBY'|'WARM_STANDBY'|'PILOT_LIGHT'|'BACKUP_AND_RESTORE' }, 'multiRegion': { 'rtoInMinutes': 123, 'rpoInMinutes': 123, 'disasterRecoveryApproach': 'ACTIVE_ACTIVE'|'HOT_STANDBY'|'WARM_STANDBY'|'PILOT_LIGHT'|'BACKUP_AND_RESTORE' }, 'dataRecovery': { 'timeBetweenBackupsInMinutes': 123 } }, 'reportOutput': { 'reportType': 'FAILURE_MODE'|'TESTING', 'status': 'PENDING'|'SUCCEEDED'|'FAILED', 'serviceArn': 'string', 'assessmentId': 'string', 'testRunId': 'string', 'testTemplateArn': 'string', 'createdAt': datetime(2015, 1, 1), 'reportOutput': { 's3ReportOutput': { 's3ObjectKey': 'string' }, 'failedReportOutput': { 'errorCode': 'INSUFFICIENT_PERMISSIONS'|'CONFIGURATION_ERROR'|'INTERNAL_ERROR', 'errorMessage': 'string' } } }, 'regionSwitchPlanArn': 'string', 'regionSwitchExecutionId': 'string', 'permissionModel': { 'invokerRoleName': 'string', 'crossAccountRoles': [ { 'crossAccountRoleArn': 'string', 'externalId': 'string' }, ] }, 'regions': [ 'string', ], 'accountTargeting': 'SINGLE_ACCOUNT'|'MULTI_ACCOUNT' } }
Response Structure
(dict) –
testRun (dict) –
The requested test run.
testRunId (string) –
The unique identifier of the test run.
testId (string) –
The identifier of the test that was run.
status (string) –
The current status of the test run.
serviceArn (string) –
The ARN of the service the test run belongs to.
startedAt (datetime) –
The timestamp when the test run started.
endedAt (datetime) –
The timestamp when the test run ended.
experiments (list) –
The AWS Fault Injection Service (AWS FIS) experiments run as part of the test run.
(dict) –
Details about an AWS Fault Injection Service (AWS FIS) experiment run as part of a test run.
experimentArn (string) –
The ARN of the AWS FIS experiment.
details (string) –
Additional details about the experiment.
eventCount (integer) –
The number of events recorded for the test run. Use ListTestRunEvents to retrieve the details.
parameters (dict) –
The parameter values used for the test run.
(string) –
The key of a test parameter.
(list) –
(string) –
A value of a test parameter.
errorMessage (string) –
A human-readable reason for test run failure. Only present when the status is FAILED or ERROR.
stopConditions (list) –
The stop conditions snapshotted from the test when the run was started.
(dict) –
A CloudWatch alarm that automatically stops a test run if it breaches its threshold.
source (string) –
The source of the stop condition.
value (string) –
The value of the stop condition, such as the ARN of the CloudWatch alarm.
loggingConfiguration (dict) –
The logging configuration snapshotted from the test when the run was started.
s3BucketName (string) –
The name of the S3 bucket for log delivery.
cloudWatchLogGroupArn (string) –
The ARN of the CloudWatch Logs log group for log delivery.
logSchemaVersion (string) –
The version of the log schema.
roleName (string) –
The IAM execution role name snapshotted from the test when the run was started.
testTemplateArn (string) –
The ARN of the test template snapshotted from the test when the run was started.
reportConfiguration (dict) –
The report configuration snapshotted from the service when the run was started.
reportOutput (list) –
The output destinations for generated reports.
(dict) –
Configuration for a report output destination.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set:
s3. 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'}
s3 (dict) –
S3 configuration for report output.
bucketPath (string) –
S3 bucket path where reports will be written (e.g., my-bucket/ngrh-reports/).
bucketOwner (string) –
Account ID of the bucket owner for cross-account access verification.
policy (dict) –
The resilience policy snapshotted from the service when the run was started.
policyArn (string) –
The ARN of the policy.
name (string) –
The name of the policy.
availabilitySlo (dict) –
The availability SLO targets.
target (float) –
The target availability percentage, expressed as a value between 0 and 100.
multiAz (dict) –
The multi-AZ resilience targets.
rtoInMinutes (integer) –
The recovery time objective (RTO) target for multi-AZ, in minutes.
rpoInMinutes (integer) –
The recovery point objective (RPO) target for multi-AZ, in minutes.
disasterRecoveryApproach (string) –
The disaster recovery approach for multi-AZ.
multiRegion (dict) –
The multi-Region resilience targets.
rtoInMinutes (integer) –
The recovery time objective (RTO) target for multi-Region, in minutes.
rpoInMinutes (integer) –
The recovery point objective (RPO) target for multi-Region, in minutes.
disasterRecoveryApproach (string) –
The disaster recovery approach for multi-Region.
dataRecovery (dict) –
The data recovery targets.
timeBetweenBackupsInMinutes (integer) –
The target time between backups, in minutes.
reportOutput (dict) –
The report generation result for the test run. Present after report generation completes or fails.
reportType (string) –
The type of the generated report.
status (string) –
The status of the report generation.
serviceArn (string) –
The service this report was generated for.
assessmentId (string) –
Present for FAILURE_MODE reports.
testRunId (string) –
The unique identifier of a test run.
testTemplateArn (string) –
An ARN owned by the service. Accepts either a standard 12-digit account ID or the literal “aws” for AWS-managed resources, such as AWS-managed test templates.
createdAt (datetime) –
The timestamp when the report was created.
reportOutput (dict) –
Present when status is SUCCEEDED or FAILED.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set:
s3ReportOutput,failedReportOutput. 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'}
s3ReportOutput (dict) –
The S3 location where the report was written.
s3ObjectKey (string) –
The S3 object key for the generated report.
failedReportOutput (dict) –
Details when report generation failed.
errorCode (string) –
The error code describing why the report generation failed.
errorMessage (string) –
The error message describing why the report generation failed.
regionSwitchPlanArn (string) –
The ARN of the ARC Region switch plan associated with the test run.
regionSwitchExecutionId (string) –
The identifier of the ARC Region switch execution detected during the test run.
permissionModel (dict) –
The permission model snapshotted from the service when the run was started.
invokerRoleName (string) –
IAM role name (supports up to 64 characters per IAM limits).
crossAccountRoles (list) –
The list of cross-account IAM role ARNs.
(dict) –
Specifies a cross-account IAM role ARN and optional external ID.
crossAccountRoleArn (string) –
ARN of the IAM Role for the profile. Null if the permission profile is the ‘Admin’ profile.
externalId (string) –
The external ID used for assuming the cross-account role.
regions (list) –
The Regions snapshotted from the service when the run was started.
(string) –
accountTargeting (string) –
Indicates whether this test run targets a single account or multiple accounts.
Exceptions
ResilienceHubV2.Client.exceptions.InternalServerExceptionResilienceHubV2.Client.exceptions.ResourceNotFoundExceptionResilienceHubV2.Client.exceptions.ValidationExceptionResilienceHubV2.Client.exceptions.AccessDeniedException