AWS CodeCommit

2017/01/24 - AWS CodeCommit - 2 new api methods

Changes  Added new API to list the different files between 2 commits

GetBlob (new) Link ¶

Returns the base-64 encoded content of an individual blob within a repository.

See also: AWS API Documentation

Request Syntax

client.get_blob(
    repositoryName='string',
    blobId='string'
)
type repositoryName

string

param repositoryName

[REQUIRED]

The name of the repository that contains the blob.

type blobId

string

param blobId

[REQUIRED]

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

rtype

dict

returns

Response Syntax

{
    'content': b'bytes'
}

Response Structure

  • (dict) --

    Represents the output of a get blob operation.

    • content (bytes) --

      The content of the blob, usually a file.

GetDifferences (new) Link ¶

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

client.get_differences(
    repositoryName='string',
    beforeCommitSpecifier='string',
    afterCommitSpecifier='string',
    beforePath='string',
    afterPath='string',
    MaxResults=123,
    NextToken='string'
)
type repositoryName

string

param repositoryName

[REQUIRED]

The name of the repository where you want to get differences.

type beforeCommitSpecifier

string

param beforeCommitSpecifier

The branch, tag, HEAD, or other fully qualified reference used to identify a commit. For example, the full commit ID. Optional. If not specified, all changes prior to the afterCommitSpecifier value will be shown. If you do not use beforeCommitSpecifier in your request, consider limiting the results with maxResults .

type afterCommitSpecifier

string

param afterCommitSpecifier

[REQUIRED]

The branch, tag, HEAD, or other fully qualified reference used to identify a commit.

type beforePath

string

param beforePath

The file path in which to check for differences. Limits the results to this path. Can also be used to specify the previous name of a directory or folder. If beforePath and afterPath are not specified, differences will be shown for all paths.

type afterPath

string

param afterPath

The file path in which to check differences. Limits the results to this path. Can also be used to specify the changed name of a directory or folder, if it has changed. If not specified, differences will be shown for all paths.

type MaxResults

integer

param MaxResults

A non-negative integer used to limit the number of returned results.

type NextToken

string

param NextToken

An enumeration token that when provided in a request, returns the next batch of the results.

rtype

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

  • (dict) --

    • differences (list) --

      A differences data type object that contains information about the differences, including whether the difference is added, modified, or deleted (A, D, M).

      • (dict) --

        Returns information about a set of differences for a commit specifier.

        • beforeBlob (dict) --

          Information about a beforeBlob data type object, including the ID, the file mode permission code, and the path.

          • blobId (string) --

            The full ID of the blob.

          • path (string) --

            The path to the blob and any associated file name, if any.

          • mode (string) --

            The file mode permissions of the blob. File mode permission codes include:

            • 100644 indicates read/write

            • 100755 indicates read/write/execute

            • 160000 indicates a submodule

            • 120000 indicates a symlink

        • afterBlob (dict) --

          Information about an afterBlob data type object, including the ID, the file mode permission code, and the path.

          • blobId (string) --

            The full ID of the blob.

          • path (string) --

            The path to the blob and any associated file name, if any.

          • mode (string) --

            The file mode permissions of the blob. File mode permission codes include:

            • 100644 indicates read/write

            • 100755 indicates read/write/execute

            • 160000 indicates a submodule

            • 120000 indicates a symlink

        • changeType (string) --

          Whether the change type of the difference is an addition (A), deletion (D), or modification (M).

    • NextToken (string) --

      An enumeration token that can be used in a request to return the next batch of the results.