AWS CodeCommit

2019/05/30 - AWS CodeCommit - 3 new 1 updated api methods

Changes  This release adds APIs that allow adding and removing tags to a repository, and viewing tags for a repository. It also enables adding tags when creating a repository.

ListTagsForResource (new) Link ¶

Gets information about AWS tags for a specified Amazon Resource Name (ARN) in AWS CodeCommit. For a list of valid resources in AWS CodeCommit, see CodeCommit Resources and Operations in the AWS CodeCommit User Guide.

See also: AWS API Documentation

Request Syntax

client.list_tags_for_resource(
    resourceArn='string',
    nextToken='string'
)
type resourceArn

string

param resourceArn

[REQUIRED]

The Amazon Resource Name (ARN) of the resource for which you want to get information about tags, if any.

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

{
    'tags': {
        'string': 'string'
    },
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • tags (dict) --

      A list of tag key and value pairs associated with the specified resource.

      • (string) --

        • (string) --

    • nextToken (string) --

      An enumeration token that allows the operation to batch the next results of the operation.

TagResource (new) Link ¶

Adds or updates tags for a resource in AWS CodeCommit. For a list of valid resources in AWS CodeCommit, see CodeCommit Resources and Operations in the AWS CodeCommit User Guide.

See also: AWS API Documentation

Request Syntax

client.tag_resource(
    resourceArn='string',
    tags={
        'string': 'string'
    }
)
type resourceArn

string

param resourceArn

[REQUIRED]

The Amazon Resource Name (ARN) of the resource to which you want to add or update tags.

type tags

dict

param tags

[REQUIRED]

The key-value pair to use when tagging this repository.

  • (string) --

    • (string) --

returns

None

UntagResource (new) Link ¶

Removes tags for a resource in AWS CodeCommit. For a list of valid resources in AWS CodeCommit, see CodeCommit Resources and Operations in the AWS CodeCommit User Guide.

See also: AWS API Documentation

Request Syntax

client.untag_resource(
    resourceArn='string',
    tagKeys=[
        'string',
    ]
)
type resourceArn

string

param resourceArn

[REQUIRED]

The Amazon Resource Name (ARN) of the resource to which you want to remove tags.

type tagKeys

list

param tagKeys

[REQUIRED]

The tag key for each tag that you want to remove from the resource.

  • (string) --

returns

None

CreateRepository (updated) Link ¶
Changes (request)
{'tags': {'string': 'string'}}

Creates a new, empty repository.

See also: AWS API Documentation

Request Syntax

client.create_repository(
    repositoryName='string',
    repositoryDescription='string',
    tags={
        'string': 'string'
    }
)
type repositoryName

string

param repositoryName

[REQUIRED]

The name of the new repository to be created.

Note

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. For a full description of the limits on repository names, see Limits in the AWS CodeCommit User Guide. The suffix ".git" is prohibited.

type repositoryDescription

string

param repositoryDescription

A comment or description about the new 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.

type tags

dict

param tags

One or more tag key-value pairs to use when tagging this repository.

  • (string) --

    • (string) --

rtype

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

  • (dict) --

    Represents the output of a create repository operation.

    • repositoryMetadata (dict) --

      Information about the newly created repository.

      • accountId (string) --

        The ID of the AWS account associated with the repository.

      • repositoryId (string) --

        The ID of the repository.

      • repositoryName (string) --

        The repository's name.

      • repositoryDescription (string) --

        A comment or description about the repository.

      • defaultBranch (string) --

        The repository's default branch name.

      • lastModifiedDate (datetime) --

        The date and time the repository was last modified, in timestamp format.

      • creationDate (datetime) --

        The date and time the repository was created, in timestamp format.

      • cloneUrlHttp (string) --

        The URL to use for cloning the repository over HTTPS.

      • cloneUrlSsh (string) --

        The URL to use for cloning the repository over SSH.

      • Arn (string) --

        The Amazon Resource Name (ARN) of the repository.