TestRepositoryTriggersCommand

Tests the functionality of repository triggers by sending information to the trigger target. If real data is available in the repository, the test sends data from the last commit. If no data is available, sample data is generated.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { CodeCommitClient, TestRepositoryTriggersCommand } from "@aws-sdk/client-codecommit"; // ES Modules import
// const { CodeCommitClient, TestRepositoryTriggersCommand } = require("@aws-sdk/client-codecommit"); // CommonJS import
const client = new CodeCommitClient(config);
const input = { // TestRepositoryTriggersInput
  repositoryName: "STRING_VALUE", // required
  triggers: [ // RepositoryTriggersList // required
    { // RepositoryTrigger
      name: "STRING_VALUE", // required
      destinationArn: "STRING_VALUE", // required
      customData: "STRING_VALUE",
      branches: [ // BranchNameList
        "STRING_VALUE",
      ],
      events: [ // RepositoryTriggerEventList // required
        "all" || "updateReference" || "createReference" || "deleteReference",
      ],
    },
  ],
};
const command = new TestRepositoryTriggersCommand(input);
const response = await client.send(command);
// { // TestRepositoryTriggersOutput
//   successfulExecutions: [ // RepositoryTriggerNameList
//     "STRING_VALUE",
//   ],
//   failedExecutions: [ // RepositoryTriggerExecutionFailureList
//     { // RepositoryTriggerExecutionFailure
//       trigger: "STRING_VALUE",
//       failureMessage: "STRING_VALUE",
//     },
//   ],
// };

TestRepositoryTriggersCommand Input

Parameter
Type
Description
repositoryName
Required
string | undefined

The name of the repository in which to test the triggers.

triggers
Required
RepositoryTrigger[] | undefined

The list of triggers to test.

TestRepositoryTriggersCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
failedExecutions
RepositoryTriggerExecutionFailure[] | undefined

The list of triggers that were not tested. This list provides the names of the triggers that could not be tested, separated by commas.

successfulExecutions
string[] | undefined

The list of triggers that were successfully tested. This list provides the names of the triggers that were successfully tested, separated by commas.

Throws

Name
Fault
Details
EncryptionIntegrityChecksFailedException
server

An encryption integrity check failed.

EncryptionKeyAccessDeniedException
client

An encryption key could not be accessed.

EncryptionKeyDisabledException
client

The encryption key is disabled.

EncryptionKeyNotFoundException
client

No encryption key was found.

EncryptionKeyUnavailableException
client

The encryption key is not available.

InvalidRepositoryNameException
client

A specified repository name is not valid.

This exception occurs only when a specified repository name is not valid. Other exceptions occur when a required repository parameter is missing, or when a specified repository does not exist.

InvalidRepositoryTriggerBranchNameException
client

One or more branch names specified for the trigger is not valid.

InvalidRepositoryTriggerCustomDataException
client

The custom data provided for the trigger is not valid.

InvalidRepositoryTriggerDestinationArnException
client

The Amazon Resource Name (ARN) for the trigger is not valid for the specified destination. The most common reason for this error is that the ARN does not meet the requirements for the service type.

InvalidRepositoryTriggerEventsException
client

One or more events specified for the trigger is not valid. Check to make sure that all events specified match the requirements for allowed events.

InvalidRepositoryTriggerNameException
client

The name of the trigger is not valid.

InvalidRepositoryTriggerRegionException
client

The Amazon Web Services Region for the trigger target does not match the Amazon Web Services Region for the repository. Triggers must be created in the same Amazon Web Services Region as the target for the trigger.

MaximumBranchesExceededException
client

The number of branches for the trigger was exceeded.

MaximumRepositoryTriggersExceededException
client

The number of triggers allowed for the repository was exceeded.

RepositoryDoesNotExistException
client

The specified repository does not exist.

RepositoryNameRequiredException
client

A repository name is required, but was not specified.

RepositoryTriggerBranchNameListRequiredException
client

At least one branch name is required, but was not specified in the trigger configuration.

RepositoryTriggerDestinationArnRequiredException
client

A destination ARN for the target service for the trigger is required, but was not specified.

RepositoryTriggerEventsListRequiredException
client

At least one event for the trigger is required, but was not specified.

RepositoryTriggerNameRequiredException
client

A name for the trigger is required, but was not specified.

RepositoryTriggersListRequiredException
client

The list of triggers for the repository is required, but was not specified.

CodeCommitServiceException
Base exception class for all service exceptions from CodeCommit service.