Skip to main content

repositories

Creates, updates, deletes, gets or lists a repositories resource.

Overview

Namerepositories
TypeResource
Idaws.codecommit.repositories

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
errorsarrayReturns information about any errors returned when attempting to retrieve information about the repositories.
repositoriesarrayA list of repositories returned by the batch get repositories operation.
repositories_not_foundarrayReturns a list of repository names for which information could not be found.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
batch_get_repositoriesselectregionReturns information about one or more repositories. The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage.
get_repositoryselectregionReturns information about a repository. The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage.
list_repositoriesselectregionGets information about one or more repositories.
create_repositoryinsertregion, repositoryNameCreates a new, empty repository.
associate_approval_rule_template_with_repositoryupdateregion, approvalRuleTemplateName, repositoryNameCreates an association between an approval rule template and a specified repository. Then, the next time a pull request is created in the repository where the destination reference (if specified) matches the destination reference (branch) for the pull request, an approval rule that matches the template conditions is automatically created for that pull request. If no destination references are specified in the template, an approval rule that matches the template contents is created for all pull requests in that repository.
update_repository_encryption_keyupdateregion, repositoryName, kmsKeyIdUpdates the Key Management Service encryption key used to encrypt and decrypt a CodeCommit repository.
update_repository_nameupdateregion, oldName, newNameRenames a repository. The repository name must be unique across the calling Amazon Web Services account. Repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. The suffix .git is prohibited. For more information about the limits on repository names, see Quotas in the CodeCommit User Guide.
update_repository_descriptionupdateregion, repositoryNameSets or changes the comment or description for a repository. The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage.
delete_repositorydeleteregionDeletes a repository. If a specified repository was already deleted, a null repository ID is returned. Deleting a repository also deletes all associated objects and metadata. After a repository is deleted, all future push calls to the deleted repository fail.
batch_associate_approval_rule_template_with_repositoriesexecregion, approvalRuleTemplateName, repositoryNamesCreates an association between an approval rule template and one or more specified repositories.
batch_disassociate_approval_rule_template_from_repositoriesexecregion, approvalRuleTemplateName, repositoryNamesRemoves the association between an approval rule template and one or more specified repositories.
disassociate_approval_rule_template_from_repositoryexecregion, approvalRuleTemplateName, repositoryNameRemoves the association between a template and a repository so that approval rules based on the template are not automatically created when pull requests are created in the specified repository. This does not delete any approval rules previously created for pull requests through the template association.
merge_branches_by_fast_forwardexecregion, repositoryName, sourceCommitSpecifier, destinationCommitSpecifierMerges two branches using the fast-forward merge strategy.
merge_branches_by_squashexecregion, repositoryName, sourceCommitSpecifier, destinationCommitSpecifierMerges two branches using the squash merge strategy.
merge_branches_by_three_wayexecregion, repositoryName, sourceCommitSpecifier, destinationCommitSpecifierMerges two specified branches using the three-way merge strategy.
post_comment_for_compared_commitexecregion, repositoryName, afterCommitId, contentPosts a comment on the comparison between two commits.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Returns information about one or more repositories. The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage.

SELECT
errors,
repositories,
repositories_not_found
FROM aws.codecommit.repositories
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a new, empty repository.

INSERT INTO aws.codecommit.repositories (
repositoryName,
repositoryDescription,
tags,
kmsKeyId,
region
)
SELECT
'{{ repositoryName }}' /* required */,
'{{ repositoryDescription }}',
'{{ tags }}',
'{{ kmsKeyId }}',
'{{ region }}'
RETURNING
repository_metadata
;

UPDATE examples

Creates an association between an approval rule template and a specified repository. Then, the next time a pull request is created in the repository where the destination reference (if specified) matches the destination reference (branch) for the pull request, an approval rule that matches the template conditions is automatically created for that pull request. If no destination references are specified in the template, an approval rule that matches the template contents is created for all pull requests in that repository.

UPDATE aws.codecommit.repositories
SET
approvalRuleTemplateName = '{{ approvalRuleTemplateName }}',
repositoryName = '{{ repositoryName }}'
WHERE
region = '{{ region }}' --required
AND approvalRuleTemplateName = '{{ approvalRuleTemplateName }}' --required
AND repositoryName = '{{ repositoryName }}' --required;

DELETE examples

Deletes a repository. If a specified repository was already deleted, a null repository ID is returned. Deleting a repository also deletes all associated objects and metadata. After a repository is deleted, all future push calls to the deleted repository fail.

DELETE FROM aws.codecommit.repositories
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Creates an association between an approval rule template and one or more specified repositories.

EXEC aws.codecommit.repositories.batch_associate_approval_rule_template_with_repositories
@region='{{ region }}' --required
@@json=
'{
"approvalRuleTemplateName": "{{ approvalRuleTemplateName }}",
"repositoryNames": "{{ repositoryNames }}"
}'
;