repositories
Creates, updates, deletes, gets or lists a repositories resource.
Overview
| Name | repositories |
| Type | Resource |
| Id | google.artifactregistry.repositories |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the repository, for example: projects/p1/locations/us-central1/repositories/repo1. For each location in a project, repository names must be unique. |
cleanupPolicies | object | Optional. 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. |
cleanupPolicyDryRun | boolean | Optional. If true, the cleanup pipeline is prevented from deleting versions in this repository. |
createTime | string (google-datetime) | Output only. The time when the repository was created. |
description | string | The user-provided description of the repository. |
disallowUnspecifiedMode | boolean | Optional. If this is true, an unspecified repo type will be treated as error rather than defaulting to standard. |
dockerConfig | object | Docker repository config contains repository level configuration for the repositories of docker type. (id: DockerRepositoryConfig) |
format | string | Optional. The format of packages that are stored in the repository. (FORMAT_UNSPECIFIED, DOCKER, MAVEN, NPM, APT, YUM, GOOGET, PYTHON, KFP, GO, GENERIC, RUBY) |
kmsKeyName | string | The 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. |
labels | object | Labels 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. |
mavenConfig | object | Maven repository config contains repository level configuration for the repositories of maven type. (id: MavenRepositoryConfig) |
mode | string | Optional. The mode of the repository. (MODE_UNSPECIFIED, STANDARD_REPOSITORY, VIRTUAL_REPOSITORY, REMOTE_REPOSITORY, AOSS_REPOSITORY, ASSURED_OSS_REPOSITORY) |
platformLogsConfig | object | Optional. Configuration for platform logs. (id: PlatformLogsConfig) |
registryUri | string | Output only. The repository endpoint, for example: us-docker.pkg.dev/my-proj/my-repo. |
remoteRepositoryConfig | object | Configuration specific for a Remote Repository. (id: RemoteRepositoryConfig) |
satisfiesPzi | boolean | Output only. Whether or not this repository satisfies PZI. |
satisfiesPzs | boolean | Output only. Whether or not this repository satisfies PZS. |
sizeBytes | string (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. |
updateTime | string (google-datetime) | Output only. The time when the repository was last updated. |
virtualRepositoryConfig | object | Configuration specific for a Virtual Repository. (id: VirtualRepositoryConfig) |
vulnerabilityScanningConfig | object | Optional. Config and state for vulnerability scanning of resources within this Repository. (id: VulnerabilityScanningConfig) |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the repository, for example: projects/p1/locations/us-central1/repositories/repo1. For each location in a project, repository names must be unique. |
cleanupPolicies | object | Optional. 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. |
cleanupPolicyDryRun | boolean | Optional. If true, the cleanup pipeline is prevented from deleting versions in this repository. |
createTime | string (google-datetime) | Output only. The time when the repository was created. |
description | string | The user-provided description of the repository. |
disallowUnspecifiedMode | boolean | Optional. If this is true, an unspecified repo type will be treated as error rather than defaulting to standard. |
dockerConfig | object | Docker repository config contains repository level configuration for the repositories of docker type. (id: DockerRepositoryConfig) |
format | string | Optional. The format of packages that are stored in the repository. (FORMAT_UNSPECIFIED, DOCKER, MAVEN, NPM, APT, YUM, GOOGET, PYTHON, KFP, GO, GENERIC, RUBY) |
kmsKeyName | string | The 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. |
labels | object | Labels 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. |
mavenConfig | object | Maven repository config contains repository level configuration for the repositories of maven type. (id: MavenRepositoryConfig) |
mode | string | Optional. The mode of the repository. (MODE_UNSPECIFIED, STANDARD_REPOSITORY, VIRTUAL_REPOSITORY, REMOTE_REPOSITORY, AOSS_REPOSITORY, ASSURED_OSS_REPOSITORY) |
platformLogsConfig | object | Optional. Configuration for platform logs. (id: PlatformLogsConfig) |
registryUri | string | Output only. The repository endpoint, for example: us-docker.pkg.dev/my-proj/my-repo. |
remoteRepositoryConfig | object | Configuration specific for a Remote Repository. (id: RemoteRepositoryConfig) |
satisfiesPzi | boolean | Output only. Whether or not this repository satisfies PZI. |
satisfiesPzs | boolean | Output only. Whether or not this repository satisfies PZS. |
sizeBytes | string (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. |
updateTime | string (google-datetime) | Output only. The time when the repository was last updated. |
virtualRepositoryConfig | object | Configuration specific for a Virtual Repository. (id: VirtualRepositoryConfig) |
vulnerabilityScanningConfig | object | Optional. Config and state for vulnerability scanning of resources within this Repository. (id: VulnerabilityScanningConfig) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | projectsId, locationsId, repositoriesId | Gets a repository. | |
list | select | projectsId, locationsId | pageSize, pageToken, orderBy, filter | Lists repositories. |
create | insert | projectsId, locationsId | repositoryId | Creates a repository. The returned Operation will finish once the repository has been created. Its response will be the created Repository. |
patch | update | projectsId, locationsId, repositoriesId | updateMask | Updates a repository. |
delete | delete | projectsId, locationsId, repositoriesId | 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. | |
prewarm_artifact | exec | projectsId, locationsId, repositoriesId | Prewarms an artifact for streaming. | |
export_artifact | exec | projectsId, locationsId, repositoriesId | Exports an artifact to a Cloud Storage bucket. | |
check_prewarmed_artifact | exec | projectsId, locationsId, repositoriesId | Checks an artifact streaming. |
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.
| Name | Datatype | Description |
|---|---|---|
locationsId | string | |
projectsId | string | |
repositoriesId | string | |
filter | string | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
repositoryId | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- get
- list
Gets a repository.
SELECT
name,
cleanupPolicies,
cleanupPolicyDryRun,
createTime,
description,
disallowUnspecifiedMode,
dockerConfig,
format,
kmsKeyName,
labels,
mavenConfig,
mode,
platformLogsConfig,
registryUri,
remoteRepositoryConfig,
satisfiesPzi,
satisfiesPzs,
sizeBytes,
updateTime,
virtualRepositoryConfig,
vulnerabilityScanningConfig
FROM google.artifactregistry.repositories
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND repositoriesId = '{{ repositoriesId }}' -- required
;
Lists repositories.
SELECT
name,
cleanupPolicies,
cleanupPolicyDryRun,
createTime,
description,
disallowUnspecifiedMode,
dockerConfig,
format,
kmsKeyName,
labels,
mavenConfig,
mode,
platformLogsConfig,
registryUri,
remoteRepositoryConfig,
satisfiesPzi,
satisfiesPzs,
sizeBytes,
updateTime,
virtualRepositoryConfig,
vulnerabilityScanningConfig
FROM google.artifactregistry.repositories
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}'
AND orderBy = '{{ orderBy }}'
AND filter = '{{ filter }}'
;
INSERT examples
- create
- Manifest
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__format,
data__labels,
data__mode,
data__disallowUnspecifiedMode,
data__description,
data__virtualRepositoryConfig,
data__platformLogsConfig,
data__remoteRepositoryConfig,
data__name,
data__kmsKeyName,
data__cleanupPolicyDryRun,
data__dockerConfig,
data__cleanupPolicies,
data__vulnerabilityScanningConfig,
projectsId,
locationsId,
repositoryId
)
SELECT
'{{ mavenConfig }}',
'{{ format }}',
'{{ labels }}',
'{{ mode }}',
{{ disallowUnspecifiedMode }},
'{{ description }}',
'{{ virtualRepositoryConfig }}',
'{{ platformLogsConfig }}',
'{{ remoteRepositoryConfig }}',
'{{ name }}',
'{{ kmsKeyName }}',
{{ cleanupPolicyDryRun }},
'{{ dockerConfig }}',
'{{ cleanupPolicies }}',
'{{ vulnerabilityScanningConfig }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ repositoryId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: repositories
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the repositories resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the repositories resource.
- name: mavenConfig
description: |
Maven repository config contains repository level configuration for the repositories of maven type.
value:
allowSnapshotOverwrites: {{ allowSnapshotOverwrites }}
versionPolicy: "{{ versionPolicy }}"
- name: format
value: "{{ format }}"
description: |
Optional. The format of packages that are stored in the repository.
valid_values: ['FORMAT_UNSPECIFIED', 'DOCKER', 'MAVEN', 'NPM', 'APT', 'YUM', 'GOOGET', 'PYTHON', 'KFP', 'GO', 'GENERIC', 'RUBY']
- name: labels
value: "{{ labels }}"
description: |
Labels 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.
- name: mode
value: "{{ mode }}"
description: |
Optional. The mode of the repository.
valid_values: ['MODE_UNSPECIFIED', 'STANDARD_REPOSITORY', 'VIRTUAL_REPOSITORY', 'REMOTE_REPOSITORY', 'AOSS_REPOSITORY', 'ASSURED_OSS_REPOSITORY']
- name: disallowUnspecifiedMode
value: {{ disallowUnspecifiedMode }}
description: |
Optional. If this is true, an unspecified repo type will be treated as error rather than defaulting to standard.
- name: description
value: "{{ description }}"
description: |
The user-provided description of the repository.
- name: virtualRepositoryConfig
description: |
Configuration specific for a Virtual Repository.
value:
upstreamPolicies:
- id: "{{ id }}"
priority: {{ priority }}
repository: "{{ repository }}"
- name: platformLogsConfig
description: |
Optional. Configuration for platform logs.
value:
loggingState: "{{ loggingState }}"
severityLevel: "{{ severityLevel }}"
- name: remoteRepositoryConfig
description: |
Configuration specific for a Remote Repository.
value:
description: "{{ description }}"
npmRepository:
publicRepository: "{{ publicRepository }}"
customRepository:
uri: "{{ uri }}"
mavenRepository:
publicRepository: "{{ publicRepository }}"
customRepository:
uri: "{{ uri }}"
commonRepository:
uri: "{{ uri }}"
disableUpstreamValidation: {{ disableUpstreamValidation }}
upstreamCredentials:
usernamePasswordCredentials:
passwordSecretVersion: "{{ passwordSecretVersion }}"
username: "{{ username }}"
pythonRepository:
publicRepository: "{{ publicRepository }}"
customRepository:
uri: "{{ uri }}"
noCache: "{{ noCache }}"
dockerRepository:
publicRepository: "{{ publicRepository }}"
customRepository:
uri: "{{ uri }}"
aptRepository:
publicRepository:
repositoryBase: "{{ repositoryBase }}"
repositoryPath: "{{ repositoryPath }}"
customRepository:
uri: "{{ uri }}"
yumRepository:
publicRepository:
repositoryBase: "{{ repositoryBase }}"
repositoryPath: "{{ repositoryPath }}"
customRepository:
uri: "{{ uri }}"
- name: name
value: "{{ name }}"
description: |
The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`. For each location in a project, repository names must be unique.
- name: kmsKeyName
value: "{{ kmsKeyName }}"
description: |
The 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.
- name: cleanupPolicyDryRun
value: {{ cleanupPolicyDryRun }}
description: |
Optional. If true, the cleanup pipeline is prevented from deleting versions in this repository.
- name: dockerConfig
description: |
Docker repository config contains repository level configuration for the repositories of docker type.
value:
immutableTags: {{ immutableTags }}
- name: cleanupPolicies
value: "{{ cleanupPolicies }}"
description: |
Optional. 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.
- name: vulnerabilityScanningConfig
description: |
Optional. Config and state for vulnerability scanning of resources within this Repository.
value:
enablementConfig: "{{ enablementConfig }}"
enablementState: "{{ enablementState }}"
lastEnableTime: "{{ lastEnableTime }}"
enablementStateReason: "{{ enablementStateReason }}"
- name: repositoryId
value: "{{ repositoryId }}"
UPDATE examples
- patch
Updates a repository.
UPDATE google.artifactregistry.repositories
SET
data__mavenConfig = '{{ mavenConfig }}',
data__format = '{{ format }}',
data__labels = '{{ labels }}',
data__mode = '{{ mode }}',
data__disallowUnspecifiedMode = {{ disallowUnspecifiedMode }},
data__description = '{{ description }}',
data__virtualRepositoryConfig = '{{ virtualRepositoryConfig }}',
data__platformLogsConfig = '{{ platformLogsConfig }}',
data__remoteRepositoryConfig = '{{ remoteRepositoryConfig }}',
data__name = '{{ name }}',
data__kmsKeyName = '{{ kmsKeyName }}',
data__cleanupPolicyDryRun = {{ cleanupPolicyDryRun }},
data__dockerConfig = '{{ dockerConfig }}',
data__cleanupPolicies = '{{ cleanupPolicies }}',
data__vulnerabilityScanningConfig = '{{ vulnerabilityScanningConfig }}'
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,
platformLogsConfig,
registryUri,
remoteRepositoryConfig,
satisfiesPzi,
satisfiesPzs,
sizeBytes,
updateTime,
virtualRepositoryConfig,
vulnerabilityScanningConfig;
DELETE examples
- delete
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
;
Lifecycle Methods
- prewarm_artifact
- export_artifact
- check_prewarmed_artifact
Prewarms an artifact for streaming.
EXEC google.artifactregistry.repositories.prewarm_artifact
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required
@@json=
'{
"platform": "{{ platform }}",
"retentionDays": "{{ retentionDays }}",
"tag": "{{ tag }}",
"streamLocation": "{{ streamLocation }}",
"version": "{{ version }}",
"force": {{ force }}
}'
;
Exports an artifact to a Cloud Storage bucket.
EXEC google.artifactregistry.repositories.export_artifact
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required
@@json=
'{
"sourceVersion": "{{ sourceVersion }}",
"sourceTag": "{{ sourceTag }}",
"gcsPath": "{{ gcsPath }}"
}'
;
Checks an artifact streaming.
EXEC google.artifactregistry.repositories.check_prewarmed_artifact
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required
@@json=
'{
"streamLocation": "{{ streamLocation }}",
"version": "{{ version }}",
"tag": "{{ tag }}"
}'
;