Skip to main content

connections

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

Overview

Nameconnections
TypeResource
Idgoogle.cloudbuild.connections

Fields

The following fields are returned by SELECT queries:

Successful response

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. (id: BitbucketCloudConfig)
bitbucketDataCenterConfigobjectConfiguration for connections to Bitbucket Data Center. (id: BitbucketDataCenterConfig)
createTimestring (google-datetime)Output 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. (id: GitHubConfig)
githubEnterpriseConfigobjectConfiguration for connections to an instance of GitHub Enterprise. (id: GoogleDevtoolsCloudbuildV2GitHubEnterpriseConfig)
gitlabConfigobjectConfiguration for connections to gitlab.com or an instance of GitLab Enterprise. (id: GoogleDevtoolsCloudbuildV2GitLabConfig)
installationStateobjectOutput only. Installation state of the Connection. (id: InstallationState)
reconcilingbooleanOutput only. Set to true when the connection is being set up or updated in the background.
updateTimestring (google-datetime)Output only. Server assigned timestamp for when the connection was updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_connections_getselectprojectsId, locationsId, connectionsIdGets details of a single connection.
projects_locations_connections_listselectprojectsId, locationsIdpageSize, pageToken, returnPartialSuccessLists Connections in a given project and location.
projects_locations_connections_createinsertprojectsId, locationsIdconnectionIdCreates a Connection.
projects_locations_connections_patchupdateprojectsId, locationsId, connectionsIdupdateMask, allowMissing, etagUpdates a single connection.
projects_locations_connections_deletedeleteprojectsId, locationsId, connectionsIdetag, validateOnlyDeletes a single connection.
projects_locations_connections_process_webhookexecprojectsId, locationsIdwebhookKeyProcessWebhook is called by the external SCM for notifying of 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
locationsIdstring
projectsIdstring
allowMissingboolean
connectionIdstring
etagstring
pageSizeinteger (int32)
pageTokenstring
returnPartialSuccessboolean
updateMaskstring (google-fieldmask)
validateOnlyboolean
webhookKeystring

SELECT examples

Gets details of a single connection.

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

INSERT examples

Creates a Connection.

INSERT INTO google.cloudbuild.connections (
data__name,
data__githubConfig,
data__githubEnterpriseConfig,
data__gitlabConfig,
data__bitbucketDataCenterConfig,
data__bitbucketCloudConfig,
data__disabled,
data__annotations,
data__etag,
projectsId,
locationsId,
connectionId
)
SELECT
'{{ name }}',
'{{ githubConfig }}',
'{{ githubEnterpriseConfig }}',
'{{ gitlabConfig }}',
'{{ bitbucketDataCenterConfig }}',
'{{ bitbucketCloudConfig }}',
{{ disabled }},
'{{ annotations }}',
'{{ etag }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ connectionId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates a single connection.

UPDATE google.cloudbuild.connections
SET
data__name = '{{ name }}',
data__githubConfig = '{{ githubConfig }}',
data__githubEnterpriseConfig = '{{ githubEnterpriseConfig }}',
data__gitlabConfig = '{{ gitlabConfig }}',
data__bitbucketDataCenterConfig = '{{ bitbucketDataCenterConfig }}',
data__bitbucketCloudConfig = '{{ bitbucketCloudConfig }}',
data__disabled = {{ disabled }},
data__annotations = '{{ annotations }}',
data__etag = '{{ etag }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND connectionsId = '{{ connectionsId }}' --required
AND updateMask = '{{ updateMask}}'
AND allowMissing = {{ allowMissing}}
AND etag = '{{ etag}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a single connection.

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

Lifecycle Methods

ProcessWebhook is called by the external SCM for notifying of events.

EXEC google.cloudbuild.connections.projects_locations_connections_process_webhook 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@webhookKey='{{ webhookKey }}'
@@json=
'{
"contentType": "{{ contentType }}",
"data": "{{ data }}",
"extensions": "{{ extensions }}"
}';