Skip to main content

packages

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

Overview

Namepackages
TypeResource
Idgoogle.artifactregistry.packages

Fields

NameDatatypeDescription
namestringThe name of the package, for example: projects/p1/locations/us-central1/repositories/repo1/packages/pkg1. If the package ID part contains slashes, the slashes are escaped.
annotationsobjectOptional. Client specified annotations.
createTimestringThe time when the package was created.
displayNamestringThe display name of the package.
updateTimestringThe time when the package was last updated. This includes publishing a new version of the package.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, packagesId, projectsId, repositoriesIdGets a package.
listSELECTlocationsId, projectsId, repositoriesIdLists packages.
deleteDELETElocationsId, packagesId, projectsId, repositoriesIdDeletes a package and all of its versions and tags. The returned operation will complete once the package has been deleted.
patchUPDATElocationsId, packagesId, projectsId, repositoriesIdUpdates a package.

SELECT examples

Lists packages.

SELECT
name,
annotations,
createTime,
displayName,
updateTime
FROM google.artifactregistry.packages
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND repositoriesId = '{{ repositoriesId }}';

UPDATE example

Updates a packages resource.

/*+ update */
UPDATE google.artifactregistry.packages
SET
name = '{{ name }}',
displayName = '{{ displayName }}',
annotations = '{{ annotations }}'
WHERE
locationsId = '{{ locationsId }}'
AND packagesId = '{{ packagesId }}'
AND projectsId = '{{ projectsId }}'
AND repositoriesId = '{{ repositoriesId }}';

DELETE example

Deletes the specified packages resource.

/*+ delete */
DELETE FROM google.artifactregistry.packages
WHERE locationsId = '{{ locationsId }}'
AND packagesId = '{{ packagesId }}'
AND projectsId = '{{ projectsId }}'
AND repositoriesId = '{{ repositoriesId }}';