Skip to main content

connections

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

Overview

Nameconnections
TypeResource
Idgoogle.cloudbuild.connections

Fields

NameDatatypeDescription
namestringImmutable. The resource name of the connection, in the format projects/{project}/locations/{location}/connections/{connection_id}.
annotationsobjectOptional. Allows clients to store small amounts of arbitrary data.
bitbucketCloudConfigobjectConfiguration for connections to Bitbucket Cloud.
bitbucketDataCenterConfigobjectConfiguration for connections to Bitbucket Data Center.
createTimestringOutput only. Server assigned timestamp for when the connection was created.
disabledbooleanOptional. If disabled is set to true, functionality is disabled for this connection. Repository based API methods and webhooks processing for repositories in this connection will be disabled.
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.
githubConfigobjectConfiguration for connections to github.com.
githubEnterpriseConfigobjectConfiguration for connections to an instance of GitHub Enterprise.
gitlabConfigobjectConfiguration for connections to gitlab.com or an instance of GitLab Enterprise.
installationStateobjectDescribes stage and necessary actions to be taken by the user to complete the installation. Used for GitHub and GitHub Enterprise based connections.
reconcilingbooleanOutput only. Set to true when the connection is being set up or updated in the background.
updateTimestringOutput only. Server assigned timestamp for when the connection was updated.

Methods

NameAccessible byRequired ParamsDescription
projects_locations_connections_getSELECTconnectionsId, locationsId, projectsIdGets details of a single connection.
projects_locations_connections_listSELECTlocationsId, projectsIdLists Connections in a given project and location.
projects_locations_connections_createINSERTlocationsId, projectsIdCreates a Connection.
projects_locations_connections_deleteDELETEconnectionsId, locationsId, projectsIdDeletes a single connection.
projects_locations_connections_patchUPDATEconnectionsId, locationsId, projectsIdUpdates a single connection.
projects_locations_connections_process_webhookEXEClocationsId, projectsIdProcessWebhook is called by the external SCM for notifying of events.

SELECT examples

Lists Connections in a given project and location.

SELECT
name,
annotations,
bitbucketCloudConfig,
bitbucketDataCenterConfig,
createTime,
disabled,
etag,
githubConfig,
githubEnterpriseConfig,
gitlabConfig,
installationState,
reconciling,
updateTime
FROM google.cloudbuild.connections
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

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

/*+ create */
INSERT INTO google.cloudbuild.connections (
locationsId,
projectsId,
githubConfig,
etag,
bitbucketDataCenterConfig,
gitlabConfig,
annotations,
name,
githubEnterpriseConfig,
bitbucketCloudConfig,
disabled
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ githubConfig }}',
'{{ etag }}',
'{{ bitbucketDataCenterConfig }}',
'{{ gitlabConfig }}',
'{{ annotations }}',
'{{ name }}',
'{{ githubEnterpriseConfig }}',
'{{ bitbucketCloudConfig }}',
true|false
;

UPDATE example

Updates a connections resource.

/*+ update */
UPDATE google.cloudbuild.connections
SET
githubConfig = '{{ githubConfig }}',
etag = '{{ etag }}',
bitbucketDataCenterConfig = '{{ bitbucketDataCenterConfig }}',
gitlabConfig = '{{ gitlabConfig }}',
annotations = '{{ annotations }}',
name = '{{ name }}',
githubEnterpriseConfig = '{{ githubEnterpriseConfig }}',
bitbucketCloudConfig = '{{ bitbucketCloudConfig }}',
disabled = true|false
WHERE
connectionsId = '{{ connectionsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified connections resource.

/*+ delete */
DELETE FROM google.cloudbuild.connections
WHERE connectionsId = '{{ connectionsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';