Skip to main content

repositories

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

Overview​

Namerepositories
TypeResource
Idgoogle.cloudbuild.repositories

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringImmutable. Resource name of the repository, in the format projects/*/locations/*/connections/*/repositories/*.
annotationsobjectOptional. Allows clients to store small amounts of arbitrary data.
createTimestring (google-datetime)Output only. Server assigned timestamp for when the connection was created.
etagstringThis checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
remoteUristringRequired. Git Clone HTTPS URI.
updateTimestring (google-datetime)Output only. Server assigned timestamp for when the connection was updated.
webhookIdstringOutput only. External ID of the webhook created for the repository.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_connections_repositories_getselectprojectsId, locationsId, connectionsId, repositoriesIdGets details of a single repository.
projects_locations_connections_repositories_listselectprojectsId, locationsId, connectionsIdfilter, pageSize, pageToken, returnPartialSuccessLists Repositories in a given connection.
projects_locations_connections_repositories_batch_createinsertprojectsId, locationsId, connectionsIdCreates multiple repositories inside a connection.
projects_locations_connections_repositories_createinsertprojectsId, locationsId, connectionsIdrepositoryIdCreates a Repository.
projects_locations_connections_repositories_deletedeleteprojectsId, locationsId, connectionsId, repositoriesIdetag, validateOnlyDeletes a single repository.
projects_locations_connections_repositories_access_read_tokenexecprojectsId, locationsId, connectionsId, repositoriesIdFetches read token of a given repository.
projects_locations_connections_repositories_access_read_write_tokenexecprojectsId, locationsId, connectionsId, repositoriesIdFetches read/write token of a given repository.

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
connectionsIdstring
locationsIdstring
projectsIdstring
repositoriesIdstring
etagstring
filterstring
pageSizeinteger (int32)
pageTokenstring
repositoryIdstring
returnPartialSuccessboolean
validateOnlyboolean

SELECT examples​

Gets details of a single repository.

SELECT
name,
annotations,
createTime,
etag,
remoteUri,
updateTime,
webhookId
FROM google.cloudbuild.repositories
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND connectionsId = '{{ connectionsId }}' -- required
AND repositoriesId = '{{ repositoriesId }}' -- required
;

INSERT examples​

Creates multiple repositories inside a connection.

INSERT INTO google.cloudbuild.repositories (
data__requests,
projectsId,
locationsId,
connectionsId
)
SELECT
'{{ requests }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ connectionsId }}'
RETURNING
name,
done,
error,
metadata,
response
;

DELETE examples​

Deletes a single repository.

DELETE FROM google.cloudbuild.repositories
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND connectionsId = '{{ connectionsId }}' --required
AND repositoriesId = '{{ repositoriesId }}' --required
AND etag = '{{ etag }}'
AND validateOnly = '{{ validateOnly }}'
;

Lifecycle Methods​

Fetches read token of a given repository.

EXEC google.cloudbuild.repositories.projects_locations_connections_repositories_access_read_token
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@connectionsId='{{ connectionsId }}' --required,
@repositoriesId='{{ repositoriesId }}' --required
;