Skip to main content

package_versions

Creates, updates, deletes, gets or lists a package_versions resource.

Overview

Namepackage_versions
TypeResource
Idaws.codeartifact.package_versions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
display_namestringThe name of the package that is displayed. The displayName varies depending on the package version's format. For example, if an npm package is named ui, is in the namespace vue, and has the format npm, then the displayName is @vue/ui.
format_stringThe format of the package version. (npm, pypi, maven, nuget, generic, ruby, swift, cargo)
home_pagestringThe homepage associated with the package.
licensesarrayInformation about licenses associated with the package version.
namespacestringThe namespace of the package version. 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. (pattern: <code>[^#/\s]+</code>)
originobjectA PackageVersionOrigin object that contains information about how the package version was added to the repository.
package_namestringThe name of the requested package. (pattern: <code>[^#/\s]+</code>)
published_timestring (date-time)A timestamp that contains the date and time the package version was published.
revisionstringThe revision of the package version. (pattern: <code>\S+</code>)
source_code_repositorystringThe repository for the source code in the package version, or the source code used to build it.
statusstringA string that contains the status of the package version. (Published, Unfinished, Unlisted, Archived, Disposed, Deleted)
summarystringA summary of the package version. The summary is extracted from the package. The information in and detail level of the summary depends on the package version's format.
versionstringThe version of the package. (pattern: <code>[^#/\s]+</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_package_versionselectdomain, repository, format, package, version, regiondomain-owner, namespaceReturns a PackageVersionDescription object that contains information about the requested package version.
list_package_versionsselectdomain, repository, format, package, regiondomain-owner, namespace, status, sortBy, max-results, next-token, originTypeReturns a list of PackageVersionSummary objects for package versions in a repository that match the request parameters. Package versions of all statuses will be returned by default when calling list-package-versions with no --status parameter.
update_package_versions_statusupdatedomain, repository, format, package, region, versions, targetStatusdomain-owner, namespaceUpdates the status of one or more versions of a package. Using UpdatePackageVersionsStatus, you can update the status of package versions to Archived, Published, or Unlisted. To set the status of a package version to Disposed, use DisposePackageVersions.
delete_package_versionsdeletedomain, repository, format, package, regiondomain-owner, namespaceDeletes 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, ListPackageVersions), but you can restore them using UpdatePackageVersionsStatus.
copy_package_versionsexecdomain, source-repository, destination-repository, format, package, regiondomain-owner, namespaceCopies package versions from one repository to another repository in the same domain. You must specify versions or versionRevisions. You cannot specify both.
dispose_package_versionsexecdomain, repository, format, package, region, versionsdomain-owner, namespaceDeletes 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.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
destination-repositorystringThe name of the repository into which package versions are copied.
domainstringThe name of the domain that contains the repository you want to dispose.
formatstringA format that specifies the type of package versions you want to dispose.
packagestringThe name of the package with the versions you want to dispose.
regionstringAWS region (default: us-east-1)
repositorystringThe name of the repository that contains the package versions you want to dispose.
source-repositorystringThe name of the repository that contains the package versions to be copied.
versionstringA string that contains the package version (for example, 3.5.2).
domain-ownerstringThe 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.
max-resultsintegerThe maximum number of results to return per page.
namespacestringThe namespace of the package versions to be disposed. The package component that specifies its namespace depends on its type. For example: 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.
next-tokenstringThe token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
originTypestringThe originType used to filter package versions. Only package versions with the provided originType will be returned.
sortBystringHow to sort the requested list of package versions.
statusstringA string that filters the requested package versions by status.

SELECT examples

Returns a PackageVersionDescription object that contains information about the requested package version.

SELECT
display_name,
format_,
home_page,
licenses,
namespace,
origin,
package_name,
published_time,
revision,
source_code_repository,
status,
summary,
version
FROM aws.codeartifact.package_versions
WHERE domain = '{{ domain }}' -- required
AND repository = '{{ repository }}' -- required
AND format = '{{ format }}' -- required
AND package = '{{ package }}' -- required
AND version = '{{ version }}' -- required
AND region = '{{ region }}' -- required
AND `domain-owner` = '{{ domain-owner }}'
AND namespace = '{{ namespace }}'
;

UPDATE examples

Updates the status of one or more versions of a package. Using UpdatePackageVersionsStatus, you can update the status of package versions to Archived, Published, or Unlisted. To set the status of a package version to Disposed, use DisposePackageVersions.

UPDATE aws.codeartifact.package_versions
SET
versions = '{{ versions }}',
versionRevisions = '{{ versionRevisions }}',
expectedStatus = '{{ expectedStatus }}',
targetStatus = '{{ targetStatus }}'
WHERE
domain = '{{ domain }}' --required
AND repository = '{{ repository }}' --required
AND format = '{{ format }}' --required
AND package = '{{ package }}' --required
AND region = '{{ region }}' --required
AND versions = '{{ versions }}' --required
AND targetStatus = '{{ targetStatus }}' --required
AND `domain-owner` = '{{ domain-owner}}'
AND namespace = '{{ namespace}}'
RETURNING
failed_versions,
successful_versions;

DELETE examples

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, ListPackageVersions), but you can restore them using UpdatePackageVersionsStatus.

DELETE FROM aws.codeartifact.package_versions
WHERE domain = '{{ domain }}' --required
AND repository = '{{ repository }}' --required
AND format = '{{ format }}' --required
AND package = '{{ package }}' --required
AND region = '{{ region }}' --required
AND `domain-owner` = '{{ domain-owner }}'
AND namespace = '{{ namespace }}'
;

Lifecycle Methods

Copies package versions from one repository to another repository in the same domain. You must specify versions or versionRevisions. You cannot specify both.

EXEC aws.codeartifact.package_versions.copy_package_versions
@domain='{{ domain }}' --required,
@source-repository='{{ source-repository }}' --required,
@destination-repository='{{ destination-repository }}' --required,
@format='{{ format }}' --required,
@package='{{ package }}' --required,
@region='{{ region }}' --required,
@domain-owner='{{ domain-owner }}',
@namespace='{{ namespace }}'
@@json=
'{
"versions": "{{ versions }}",
"versionRevisions": "{{ versionRevisions }}",
"allowOverwrite": {{ allowOverwrite }},
"includeFromUpstream": {{ includeFromUpstream }}
}'
;