CodeCommit / Client / create_repository

create_repository#

CodeCommit.Client.create_repository(**kwargs)#

Creates a new, empty repository.

See also: AWS API Documentation

Request Syntax

response = client.create_repository(
    repositoryName='string',
    repositoryDescription='string',
    tags={
        'string': 'string'
    },
    kmsKeyId='string'
)
Parameters:
  • repositoryName (string) –

    [REQUIRED]

    The name of the new repository to be created.

    Note

    The repository name must be unique across the calling Amazon Web Services account. Repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. For more information about the limits on repository names, see Quotas in the CodeCommit User Guide. The suffix .git is prohibited.

  • repositoryDescription (string) –

    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 webpage can 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 webpage.

  • tags (dict) –

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

    • (string) –

      • (string) –

  • kmsKeyId (string) –

    The ID of the encryption key. You can view the ID of an encryption key in the KMS console, or use the KMS APIs to programmatically retrieve a key ID. For more information about acceptable values for kmsKeyID, see KeyId in the Decrypt API description in the Key Management Service API Reference.

    If no key is specified, the default aws/codecommit Amazon Web Services managed key is used.

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',
        'kmsKeyId': '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 Amazon Web Services 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.

      • kmsKeyId (string) –

        The ID of the Key Management Service encryption key used to encrypt and decrypt the repository.

Exceptions

  • CodeCommit.Client.exceptions.RepositoryNameExistsException

  • CodeCommit.Client.exceptions.RepositoryNameRequiredException

  • CodeCommit.Client.exceptions.InvalidRepositoryNameException

  • CodeCommit.Client.exceptions.InvalidRepositoryDescriptionException

  • CodeCommit.Client.exceptions.RepositoryLimitExceededException

  • CodeCommit.Client.exceptions.EncryptionIntegrityChecksFailedException

  • CodeCommit.Client.exceptions.EncryptionKeyAccessDeniedException

  • CodeCommit.Client.exceptions.EncryptionKeyDisabledException

  • CodeCommit.Client.exceptions.EncryptionKeyNotFoundException

  • CodeCommit.Client.exceptions.EncryptionKeyUnavailableException

  • CodeCommit.Client.exceptions.EncryptionKeyInvalidIdException

  • CodeCommit.Client.exceptions.EncryptionKeyInvalidUsageException

  • CodeCommit.Client.exceptions.InvalidTagsMapException

  • CodeCommit.Client.exceptions.TooManyTagsException

  • CodeCommit.Client.exceptions.InvalidSystemTagUsageException

  • CodeCommit.Client.exceptions.TagPolicyException