Table of Contents
CodeCommit.Client¶A low-level client representing AWS CodeCommit:
client = session.create_client('codecommit')
These are the available methods:
batch_get_repositories()can_paginate()create_branch()create_repository()delete_repository()generate_presigned_url()get_blob()get_branch()get_commit()get_differences()get_paginator()get_repository()get_repository_triggers()get_waiter()list_branches()list_repositories()put_repository_triggers()test_repository_triggers()update_default_branch()update_repository_description()update_repository_name()batch_get_repositories(**kwargs)¶Returns information about one or more repositories.
Note
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 web page could 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 web page.
See also: AWS API Documentation
Request Syntax
response = client.batch_get_repositories(
repositoryNames=[
'string',
]
)
| Parameters: | repositoryNames (list) – [REQUIRED] The names of the repositories to get information about.
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'repositories': [
{
'accountId': 'string',
'repositoryId': 'string',
'repositoryName': 'string',
'repositoryDescription': 'string',
'defaultBranch': 'string',
'lastModifiedDate': datetime(2015, 1, 1),
'creationDate': datetime(2015, 1, 1),
'cloneUrlHttp': 'string',
'cloneUrlSsh': 'string',
'Arn': 'string'
},
],
'repositoriesNotFound': [
'string',
]
}
Response Structure
|
can_paginate(operation_name)¶Check if an operation can be paginated.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Returns: | True if the operation can be paginated,
False otherwise. |
create_branch(**kwargs)¶Creates a new branch in a repository and points the branch to a commit.
Note
Calling the create branch operation does not set a repository’s default branch. To do this, call the update default branch operation.
See also: AWS API Documentation
Request Syntax
response = client.create_branch(
repositoryName='string',
branchName='string',
commitId='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
create_repository(**kwargs)¶Creates a new, empty repository.
See also: AWS API Documentation
Request Syntax
response = client.create_repository(
repositoryName='string',
repositoryDescription='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'repositoryMetadata': {
'accountId': 'string',
'repositoryId': 'string',
'repositoryName': 'string',
'repositoryDescription': 'string',
'defaultBranch': 'string',
'lastModifiedDate': datetime(2015, 1, 1),
'creationDate': datetime(2015, 1, 1),
'cloneUrlHttp': 'string',
'cloneUrlSsh': 'string',
'Arn': 'string'
}
}
Response Structure
|
delete_repository(**kwargs)¶Deletes a repository. If a specified repository was already deleted, a null repository ID will be returned.
Warning
Deleting a repository also deletes all associated objects and metadata. After a repository is deleted, all future push calls to the deleted repository will fail.
See also: AWS API Documentation
Request Syntax
response = client.delete_repository(
repositoryName='string'
)
| Parameters: | repositoryName (string) – [REQUIRED] The name of the repository to delete. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'repositoryId': 'string'
}
Response Structure
|
generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)¶Generate a presigned url given a client, its method, and arguments
| Parameters: |
|
|---|---|
| Returns: | The presigned url |
get_blob(**kwargs)¶Returns the base-64 encoded content of an individual blob within a repository.
See also: AWS API Documentation
Request Syntax
response = client.get_blob(
repositoryName='string',
blobId='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'content': b'bytes'
}
Response Structure
|
get_branch(**kwargs)¶Returns information about a repository branch, including its name and the last commit ID.
See also: AWS API Documentation
Request Syntax
response = client.get_branch(
repositoryName='string',
branchName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'branch': {
'branchName': 'string',
'commitId': 'string'
}
}
Response Structure
|
get_commit(**kwargs)¶Returns information about a commit, including commit message and committer information.
See also: AWS API Documentation
Request Syntax
response = client.get_commit(
repositoryName='string',
commitId='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'commit': {
'treeId': 'string',
'parents': [
'string',
],
'message': 'string',
'author': {
'name': 'string',
'email': 'string',
'date': 'string'
},
'committer': {
'name': 'string',
'email': 'string',
'date': 'string'
},
'additionalData': 'string'
}
}
Response Structure
|
get_differences(**kwargs)¶Returns information about the differences in a valid commit specifier (such as a branch, tag, HEAD, commit ID or other fully qualified reference). Results can be limited to a specified path.
See also: AWS API Documentation
Request Syntax
response = client.get_differences(
repositoryName='string',
beforeCommitSpecifier='string',
afterCommitSpecifier='string',
beforePath='string',
afterPath='string',
MaxResults=123,
NextToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'differences': [
{
'beforeBlob': {
'blobId': 'string',
'path': 'string',
'mode': 'string'
},
'afterBlob': {
'blobId': 'string',
'path': 'string',
'mode': 'string'
},
'changeType': 'A'|'M'|'D'
},
],
'NextToken': 'string'
}
Response Structure
|
get_paginator(operation_name)¶Create a paginator for an operation.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Raises: | OperationNotPageableError – Raised if the operation is not
pageable. You can use the client.can_paginate method to
check if an operation is pageable. |
| Return type: | L{botocore.paginate.Paginator} |
| Returns: | A paginator object. |
get_repository(**kwargs)¶Returns information about a repository.
Note
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 web page could 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 web page.
See also: AWS API Documentation
Request Syntax
response = client.get_repository(
repositoryName='string'
)
| Parameters: | repositoryName (string) – [REQUIRED] The name of the repository to get information about. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'repositoryMetadata': {
'accountId': 'string',
'repositoryId': 'string',
'repositoryName': 'string',
'repositoryDescription': 'string',
'defaultBranch': 'string',
'lastModifiedDate': datetime(2015, 1, 1),
'creationDate': datetime(2015, 1, 1),
'cloneUrlHttp': 'string',
'cloneUrlSsh': 'string',
'Arn': 'string'
}
}
Response Structure
|
get_repository_triggers(**kwargs)¶Gets information about triggers configured for a repository.
See also: AWS API Documentation
Request Syntax
response = client.get_repository_triggers(
repositoryName='string'
)
| Parameters: | repositoryName (string) – [REQUIRED] The name of the repository for which the trigger is configured. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'configurationId': 'string',
'triggers': [
{
'name': 'string',
'destinationArn': 'string',
'customData': 'string',
'branches': [
'string',
],
'events': [
'all'|'updateReference'|'createReference'|'deleteReference',
]
},
]
}
Response Structure
|
get_waiter(waiter_name)¶list_branches(**kwargs)¶Gets information about one or more branches in a repository.
See also: AWS API Documentation
Request Syntax
response = client.list_branches(
repositoryName='string',
nextToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'branches': [
'string',
],
'nextToken': 'string'
}
Response Structure
|
list_repositories(**kwargs)¶Gets information about one or more repositories.
See also: AWS API Documentation
Request Syntax
response = client.list_repositories(
nextToken='string',
sortBy='repositoryName'|'lastModifiedDate',
order='ascending'|'descending'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'repositories': [
{
'repositoryName': 'string',
'repositoryId': 'string'
},
],
'nextToken': 'string'
}
Response Structure
|
put_repository_triggers(**kwargs)¶Replaces all triggers for a repository. This can be used to create or delete triggers.
See also: AWS API Documentation
Request Syntax
response = client.put_repository_triggers(
repositoryName='string',
triggers=[
{
'name': 'string',
'destinationArn': 'string',
'customData': 'string',
'branches': [
'string',
],
'events': [
'all'|'updateReference'|'createReference'|'deleteReference',
]
},
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'configurationId': 'string'
}
Response Structure
|
test_repository_triggers(**kwargs)¶Tests the functionality of repository triggers by sending information to the trigger target. If real data is available in the repository, the test will send data from the last commit. If no data is available, sample data will be generated.
See also: AWS API Documentation
Request Syntax
response = client.test_repository_triggers(
repositoryName='string',
triggers=[
{
'name': 'string',
'destinationArn': 'string',
'customData': 'string',
'branches': [
'string',
],
'events': [
'all'|'updateReference'|'createReference'|'deleteReference',
]
},
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'successfulExecutions': [
'string',
],
'failedExecutions': [
{
'trigger': 'string',
'failureMessage': 'string'
},
]
}
Response Structure
|
update_default_branch(**kwargs)¶Sets or changes the default branch name for the specified repository.
Note
If you use this operation to change the default branch name to the current default branch name, a success message is returned even though the default branch did not change.
See also: AWS API Documentation
Request Syntax
response = client.update_default_branch(
repositoryName='string',
defaultBranchName='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
update_repository_description(**kwargs)¶Sets or changes the comment or description for a repository.
Note
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 web page could 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 web page.
See also: AWS API Documentation
Request Syntax
response = client.update_repository_description(
repositoryName='string',
repositoryDescription='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
update_repository_name(**kwargs)¶Renames a repository. The repository name must be unique across the calling AWS account. In addition, repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. The suffix “.git” is prohibited. For a full description of the limits on repository names, see Limits in the AWS CodeCommit User Guide.
See also: AWS API Documentation
Request Syntax
response = client.update_repository_name(
oldName='string',
newName='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
The available paginators are:
CodeCommit.Paginator.ListBranches¶paginator = client.get_paginator('list_branches')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from CodeCommit.Client.list_branches().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
repositoryName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'branches': [
'string',
],
'NextToken': 'string'
}
Response Structure
|
CodeCommit.Paginator.ListRepositories¶paginator = client.get_paginator('list_repositories')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from CodeCommit.Client.list_repositories().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
sortBy='repositoryName'|'lastModifiedDate',
order='ascending'|'descending',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'repositories': [
{
'repositoryName': 'string',
'repositoryId': 'string'
},
],
'NextToken': 'string'
}
Response Structure
|