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'|'nuget',
namespace='string',
package='string',
versions=[
'string',
],
expectedStatus='Published'|'Unfinished'|'Unlisted'|'Archived'|'Disposed'|'Deleted'
)
[REQUIRED]
The name of the domain that contains the package to delete.
[REQUIRED]
The name of the repository that contains the package versions to delete.
[REQUIRED]
The format of the package versions to delete.
The namespace of the package versions to be deleted. The package version component that specifies its namespace depends on its type. For example:
groupId
. The namespace is required when deleting Maven package versions.scope
.[REQUIRED]
The name of the package with the versions to delete.
[REQUIRED]
An array of strings that specify the versions of the package to delete.
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 deleted. The status of every successful version will be 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.
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) --
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