CodeArtifact

Client

class CodeArtifact.Client

A low-level client representing CodeArtifact:

client = session.create_client('codeartifact')

These are the available methods:

associate_external_connection(**kwargs)

Adds an existing external connection to a repository. One external connection is allowed per repository.

Note

A repository can have one or more upstream repositories, or an external connection.

See also: AWS API Documentation

Request Syntax

response = client.associate_external_connection(
    domain='string',
    domainOwner='string',
    repository='string',
    externalConnection='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain that contains the repository.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The name of the repository to which the external connection is added.

  • externalConnection (string) --

    [REQUIRED]

    The name of the external connection to add to the repository. The following values are supported:

    • public:npmjs - for the npm public repository.
    • public:pypi - for the Python Package Index.
    • public:maven-central - for Maven Central.
    • public:maven-googleandroid - for the Google Android repository.
    • public:maven-gradleplugins - for the Gradle plugins repository.
    • public:maven-commonsware - for the CommonsWare Android repository.
Return type

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 connected 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 .

Exceptions

can_paginate(operation_name)

Check if an operation can be paginated.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Returns
True if the operation can be paginated, False otherwise.
copy_package_versions(**kwargs)

Copies package versions from one repository to another repository in the same domain.

Note

You must specify versions or versionRevisions . You cannot specify both.

See also: AWS API Documentation

Request Syntax

response = client.copy_package_versions(
    domain='string',
    domainOwner='string',
    sourceRepository='string',
    destinationRepository='string',
    format='npm'|'pypi'|'maven',
    namespace='string',
    package='string',
    versions=[
        'string',
    ],
    versionRevisions={
        'string': 'string'
    },
    allowOverwrite=True|False,
    includeFromUpstream=True|False
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain that contains the source and destination repositories.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • sourceRepository (string) --

    [REQUIRED]

    The name of the repository that contains the package versions to copy.

  • destinationRepository (string) --

    [REQUIRED]

    The name of the repository into which package versions are copied.

  • format (string) --

    [REQUIRED]

    The format of the package that is copied. The valid package types 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.
  • namespace (string) --

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId .
    • The namespace of an npm package is its scope .
    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
  • package (string) --

    [REQUIRED]

    The name of the package that is copied.

  • versions (list) --

    The versions of the package to copy.

    Note

    You must specify versions or versionRevisions . You cannot specify both.

    • (string) --
  • versionRevisions (dict) --

    A list of key-value pairs. The keys are package versions and the values are package version revisions. A CopyPackageVersion operation succeeds if the specified versions in the source repository match the specified package version revision.

    Note

    You must specify versions or versionRevisions . You cannot specify both.

    • (string) --
      • (string) --
  • allowOverwrite (boolean) -- Set to true to overwrite a package version that already exists in the destination repository. If set to false and the package version already exists in the destination repository, the package version is returned in the failedVersions field of the response with an ALREADY_EXISTS error code.
  • includeFromUpstream (boolean) -- Set to true to copy packages from repositories that are upstream from the source repository to the destination repository. The default setting is false. For more information, see Working with upstream repositories .
Return type

dict

Returns

Response Syntax

{
    'successfulVersions': {
        'string': {
            'revision': 'string',
            'status': 'Published'|'Unfinished'|'Unlisted'|'Archived'|'Disposed'|'Deleted'
        }
    },
    'failedVersions': {
        'string': {
            'errorCode': 'ALREADY_EXISTS'|'MISMATCHED_REVISION'|'MISMATCHED_STATUS'|'NOT_ALLOWED'|'NOT_FOUND'|'SKIPPED',
            'errorMessage': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • successfulVersions (dict) --

      A list of the package versions that were successfully copied to your repository.

      • (string) --

        • (dict) --

          Contains the revision and status of a package version.

          • revision (string) --

            The revision of a package version.

          • status (string) --

            The status of a package version. Valid statuses are:

            • Published
            • Unfinished
            • Unlisted
            • Archived
            • Disposed
    • failedVersions (dict) --

      A map of package versions that failed to copy and their error codes. The possible error codes are in the PackageVersionError data type. They are:

      • ALREADY_EXISTS
      • MISMATCHED_REVISION
      • MISMATCHED_STATUS
      • NOT_ALLOWED
      • NOT_FOUND
      • SKIPPED
      • (string) --

        • (dict) --

          An error associated with package.

          • errorCode (string) --

            The error code associated with the error. Valid error codes are:

            • ALREADY_EXISTS
            • MISMATCHED_REVISION
            • MISMATCHED_STATUS
            • NOT_ALLOWED
            • NOT_FOUND
            • SKIPPED
          • errorMessage (string) --

            The error message associated with the error.

Exceptions

create_domain(**kwargs)

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

response = client.create_domain(
    domain='string',
    encryptionKey='string'
)
Parameters
  • domain (string) --

    [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.

  • encryptionKey (string) --

    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 .

Return type

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

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.

Exceptions

create_repository(**kwargs)

Creates a repository.

See also: AWS API Documentation

Request Syntax

response = client.create_repository(
    domain='string',
    domainOwner='string',
    repository='string',
    description='string',
    upstreams=[
        {
            'repositoryName': 'string'
        },
    ]
)
Parameters
  • domain (string) --

    [REQUIRED]

    The domain that contains the created repository.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The name of the repository to create.

  • description (string) -- A description of the created 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 .

Return type

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 .

Exceptions

delete_domain(**kwargs)

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

response = client.delete_domain(
    domain='string',
    domainOwner='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain to delete.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
Return type

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

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.

Exceptions

delete_domain_permissions_policy(**kwargs)

Deletes the resource policy set on a domain.

See also: AWS API Documentation

Request Syntax

response = client.delete_domain_permissions_policy(
    domain='string',
    domainOwner='string',
    policyRevision='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain associated with the resource policy to be deleted.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • policyRevision (string) -- The current revision of the resource policy to be deleted. This revision is used for optimistic locking, which prevents others from overwriting your changes to the domain's resource policy.
Return type

dict

Returns

Response Syntax

{
    'policy': {
        'resourceArn': 'string',
        'revision': 'string',
        'document': 'string'
    }
}

Response Structure

  • (dict) --

    • policy (dict) --

      Information about the deleted resource policy after processing the request.

      • resourceArn (string) --

        The ARN of the resource associated with the resource policy

      • revision (string) --

        The current revision of the resource policy.

      • document (string) --

        The resource policy formatted in JSON.

Exceptions

delete_package_versions(**kwargs)

Deletes one or more versions of a package. A deleted package version cannot be restored in your repository. If you want to remove a package version from your repository and be able to restore it later, set its status to Archived . Archived packages cannot be downloaded from a repository and don't show up with list package APIs (for example, `` ListackageVersions `` ), but you can restore them using `` UpdatePackageVersionsStatus `` .

See also: AWS API Documentation

Request Syntax

response = client.delete_package_versions(
    domain='string',
    domainOwner='string',
    repository='string',
    format='npm'|'pypi'|'maven',
    namespace='string',
    package='string',
    versions=[
        'string',
    ],
    expectedStatus='Published'|'Unfinished'|'Unlisted'|'Archived'|'Disposed'|'Deleted'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain that contains the package to delete.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The name of the repository that contains the package versions to delete.

  • format (string) --

    [REQUIRED]

    The format of the package versions to delete. The valid values are:

    • npm
    • pypi
    • maven
  • namespace (string) --

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId .
    • The namespace of an npm package is its scope .
    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
  • package (string) --

    [REQUIRED]

    The name of the package with the versions to delete.

  • versions (list) --

    [REQUIRED]

    An array of strings that specify the versions of the package to delete.

    • (string) --
  • expectedStatus (string) --

    The expected status of the package version to delete. Valid values are:

    • Published
    • Unfinished
    • Unlisted
    • Archived
    • Disposed
Return type

dict

Returns

Response Syntax

{
    'successfulVersions': {
        'string': {
            'revision': 'string',
            'status': 'Published'|'Unfinished'|'Unlisted'|'Archived'|'Disposed'|'Deleted'
        }
    },
    'failedVersions': {
        'string': {
            'errorCode': 'ALREADY_EXISTS'|'MISMATCHED_REVISION'|'MISMATCHED_STATUS'|'NOT_ALLOWED'|'NOT_FOUND'|'SKIPPED',
            'errorMessage': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • successfulVersions (dict) --

      A list of the package versions that were successfully deleted.

      • (string) --

        • (dict) --

          Contains the revision and status of a package version.

          • revision (string) --

            The revision of a package version.

          • status (string) --

            The status of a package version. Valid statuses are:

            • Published
            • Unfinished
            • Unlisted
            • Archived
            • Disposed
    • failedVersions (dict) --

      A PackageVersionError object that contains a map of errors codes for the deleted package that failed. The possible error codes are:

      • ALREADY_EXISTS
      • MISMATCHED_REVISION
      • MISMATCHED_STATUS
      • NOT_ALLOWED
      • NOT_FOUND
      • SKIPPED
      • (string) --

        • (dict) --

          An error associated with package.

          • errorCode (string) --

            The error code associated with the error. Valid error codes are:

            • ALREADY_EXISTS
            • MISMATCHED_REVISION
            • MISMATCHED_STATUS
            • NOT_ALLOWED
            • NOT_FOUND
            • SKIPPED
          • errorMessage (string) --

            The error message associated with the error.

Exceptions

delete_repository(**kwargs)

Deletes a repository.

See also: AWS API Documentation

Request Syntax

response = client.delete_repository(
    domain='string',
    domainOwner='string',
    repository='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain that contains the repository to delete.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The name of the repository to delete.

Return type

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 deleted 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 .

Exceptions

delete_repository_permissions_policy(**kwargs)

Deletes the resource policy that is set on a repository. After a resource policy is deleted, the permissions allowed and denied by the deleted policy are removed. The effect of deleting a resource policy might not be immediate.

Warning

Use DeleteRepositoryPermissionsPolicy with caution. After a policy is deleted, AWS users, roles, and accounts lose permissions to perform the repository actions granted by the deleted policy.

See also: AWS API Documentation

Request Syntax

response = client.delete_repository_permissions_policy(
    domain='string',
    domainOwner='string',
    repository='string',
    policyRevision='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain that contains the repository associated with the resource policy to be deleted.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The name of the repository that is associated with the resource policy to be deleted

  • policyRevision (string) -- The revision of the repository's resource policy to be deleted. This revision is used for optimistic locking, which prevents others from accidentally overwriting your changes to the repository's resource policy.
Return type

dict

Returns

Response Syntax

{
    'policy': {
        'resourceArn': 'string',
        'revision': 'string',
        'document': 'string'
    }
}

Response Structure

  • (dict) --

    • policy (dict) --

      Information about the deleted policy after processing the request.

      • resourceArn (string) --

        The ARN of the resource associated with the resource policy

      • revision (string) --

        The current revision of the resource policy.

      • document (string) --

        The resource policy formatted in JSON.

Exceptions

describe_domain(**kwargs)

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

response = client.describe_domain(
    domain='string',
    domainOwner='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    A string that specifies the name of the requested domain.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
Return type

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

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.

Exceptions

describe_package_version(**kwargs)

Returns a ` PackageVersionDescription https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageVersionDescription.html`__ object that contains information about the requested package version.

See also: AWS API Documentation

Request Syntax

response = client.describe_package_version(
    domain='string',
    domainOwner='string',
    repository='string',
    format='npm'|'pypi'|'maven',
    namespace='string',
    package='string',
    packageVersion='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain that contains the repository that contains the package version.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The name of the repository that contains the package version.

  • format (string) --

    [REQUIRED]

    A format that specifies the type of the requested package version. The valid values are:

    • npm
    • pypi
    • maven
  • namespace (string) --

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId .
    • The namespace of an npm package is its scope .
    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
  • package (string) --

    [REQUIRED]

    The name of the requested package version.

  • packageVersion (string) --

    [REQUIRED]

    A string that contains the package version (for example, 3.5.2 ).

Return type

dict

Returns

Response Syntax

{
    'packageVersion': {
        'format': 'npm'|'pypi'|'maven',
        'namespace': 'string',
        'packageName': 'string',
        'displayName': 'string',
        'version': 'string',
        'summary': 'string',
        'homePage': 'string',
        'sourceCodeRepository': 'string',
        'publishedTime': datetime(2015, 1, 1),
        'licenses': [
            {
                'name': 'string',
                'url': 'string'
            },
        ],
        'revision': 'string',
        'status': 'Published'|'Unfinished'|'Unlisted'|'Archived'|'Disposed'|'Deleted'
    }
}

Response Structure

  • (dict) --

    • packageVersion (dict) --

      A `` PackageVersionDescription `` object that contains information about the requested package version.

      • format (string) --

        The format of the package version. 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.
      • namespace (string) --

        The namespace of the package. The package component that specifies its namespace depends on its type. For example:

        • The namespace of a Maven package is its groupId .
        • The namespace of an npm package is its scope .
        • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
      • packageName (string) --

        The name of the requested package.

      • displayName (string) --

        The name of the package that is displayed. The displayName varies depending on the package version's format. For example, if an npm package is named ui , is in the namespace vue , and has the format npm , then the displayName is @vue/ui .

      • version (string) --

        The version of the package.

      • summary (string) --

        A summary of the package version. The summary is extracted from the package. The information in and detail level of the summary depends on the package version's format.

      • homePage (string) --

        The homepage associated with the package.

      • sourceCodeRepository (string) --

        The repository for the source code in the package version, or the source code used to build it.

      • publishedTime (datetime) --

        A timestamp that contains the date and time the package version was published.

      • licenses (list) --

        Information about licenses associated with the package version.

        • (dict) --

          Details of the license data.

          • name (string) --

            Name of the license.

          • url (string) --

            The URL for license data.

      • revision (string) --

        The revision of the package version.

      • status (string) --

        A string that contains the status of the package version. It can be one of the following:

        • Published
        • Unfinished
        • Unlisted
        • Archived
        • Disposed

Exceptions

describe_repository(**kwargs)

Returns a RepositoryDescription object that contains detailed information about the requested repository.

See also: AWS API Documentation

Request Syntax

response = client.describe_repository(
    domain='string',
    domainOwner='string',
    repository='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain that contains the repository to describe.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    A string that specifies the name of the requested repository.

Return type

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

      A RepositoryDescription object that contains the requested repository information.

      • 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 .

Exceptions

disassociate_external_connection(**kwargs)

Removes an existing external connection from a repository.

See also: AWS API Documentation

Request Syntax

response = client.disassociate_external_connection(
    domain='string',
    domainOwner='string',
    repository='string',
    externalConnection='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain that contains the repository from which to remove the external repository.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The name of the repository from which the external connection will be removed.

  • externalConnection (string) --

    [REQUIRED]

    The name of the external connection to be removed from the repository.

Return type

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

      The repository associated with the removed external connection.

      • 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 .

Exceptions

dispose_package_versions(**kwargs)

Deletes the assets in package versions and sets the package versions' status to Disposed . A disposed package version cannot be restored in your repository because its assets are deleted.

To view all disposed package versions in a repository, use `` ListackageVersions `` and set the `` status `` parameter to Disposed .

To view information about a disposed package version, use `` ListPackageVersions `` and set the `` status `` parameter to Disposed .

See also: AWS API Documentation

Request Syntax

response = client.dispose_package_versions(
    domain='string',
    domainOwner='string',
    repository='string',
    format='npm'|'pypi'|'maven',
    namespace='string',
    package='string',
    versions=[
        'string',
    ],
    versionRevisions={
        'string': 'string'
    },
    expectedStatus='Published'|'Unfinished'|'Unlisted'|'Archived'|'Disposed'|'Deleted'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain that contains the repository you want to dispose.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The name of the repository that contains the package versions you want to dispose.

  • format (string) --

    [REQUIRED]

    A format that specifies the type of package versions you want to dispose. The valid values are:

    • npm
    • pypi
    • maven
  • namespace (string) --

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId .
    • The namespace of an npm package is its scope .
    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
  • package (string) --

    [REQUIRED]

    The name of the package with the versions you want to dispose.

  • versions (list) --

    [REQUIRED]

    The versions of the package you want to dispose.

    • (string) --
  • versionRevisions (dict) --

    The revisions of the package versions you want to dispose.

    • (string) --
      • (string) --
  • expectedStatus (string) --

    The expected status of the package version to dispose. Valid values are:

    • Published
    • Unfinished
    • Unlisted
    • Archived
    • Disposed
Return type

dict

Returns

Response Syntax

{
    'successfulVersions': {
        'string': {
            'revision': 'string',
            'status': 'Published'|'Unfinished'|'Unlisted'|'Archived'|'Disposed'|'Deleted'
        }
    },
    'failedVersions': {
        'string': {
            'errorCode': 'ALREADY_EXISTS'|'MISMATCHED_REVISION'|'MISMATCHED_STATUS'|'NOT_ALLOWED'|'NOT_FOUND'|'SKIPPED',
            'errorMessage': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • successfulVersions (dict) --

      A list of the package versions that were successfully disposed.

      • (string) --

        • (dict) --

          Contains the revision and status of a package version.

          • revision (string) --

            The revision of a package version.

          • status (string) --

            The status of a package version. Valid statuses are:

            • Published
            • Unfinished
            • Unlisted
            • Archived
            • Disposed
    • failedVersions (dict) --

      A PackageVersionError object that contains a map of errors codes for the disposed package versions that failed. The possible error codes are:

      • ALREADY_EXISTS
      • MISMATCHED_REVISION
      • MISMATCHED_STATUS
      • NOT_ALLOWED
      • NOT_FOUND
      • SKIPPED
      • (string) --

        • (dict) --

          An error associated with package.

          • errorCode (string) --

            The error code associated with the error. Valid error codes are:

            • ALREADY_EXISTS
            • MISMATCHED_REVISION
            • MISMATCHED_STATUS
            • NOT_ALLOWED
            • NOT_FOUND
            • SKIPPED
          • errorMessage (string) --

            The error message associated with the error.

Exceptions

generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)

Generate a presigned url given a client, its method, and arguments

Parameters
  • ClientMethod (string) -- The client method to presign for
  • Params (dict) -- The parameters normally passed to ClientMethod.
  • ExpiresIn (int) -- The number of seconds the presigned url is valid for. By default it expires in an hour (3600 seconds)
  • HttpMethod (string) -- The http method to use on the generated url. By default, the http method is whatever is used in the method's model.
Returns

The presigned url

get_authorization_token(**kwargs)

Generates a temporary authentication token for accessing repositories in the domain. This API requires the codeartifact:GetAuthorizationToken and sts:GetServiceBearerToken permissions.

Note

CodeArtifact authorization tokens are valid for a period of 12 hours when created with the login command. You can call login periodically to refresh the token. When you create an authorization token with the GetAuthorizationToken API, you can set a custom authorization period, up to a maximum of 12 hours, with the durationSeconds parameter.

The authorization period begins after login or GetAuthorizationToken is called. If login or GetAuthorizationToken is called while assuming a role, the token lifetime is independent of the maximum session duration of the role. For example, if you call sts assume-role and specify a session duration of 15 minutes, then generate a CodeArtifact authorization token, the token will be valid for the full authorization period even though this is longer than the 15-minute session duration.

See Using IAM Roles for more information on controlling session duration.

See also: AWS API Documentation

Request Syntax

response = client.get_authorization_token(
    domain='string',
    domainOwner='string',
    durationSeconds=123
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain that is in scope for the generated authorization token.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • durationSeconds (integer) -- The time, in seconds, that the generated authorization token is valid.
Return type

dict

Returns

Response Syntax

{
    'authorizationToken': 'string',
    'expiration': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • authorizationToken (string) --

      The returned authentication token.

    • expiration (datetime) --

      A timestamp that specifies the date and time the authorization token expires.

Exceptions

get_domain_permissions_policy(**kwargs)

Returns the resource policy attached to the specified domain.

Note

The policy is a resource-based policy, not an identity-based policy. For more information, see Identity-based policies and resource-based policies in the AWS Identity and Access Management User Guide .

See also: AWS API Documentation

Request Syntax

response = client.get_domain_permissions_policy(
    domain='string',
    domainOwner='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain to which the resource policy is attached.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
Return type

dict

Returns

Response Syntax

{
    'policy': {
        'resourceArn': 'string',
        'revision': 'string',
        'document': 'string'
    }
}

Response Structure

  • (dict) --

    • policy (dict) --

      The returned resource policy.

      • resourceArn (string) --

        The ARN of the resource associated with the resource policy

      • revision (string) --

        The current revision of the resource policy.

      • document (string) --

        The resource policy formatted in JSON.

Exceptions

get_package_version_asset(**kwargs)

Returns an asset (or file) that is in a package. For example, for a Maven package version, use GetPackageVersionAsset to download a JAR file, a POM file, or any other assets in the package version.

See also: AWS API Documentation

Request Syntax

response = client.get_package_version_asset(
    domain='string',
    domainOwner='string',
    repository='string',
    format='npm'|'pypi'|'maven',
    namespace='string',
    package='string',
    packageVersion='string',
    asset='string',
    packageVersionRevision='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The domain that contains the repository that contains the package version with the requested asset.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The repository that contains the package version with the requested asset.

  • format (string) --

    [REQUIRED]

    A format that specifies the type of the package version with the requested asset file. The valid values are:

    • npm
    • pypi
    • maven
  • namespace (string) --

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId .
    • The namespace of an npm package is its scope .
    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
  • package (string) --

    [REQUIRED]

    The name of the package that contains the requested asset.

  • packageVersion (string) --

    [REQUIRED]

    A string that contains the package version (for example, 3.5.2 ).

  • asset (string) --

    [REQUIRED]

    The name of the requested asset.

  • packageVersionRevision (string) -- The name of the package version revision that contains the requested asset.
Return type

dict

Returns

Response Syntax

{
    'asset': StreamingBody(),
    'assetName': 'string',
    'packageVersion': 'string',
    'packageVersionRevision': 'string'
}

Response Structure

  • (dict) --

    • asset (StreamingBody) --

      The binary file, or asset, that is downloaded.

    • assetName (string) --

      The name of the asset that is downloaded.

    • packageVersion (string) --

      A string that contains the package version (for example, 3.5.2 ).

    • packageVersionRevision (string) --

      The name of the package version revision that contains the downloaded asset.

Exceptions

get_package_version_readme(**kwargs)

Gets the readme file or descriptive text for a package version. For packages that do not contain a readme file, CodeArtifact extracts a description from a metadata file. For example, from the <description> element in the pom.xml file of a Maven package.

The returned text might contain formatting. For example, it might contain formatting for Markdown or reStructuredText.

See also: AWS API Documentation

Request Syntax

response = client.get_package_version_readme(
    domain='string',
    domainOwner='string',
    repository='string',
    format='npm'|'pypi'|'maven',
    namespace='string',
    package='string',
    packageVersion='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain that contains the repository that contains the package version with the requested readme file.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The repository that contains the package with the requested readme file.

  • format (string) --

    [REQUIRED]

    A format that specifies the type of the package version with the requested readme file. The valid values are:

    • npm
    • pypi
    • maven
  • namespace (string) --

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId .
    • The namespace of an npm package is its scope .
    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
  • package (string) --

    [REQUIRED]

    The name of the package version that contains the requested readme file.

  • packageVersion (string) --

    [REQUIRED]

    A string that contains the package version (for example, 3.5.2 ).

Return type

dict

Returns

Response Syntax

{
    'format': 'npm'|'pypi'|'maven',
    'namespace': 'string',
    'package': 'string',
    'version': 'string',
    'versionRevision': 'string',
    'readme': 'string'
}

Response Structure

  • (dict) --

    • format (string) --

      The format of the package with the requested readme file. Valid format types are:

      • npm
      • pypi
      • maven
    • namespace (string) --

      The namespace of the package. The package component that specifies its namespace depends on its type. For example:

      • The namespace of a Maven package is its groupId .
      • The namespace of an npm package is its scope .
      • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
    • package (string) --

      The name of the package that contains the returned readme file.

    • version (string) --

      The version of the package with the requested readme file.

    • versionRevision (string) --

      The current revision associated with the package version.

    • readme (string) --

      The text of the returned readme file.

Exceptions

get_paginator(operation_name)

Create a paginator for an operation.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Raises OperationNotPageableError
Raised if the operation is not pageable. You can use the client.can_paginate method to check if an operation is pageable.
Return type
L{botocore.paginate.Paginator}
Returns
A paginator object.
get_repository_endpoint(**kwargs)

Returns the endpoint of a repository for a specific package format. A repository has one endpoint for each package format:

  • npm
  • pypi
  • maven

See also: AWS API Documentation

Request Syntax

response = client.get_repository_endpoint(
    domain='string',
    domainOwner='string',
    repository='string',
    format='npm'|'pypi'|'maven'
)
Parameters
  • domain (string) --

    [REQUIRED]

    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.
  • repository (string) --

    [REQUIRED]

    The name of the repository.

  • format (string) --

    [REQUIRED]

    Returns which endpoint of a repository to return. A repository has one endpoint for each package format:

    • npm
    • pypi
    • maven
Return type

dict

Returns

Response Syntax

{
    'repositoryEndpoint': 'string'
}

Response Structure

  • (dict) --

    • repositoryEndpoint (string) --

      A string that specifies the URL of the returned endpoint.

Exceptions

get_repository_permissions_policy(**kwargs)

Returns the resource policy that is set on a repository.

See also: AWS API Documentation

Request Syntax

response = client.get_repository_permissions_policy(
    domain='string',
    domainOwner='string',
    repository='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain containing the repository whose associated resource policy is to be retrieved.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The name of the repository whose associated resource policy is to be retrieved.

Return type

dict

Returns

Response Syntax

{
    'policy': {
        'resourceArn': 'string',
        'revision': 'string',
        'document': 'string'
    }
}

Response Structure

  • (dict) --

    • policy (dict) --

      The returned resource policy.

      • resourceArn (string) --

        The ARN of the resource associated with the resource policy

      • revision (string) --

        The current revision of the resource policy.

      • document (string) --

        The resource policy formatted in JSON.

Exceptions

get_waiter(waiter_name)

Returns an object that can wait for some condition.

Parameters
waiter_name (str) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters.
Returns
The specified waiter object.
Return type
botocore.waiter.Waiter
list_domains(**kwargs)

Returns a list of `` DomainSummary `` objects for all domains owned by the AWS account that makes this call. Each returned DomainSummary object contains information about a domain.

See also: AWS API Documentation

Request Syntax

response = client.list_domains(
    maxResults=123,
    nextToken='string'
)
Parameters
  • maxResults (integer) -- The maximum number of results to return per page.
  • nextToken (string) -- The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
Return type

dict

Returns

Response Syntax

{
    'domains': [
        {
            'name': 'string',
            'owner': 'string',
            'arn': 'string',
            'status': 'Active'|'Deleted',
            'createdTime': datetime(2015, 1, 1),
            'encryptionKey': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • domains (list) --

      The returned list of `` DomainSummary `` objects.

      • (dict) --

        Information about a domain, including its name, Amazon Resource Name (ARN), and status. The ` ListDomains https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListDomains.html`__ operation returns a list of DomainSummary objects.

        • name (string) --

          The name of the domain.

        • owner (string) --

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

        • arn (string) --

          The ARN of the domain.

        • status (string) --

          A string that contains the status of the domain. The valid values are:

          • Active
          • Deleted
        • createdTime (datetime) --

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

        • encryptionKey (string) --

          The key used to encrypt the domain.

    • nextToken (string) --

      The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

Exceptions

list_package_version_assets(**kwargs)

Returns a list of ` AssetSummary https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_AssetSummary.html`__ objects for assets in a package version.

See also: AWS API Documentation

Request Syntax

response = client.list_package_version_assets(
    domain='string',
    domainOwner='string',
    repository='string',
    format='npm'|'pypi'|'maven',
    namespace='string',
    package='string',
    packageVersion='string',
    maxResults=123,
    nextToken='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain that contains the repository associated with the package version assets.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The name of the repository that contains the package that contains the returned package version assets.

  • format (string) --

    [REQUIRED]

    The format of the package that contains the returned package version assets. The valid package types 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.
  • namespace (string) --

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId .
    • The namespace of an npm package is its scope .
    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
  • package (string) --

    [REQUIRED]

    The name of the package that contains the returned package version assets.

  • packageVersion (string) --

    [REQUIRED]

    A string that contains the package version (for example, 3.5.2 ).

  • maxResults (integer) -- The maximum number of results to return per page.
  • nextToken (string) -- The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
Return type

dict

Returns

Response Syntax

{
    'format': 'npm'|'pypi'|'maven',
    'namespace': 'string',
    'package': 'string',
    'version': 'string',
    'versionRevision': 'string',
    'nextToken': 'string',
    'assets': [
        {
            'name': 'string',
            'size': 123,
            'hashes': {
                'string': 'string'
            }
        },
    ]
}

Response Structure

  • (dict) --

    • format (string) --

      The format of the package that contains the returned package version assets.

    • namespace (string) --

      The namespace of the package. The package component that specifies its namespace depends on its type. For example:

      • The namespace of a Maven package is its groupId .
      • The namespace of an npm package is its scope .
      • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
    • package (string) --

      The name of the package that contains the returned package version assets.

    • version (string) --

      The version of the package associated with the returned assets.

    • versionRevision (string) --

      The current revision associated with the package version.

    • nextToken (string) --

      If there are additional results, this is the token for the next set of results.

    • assets (list) --

      The returned list of ` AssetSummary https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_AssetSummary.html`__ objects.

      • (dict) --

        Contains details about a package version asset.

        • name (string) --

          The name of the asset.

        • size (integer) --

          The size of the asset.

        • hashes (dict) --

          The hashes of the asset.

          • (string) --
            • (string) --

Exceptions

list_package_version_dependencies(**kwargs)

Returns the direct dependencies for a package version. The dependencies are returned as ` PackageDependency https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageDependency.html`__ objects. CodeArtifact extracts the dependencies for a package version from the metadata file for the package format (for example, the package.json file for npm packages and the pom.xml file for Maven). Any package version dependencies that are not listed in the configuration file are not returned.

See also: AWS API Documentation

Request Syntax

response = client.list_package_version_dependencies(
    domain='string',
    domainOwner='string',
    repository='string',
    format='npm'|'pypi'|'maven',
    namespace='string',
    package='string',
    packageVersion='string',
    nextToken='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The domain that contains the repository that contains the requested package version dependencies.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The name of the repository that contains the requested package version.

  • format (string) --

    [REQUIRED]

    The format of the package with the requested dependencies. The valid package types 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.
  • namespace (string) --

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId .
    • The namespace of an npm package is its scope .
    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
  • package (string) --

    [REQUIRED]

    The name of the package versions' package.

  • packageVersion (string) --

    [REQUIRED]

    A string that contains the package version (for example, 3.5.2 ).

  • nextToken (string) -- The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
Return type

dict

Returns

Response Syntax

{
    'format': 'npm'|'pypi'|'maven',
    'namespace': 'string',
    'package': 'string',
    'version': 'string',
    'versionRevision': 'string',
    'nextToken': 'string',
    'dependencies': [
        {
            'namespace': 'string',
            'package': 'string',
            'dependencyType': 'string',
            'versionRequirement': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • format (string) --

      A format that specifies the type of the package that contains the returned dependencies. The valid values are:

      • npm
      • pypi
      • maven
    • namespace (string) --

      The namespace of the package. The package component that specifies its namespace depends on its type. For example:

      • The namespace of a Maven package is its groupId .
      • The namespace of an npm package is its scope .
      • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
    • package (string) --

      The name of the package that contains the returned package versions dependencies.

    • version (string) --

      The version of the package that is specified in the request.

    • versionRevision (string) --

      The current revision associated with the package version.

    • nextToken (string) --

      The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

    • dependencies (list) --

      The returned list of ` PackageDependency https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageDependency.html`__ objects.

      • (dict) --

        Details about a package dependency.

        • namespace (string) --

          The namespace of the package. The package component that specifies its namespace depends on its type. For example:

          • The namespace of a Maven package is its groupId .
          • The namespace of an npm package is its scope .
          • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
        • package (string) --

          The name of the package that this package depends on.

        • dependencyType (string) --

          The type of a package dependency. The possible values depend on the package type. Example types are compile , runtime , and test for Maven packages, and dev , prod , and optional for npm packages.

        • versionRequirement (string) --

          The required version, or version range, of the package that this package depends on. The version format is specific to the package type. For example, the following are possible valid required versions: 1.2.3 , ^2.3.4 , or 4.x .

Exceptions

list_package_versions(**kwargs)

Returns a list of ` PackageVersionSummary https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageVersionSummary.html`__ objects for package versions in a repository that match the request parameters.

See also: AWS API Documentation

Request Syntax

response = client.list_package_versions(
    domain='string',
    domainOwner='string',
    repository='string',
    format='npm'|'pypi'|'maven',
    namespace='string',
    package='string',
    status='Published'|'Unfinished'|'Unlisted'|'Archived'|'Disposed'|'Deleted',
    sortBy='PUBLISHED_TIME',
    maxResults=123,
    nextToken='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain that contains the repository that contains the returned package versions.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The name of the repository that contains the package.

  • format (string) --

    [REQUIRED]

    The format of the returned packages. The valid package types 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.
  • namespace (string) --

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId .
    • The namespace of an npm package is its scope .
    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
  • package (string) --

    [REQUIRED]

    The name of the package for which you want to return a list of package versions.

  • status (string) --

    A string that specifies the status of the package versions to include in the returned list. It can be one of the following:

    • Published
    • Unfinished
    • Unlisted
    • Archived
    • Disposed
  • sortBy (string) -- How to sort the returned list of package versions.
  • maxResults (integer) -- The maximum number of results to return per page.
  • nextToken (string) -- The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
Return type

dict

Returns

Response Syntax

{
    'defaultDisplayVersion': 'string',
    'format': 'npm'|'pypi'|'maven',
    'namespace': 'string',
    'package': 'string',
    'versions': [
        {
            'version': 'string',
            'revision': 'string',
            'status': 'Published'|'Unfinished'|'Unlisted'|'Archived'|'Disposed'|'Deleted'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • defaultDisplayVersion (string) --

      The default package version to display. This depends on the package format:

      • For Maven and PyPI packages, it's the most recently published package version.
      • For npm packages, it's the version referenced by the latest tag. If the latest tag is not set, it's the most recently published package version.
    • format (string) --

      A format of the package. Valid package format values are:

      • npm
      • pypi
      • maven
    • namespace (string) --

      The namespace of the package. The package component that specifies its namespace depends on its type. For example:

      • The namespace of a Maven package is its groupId .
      • The namespace of an npm package is its scope .
      • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
    • package (string) --

      The name of the package.

    • versions (list) --

      The returned list of ` PackageVersionSummary https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageVersionSummary.html`__ objects.

      • (dict) --

        Details about a package version, including its status, version, and revision. The ` ListPackageVersions https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListPackageVersions.html`__ operation returns a list of PackageVersionSummary objects.

        • version (string) --

          Information about a package version.

        • revision (string) --

          The revision associated with a package version.

        • status (string) --

          A string that contains the status of the package version. It can be one of the following:

          • Published
          • Unfinished
          • Unlisted
          • Archived
          • Disposed
    • nextToken (string) --

      If there are additional results, this is the token for the next set of results.

Exceptions

list_packages(**kwargs)

Returns a list of ` PackageSummary https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageSummary.html`__ objects for packages in a repository that match the request parameters.

See also: AWS API Documentation

Request Syntax

response = client.list_packages(
    domain='string',
    domainOwner='string',
    repository='string',
    format='npm'|'pypi'|'maven',
    namespace='string',
    packagePrefix='string',
    maxResults=123,
    nextToken='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The domain that contains the repository that contains the requested list of packages.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The name of the repository from which packages are to be listed.

  • format (string) --

    The format of the packages. The valid package types 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.
  • namespace (string) --

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId .
    • The namespace of an npm package is its scope .
    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
  • packagePrefix (string) -- A prefix used to filter returned repositories. Only repositories with names that start with repositoryPrefix are returned.
  • maxResults (integer) -- The maximum number of results to return per page.
  • nextToken (string) -- The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
Return type

dict

Returns

Response Syntax

{
    'packages': [
        {
            'format': 'npm'|'pypi'|'maven',
            'namespace': 'string',
            'package': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • packages (list) --

      The list of returned ` PackageSummary https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageSummary.html`__ objects.

      • (dict) --

        Details about a package, including its format, namespace, and name. The ` ListPackages https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListPackages.html`__ operation returns a list of PackageSummary objects.

        • format (string) --

          The format of the package. Valid values are:

          • npm
          • pypi
          • maven
        • namespace (string) --

          The namespace of the package. The package component that specifies its namespace depends on its type. For example:

          • The namespace of a Maven package is its groupId .
          • The namespace of an npm package is its scope .
          • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
        • package (string) --

          The name of the package.

    • nextToken (string) --

      If there are additional results, this is the token for the next set of results.

Exceptions

list_repositories(**kwargs)

Returns a list of ` RepositorySummary https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_RepositorySummary.html`__ objects. Each RepositorySummary contains information about a repository in the specified AWS account and that matches the input parameters.

See also: AWS API Documentation

Request Syntax

response = client.list_repositories(
    repositoryPrefix='string',
    maxResults=123,
    nextToken='string'
)
Parameters
  • repositoryPrefix (string) -- A prefix used to filter returned repositories. Only repositories with names that start with repositoryPrefix are returned.
  • maxResults (integer) -- The maximum number of results to return per page.
  • nextToken (string) -- The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
Return type

dict

Returns

Response Syntax

{
    'repositories': [
        {
            'name': 'string',
            'administratorAccount': 'string',
            'domainName': 'string',
            'domainOwner': 'string',
            'arn': 'string',
            'description': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • repositories (list) --

      The returned list of ` RepositorySummary https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_RepositorySummary.html`__ objects.

      • (dict) --

        Details about a repository, including its Amazon Resource Name (ARN), description, and domain information. The ` ListRepositories https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListRepositories.html`__ operation returns a list of RepositorySummary objects.

        • name (string) --

          The name of the repository.

        • administratorAccount (string) --

          The AWS account ID 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. It does not include dashes or spaces.

        • arn (string) --

          The ARN of the repository.

        • description (string) --

          The description of the repository.

    • nextToken (string) --

      If there are additional results, this is the token for the next set of results.

Exceptions

list_repositories_in_domain(**kwargs)

Returns a list of ` RepositorySummary https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_RepositorySummary.html`__ objects. Each RepositorySummary contains information about a repository in the specified domain and that matches the input parameters.

See also: AWS API Documentation

Request Syntax

response = client.list_repositories_in_domain(
    domain='string',
    domainOwner='string',
    administratorAccount='string',
    repositoryPrefix='string',
    maxResults=123,
    nextToken='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain that contains the returned list of repositories.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • administratorAccount (string) -- Filter the list of repositories to only include those that are managed by the AWS account ID.
  • repositoryPrefix (string) -- A prefix used to filter returned repositories. Only repositories with names that start with repositoryPrefix are returned.
  • maxResults (integer) -- The maximum number of results to return per page.
  • nextToken (string) -- The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
Return type

dict

Returns

Response Syntax

{
    'repositories': [
        {
            'name': 'string',
            'administratorAccount': 'string',
            'domainName': 'string',
            'domainOwner': 'string',
            'arn': 'string',
            'description': 'string'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • repositories (list) --

      The returned list of repositories.

      • (dict) --

        Details about a repository, including its Amazon Resource Name (ARN), description, and domain information. The ` ListRepositories https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListRepositories.html`__ operation returns a list of RepositorySummary objects.

        • name (string) --

          The name of the repository.

        • administratorAccount (string) --

          The AWS account ID 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. It does not include dashes or spaces.

        • arn (string) --

          The ARN of the repository.

        • description (string) --

          The description of the repository.

    • nextToken (string) --

      If there are additional results, this is the token for the next set of results.

Exceptions

put_domain_permissions_policy(**kwargs)

Sets a resource policy on a domain that specifies permissions to access it.

See also: AWS API Documentation

Request Syntax

response = client.put_domain_permissions_policy(
    domain='string',
    domainOwner='string',
    policyRevision='string',
    policyDocument='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain on which to set the resource policy.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • policyRevision (string) -- The current revision of the resource policy to be set. This revision is used for optimistic locking, which prevents others from overwriting your changes to the domain's resource policy.
  • policyDocument (string) --

    [REQUIRED]

    A valid displayable JSON Aspen policy string to be set as the access control resource policy on the provided domain.

Return type

dict

Returns

Response Syntax

{
    'policy': {
        'resourceArn': 'string',
        'revision': 'string',
        'document': 'string'
    }
}

Response Structure

  • (dict) --

    • policy (dict) --

      The resource policy that was set after processing the request.

      • resourceArn (string) --

        The ARN of the resource associated with the resource policy

      • revision (string) --

        The current revision of the resource policy.

      • document (string) --

        The resource policy formatted in JSON.

Exceptions

put_repository_permissions_policy(**kwargs)

Sets the resource policy on a repository that specifies permissions to access it.

See also: AWS API Documentation

Request Syntax

response = client.put_repository_permissions_policy(
    domain='string',
    domainOwner='string',
    repository='string',
    policyRevision='string',
    policyDocument='string'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain containing the repository to set the resource policy on.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The name of the repository to set the resource policy on.

  • policyRevision (string) -- Sets the revision of the resource policy that specifies permissions to access the repository. This revision is used for optimistic locking, which prevents others from overwriting your changes to the repository's resource policy.
  • policyDocument (string) --

    [REQUIRED]

    A valid displayable JSON Aspen policy string to be set as the access control resource policy on the provided repository.

Return type

dict

Returns

Response Syntax

{
    'policy': {
        'resourceArn': 'string',
        'revision': 'string',
        'document': 'string'
    }
}

Response Structure

  • (dict) --

    • policy (dict) --

      The resource policy that was set after processing the request.

      • resourceArn (string) --

        The ARN of the resource associated with the resource policy

      • revision (string) --

        The current revision of the resource policy.

      • document (string) --

        The resource policy formatted in JSON.

Exceptions

update_package_versions_status(**kwargs)

Updates the status of one or more versions of a package.

See also: AWS API Documentation

Request Syntax

response = client.update_package_versions_status(
    domain='string',
    domainOwner='string',
    repository='string',
    format='npm'|'pypi'|'maven',
    namespace='string',
    package='string',
    versions=[
        'string',
    ],
    versionRevisions={
        'string': 'string'
    },
    expectedStatus='Published'|'Unfinished'|'Unlisted'|'Archived'|'Disposed'|'Deleted',
    targetStatus='Published'|'Unfinished'|'Unlisted'|'Archived'|'Disposed'|'Deleted'
)
Parameters
  • domain (string) --

    [REQUIRED]

    The domain that contains the repository that contains the package versions with a status to be updated.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The repository that contains the package versions with the status you want to update.

  • format (string) --

    [REQUIRED]

    A format that specifies the type of the package with the statuses to update. The valid values are:

    • npm
    • pypi
    • maven
  • namespace (string) --

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId .
    • The namespace of an npm package is its scope .
    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
  • package (string) --

    [REQUIRED]

    The name of the package with the version statuses to update.

  • versions (list) --

    [REQUIRED]

    An array of strings that specify the versions of the package with the statuses to update.

    • (string) --
  • versionRevisions (dict) --

    A map of package versions and package version revisions. The map key is the package version (for example, 3.5.2 ), and the map value is the package version revision.

    • (string) --
      • (string) --
  • expectedStatus (string) -- The package version’s expected status before it is updated. If expectedStatus is provided, the package version's status is updated only if its status at the time UpdatePackageVersionsStatus is called matches expectedStatus .
  • targetStatus (string) --

    [REQUIRED]

    The status you want to change the package version status to.

Return type

dict

Returns

Response Syntax

{
    'successfulVersions': {
        'string': {
            'revision': 'string',
            'status': 'Published'|'Unfinished'|'Unlisted'|'Archived'|'Disposed'|'Deleted'
        }
    },
    'failedVersions': {
        'string': {
            'errorCode': 'ALREADY_EXISTS'|'MISMATCHED_REVISION'|'MISMATCHED_STATUS'|'NOT_ALLOWED'|'NOT_FOUND'|'SKIPPED',
            'errorMessage': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • successfulVersions (dict) --

      A list of PackageVersionError objects, one for each package version with a status that failed to update.

      • (string) --

        • (dict) --

          Contains the revision and status of a package version.

          • revision (string) --

            The revision of a package version.

          • status (string) --

            The status of a package version. Valid statuses are:

            • Published
            • Unfinished
            • Unlisted
            • Archived
            • Disposed
    • failedVersions (dict) --

      A list of SuccessfulPackageVersionInfo objects, one for each package version with a status that successfully updated.

      • (string) --

        • (dict) --

          An error associated with package.

          • errorCode (string) --

            The error code associated with the error. Valid error codes are:

            • ALREADY_EXISTS
            • MISMATCHED_REVISION
            • MISMATCHED_STATUS
            • NOT_ALLOWED
            • NOT_FOUND
            • SKIPPED
          • errorMessage (string) --

            The error message associated with the error.

Exceptions

update_repository(**kwargs)

Update the properties of a repository.

See also: AWS API Documentation

Request Syntax

response = client.update_repository(
    domain='string',
    domainOwner='string',
    repository='string',
    description='string',
    upstreams=[
        {
            'repositoryName': 'string'
        },
    ]
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain associated with the repository to update.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The name of the repository to update.

  • description (string) -- An updated repository description.
  • 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 .

Return type

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

      The updated repository.

      • 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 .

Exceptions

Client Exceptions

Client exceptions are available on a client instance via the exceptions property. For more detailed instructions and examples on the exact usage of client exceptions, see the error handling user guide.

The available client exceptions are:

class CodeArtifact.Client.exceptions.AccessDeniedException

The operation did not succeed because of an unauthorized access attempt.

Example

try:
  ...
except client.exceptions.AccessDeniedException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'message': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    The operation did not succeed because of an unauthorized access attempt.

    • message (string) --
    • Error (dict) -- Normalized access to common exception attributes.
      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class CodeArtifact.Client.exceptions.ConflictException

The operation did not succeed because prerequisites are not met.

Example

try:
  ...
except client.exceptions.ConflictException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'message': 'string',
    'resourceId': 'string',
    'resourceType': 'domain'|'repository'|'package'|'package-version'|'asset',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    The operation did not succeed because prerequisites are not met.

    • message (string) --

    • resourceId (string) --

      The ID of the resource.

    • resourceType (string) --

      The type of AWS resource.

    • Error (dict) -- Normalized access to common exception attributes.

      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class CodeArtifact.Client.exceptions.InternalServerException

The operation did not succeed because of an error that occurred inside AWS CodeArtifact.

Example

try:
  ...
except client.exceptions.InternalServerException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'message': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    The operation did not succeed because of an error that occurred inside AWS CodeArtifact.

    • message (string) --
    • Error (dict) -- Normalized access to common exception attributes.
      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class CodeArtifact.Client.exceptions.ResourceNotFoundException

The operation did not succeed because the resource requested is not found in the service.

Example

try:
  ...
except client.exceptions.ResourceNotFoundException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'message': 'string',
    'resourceId': 'string',
    'resourceType': 'domain'|'repository'|'package'|'package-version'|'asset',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    The operation did not succeed because the resource requested is not found in the service.

    • message (string) --

    • resourceId (string) --

      The ID of the resource.

    • resourceType (string) --

      The type of AWS resource.

    • Error (dict) -- Normalized access to common exception attributes.

      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class CodeArtifact.Client.exceptions.ServiceQuotaExceededException

The operation did not succeed because it would have exceeded a service limit for your account.

Example

try:
  ...
except client.exceptions.ServiceQuotaExceededException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'message': 'string',
    'resourceId': 'string',
    'resourceType': 'domain'|'repository'|'package'|'package-version'|'asset',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    The operation did not succeed because it would have exceeded a service limit for your account.

    • message (string) --

    • resourceId (string) --

      The ID of the resource.

    • resourceType (string) --

      The type of AWS resource.

    • Error (dict) -- Normalized access to common exception attributes.

      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class CodeArtifact.Client.exceptions.ThrottlingException

The operation did not succeed because too many requests are sent to the service.

Example

try:
  ...
except client.exceptions.ThrottlingException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'message': 'string',
    'retryAfterSeconds': 123,
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    The operation did not succeed because too many requests are sent to the service.

    • message (string) --

    • retryAfterSeconds (integer) --

      The time period, in seconds, to wait before retrying the request.

    • Error (dict) -- Normalized access to common exception attributes.

      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.
class CodeArtifact.Client.exceptions.ValidationException

The operation did not succeed because a parameter in the request was sent with an invalid value.

Example

try:
  ...
except client.exceptions.ValidationException as e:
  print(e.response)
response

The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.

Syntax

{
    'message': 'string',
    'reason': 'CANNOT_PARSE'|'ENCRYPTION_KEY_ERROR'|'FIELD_VALIDATION_FAILED'|'UNKNOWN_OPERATION'|'OTHER',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) --

    The operation did not succeed because a parameter in the request was sent with an invalid value.

    • message (string) --
    • reason (string) --
    • Error (dict) -- Normalized access to common exception attributes.
      • Code (string) -- An identifier specifying the exception type.
      • Message (string) -- A descriptive message explaining why the exception occured.

Paginators

The available paginators are:

class CodeArtifact.Paginator.ListDomains
paginator = client.get_paginator('list_domains')
paginate(**kwargs)

Creates an iterator that will paginate through responses from CodeArtifact.Client.list_domains().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
PaginationConfig (dict) --

A dictionary that provides parameters to control pagination.

  • MaxItems (integer) --

    The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

  • PageSize (integer) --

    The size of each page.

  • StartingToken (string) --

    A token to specify where to start paginating. This is the NextToken from a previous response.

Return type
dict
Returns
Response Syntax
{
    'domains': [
        {
            'name': 'string',
            'owner': 'string',
            'arn': 'string',
            'status': 'Active'|'Deleted',
            'createdTime': datetime(2015, 1, 1),
            'encryptionKey': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --
    • domains (list) --

      The returned list of `` DomainSummary `` objects.

      • (dict) --

        Information about a domain, including its name, Amazon Resource Name (ARN), and status. The ` ListDomains https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListDomains.html`__ operation returns a list of DomainSummary objects.

        • name (string) --

          The name of the domain.

        • owner (string) --

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

        • arn (string) --

          The ARN of the domain.

        • status (string) --

          A string that contains the status of the domain. The valid values are:

          • Active
          • Deleted
        • createdTime (datetime) --

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

        • encryptionKey (string) --

          The key used to encrypt the domain.

    • NextToken (string) --

      A token to resume pagination.

class CodeArtifact.Paginator.ListPackageVersionAssets
paginator = client.get_paginator('list_package_version_assets')
paginate(**kwargs)

Creates an iterator that will paginate through responses from CodeArtifact.Client.list_package_version_assets().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    domain='string',
    domainOwner='string',
    repository='string',
    format='npm'|'pypi'|'maven',
    namespace='string',
    package='string',
    packageVersion='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain that contains the repository associated with the package version assets.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The name of the repository that contains the package that contains the returned package version assets.

  • format (string) --

    [REQUIRED]

    The format of the package that contains the returned package version assets. The valid package types 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.
  • namespace (string) --

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId .
    • The namespace of an npm package is its scope .
    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
  • package (string) --

    [REQUIRED]

    The name of the package that contains the returned package version assets.

  • packageVersion (string) --

    [REQUIRED]

    A string that contains the package version (for example, 3.5.2 ).

  • PaginationConfig (dict) --

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'format': 'npm'|'pypi'|'maven',
    'namespace': 'string',
    'package': 'string',
    'version': 'string',
    'versionRevision': 'string',
    'assets': [
        {
            'name': 'string',
            'size': 123,
            'hashes': {
                'string': 'string'
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • format (string) --

      The format of the package that contains the returned package version assets.

    • namespace (string) --

      The namespace of the package. The package component that specifies its namespace depends on its type. For example:

      • The namespace of a Maven package is its groupId .
      • The namespace of an npm package is its scope .
      • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
    • package (string) --

      The name of the package that contains the returned package version assets.

    • version (string) --

      The version of the package associated with the returned assets.

    • versionRevision (string) --

      The current revision associated with the package version.

    • assets (list) --

      The returned list of ` AssetSummary https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_AssetSummary.html`__ objects.

      • (dict) --

        Contains details about a package version asset.

        • name (string) --

          The name of the asset.

        • size (integer) --

          The size of the asset.

        • hashes (dict) --

          The hashes of the asset.

          • (string) --
            • (string) --
    • NextToken (string) --

      A token to resume pagination.

class CodeArtifact.Paginator.ListPackageVersions
paginator = client.get_paginator('list_package_versions')
paginate(**kwargs)

Creates an iterator that will paginate through responses from CodeArtifact.Client.list_package_versions().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    domain='string',
    domainOwner='string',
    repository='string',
    format='npm'|'pypi'|'maven',
    namespace='string',
    package='string',
    status='Published'|'Unfinished'|'Unlisted'|'Archived'|'Disposed'|'Deleted',
    sortBy='PUBLISHED_TIME',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain that contains the repository that contains the returned package versions.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The name of the repository that contains the package.

  • format (string) --

    [REQUIRED]

    The format of the returned packages. The valid package types 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.
  • namespace (string) --

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId .
    • The namespace of an npm package is its scope .
    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
  • package (string) --

    [REQUIRED]

    The name of the package for which you want to return a list of package versions.

  • status (string) --

    A string that specifies the status of the package versions to include in the returned list. It can be one of the following:

    • Published
    • Unfinished
    • Unlisted
    • Archived
    • Disposed
  • sortBy (string) -- How to sort the returned list of package versions.
  • PaginationConfig (dict) --

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'defaultDisplayVersion': 'string',
    'format': 'npm'|'pypi'|'maven',
    'namespace': 'string',
    'package': 'string',
    'versions': [
        {
            'version': 'string',
            'revision': 'string',
            'status': 'Published'|'Unfinished'|'Unlisted'|'Archived'|'Disposed'|'Deleted'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • defaultDisplayVersion (string) --

      The default package version to display. This depends on the package format:

      • For Maven and PyPI packages, it's the most recently published package version.
      • For npm packages, it's the version referenced by the latest tag. If the latest tag is not set, it's the most recently published package version.
    • format (string) --

      A format of the package. Valid package format values are:

      • npm
      • pypi
      • maven
    • namespace (string) --

      The namespace of the package. The package component that specifies its namespace depends on its type. For example:

      • The namespace of a Maven package is its groupId .
      • The namespace of an npm package is its scope .
      • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
    • package (string) --

      The name of the package.

    • versions (list) --

      The returned list of ` PackageVersionSummary https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageVersionSummary.html`__ objects.

      • (dict) --

        Details about a package version, including its status, version, and revision. The ` ListPackageVersions https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListPackageVersions.html`__ operation returns a list of PackageVersionSummary objects.

        • version (string) --

          Information about a package version.

        • revision (string) --

          The revision associated with a package version.

        • status (string) --

          A string that contains the status of the package version. It can be one of the following:

          • Published
          • Unfinished
          • Unlisted
          • Archived
          • Disposed
    • NextToken (string) --

      A token to resume pagination.

class CodeArtifact.Paginator.ListPackages
paginator = client.get_paginator('list_packages')
paginate(**kwargs)

Creates an iterator that will paginate through responses from CodeArtifact.Client.list_packages().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    domain='string',
    domainOwner='string',
    repository='string',
    format='npm'|'pypi'|'maven',
    namespace='string',
    packagePrefix='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • domain (string) --

    [REQUIRED]

    The domain that contains the repository that contains the requested list of packages.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • repository (string) --

    [REQUIRED]

    The name of the repository from which packages are to be listed.

  • format (string) --

    The format of the packages. The valid package types 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.
  • namespace (string) --

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId .
    • The namespace of an npm package is its scope .
    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
  • packagePrefix (string) -- A prefix used to filter returned repositories. Only repositories with names that start with repositoryPrefix are returned.
  • PaginationConfig (dict) --

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'packages': [
        {
            'format': 'npm'|'pypi'|'maven',
            'namespace': 'string',
            'package': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • packages (list) --

      The list of returned ` PackageSummary https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageSummary.html`__ objects.

      • (dict) --

        Details about a package, including its format, namespace, and name. The ` ListPackages https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListPackages.html`__ operation returns a list of PackageSummary objects.

        • format (string) --

          The format of the package. Valid values are:

          • npm
          • pypi
          • maven
        • namespace (string) --

          The namespace of the package. The package component that specifies its namespace depends on its type. For example:

          • The namespace of a Maven package is its groupId .
          • The namespace of an npm package is its scope .
          • A Python package does not contain a corresponding component, so Python packages do not have a namespace.
        • package (string) --

          The name of the package.

    • NextToken (string) --

      A token to resume pagination.

class CodeArtifact.Paginator.ListRepositories
paginator = client.get_paginator('list_repositories')
paginate(**kwargs)

Creates an iterator that will paginate through responses from CodeArtifact.Client.list_repositories().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    repositoryPrefix='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • repositoryPrefix (string) -- A prefix used to filter returned repositories. Only repositories with names that start with repositoryPrefix are returned.
  • PaginationConfig (dict) --

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'repositories': [
        {
            'name': 'string',
            'administratorAccount': 'string',
            'domainName': 'string',
            'domainOwner': 'string',
            'arn': 'string',
            'description': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • repositories (list) --

      The returned list of ` RepositorySummary https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_RepositorySummary.html`__ objects.

      • (dict) --

        Details about a repository, including its Amazon Resource Name (ARN), description, and domain information. The ` ListRepositories https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListRepositories.html`__ operation returns a list of RepositorySummary objects.

        • name (string) --

          The name of the repository.

        • administratorAccount (string) --

          The AWS account ID 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. It does not include dashes or spaces.

        • arn (string) --

          The ARN of the repository.

        • description (string) --

          The description of the repository.

    • NextToken (string) --

      A token to resume pagination.

class CodeArtifact.Paginator.ListRepositoriesInDomain
paginator = client.get_paginator('list_repositories_in_domain')
paginate(**kwargs)

Creates an iterator that will paginate through responses from CodeArtifact.Client.list_repositories_in_domain().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    domain='string',
    domainOwner='string',
    administratorAccount='string',
    repositoryPrefix='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • domain (string) --

    [REQUIRED]

    The name of the domain that contains the returned list of repositories.

  • domainOwner (string) -- The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
  • administratorAccount (string) -- Filter the list of repositories to only include those that are managed by the AWS account ID.
  • repositoryPrefix (string) -- A prefix used to filter returned repositories. Only repositories with names that start with repositoryPrefix are returned.
  • PaginationConfig (dict) --

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'repositories': [
        {
            'name': 'string',
            'administratorAccount': 'string',
            'domainName': 'string',
            'domainOwner': 'string',
            'arn': 'string',
            'description': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • repositories (list) --

      The returned list of repositories.

      • (dict) --

        Details about a repository, including its Amazon Resource Name (ARN), description, and domain information. The ` ListRepositories https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_ListRepositories.html`__ operation returns a list of RepositorySummary objects.

        • name (string) --

          The name of the repository.

        • administratorAccount (string) --

          The AWS account ID 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. It does not include dashes or spaces.

        • arn (string) --

          The ARN of the repository.

        • description (string) --

          The description of the repository.

    • NextToken (string) --

      A token to resume pagination.