Skip to main content

listings

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

Overview

Namelistings
TypeResource
Idgoogle.analyticshub.listings

Fields

NameDatatypeDescription
namestringOutput only. The resource name of the listing. e.g. projects/myproject/locations/US/dataExchanges/123/listings/456
descriptionstringOptional. Short description of the listing. The description must not contain Unicode non-characters and 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.
bigqueryDatasetobjectA reference to a shared dataset. It is an existing BigQuery dataset with a collection of objects such as tables and views that you want to share with subscribers. When subscriber's subscribe to a listing, Analytics Hub creates a linked dataset in the subscriber's project. A Linked dataset is an opaque, read-only BigQuery dataset that serves as a symbolic link to a shared dataset.
categoriesarrayOptional. Categories of the listing. Up to two categories are allowed.
dataProviderobjectContains details of the data provider.
discoveryTypestringOptional. Type of discovery of the listing on the discovery page.
displayNamestringRequired. Human-readable display name of the listing. The display name must contain only Unicode letters, numbers (0-9), underscores (_), dashes (-), spaces ( ), ampersands (&) and can't start or end with spaces. Default value is an empty string. Max length: 63 bytes.
documentationstringOptional. Documentation describing the listing.
iconstringOptional. Base64 encoded image representing the listing. 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 contents of the field are base64-encoded (which increases the size of the data by 33-36%) when using JSON on the wire.
primaryContactstringOptional. Email or URL of the primary point of contact of the listing. Max Length: 1000 bytes.
publisherobjectContains details of the listing publisher.
pubsubTopicobjectPub/Sub topic source.
requestAccessstringOptional. Email or URL of the request access of the listing. Subscribers can use this reference to request access. Max Length: 1000 bytes.
resourceTypestringOutput only. Listing shared asset type.
restrictedExportConfigobjectRestricted export config, used to configure restricted export on linked dataset.
statestringOutput only. Current state of the listing.

Methods

NameAccessible byRequired ParamsDescription
projects_locations_data_exchanges_listings_getSELECTdataExchangesId, listingsId, locationsId, projectsIdGets the details of a listing.
projects_locations_data_exchanges_listings_listSELECTdataExchangesId, locationsId, projectsIdLists all listings in a given project and location.
projects_locations_data_exchanges_listings_createINSERTdataExchangesId, locationsId, projectsIdCreates a new listing.
projects_locations_data_exchanges_listings_deleteDELETEdataExchangesId, listingsId, locationsId, projectsIdDeletes a listing.
projects_locations_data_exchanges_listings_patchUPDATEdataExchangesId, listingsId, locationsId, projectsIdUpdates an existing listing.
projects_locations_data_exchanges_listings_subscribeEXECdataExchangesId, listingsId, locationsId, projectsIdSubscribes to a listing. Currently, with Analytics Hub, you can create listings that reference only BigQuery datasets. Upon subscription to a listing for a BigQuery dataset, Analytics Hub creates a linked dataset in the subscriber's project.

SELECT examples

Lists all listings in a given project and location.

SELECT
name,
description,
bigqueryDataset,
categories,
dataProvider,
discoveryType,
displayName,
documentation,
icon,
primaryContact,
publisher,
pubsubTopic,
requestAccess,
resourceType,
restrictedExportConfig,
state
FROM google.analyticshub.listings
WHERE dataExchangesId = '{{ dataExchangesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new listings resource.

/*+ create */
INSERT INTO google.analyticshub.listings (
dataExchangesId,
locationsId,
projectsId,
bigqueryDataset,
pubsubTopic,
displayName,
description,
primaryContact,
documentation,
icon,
dataProvider,
categories,
publisher,
requestAccess,
restrictedExportConfig,
discoveryType
)
SELECT
'{{ dataExchangesId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ bigqueryDataset }}',
'{{ pubsubTopic }}',
'{{ displayName }}',
'{{ description }}',
'{{ primaryContact }}',
'{{ documentation }}',
'{{ icon }}',
'{{ dataProvider }}',
'{{ categories }}',
'{{ publisher }}',
'{{ requestAccess }}',
'{{ restrictedExportConfig }}',
'{{ discoveryType }}'
;

UPDATE example

Updates a listings resource.

/*+ update */
UPDATE google.analyticshub.listings
SET
bigqueryDataset = '{{ bigqueryDataset }}',
pubsubTopic = '{{ pubsubTopic }}',
displayName = '{{ displayName }}',
description = '{{ description }}',
primaryContact = '{{ primaryContact }}',
documentation = '{{ documentation }}',
icon = '{{ icon }}',
dataProvider = '{{ dataProvider }}',
categories = '{{ categories }}',
publisher = '{{ publisher }}',
requestAccess = '{{ requestAccess }}',
restrictedExportConfig = '{{ restrictedExportConfig }}',
discoveryType = '{{ discoveryType }}'
WHERE
dataExchangesId = '{{ dataExchangesId }}'
AND listingsId = '{{ listingsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified listings resource.

/*+ delete */
DELETE FROM google.analyticshub.listings
WHERE dataExchangesId = '{{ dataExchangesId }}'
AND listingsId = '{{ listingsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';