CodeArtifact / Client / dispose_package_versions

dispose_package_versions#

CodeArtifact.Client.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 ListPackageVersions and set the status parameter to Disposed.

To view information about a disposed package version, use DescribePackageVersion.

See also: AWS API Documentation

Request Syntax

response = client.dispose_package_versions(
    domain='string',
    domainOwner='string',
    repository='string',
    format='npm'|'pypi'|'maven'|'nuget'|'generic'|'ruby'|'swift'|'cargo',
    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 Amazon Web Services 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.

  • namespace (string) –

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

    Note

    The namespace is required when disposing package versions of the following formats:

    • Maven

    • Swift

    • generic

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

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

    • The namespace of a generic package is its namespace.

    • Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of those formats 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.

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.

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

          l 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