Skip to main content

repositories

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

Overview

Namerepositories
TypeResource
Idgoogle.artifactregistry.repositories

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringThe name of the repository, for example: projects/p1/locations/us-central1/repositories/repo1. For each location in a project, repository names must be unique.
cleanupPoliciesobjectOptional. Cleanup policies for this repository. Cleanup policies indicate when certain package versions can be automatically deleted. Map keys are policy IDs supplied by users during policy creation. They must unique within a repository and be under 128 characters in length.
cleanupPolicyDryRunbooleanOptional. If true, the cleanup pipeline is prevented from deleting versions in this repository.
createTimestring (google-datetime)Output only. The time when the repository was created.
descriptionstringThe user-provided description of the repository.
disallowUnspecifiedModebooleanOptional. If this is true, an unspecified repo type will be treated as error rather than defaulting to standard.
dockerConfigobjectDocker repository config contains repository level configuration for the repositories of docker type. (id: DockerRepositoryConfig)
formatstringOptional. The format of packages that are stored in the repository.
kmsKeyNamestringThe Cloud KMS resource name of the customer managed encryption key that's used to encrypt the contents of the Repository. Has the form: projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key. This value may not be changed after the Repository has been created.
labelsobjectLabels with user-defined metadata. This field may contain up to 64 entries. Label keys and values may be no longer than 63 characters. Label keys must begin with a lowercase letter and may only contain lowercase letters, numeric characters, underscores, and dashes.
mavenConfigobjectMaven repository config contains repository level configuration for the repositories of maven type. (id: MavenRepositoryConfig)
modestringOptional. The mode of the repository.
registryUristringOutput only. The repository endpoint, for example: us-docker.pkg.dev/my-proj/my-repo.
remoteRepositoryConfigobjectConfiguration specific for a Remote Repository. (id: RemoteRepositoryConfig)
satisfiesPzibooleanOutput only. Whether or not this repository satisfies PZI.
satisfiesPzsbooleanOutput only. Whether or not this repository satisfies PZS.
sizeBytesstring (int64)Output only. The size, in bytes, of all artifact storage in this repository. Repositories that are generally available or in public preview use this to calculate storage costs.
updateTimestring (google-datetime)Output only. The time when the repository was last updated.
virtualRepositoryConfigobjectConfiguration specific for a Virtual Repository. (id: VirtualRepositoryConfig)
vulnerabilityScanningConfigobjectOptional. Config and state for vulnerability scanning of resources within this Repository. (id: VulnerabilityScanningConfig)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, repositoriesIdGets a repository.
listselectprojectsId, locationsIdpageSize, pageToken, filter, orderByLists repositories.
createinsertprojectsId, locationsIdrepositoryIdCreates a repository. The returned Operation will finish once the repository has been created. Its response will be the created Repository.
patchupdateprojectsId, locationsId, repositoriesIdupdateMaskUpdates a repository.
deletedeleteprojectsId, locationsId, repositoriesIdDeletes a repository and all of its contents. The returned Operation will finish once the repository has been deleted. It will not have any Operation metadata and will return a google.protobuf.Empty response.

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
projectsIdstring
repositoriesIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
repositoryIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets a repository.

SELECT
name,
cleanupPolicies,
cleanupPolicyDryRun,
createTime,
description,
disallowUnspecifiedMode,
dockerConfig,
format,
kmsKeyName,
labels,
mavenConfig,
mode,
registryUri,
remoteRepositoryConfig,
satisfiesPzi,
satisfiesPzs,
sizeBytes,
updateTime,
virtualRepositoryConfig,
vulnerabilityScanningConfig
FROM google.artifactregistry.repositories
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND repositoriesId = '{{ repositoriesId }}' -- required;

INSERT examples

Creates a repository. The returned Operation will finish once the repository has been created. Its response will be the created Repository.

INSERT INTO google.artifactregistry.repositories (
data__mavenConfig,
data__dockerConfig,
data__virtualRepositoryConfig,
data__remoteRepositoryConfig,
data__name,
data__format,
data__description,
data__labels,
data__kmsKeyName,
data__mode,
data__cleanupPolicies,
data__cleanupPolicyDryRun,
data__vulnerabilityScanningConfig,
data__disallowUnspecifiedMode,
projectsId,
locationsId,
repositoryId
)
SELECT
'{{ mavenConfig }}',
'{{ dockerConfig }}',
'{{ virtualRepositoryConfig }}',
'{{ remoteRepositoryConfig }}',
'{{ name }}',
'{{ format }}',
'{{ description }}',
'{{ labels }}',
'{{ kmsKeyName }}',
'{{ mode }}',
'{{ cleanupPolicies }}',
{{ cleanupPolicyDryRun }},
'{{ vulnerabilityScanningConfig }}',
{{ disallowUnspecifiedMode }},
'{{ projectsId }}',
'{{ locationsId }}',
'{{ repositoryId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates a repository.

UPDATE google.artifactregistry.repositories
SET
data__mavenConfig = '{{ mavenConfig }}',
data__dockerConfig = '{{ dockerConfig }}',
data__virtualRepositoryConfig = '{{ virtualRepositoryConfig }}',
data__remoteRepositoryConfig = '{{ remoteRepositoryConfig }}',
data__name = '{{ name }}',
data__format = '{{ format }}',
data__description = '{{ description }}',
data__labels = '{{ labels }}',
data__kmsKeyName = '{{ kmsKeyName }}',
data__mode = '{{ mode }}',
data__cleanupPolicies = '{{ cleanupPolicies }}',
data__cleanupPolicyDryRun = {{ cleanupPolicyDryRun }},
data__vulnerabilityScanningConfig = '{{ vulnerabilityScanningConfig }}',
data__disallowUnspecifiedMode = {{ disallowUnspecifiedMode }}
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND repositoriesId = '{{ repositoriesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
cleanupPolicies,
cleanupPolicyDryRun,
createTime,
description,
disallowUnspecifiedMode,
dockerConfig,
format,
kmsKeyName,
labels,
mavenConfig,
mode,
registryUri,
remoteRepositoryConfig,
satisfiesPzi,
satisfiesPzs,
sizeBytes,
updateTime,
virtualRepositoryConfig,
vulnerabilityScanningConfig;

DELETE examples

Deletes a repository and all of its contents. The returned Operation will finish once the repository has been deleted. It will not have any Operation metadata and will return a google.protobuf.Empty response.

DELETE FROM google.artifactregistry.repositories
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND repositoriesId = '{{ repositoriesId }}' --required;