Skip to main content

versions

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

Overview

Nameversions
TypeResource
Idgoogle.artifactregistry.versions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the version, for example: projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1. If the package or version ID parts contain slashes, the slashes are escaped.
annotationsobjectOptional. Client specified annotations.
createTimestring (google-datetime)The time when the version was created.
descriptionstringOptional. Description of the version, as specified in its metadata.
fingerprintsarrayOutput only. Immutable reference for the version, calculated based on the version's content. Currently we only support dirsum_sha256 hash algorithm. Additional hash algorithms may be added in the future.
metadataobjectOutput only. Repository-specific Metadata stored against this version. The fields returned are defined by the underlying repository-specific resource. Currently, the resources could be: DockerImage MavenArtifact
relatedTagsarrayOutput only. A list of related tags. Will contain up to 100 tags that reference this version.
updateTimestring (google-datetime)The time when the version was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, repositoriesId, packagesId, versionsIdviewGets a version
listselectprojectsId, locationsId, repositoriesId, packagesIdfilter, view, pageToken, orderBy, pageSizeLists versions.
patchupdateprojectsId, locationsId, repositoriesId, packagesId, versionsIdupdateMaskUpdates a version.
deletedeleteprojectsId, locationsId, repositoriesId, packagesId, versionsIdforceDeletes a version and all of its content. The returned operation will complete once the version has been deleted.
batch_deletedeleteprojectsId, locationsId, repositoriesId, packagesIdDeletes multiple versions across a repository. The returned operation will complete once the versions have been deleted.

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
locationsIdstring
packagesIdstring
projectsIdstring
repositoriesIdstring
versionsIdstring
filterstring
forceboolean
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)
viewstring

SELECT examples

Gets a version

SELECT
name,
annotations,
createTime,
description,
fingerprints,
metadata,
relatedTags,
updateTime
FROM google.artifactregistry.versions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND repositoriesId = '{{ repositoriesId }}' -- required
AND packagesId = '{{ packagesId }}' -- required
AND versionsId = '{{ versionsId }}' -- required
AND view = '{{ view }}'
;

UPDATE examples

Updates a version.

UPDATE google.artifactregistry.versions
SET
data__createTime = '{{ createTime }}',
data__name = '{{ name }}',
data__description = '{{ description }}',
data__updateTime = '{{ updateTime }}',
data__relatedTags = '{{ relatedTags }}',
data__annotations = '{{ annotations }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND repositoriesId = '{{ repositoriesId }}' --required
AND packagesId = '{{ packagesId }}' --required
AND versionsId = '{{ versionsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
annotations,
createTime,
description,
fingerprints,
metadata,
relatedTags,
updateTime;

DELETE examples

Deletes a version and all of its content. The returned operation will complete once the version has been deleted.

DELETE FROM google.artifactregistry.versions
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND repositoriesId = '{{ repositoriesId }}' --required
AND packagesId = '{{ packagesId }}' --required
AND versionsId = '{{ versionsId }}' --required
AND force = '{{ force }}'
;