Table of Contents
CodeCommit.
Client
¶A low-level client representing AWS CodeCommit:
import boto3
client = boto3.client('codecommit')
These are the available methods:
batch_get_repositories()
can_paginate()
create_branch()
create_repository()
delete_repository()
generate_presigned_url()
get_branch()
get_paginator()
get_repository()
get_waiter()
list_branches()
list_repositories()
update_default_branch()
update_repository_description()
update_repository_name()
batch_get_repositories
(**kwargs)¶Gets 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.
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.
Request Syntax
response = client.create_branch(
repositoryName='string',
branchName='string',
commitId='string'
)
Parameters: |
|
---|---|
Returns: | None |
create_repository
(**kwargs)¶Creates a new, empty repository.
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.
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_branch
(**kwargs)¶Retrieves information about a repository branch, including its name and the last commit ID.
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_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)¶Gets 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.
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_waiter
(waiter_name)¶list_branches
(**kwargs)¶Gets information about one or more branches in a repository.
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.
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
|
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.
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.
Request Syntax
response = client.update_repository_description(
repositoryName='string',
repositoryDescription='string'
)
Parameters: |
|
---|---|
Returns: | None |
update_repository_name
(**kwargs)¶Renames a repository.
Request Syntax
response = client.update_repository_name(
oldName='string',
newName='string'
)
Parameters: |
|
---|---|
Returns: | None |