Skip to main content

connections

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

Overview

Nameconnections
TypeResource
Idgoogle.dlp.connections

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringOutput only. Name of the connection: projects/{project}/locations/{location}/connections/{name}.
cloudSqlobjectConnect to a Cloud SQL instance. (id: GooglePrivacyDlpV2CloudSqlProperties)
errorsarrayOutput only. Set if status == ERROR, to provide additional details. Will store the last 10 errors sorted with the most recent first.
statestringRequired. The connection's state in its lifecycle. (CONNECTION_STATE_UNSPECIFIED, MISSING_CREDENTIALS, AVAILABLE, ERROR)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_connections_getselectprojectsId, locationsId, connectionsIdGet a Connection by name.
organizations_locations_connections_getselectorganizationsId, locationsId, connectionsIdGet a Connection by name.
projects_locations_connections_listselectprojectsId, locationsIdpageSize, pageToken, filterLists Connections in a parent. Use SearchConnections to see all connections within an organization.
organizations_locations_connections_listselectorganizationsId, locationsIdpageToken, filter, pageSizeLists Connections in a parent. Use SearchConnections to see all connections within an organization.
projects_locations_connections_createinsertprojectsId, locationsIdCreate a Connection to an external data source.
organizations_locations_connections_createinsertorganizationsId, locationsIdCreate a Connection to an external data source.
projects_locations_connections_patchupdateprojectsId, locationsId, connectionsIdUpdate a Connection.
organizations_locations_connections_patchupdateorganizationsId, locationsId, connectionsIdUpdate a Connection.
projects_locations_connections_deletedeleteprojectsId, locationsId, connectionsIdDelete a Connection.
organizations_locations_connections_deletedeleteorganizationsId, locationsId, connectionsIdDelete a Connection.
projects_locations_connections_searchexecprojectsId, locationsIdpageToken, filter, pageSizeSearches for Connections in a parent.
organizations_locations_connections_searchexecorganizationsId, locationsIdpageSize, pageToken, filterSearches for Connections in a parent.

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
organizationsIdstring
projectsIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Get a Connection by name.

SELECT
name,
cloudSql,
errors,
state
FROM google.dlp.connections
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND connectionsId = '{{ connectionsId }}' -- required
;

INSERT examples

Create a Connection to an external data source.

INSERT INTO google.dlp.connections (
data__connection,
projectsId,
locationsId
)
SELECT
'{{ connection }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
cloudSql,
errors,
state
;

UPDATE examples

Update a Connection.

UPDATE google.dlp.connections
SET
data__updateMask = '{{ updateMask }}',
data__connection = '{{ connection }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND connectionsId = '{{ connectionsId }}' --required
RETURNING
name,
cloudSql,
errors,
state;

DELETE examples

Delete a Connection.

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

Lifecycle Methods

Searches for Connections in a parent.

EXEC google.dlp.connections.projects_locations_connections_search
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@pageToken='{{ pageToken }}',
@filter='{{ filter }}',
@pageSize='{{ pageSize }}'
;