CodeArtifact / Client / delete_package

delete_package#

CodeArtifact.Client.delete_package(**kwargs)#

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.

See also: AWS API Documentation

Request Syntax

response = client.delete_package(
    domain='string',
    domainOwner='string',
    repository='string',
    format='npm'|'pypi'|'maven'|'nuget'|'generic'|'ruby'|'swift'|'cargo',
    namespace='string',
    package='string'
)
Parameters:
  • domain (string) –

    [REQUIRED]

    The name of the domain that contains the package to delete.

  • 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 to delete.

  • format (string) –

    [REQUIRED]

    The format of the requested package to delete.

  • namespace (string) –

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

    Note

    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 (string) –

    [REQUIRED]

    The name of the package to delete.

Return type:

dict

Returns:

Response Syntax

{
    'deletedPackage': {
        'format': 'npm'|'pypi'|'maven'|'nuget'|'generic'|'ruby'|'swift'|'cargo',
        'namespace': 'string',
        'package': 'string',
        'originConfiguration': {
            'restrictions': {
                'publish': 'ALLOW'|'BLOCK',
                'upstream': 'ALLOW'|'BLOCK'
            }
        }
    }
}

Response Structure

  • (dict) –

    • deletedPackage (dict) –

      Details about a package, including its format, namespace, and name.

      • format (string) –

        The format of the package.

      • namespace (string) –

        The namespace of the package. The package 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 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) –

        The name of the package.

      • originConfiguration (dict) –

        A PackageOriginConfiguration object that contains a PackageOriginRestrictions object that contains information about the upstream and publish package origin restrictions.

        • restrictions (dict) –

          A PackageOriginRestrictions object that contains information about the upstream and publish package origin configuration for the package.

          • publish (string) –

            The package origin configuration that determines if new versions of the package can be published directly to the repository.

          • upstream (string) –

            The package origin configuration that determines if new versions of the package can be added to the repository from an external connection or upstream source.

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