Skip to main content

data_exchanges

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

Overview

Namedata_exchanges
TypeResource
Idgoogle.analyticshub.data_exchanges

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The resource name of the data exchange. e.g. projects/myproject/locations/us/dataExchanges/123.
descriptionstringOptional. Description of the data exchange. The description must not contain Unicode non-characters as well as C0 and C1 control codes except tabs (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default value is an empty string. Max length: 2000 bytes.
discoveryTypestringOptional. Type of discovery on the discovery page for all the listings under this exchange. Updating this field also updates (overwrites) the discovery_type field for all the listings under this exchange.
displayNamestringRequired. Human-readable display name of the data exchange. The display name must contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces ( ), ampersands (&) and must not start or end with spaces. Default value is an empty string. Max length: 63 bytes.
documentationstringOptional. Documentation describing the data exchange.
iconstring (byte)Optional. Base64 encoded image representing the data exchange. Max Size: 3.0MiB Expected image dimensions are 512x512 pixels, however the API only performs validation on size of the encoded data. Note: For byte fields, the content of the fields are base64-encoded (which increases the size of the data by 33-36%) when using JSON on the wire.
listingCountinteger (int32)Output only. Number of listings contained in the data exchange.
logLinkedDatasetQueryUserEmailbooleanOptional. By default, false. If true, the DataExchange has an email sharing mandate enabled.
primaryContactstringOptional. Email or URL of the primary point of contact of the data exchange. Max Length: 1000 bytes.
sharingEnvironmentConfigobjectOptional. Configurable data sharing environment option for a data exchange. (id: SharingEnvironmentConfig)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_data_exchanges_getselectprojectsId, locationsId, dataExchangesIdGets the details of a data exchange.
projects_locations_data_exchanges_listselectprojectsId, locationsIdpageSize, pageTokenLists all data exchanges in a given project and location.
organizations_locations_data_exchanges_listselectorganizationsId, locationsIdpageSize, pageTokenLists all data exchanges from projects in a given organization and location.
projects_locations_data_exchanges_createinsertprojectsId, locationsIddataExchangeIdCreates a new data exchange.
projects_locations_data_exchanges_patchupdateprojectsId, locationsId, dataExchangesIdupdateMaskUpdates an existing data exchange.
projects_locations_data_exchanges_deletedeleteprojectsId, locationsId, dataExchangesIdDeletes an existing data exchange.
projects_locations_data_exchanges_subscribeexecprojectsId, locationsId, dataExchangesIdCreates a Subscription to a Data Clean Room. This is a long-running operation as it will create one or more linked datasets. Throws a Bad Request error if the Data Exchange does not contain any listings.

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
dataExchangesIdstring
locationsIdstring
organizationsIdstring
projectsIdstring
dataExchangeIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets the details of a data exchange.

SELECT
name,
description,
discoveryType,
displayName,
documentation,
icon,
listingCount,
logLinkedDatasetQueryUserEmail,
primaryContact,
sharingEnvironmentConfig
FROM google.analyticshub.data_exchanges
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND dataExchangesId = '{{ dataExchangesId }}' -- required;

INSERT examples

Creates a new data exchange.

INSERT INTO google.analyticshub.data_exchanges (
data__displayName,
data__description,
data__primaryContact,
data__documentation,
data__icon,
data__sharingEnvironmentConfig,
data__discoveryType,
data__logLinkedDatasetQueryUserEmail,
projectsId,
locationsId,
dataExchangeId
)
SELECT
'{{ displayName }}',
'{{ description }}',
'{{ primaryContact }}',
'{{ documentation }}',
'{{ icon }}',
'{{ sharingEnvironmentConfig }}',
'{{ discoveryType }}',
{{ logLinkedDatasetQueryUserEmail }},
'{{ projectsId }}',
'{{ locationsId }}',
'{{ dataExchangeId }}'
RETURNING
name,
description,
discoveryType,
displayName,
documentation,
icon,
listingCount,
logLinkedDatasetQueryUserEmail,
primaryContact,
sharingEnvironmentConfig
;

UPDATE examples

Updates an existing data exchange.

UPDATE google.analyticshub.data_exchanges
SET
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__primaryContact = '{{ primaryContact }}',
data__documentation = '{{ documentation }}',
data__icon = '{{ icon }}',
data__sharingEnvironmentConfig = '{{ sharingEnvironmentConfig }}',
data__discoveryType = '{{ discoveryType }}',
data__logLinkedDatasetQueryUserEmail = {{ logLinkedDatasetQueryUserEmail }}
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND dataExchangesId = '{{ dataExchangesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
description,
discoveryType,
displayName,
documentation,
icon,
listingCount,
logLinkedDatasetQueryUserEmail,
primaryContact,
sharingEnvironmentConfig;

DELETE examples

Deletes an existing data exchange.

DELETE FROM google.analyticshub.data_exchanges
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND dataExchangesId = '{{ dataExchangesId }}' --required;

Lifecycle Methods

Creates a Subscription to a Data Clean Room. This is a long-running operation as it will create one or more linked datasets. Throws a Bad Request error if the Data Exchange does not contain any listings.

EXEC google.analyticshub.data_exchanges.projects_locations_data_exchanges_subscribe 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@dataExchangesId='{{ dataExchangesId }}' --required
@@json=
'{
"destination": "{{ destination }}",
"destinationDataset": "{{ destinationDataset }}",
"subscription": "{{ subscription }}",
"subscriberContact": "{{ subscriberContact }}"
}';