delete_package
async
¶
delete_package(
domain: DomainName,
repository: RepositoryName,
format: PackageFormat,
package: PackageName,
*,
config_overrides: Optional[AsynccodeartifactClientConfig] = None,
domain_owner: Optional[AccountId] = None,
namespace: Optional[PackageNamespace] = None,
) -> DeletePackageResult
Deletes a package and all associated package versions. A deleted package cannot be restored. To delete one or more package versions, use the DeletePackageVersions API.
Parameters:
-
domain(DomainName) –The name of the domain that contains the package to delete.
-
domain_owner(Optional[AccountId], default:None) –The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.
-
repository(RepositoryName) –The name of the repository that contains the package to delete.
-
format(PackageFormat) –The format of the requested package to delete.
-
namespace(Optional[PackageNamespace], default:None) –The namespace of the package to delete. The package component that specifies its namespace depends on its type. For example:
The namespace is required when deleting packages 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(PackageName) –The name of the package to delete.
Raises:
-
AccessDeniedException–The operation did not succeed because of an unauthorized access attempt.
-
ConflictException–The operation did not succeed because prerequisites are not met.
-
InternalServerException–The operation did not succeed because of an error that occurred inside CodeArtifact.
-
ResourceNotFoundException–The operation did not succeed because the resource requested is not found in the service.
-
ThrottlingException–The operation did not succeed because too many requests are sent to the service.
-
ValidationException–The operation did not succeed because a parameter in the request was sent with an invalid value.
-
UnknownServiceError–The service returned an error code this client does not model.