CodeArtifact

2020/10/29 - CodeArtifact - 3 new 4 updated api methods

Changes  Add support for tagging of CodeArtifact domain and repository resources.

ListTagsForResource (new) Link ¶

Gets information about AWS tags for a specified Amazon Resource Name (ARN) in AWS CodeArtifact.

See also: AWS API Documentation

Request Syntax

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

string

param resourceArn

[REQUIRED]

The Amazon Resource Name (ARN) of the resource to get tags for.

rtype

dict

returns

Response Syntax

{
    'tags': [
        {
            'key': 'string',
            'value': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • tags (list) --

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

      • (dict) --

        A tag is a key-value pair that can be used to manage, search for, or filter resources in AWS CodeArtifact.

        • key (string) --

          The tag's key.

        • value (string) --

          The tag's value.

TagResource (new) Link ¶

Adds or updates tags for a resource in AWS CodeArtifact.

See also: AWS API Documentation

Request Syntax

client.tag_resource(
    resourceArn='string',
    tags=[
        {
            'key': 'string',
            'value': '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

list

param tags

[REQUIRED]

The tags you want to modify or add to the resource.

  • (dict) --

    A tag is a key-value pair that can be used to manage, search for, or filter resources in AWS CodeArtifact.

    • key (string) -- [REQUIRED]

      The tag's key.

    • value (string) -- [REQUIRED]

      The tag's value.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

UntagResource (new) Link ¶

Removes tags from a resource in AWS CodeArtifact.

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) --

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

CreateDomain (updated) Link ¶
Changes (request, response)
Request
{'tags': [{'key': 'string', 'value': 'string'}]}
Response
{'domain': {'s3BucketArn': 'string'}}

Creates a domain. CodeArtifact domains make it easier to manage multiple repositories across an organization. You can use a domain to apply permissions across many repositories owned by different AWS accounts. An asset is stored only once in a domain, even if it's in multiple repositories.

Although you can have multiple domains, we recommend a single production domain that contains all published artifacts so that your development teams can find and share packages. You can use a second pre-production domain to test changes to the production domain configuration.

See also: AWS API Documentation

Request Syntax

client.create_domain(
    domain='string',
    encryptionKey='string',
    tags=[
        {
            'key': 'string',
            'value': 'string'
        },
    ]
)
type domain

string

param domain

[REQUIRED]

The name of the domain to create. All domain names in an AWS Region that are in the same AWS account must be unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a domain name because it is publicly discoverable.

type encryptionKey

string

param encryptionKey

The encryption key for the domain. This is used to encrypt content stored in a domain. An encryption key can be a key ID, a key Amazon Resource Name (ARN), a key alias, or a key alias ARN. To specify an encryptionKey , your IAM role must have kms:DescribeKey and kms:CreateGrant permissions on the encryption key that is used. For more information, see DescribeKey in the AWS Key Management Service API Reference and AWS KMS API Permissions Reference in the AWS Key Management Service Developer Guide .

Warning

CodeArtifact supports only symmetric CMKs. Do not associate an asymmetric CMK with your domain. For more information, see Using symmetric and asymmetric keys in the AWS Key Management Service Developer Guide .

type tags

list

param tags

One or more tag key-value pairs for the domain.

  • (dict) --

    A tag is a key-value pair that can be used to manage, search for, or filter resources in AWS CodeArtifact.

    • key (string) -- [REQUIRED]

      The tag's key.

    • value (string) -- [REQUIRED]

      The tag's value.

rtype

dict

returns

Response Syntax

{
    'domain': {
        'name': 'string',
        'owner': 'string',
        'arn': 'string',
        'status': 'Active'|'Deleted',
        'createdTime': datetime(2015, 1, 1),
        'encryptionKey': 'string',
        'repositoryCount': 123,
        'assetSizeBytes': 123,
        's3BucketArn': 'string'
    }
}

Response Structure

  • (dict) --

    • domain (dict) --

      Contains information about the created domain after processing the request.

      • name (string) --

        The name of the domain.

      • owner (string) --

        The AWS account ID that owns the domain.

      • arn (string) --

        The Amazon Resource Name (ARN) of the domain.

      • status (string) --

        The current status of a domain. The valid values are

        • Active

        • Deleted

      • createdTime (datetime) --

        A timestamp that represents the date and time the domain was created.

      • encryptionKey (string) --

        The ARN of an AWS Key Management Service (AWS KMS) key associated with a domain.

      • repositoryCount (integer) --

        The number of repositories in the domain.

      • assetSizeBytes (integer) --

        The total size of all assets in the domain.

      • s3BucketArn (string) --

        The Amazon Resource Name (ARN) of the Amazon S3 bucket that is used to store package assets in the domain.

CreateRepository (updated) Link ¶
Changes (request)
{'tags': [{'key': 'string', 'value': 'string'}]}

Creates a repository.

See also: AWS API Documentation

Request Syntax

client.create_repository(
    domain='string',
    domainOwner='string',
    repository='string',
    description='string',
    upstreams=[
        {
            'repositoryName': 'string'
        },
    ],
    tags=[
        {
            'key': 'string',
            'value': 'string'
        },
    ]
)
type domain

string

param domain

[REQUIRED]

The domain that contains the created repository.

type domainOwner

string

param domainOwner

The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

type repository

string

param repository

[REQUIRED]

The name of the repository to create.

type description

string

param description

A description of the created repository.

type upstreams

list

param upstreams

A list of upstream repositories to associate with the repository. The order of the upstream repositories in the list determines their priority order when AWS CodeArtifact looks for a requested package version. For more information, see Working with upstream repositories .

type tags

list

param tags

One or more tag key-value pairs for the repository.

  • (dict) --

    A tag is a key-value pair that can be used to manage, search for, or filter resources in AWS CodeArtifact.

    • key (string) -- [REQUIRED]

      The tag's key.

    • value (string) -- [REQUIRED]

      The tag's value.

rtype

dict

returns

Response Syntax

{
    'repository': {
        'name': 'string',
        'administratorAccount': 'string',
        'domainName': 'string',
        'domainOwner': 'string',
        'arn': 'string',
        'description': 'string',
        'upstreams': [
            {
                'repositoryName': 'string'
            },
        ],
        'externalConnections': [
            {
                'externalConnectionName': 'string',
                'packageFormat': 'npm'|'pypi'|'maven',
                'status': 'Available'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • repository (dict) --

      Information about the created repository after processing the request.

      • name (string) --

        The name of the repository.

      • administratorAccount (string) --

        The 12-digit account number of the AWS account that manages the repository.

      • domainName (string) --

        The name of the domain that contains the repository.

      • domainOwner (string) --

        The 12-digit account number of the AWS account that owns the domain that contains the repository. It does not include dashes or spaces.

      • arn (string) --

        The Amazon Resource Name (ARN) of the repository.

      • description (string) --

        A text description of the repository.

      • upstreams (list) --

        A list of upstream repositories to associate with the repository. The order of the upstream repositories in the list determines their priority order when AWS CodeArtifact looks for a requested package version. For more information, see Working with upstream repositories .

        • (dict) --

          Information about an upstream repository.

          • repositoryName (string) --

            The name of an upstream repository.

      • externalConnections (list) --

        An array of external connections associated with the repository.

        • (dict) --

          Contains information about the external connection of a repository.

          • externalConnectionName (string) --

            The name of the external connection associated with a repository.

          • packageFormat (string) --

            The package format associated with a repository's external connection. The valid package formats are:

            • npm : A Node Package Manager (npm) package.

            • pypi : A Python Package Index (PyPI) package.

            • maven : A Maven package that contains compiled code in a distributable format, such as a JAR file.

          • status (string) --

            The status of the external connection of a repository. There is one valid value, Available .

DeleteDomain (updated) Link ¶
Changes (response)
{'domain': {'s3BucketArn': 'string'}}

Deletes a domain. You cannot delete a domain that contains repositories. If you want to delete a domain with repositories, first delete its repositories.

See also: AWS API Documentation

Request Syntax

client.delete_domain(
    domain='string',
    domainOwner='string'
)
type domain

string

param domain

[REQUIRED]

The name of the domain to delete.

type domainOwner

string

param domainOwner

The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

rtype

dict

returns

Response Syntax

{
    'domain': {
        'name': 'string',
        'owner': 'string',
        'arn': 'string',
        'status': 'Active'|'Deleted',
        'createdTime': datetime(2015, 1, 1),
        'encryptionKey': 'string',
        'repositoryCount': 123,
        'assetSizeBytes': 123,
        's3BucketArn': 'string'
    }
}

Response Structure

  • (dict) --

    • domain (dict) --

      Contains information about the deleted domain after processing the request.

      • name (string) --

        The name of the domain.

      • owner (string) --

        The AWS account ID that owns the domain.

      • arn (string) --

        The Amazon Resource Name (ARN) of the domain.

      • status (string) --

        The current status of a domain. The valid values are

        • Active

        • Deleted

      • createdTime (datetime) --

        A timestamp that represents the date and time the domain was created.

      • encryptionKey (string) --

        The ARN of an AWS Key Management Service (AWS KMS) key associated with a domain.

      • repositoryCount (integer) --

        The number of repositories in the domain.

      • assetSizeBytes (integer) --

        The total size of all assets in the domain.

      • s3BucketArn (string) --

        The Amazon Resource Name (ARN) of the Amazon S3 bucket that is used to store package assets in the domain.

DescribeDomain (updated) Link ¶
Changes (response)
{'domain': {'s3BucketArn': 'string'}}

Returns a ` DomainDescription https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_DomainDescription.html`__ object that contains information about the requested domain.

See also: AWS API Documentation

Request Syntax

client.describe_domain(
    domain='string',
    domainOwner='string'
)
type domain

string

param domain

[REQUIRED]

A string that specifies the name of the requested domain.

type domainOwner

string

param domainOwner

The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

rtype

dict

returns

Response Syntax

{
    'domain': {
        'name': 'string',
        'owner': 'string',
        'arn': 'string',
        'status': 'Active'|'Deleted',
        'createdTime': datetime(2015, 1, 1),
        'encryptionKey': 'string',
        'repositoryCount': 123,
        'assetSizeBytes': 123,
        's3BucketArn': 'string'
    }
}

Response Structure

  • (dict) --

    • domain (dict) --

      Information about a domain. A domain is a container for repositories. When you create a domain, it is empty until you add one or more repositories.

      • name (string) --

        The name of the domain.

      • owner (string) --

        The AWS account ID that owns the domain.

      • arn (string) --

        The Amazon Resource Name (ARN) of the domain.

      • status (string) --

        The current status of a domain. The valid values are

        • Active

        • Deleted

      • createdTime (datetime) --

        A timestamp that represents the date and time the domain was created.

      • encryptionKey (string) --

        The ARN of an AWS Key Management Service (AWS KMS) key associated with a domain.

      • repositoryCount (integer) --

        The number of repositories in the domain.

      • assetSizeBytes (integer) --

        The total size of all assets in the domain.

      • s3BucketArn (string) --

        The Amazon Resource Name (ARN) of the Amazon S3 bucket that is used to store package assets in the domain.