AWS CodeCommit

2018/02/21 - AWS CodeCommit - 1 new api methods

Changes  Update codecommit client to latest version

PutFile (new) Link ΒΆ

Adds or updates a file in an AWS CodeCommit repository.

See also: AWS API Documentation

Request Syntax

client.put_file(
    repositoryName='string',
    branchName='string',
    fileContent=b'bytes',
    filePath='string',
    fileMode='EXECUTABLE'|'NORMAL'|'SYMLINK',
    parentCommitId='string',
    commitMessage='string',
    name='string',
    email='string'
)
type repositoryName:

string

param repositoryName:

[REQUIRED]

The name of the repository where you want to add or update the file.

type branchName:

string

param branchName:

[REQUIRED]

The name of the branch where you want to add or update the file.

type fileContent:

bytes

param fileContent:

[REQUIRED]

The content of the file, in binary object format.

type filePath:

string

param filePath:

[REQUIRED]

The name of the file you want to add or update, including the relative path to the file in the repository.

type fileMode:

string

param fileMode:

The file mode permissions of the blob. Valid file mode permissions are listed below.

type parentCommitId:

string

param parentCommitId:

The full commit ID of the head commit in the branch where you want to add or update the file. If the commit ID does not match the ID of the head commit at the time of the operation, an error will occur, and the file will not be added or updated.

type commitMessage:

string

param commitMessage:

A message about why this file was added or updated. While optional, adding a message is strongly encouraged in order to provide a more useful commit history for your repository.

type name:

string

param name:

The name of the person adding or updating the file. While optional, adding a name is strongly encouraged in order to provide a more useful commit history for your repository.

type email:

string

param email:

An email address for the person adding or updating the file.

rtype:

dict

returns:

Response Syntax

{
    'commitId': 'string',
    'blobId': 'string',
    'treeId': 'string'
}

Response Structure

  • (dict) --

    • commitId (string) --

      The full SHA of the commit that contains this file change.

    • blobId (string) --

      The ID of the blob, which is its SHA-1 pointer.

    • treeId (string) --

      Tree information for the commit that contains this file change.