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',
namespace='string',
package='string',
versions=[
'string',
],
versionRevisions={
'string': 'string'
},
expectedStatus='Published'|'Unfinished'|'Unlisted'|'Archived'|'Disposed'|'Deleted'
)
[REQUIRED]
The name of the domain that contains the repository you want to dispose.
[REQUIRED]
The name of the repository that contains the package versions you want to dispose.
[REQUIRED]
A format that specifies the type of package versions you want to dispose.
The namespace of the package versions to be disposed. The package version component that specifies its namespace depends on its type. For example:
groupId
.scope
.namespace
.[REQUIRED]
The name of the package with the versions you want to dispose.
[REQUIRED]
The versions of the package you want to dispose.
The revisions of the package versions you want to dispose.
dict
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
CodeArtifact.Client.exceptions.AccessDeniedException
CodeArtifact.Client.exceptions.ConflictException
CodeArtifact.Client.exceptions.InternalServerException
CodeArtifact.Client.exceptions.ResourceNotFoundException
CodeArtifact.Client.exceptions.ThrottlingException
CodeArtifact.Client.exceptions.ValidationException