Skip to main content

repositories

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

Overview

Namerepositories
TypeResource
Idgoogle.artifactregistry.repositories

Fields

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.
descriptionstringThe user-provided description of the repository.
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.
createTimestringOutput only. The time when the repository was created.
disallowUnspecifiedModebooleanOptional. If this is true, an unspecified repo type will be treated as error rather than defaulting to standard.
dockerConfigobjectDockerRepositoryConfig is docker related repository details. Provides additional configuration details for repositories of the docker format type.
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.
mavenConfigobjectMavenRepositoryConfig is maven related repository details. Provides additional configuration details for repositories of the maven format type.
modestringOptional. The mode of the repository.
remoteRepositoryConfigobjectRemote repository configuration.
satisfiesPzibooleanOutput only. If set, the repository satisfies physical zone isolation.
satisfiesPzsbooleanOutput only. If set, the repository satisfies physical zone separation.
sizeBytesstringOutput 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.
updateTimestringOutput only. The time when the repository was last updated.
virtualRepositoryConfigobjectVirtual repository configuration.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, projectsId, repositoriesIdGets a repository.
listSELECTlocationsId, projectsIdLists repositories.
createINSERTlocationsId, projectsIdCreates a repository. The returned Operation will finish once the repository has been created. Its response will be the created Repository.
deleteDELETElocationsId, projectsId, 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.
patchUPDATElocationsId, projectsId, repositoriesIdUpdates a repository.

SELECT examples

Lists repositories.

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

INSERT example

Use the following StackQL query and manifest file to create a new repositories resource.

/*+ create */
INSERT INTO google.artifactregistry.repositories (
locationsId,
projectsId,
mavenConfig,
dockerConfig,
virtualRepositoryConfig,
remoteRepositoryConfig,
name,
format,
description,
labels,
kmsKeyName,
mode,
cleanupPolicies,
cleanupPolicyDryRun,
disallowUnspecifiedMode
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ mavenConfig }}',
'{{ dockerConfig }}',
'{{ virtualRepositoryConfig }}',
'{{ remoteRepositoryConfig }}',
'{{ name }}',
'{{ format }}',
'{{ description }}',
'{{ labels }}',
'{{ kmsKeyName }}',
'{{ mode }}',
'{{ cleanupPolicies }}',
{{ cleanupPolicyDryRun }},
{{ disallowUnspecifiedMode }}
;

UPDATE example

Updates a repositories resource.

/*+ update */
UPDATE google.artifactregistry.repositories
SET
mavenConfig = '{{ mavenConfig }}',
dockerConfig = '{{ dockerConfig }}',
virtualRepositoryConfig = '{{ virtualRepositoryConfig }}',
remoteRepositoryConfig = '{{ remoteRepositoryConfig }}',
name = '{{ name }}',
format = '{{ format }}',
description = '{{ description }}',
labels = '{{ labels }}',
kmsKeyName = '{{ kmsKeyName }}',
mode = '{{ mode }}',
cleanupPolicies = '{{ cleanupPolicies }}',
cleanupPolicyDryRun = true|false,
disallowUnspecifiedMode = true|false
WHERE
locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND repositoriesId = '{{ repositoriesId }}';

DELETE example

Deletes the specified repositories resource.

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