Skip to main content

connections

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

Overview

Nameconnections
TypeResource
Idgoogle.bigqueryconnection.connections

Fields

NameDatatypeDescription
namestringOutput only. The resource name of the connection in the form of: projects/{project_id}/locations/{location_id}/connections/{connection_id}
descriptionstringUser provided description.
awsobjectConnection properties specific to Amazon Web Services (AWS).
azureobjectContainer for connection properties specific to Azure.
cloudResourceobjectContainer for connection properties for delegation of access to GCP resources.
cloudSpannerobjectConnection properties specific to Cloud Spanner.
cloudSqlobjectConnection properties specific to the Cloud SQL.
configurationobjectRepresents concrete parameter values for Connector Configuration.
creationTimestringOutput only. The creation timestamp of the connection.
friendlyNamestringUser provided display name for the connection.
hasCredentialbooleanOutput only. True, if credential is configured for this connection.
kmsKeyNamestringOptional. The Cloud KMS key that is used for credentials encryption. If omitted, internal Google owned encryption keys are used. Example: projects/[kms_project_id]/locations/[region]/keyRings/[key_region]/cryptoKeys/[key]
lastModifiedTimestringOutput only. The last update timestamp of the connection.
salesforceDataCloudobjectConnection properties specific to Salesforce DataCloud. This is intended for use only by Salesforce partner projects.
sparkobjectContainer for connection properties to execute stored procedures for Apache Spark.

Methods

NameAccessible byRequired ParamsDescription
getSELECTconnectionsId, locationsId, projectsIdReturns specified connection.
listSELECTlocationsId, projectsIdReturns a list of connections in the given project.
createINSERTlocationsId, projectsIdCreates a new connection.
deleteDELETEconnectionsId, locationsId, projectsIdDeletes connection and associated credential.
patchUPDATEconnectionsId, locationsId, projectsIdUpdates the specified connection. For security reasons, also resets credential if connection properties are in the update field mask.

SELECT examples

Returns a list of connections in the given project.

SELECT
name,
description,
aws,
azure,
cloudResource,
cloudSpanner,
cloudSql,
configuration,
creationTime,
friendlyName,
hasCredential,
kmsKeyName,
lastModifiedTime,
salesforceDataCloud,
spark
FROM google.bigqueryconnection.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.bigqueryconnection.connections (
locationsId,
projectsId,
friendlyName,
description,
cloudSql,
aws,
azure,
cloudSpanner,
cloudResource,
spark,
salesforceDataCloud,
configuration,
kmsKeyName
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ friendlyName }}',
'{{ description }}',
'{{ cloudSql }}',
'{{ aws }}',
'{{ azure }}',
'{{ cloudSpanner }}',
'{{ cloudResource }}',
'{{ spark }}',
'{{ salesforceDataCloud }}',
'{{ configuration }}',
'{{ kmsKeyName }}'
;

UPDATE example

Updates a connections resource.

/*+ update */
UPDATE google.bigqueryconnection.connections
SET
friendlyName = '{{ friendlyName }}',
description = '{{ description }}',
cloudSql = '{{ cloudSql }}',
aws = '{{ aws }}',
azure = '{{ azure }}',
cloudSpanner = '{{ cloudSpanner }}',
cloudResource = '{{ cloudResource }}',
spark = '{{ spark }}',
salesforceDataCloud = '{{ salesforceDataCloud }}',
configuration = '{{ configuration }}',
kmsKeyName = '{{ kmsKeyName }}'
WHERE
connectionsId = '{{ connectionsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified connections resource.

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