Skip to main content

git_repository_links

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

Overview

Namegit_repository_links
TypeResource
Idgoogle.developerconnect.git_repository_links

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. Resource name of the repository, in the format projects/*/locations/*/connections/*/gitRepositoryLinks/*.
annotationsobjectOptional. Allows clients to store small amounts of arbitrary data.
cloneUristringRequired. Git Clone URI.
createTimestring (google-datetime)Output only. [Output only] Create timestamp
deleteTimestring (google-datetime)Output only. [Output only] Delete timestamp
etagstringOptional. This 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.
gitProxyUristringOutput only. URI to access the linked repository through the Git Proxy. This field is only populated if the git proxy is enabled for the connection.
labelsobjectOptional. Labels as key value pairs
reconcilingbooleanOutput only. Set to true when the connection is being set up or updated in the background.
uidstringOutput only. A system-assigned unique identifier for the GitRepositoryLink.
updateTimestring (google-datetime)Output only. [Output only] Update timestamp
webhookIdstringOutput only. External ID of the webhook created for the repository.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, connectionsId, gitRepositoryLinksIdGets details of a single GitRepositoryLink.
listselectprojectsId, locationsId, connectionsIdpageSize, pageToken, filter, orderByLists GitRepositoryLinks in a given project, location, and connection.
createinsertprojectsId, locationsId, connectionsIdgitRepositoryLinkId, requestId, validateOnlyCreates a GitRepositoryLink. Upon linking a Git Repository, Developer Connect will configure the Git Repository to send webhook events to Developer Connect. Connections that use Firebase GitHub Application will have events forwarded to the Firebase service. All other Connections will have events forwarded to Cloud Build.
deletedeleteprojectsId, locationsId, connectionsId, gitRepositoryLinksIdrequestId, validateOnly, etagDeletes a single GitRepositoryLink.
processgitlab_enterprise_webhookexecprojectsId, locationsId, connectionsId, gitRepositoryLinksIdProcessGitLabEnterpriseWebhook is called by the external GitLab Enterprise instances for notifying events.
processgitlab_webhookexecprojectsId, locationsId, connectionsId, gitRepositoryLinksIdProcessGitLabWebhook is called by the GitLab.com for notifying events.
process_bitbucket_data_center_webhookexecprojectsId, locationsId, connectionsId, gitRepositoryLinksIdProcessBitbucketDataCenterWebhook is called by the external Bitbucket Data Center instances for notifying events.
process_bitbucket_cloud_webhookexecprojectsId, locationsId, connectionsId, gitRepositoryLinksIdProcessBitbucketCloudWebhook is called by the external Bitbucket Cloud instances for notifying events.

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
gitRepositoryLinksIdstring
locationsIdstring
projectsIdstring
etagstring
filterstring
gitRepositoryLinkIdstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring
validateOnlyboolean

SELECT examples

Gets details of a single GitRepositoryLink.

SELECT
name,
annotations,
cloneUri,
createTime,
deleteTime,
etag,
gitProxyUri,
labels,
reconciling,
uid,
updateTime,
webhookId
FROM google.developerconnect.git_repository_links
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND connectionsId = '{{ connectionsId }}' -- required
AND gitRepositoryLinksId = '{{ gitRepositoryLinksId }}' -- required;

INSERT examples

Creates a GitRepositoryLink. Upon linking a Git Repository, Developer Connect will configure the Git Repository to send webhook events to Developer Connect. Connections that use Firebase GitHub Application will have events forwarded to the Firebase service. All other Connections will have events forwarded to Cloud Build.

INSERT INTO google.developerconnect.git_repository_links (
data__name,
data__cloneUri,
data__labels,
data__etag,
data__annotations,
projectsId,
locationsId,
connectionsId,
gitRepositoryLinkId,
requestId,
validateOnly
)
SELECT
'{{ name }}',
'{{ cloneUri }}',
'{{ labels }}',
'{{ etag }}',
'{{ annotations }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ connectionsId }}',
'{{ gitRepositoryLinkId }}',
'{{ requestId }}',
'{{ validateOnly }}'
RETURNING
name,
done,
error,
metadata,
response
;

DELETE examples

Deletes a single GitRepositoryLink.

DELETE FROM google.developerconnect.git_repository_links
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND connectionsId = '{{ connectionsId }}' --required
AND gitRepositoryLinksId = '{{ gitRepositoryLinksId }}' --required
AND requestId = '{{ requestId }}'
AND validateOnly = '{{ validateOnly }}'
AND etag = '{{ etag }}';

Lifecycle Methods

ProcessGitLabEnterpriseWebhook is called by the external GitLab Enterprise instances for notifying events.

EXEC google.developerconnect.git_repository_links.processgitlab_enterprise_webhook 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@connectionsId='{{ connectionsId }}' --required,
@gitRepositoryLinksId='{{ gitRepositoryLinksId }}' --required
@@json=
'{
"body": "{{ body }}"
}';