Manage subscriptions

As an Analytics Hub subscriber, you can perform the following tasks:

  • Subscribe to a listing.
  • List your current subscriptions in a given project.
  • Delete a subscription.

As an Analytics Hub publisher, you can perform the following tasks:

  • View all subscriptions to your listing.
  • Revoke access to a specific subscription.

A subscription is a regionalized resource which resides in the subscriber's project. Subscriptions store relevant information about the subscriber and represents the contract between publisher and subscriber.

Before you begin

To get started with Analytics Hub, you need to enable the Analytics Hub API inside your Google Cloud project.

Required permissions

To enable the Analytics Hub API, you need the following Identity and Access Management (IAM) permissions:

  • serviceUsage.services.get
  • serviceUsage.services.list
  • serviceUsage.services.enable

The following predefined IAM role includes the permissions that you need to enable the Analytics Hub API:

  • roles/serviceusage.serviceUsageAdmin

For more information about IAM roles in BigQuery, see Predefined roles and permissions.

Enable the Analytics Hub API

To enable the Analytics Hub API, do the following:

Console

Go to the Analytics Hub API for your Google Cloud project and enable it.

Enable the Analytics Hub API

gcloud

Run the gcloud services enable command:

gcloud services enable analyticshub.googleapis.com

Required permissions

To manage subscriptions, you must have one of the following Analytics Hub roles:

  • Analytics Hub Subscription Owner role (roles/analyticshub.subscriptionOwner), which lets you manage subscriptions that you create.

For more information, see Analytics Hub user roles.

Subscriber workflow

Subscribers can perform the following actions with subscriptions.

Subscribe to listings

To subscribe to listings, follow the steps in Subscribe to listings.

List subscriptions

To list all subscriptions, follow these steps.

API

To view your current subscriptions in a given project, use the projects.locations.subscriptions.list method.

GET https://analyticshub.googleapis.com/v1/projects/PROJECT_ID/location/LOCATION/subscriptions

Replace the following:

  • PROJECT_ID: the project ID that contains the subscriptions that you want to list.

  • LOCATION: the location for which you want to list the existing subscriptions.

Publisher workflow

Publishers can perform the following actions with subscriptions. For more information about managing subscriptions to listings, see Manage listings.

List subscriptions

To list all subscriptions, follow these steps.

Console

  1. In the Google Cloud console, go to the Analytics Hub page.

    Go to Analytics Hub

    A page appears that lists all data exchanges that you can access.

  2. Click the data exchange name in which you want to list the subscriptions.

  3. Click the Subscriptions tab to view all the subscriptions to listings within the data exchange.

API

To list subscriptions of Listings in a particular Data Exchange, use the projects.locations.dataExchanges.listSubscriptions method.

GET https://analyticshub.googleapis.com/v1/projects/PROJECT_ID/location/LOCATION/dataExchanges/DATAEXCHANGE_ID:listSubscriptions

Replace the following:

  • PROJECT_ID: the project ID of the Data Exchange for which you want to list the subscriptions want to remove.
  • LOCATION: the location of the Data Exchange.
  • DATAEXCHANGE_ID: the ID of the Data Exchange for which you want to list the subscriptions.

Remove a subscription

Console

  1. In the Google Cloud console, go to the Analytics Hub page.

    Go to Analytics Hub

    A page appears that lists all data exchanges that you can access.

  2. Click the data exchange name in which you want to create the listing.

  3. Click the Subscriptions tab to view all the subscriptions to the data exchange.

  4. Select the checkbox next to the subscriptions you wish to remove, or select all subscriptions.

  5. Click Remove subscriptions.

API

To remove a subscription, use the projects.locations.subscriptions.revoke method.

POST https://analyticshub.googleapis.com/v1/projects/PROJECT_ID/location/LOCATION/subscriptions/SUBSCRIPTION_ID:revoke

Replace the following:

  • PROJECT_ID: the project ID of the subscription that you want to remove.
  • LOCATION: the location of the subscription.
  • SUBSCRIPTION_ID: the ID of the subscription that you want to remove.

Limitations

Subscriptions are subject to the following limitations:

  • Linked datasets created before July 25, 2023 are not backfilled. Only subscriptions created after July 25, 2023 work with the API methods.

What's next