Skip to main content

listings

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

Overview

Namelistings
TypeResource
Idgoogle.analyticshub.listings

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The resource name of the listing. e.g. projects/myproject/locations/us/dataExchanges/123/listings/456
allowOnlyMetadataSharingbooleanOptional. If true, the listing is only available to get the resource metadata. Listing is non subscribable.
bigqueryDatasetobjectShared dataset i.e. BigQuery dataset source. (id: BigQueryDatasetSource)
categoriesarrayOptional. Categories of the listing. Up to five categories are allowed.
commercialInfoobjectOutput only. Commercial info contains the information about the commercial data products associated with the listing. (id: GoogleCloudBigqueryAnalyticshubV1ListingCommercialInfo)
dataProviderobjectOptional. Details of the data provider who owns the source data. (id: DataProvider)
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.
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.
iconstring (byte)Optional. 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.
logLinkedDatasetQueryUserEmailbooleanOptional. By default, false. If true, the Listing has an email sharing mandate enabled.
primaryContactstringOptional. Email or URL of the primary point of contact of the listing. Max Length: 1000 bytes.
publisherobjectOptional. Details of the publisher who owns the listing and who can share the source data. (id: Publisher)
pubsubTopicobjectPub/Sub topic source. (id: PubSubTopicSource)
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.
restrictedExportConfigobjectOptional. If set, restricted export configuration will be propagated and enforced on the linked dataset. (id: RestrictedExportConfig)
statestringOutput only. Current state of the listing.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_data_exchanges_listings_getselectprojectsId, locationsId, dataExchangesId, listingsIdGets the details of a listing.
projects_locations_data_exchanges_listings_listselectprojectsId, locationsId, dataExchangesIdpageSize, pageTokenLists all listings in a given project and location.
projects_locations_data_exchanges_listings_createinsertprojectsId, locationsId, dataExchangesIdlistingIdCreates a new listing.
projects_locations_data_exchanges_listings_patchupdateprojectsId, locationsId, dataExchangesId, listingsIdupdateMaskUpdates an existing listing.
projects_locations_data_exchanges_listings_deletedeleteprojectsId, locationsId, dataExchangesId, listingsIddeleteCommercialDeletes a listing.
projects_locations_data_exchanges_listings_subscribeexecprojectsId, locationsId, dataExchangesId, listingsIdSubscribes 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.

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
listingsIdstring
locationsIdstring
projectsIdstring
deleteCommercialboolean
listingIdstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets the details of a listing.

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

INSERT examples

Creates a new listing.

INSERT INTO google.analyticshub.listings (
data__bigqueryDataset,
data__pubsubTopic,
data__displayName,
data__description,
data__primaryContact,
data__documentation,
data__icon,
data__dataProvider,
data__categories,
data__publisher,
data__requestAccess,
data__restrictedExportConfig,
data__discoveryType,
data__logLinkedDatasetQueryUserEmail,
data__allowOnlyMetadataSharing,
projectsId,
locationsId,
dataExchangesId,
listingId
)
SELECT
'{{ bigqueryDataset }}',
'{{ pubsubTopic }}',
'{{ displayName }}',
'{{ description }}',
'{{ primaryContact }}',
'{{ documentation }}',
'{{ icon }}',
'{{ dataProvider }}',
'{{ categories }}',
'{{ publisher }}',
'{{ requestAccess }}',
'{{ restrictedExportConfig }}',
'{{ discoveryType }}',
{{ logLinkedDatasetQueryUserEmail }},
{{ allowOnlyMetadataSharing }},
'{{ projectsId }}',
'{{ locationsId }}',
'{{ dataExchangesId }}',
'{{ listingId }}'
RETURNING
name,
allowOnlyMetadataSharing,
bigqueryDataset,
categories,
commercialInfo,
dataProvider,
description,
discoveryType,
displayName,
documentation,
icon,
logLinkedDatasetQueryUserEmail,
primaryContact,
publisher,
pubsubTopic,
requestAccess,
resourceType,
restrictedExportConfig,
state
;

UPDATE examples

Updates an existing listing.

UPDATE google.analyticshub.listings
SET
data__bigqueryDataset = '{{ bigqueryDataset }}',
data__pubsubTopic = '{{ pubsubTopic }}',
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__primaryContact = '{{ primaryContact }}',
data__documentation = '{{ documentation }}',
data__icon = '{{ icon }}',
data__dataProvider = '{{ dataProvider }}',
data__categories = '{{ categories }}',
data__publisher = '{{ publisher }}',
data__requestAccess = '{{ requestAccess }}',
data__restrictedExportConfig = '{{ restrictedExportConfig }}',
data__discoveryType = '{{ discoveryType }}',
data__logLinkedDatasetQueryUserEmail = {{ logLinkedDatasetQueryUserEmail }},
data__allowOnlyMetadataSharing = {{ allowOnlyMetadataSharing }}
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND dataExchangesId = '{{ dataExchangesId }}' --required
AND listingsId = '{{ listingsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
allowOnlyMetadataSharing,
bigqueryDataset,
categories,
commercialInfo,
dataProvider,
description,
discoveryType,
displayName,
documentation,
icon,
logLinkedDatasetQueryUserEmail,
primaryContact,
publisher,
pubsubTopic,
requestAccess,
resourceType,
restrictedExportConfig,
state;

DELETE examples

Deletes a listing.

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

Lifecycle Methods

Subscribes 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.

EXEC google.analyticshub.listings.projects_locations_data_exchanges_listings_subscribe 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@dataExchangesId='{{ dataExchangesId }}' --required,
@listingsId='{{ listingsId }}' --required
@@json=
'{
"destinationDataset": "{{ destinationDataset }}",
"destinationPubsubSubscription": "{{ destinationPubsubSubscription }}"
}';