Skip to main content

connections

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

Overview

Nameconnections
TypeResource
Idgoogle.bigqueryconnection.connections

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The resource name of the connection in the form of: projects/{project_id}/locations/{location_id}/connections/{connection_id}
awsobjectAmazon Web Services (AWS) properties. (id: AwsProperties)
azureobjectAzure properties. (id: AzureProperties)
cloudResourceobjectCloud Resource properties. (id: CloudResourceProperties)
cloudSpannerobjectCloud Spanner properties. (id: CloudSpannerProperties)
cloudSqlobjectCloud SQL properties. (id: CloudSqlProperties)
configurationobjectOptional. Connector configuration. (id: ConnectorConfiguration)
creationTimestring (int64)Output only. The creation timestamp of the connection.
descriptionstringUser provided description.
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]
lastModifiedTimestring (int64)Output only. The last update timestamp of the connection.
salesforceDataCloudobjectOptional. Salesforce DataCloud properties. This field is intended for use only by Salesforce partner projects. This field contains properties for your Salesforce DataCloud connection. (id: SalesforceDataCloudProperties)
sparkobjectSpark properties. (id: SparkProperties)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, connectionsIdReturns specified connection.
listselectprojectsId, locationsIdpageSize, pageTokenReturns a list of connections in the given project.
createinsertprojectsId, locationsIdconnectionIdCreates a new connection.
patchupdateprojectsId, locationsId, connectionsIdupdateMaskUpdates the specified connection. For security reasons, also resets credential if connection properties are in the update field mask.
deletedeleteprojectsId, locationsId, connectionsIdDeletes connection and associated credential.

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
connectionIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Returns specified connection.

SELECT
name,
aws,
azure,
cloudResource,
cloudSpanner,
cloudSql,
configuration,
creationTime,
description,
friendlyName,
hasCredential,
kmsKeyName,
lastModifiedTime,
salesforceDataCloud,
spark
FROM google.bigqueryconnection.connections
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND connectionsId = '{{ connectionsId }}' -- required;

INSERT examples

Creates a new connection.

INSERT INTO google.bigqueryconnection.connections (
data__friendlyName,
data__description,
data__cloudSql,
data__aws,
data__azure,
data__cloudSpanner,
data__cloudResource,
data__spark,
data__salesforceDataCloud,
data__configuration,
data__kmsKeyName,
projectsId,
locationsId,
connectionId
)
SELECT
'{{ friendlyName }}',
'{{ description }}',
'{{ cloudSql }}',
'{{ aws }}',
'{{ azure }}',
'{{ cloudSpanner }}',
'{{ cloudResource }}',
'{{ spark }}',
'{{ salesforceDataCloud }}',
'{{ configuration }}',
'{{ kmsKeyName }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ connectionId }}'
RETURNING
name,
aws,
azure,
cloudResource,
cloudSpanner,
cloudSql,
configuration,
creationTime,
description,
friendlyName,
hasCredential,
kmsKeyName,
lastModifiedTime,
salesforceDataCloud,
spark
;

UPDATE examples

Updates the specified connection. For security reasons, also resets credential if connection properties are in the update field mask.

UPDATE google.bigqueryconnection.connections
SET
data__friendlyName = '{{ friendlyName }}',
data__description = '{{ description }}',
data__cloudSql = '{{ cloudSql }}',
data__aws = '{{ aws }}',
data__azure = '{{ azure }}',
data__cloudSpanner = '{{ cloudSpanner }}',
data__cloudResource = '{{ cloudResource }}',
data__spark = '{{ spark }}',
data__salesforceDataCloud = '{{ salesforceDataCloud }}',
data__configuration = '{{ configuration }}',
data__kmsKeyName = '{{ kmsKeyName }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND connectionsId = '{{ connectionsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
aws,
azure,
cloudResource,
cloudSpanner,
cloudSql,
configuration,
creationTime,
description,
friendlyName,
hasCredential,
kmsKeyName,
lastModifiedTime,
salesforceDataCloud,
spark;

DELETE examples

Deletes connection and associated credential.

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