CodeCommit.Client.
put_file
(**kwargs)¶Adds or updates a file in a branch in an AWS CodeCommit repository, and generates a commit for the addition in the specified branch.
See also: AWS API Documentation
Request Syntax
response = client.put_file(
repositoryName='string',
branchName='string',
fileContent=b'bytes',
filePath='string',
fileMode='EXECUTABLE'|'NORMAL'|'SYMLINK',
parentCommitId='string',
commitMessage='string',
name='string',
email='string'
)
[REQUIRED]
The name of the repository where you want to add or update the file.
[REQUIRED]
The name of the branch where you want to add or update the file. If this is an empty repository, this branch is created.
[REQUIRED]
The content of the file, in binary object format.
[REQUIRED]
The name of the file you want to add or update, including the relative path to the file in the repository.
Note
If the path does not currently exist in the repository, the path is created as part of adding the file.
The full commit ID of the head commit in the branch where you want to add or update the file. If this is an empty repository, no commit ID is required. If this is not an empty repository, a commit ID is required.
The commit ID must match the ID of the head commit at the time of the operation. Otherwise, an error occurs, and the file is not added or updated.
dict
Response Syntax
{
'commitId': 'string',
'blobId': 'string',
'treeId': 'string'
}
Response Structure
(dict) --
commitId (string) --
The full SHA ID of the commit that contains this file change.
blobId (string) --
The ID of the blob, which is its SHA-1 pointer.
treeId (string) --
The full SHA-1 pointer of the tree information for the commit that contains this file change.
Exceptions
CodeCommit.Client.exceptions.RepositoryNameRequiredException
CodeCommit.Client.exceptions.InvalidRepositoryNameException
CodeCommit.Client.exceptions.RepositoryDoesNotExistException
CodeCommit.Client.exceptions.ParentCommitIdRequiredException
CodeCommit.Client.exceptions.InvalidParentCommitIdException
CodeCommit.Client.exceptions.ParentCommitDoesNotExistException
CodeCommit.Client.exceptions.ParentCommitIdOutdatedException
CodeCommit.Client.exceptions.FileContentRequiredException
CodeCommit.Client.exceptions.FileContentSizeLimitExceededException
CodeCommit.Client.exceptions.FolderContentSizeLimitExceededException
CodeCommit.Client.exceptions.PathRequiredException
CodeCommit.Client.exceptions.InvalidPathException
CodeCommit.Client.exceptions.BranchNameRequiredException
CodeCommit.Client.exceptions.InvalidBranchNameException
CodeCommit.Client.exceptions.BranchDoesNotExistException
CodeCommit.Client.exceptions.BranchNameIsTagNameException
CodeCommit.Client.exceptions.InvalidFileModeException
CodeCommit.Client.exceptions.NameLengthExceededException
CodeCommit.Client.exceptions.InvalidEmailException
CodeCommit.Client.exceptions.CommitMessageLengthExceededException
CodeCommit.Client.exceptions.InvalidDeletionParameterException
CodeCommit.Client.exceptions.EncryptionIntegrityChecksFailedException
CodeCommit.Client.exceptions.EncryptionKeyAccessDeniedException
CodeCommit.Client.exceptions.EncryptionKeyDisabledException
CodeCommit.Client.exceptions.EncryptionKeyNotFoundException
CodeCommit.Client.exceptions.EncryptionKeyUnavailableException
CodeCommit.Client.exceptions.SameFileContentException
CodeCommit.Client.exceptions.FileNameConflictsWithDirectoryNameException
CodeCommit.Client.exceptions.DirectoryNameConflictsWithFileNameException
CodeCommit.Client.exceptions.FilePathConflictsWithSubmodulePathException