CodeArtifact / Client / get_package_version_asset

get_package_version_asset#

CodeArtifact.Client.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'|'nuget'|'generic'|'swift',
    namespace='string',
    package='string',
    packageVersion='string',
    asset='string',
    packageVersionRevision='string'
)
Parameters:
  • domain (string) –

    [REQUIRED]

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

  • domainOwner (string) – The 12-digit account number of the Amazon Web Services 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.

  • namespace (string) –

    The namespace of the package version with the requested asset file. The package version component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package version is its groupId.

    • The namespace of an npm package version is its scope.

    • Python and NuGet package versions do not contain a corresponding component, package versions of those formats do not have a namespace.

    • The namespace of a generic package is its 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

  • CodeArtifact.Client.exceptions.AccessDeniedException

  • CodeArtifact.Client.exceptions.InternalServerException

  • CodeArtifact.Client.exceptions.ResourceNotFoundException

  • CodeArtifact.Client.exceptions.ThrottlingException

  • CodeArtifact.Client.exceptions.ValidationException

  • CodeArtifact.Client.exceptions.ConflictException