Skip to main content

files

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

Overview

Namefiles
TypeResource
Idgoogle.artifactregistry.files

Fields

NameDatatypeDescription
namestringThe name of the file, for example: projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt. If the file ID part contains slashes, they are escaped.
createTimestringOutput only. The time when the File was created.
fetchTimestringOutput only. The time when the last attempt to refresh the file's data was made. Only set when the repository is remote.
hashesarrayThe hashes of the file content.
ownerstringThe name of the Package or Version that owns this file, if any.
sizeBytesstringThe size of the File in bytes.
updateTimestringOutput only. The time when the File was last updated.

Methods

NameAccessible byRequired ParamsDescription
getSELECTfilesId, locationsId, projectsId, repositoriesIdGets a file.
listSELECTlocationsId, projectsId, repositoriesIdLists files.
deleteDELETEfilesId, locationsId, projectsId, repositoriesIdDeletes a file and all of its content. It is only allowed on generic repositories. The returned operation will complete once the file has been deleted.
downloadEXECfilesId, locationsId, projectsId, repositoriesIdDownload a file.

SELECT examples

Lists files.

SELECT
name,
createTime,
fetchTime,
hashes,
owner,
sizeBytes,
updateTime
FROM google.artifactregistry.files
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND repositoriesId = '{{ repositoriesId }}';

DELETE example

Deletes the specified files resource.

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