[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eAnalytics Hub subscribers can subscribe to listings, list their current subscriptions, and delete subscriptions within a project.\u003c/p\u003e\n"],["\u003cp\u003eAnalytics Hub publishers can view all subscriptions to their listings and revoke access to specific subscriptions.\u003c/p\u003e\n"],["\u003cp\u003eEnabling the Analytics Hub API in your Google Cloud project requires specific Identity and Access Management (IAM) permissions or the \u003ccode\u003eroles/serviceusage.serviceUsageAdmin\u003c/code\u003e role.\u003c/p\u003e\n"],["\u003cp\u003eManaging subscriptions requires the Analytics Hub Subscription Owner role (\u003ccode\u003eroles/analyticshub.subscriptionOwner\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eSubscriptions are regionalized resources that store subscriber information and represent the contract between the publisher and subscriber.\u003c/p\u003e\n"]]],[],null,["Manage subscriptions\n\nAs an Analytics Hub subscriber, you can perform the following\ntasks:\n\n- Subscribe to a listing.\n- List your current subscriptions in a given project.\n- Delete a subscription.\n\nAs an Analytics Hub publisher, you can perform the following\ntasks:\n\n- View all subscriptions to your listing.\n- Revoke access to a specific subscription.\n\nA subscription is a regionalized resource which resides in the subscriber's\nproject. Subscriptions store relevant information about the subscriber and\nrepresents the contract between publisher and subscriber.\n\nBefore you begin\n\nTo get started with BigQuery sharing (formerly Analytics Hub), you need to\nenable the Analytics Hub API inside your Google Cloud project.\n\nRequired permissions\n\nTo enable the Analytics Hub API, you need the following\nIdentity and Access Management (IAM) permissions:\n\n- `serviceUsage.services.get`\n- `serviceUsage.services.list`\n- `serviceUsage.services.enable`\n\nThe following predefined IAM role includes the\npermissions that you need to enable the Analytics Hub API:\n\n- `roles/serviceusage.serviceUsageAdmin`\n\nFor more information about IAM roles in BigQuery,\nsee [Predefined roles and permissions](https://cloud.google.com/bigquery/docs/access-control).\n\nEnable the Analytics Hub API\n\nTo enable the Analytics Hub API, do the following: \n\nConsole\n\nGo to the **Analytics Hub API** page and enable the Analytics Hub API for\nyour Google Cloud project.\n\n[Enable the Analytics Hub API](https://console.cloud.google.com/apis/library/analyticshub.googleapis.com)\n\ngcloud\n\nRun the [gcloud services enable](/sdk/gcloud/reference/services/enable)\ncommand: \n\n```\ngcloud services enable analyticshub.googleapis.com\n```\n\nRequired roles\n\n\nTo get the permissions that\nyou need to manage subscriptions,\n\nask your administrator to grant you the\n\n\n[Analytics Hub Subscription Owner](/iam/docs/roles-permissions/analyticshub#analyticshub.subscriptionOwner) (`roles/analyticshub.subscriptionOwner`)\nIAM role on the project.\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nYou might also be able to get\nthe required permissions through [custom\nroles](/iam/docs/creating-custom-roles) or other [predefined\nroles](/iam/docs/roles-overview#predefined).\n\nSubscriber workflow\n\nSubscribers can perform the following actions with subscriptions.\n\nSubscribe to listings\n\nTo subscribe to listings, follow the steps in [Subscribe to listings](/bigquery/docs/analytics-hub-view-subscribe-listings#subscribe-listings).\n\nList subscriptions\n\nTo view your current subscriptions in a given project, use the\n[`projects.locations.subscriptions.list` method](/bigquery/docs/reference/analytics-hub/rest/v1/projects.locations.subscriptions/list): \n\n```\nGET https://analyticshub.googleapis.com/v1/projects/PROJECT_ID/location/LOCATION/subscriptions\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID that contains the\n subscriptions that you want to list.\n\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location for which you want to list\n the existing subscriptions.\n\nDelete a subscription\n\nTo delete a subscription, use the\n[`projects.locations.subscriptions.delete` method](/bigquery/docs/reference/analytics-hub/rest/v1/projects.locations.subscriptions/delete): \n\n DELETE https://analyticshub.googleapis.com/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/location/\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e/subscriptions/\u003cvar translate=\"no\"\u003eSUBSCRIPTION_ID\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID that contains the subscription that you want to delete.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location of the subscription that you want to delete. For more information about locations that support BigQuery sharing, see [Supported regions](/bigquery/docs/analytics-hub-introduction#supported-regions).\n- \u003cvar translate=\"no\"\u003eSUBSCRIPTION_ID\u003c/var\u003e: the ID of the subscription that you want to delete.\n\nThe request body must be empty. If the request is successful, the response\nbody contains an instance of the operation.\n\nWhen initiated by a subscriber, deleting a subscription deletes the\nlinked dataset from the subscriber's project.\n\nWhen deleting a subscription from a listing for multiple regions\n([Preview](/products#product-launch-stages)), all the primary and secondary\nlinked dataset replicas are also deleted from the subscriber's project.\n\nFor more information about the tasks that you can perform on subscriptions\nusing the API, see the\n[`projects.locations.subscriptions` methods](/bigquery/docs/reference/analytics-hub/rest/v1/projects.locations.subscriptions#methods).\n\nPublisher workflow\n\nPublishers can perform the following actions with subscriptions. For more\ninformation about managing subscriptions to listings, see [Manage\nlistings](/bigquery/docs/analytics-hub-manage-listings).\n\nList subscriptions\n\nTo list all subscriptions, select one of the following options. \n\nConsole\n\n1. In the Google Cloud console, go to the **Sharing (Analytics Hub)** page.\n\n [Go to Sharing (Analytics Hub)](https://console.cloud.google.com/bigquery/analytics-hub)\n\n A page appears that lists all the\n [data exchanges](/bigquery/docs/analytics-hub-introduction#data_exchanges)\n that you can access.\n2. Click the data exchange name in which you want to list the subscriptions.\n\n3. Click the **Subscriptions** tab to view all the subscriptions to listings\n within the data exchange.\n\nAPI\n\nTo list subscriptions of Listings in a particular Data Exchange, use the\n[`projects.locations.dataExchanges.listSubscriptions` method](/bigquery/docs/reference/analytics-hub/rest/v1/projects.locations.dataExchanges/listSubscriptions). \n\n```\nGET https://analyticshub.googleapis.com/v1/projects/PROJECT_ID/location/LOCATION/dataExchanges/DATAEXCHANGE_ID:listSubscriptions\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID of the Data Exchange for which you want to list the subscriptions want to remove.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location of the Data Exchange for which you want to list the subscriptions.\n- \u003cvar translate=\"no\"\u003eDATAEXCHANGE_ID\u003c/var\u003e: the ID of the Data Exchange for which you want to list the subscriptions.\n\nRevoke a subscription\n\nWhen a publisher revokes a subscription, the subscriber loses the ability to\nquery the linked dataset. Since this is a publisher-initiated action on a\nsubscriber-owned resource, the linked dataset remains dangling in the\nsubscriber's project. The subscriber can choose to remove the dangling\ndataset by deleting it.\n\nIf a publisher revokes a subscription from a listing for multiple regions\n([Preview](/products#product-launch-stages)), subscribers are no longer able to\nquery any primary or secondary linked dataset replicas.\n| **Caution:** Revoking [Cloud Marketplace-integrated commercial subscriptions](/bigquery/docs/analytics-hub-cloud-marketplace) might impact your customers and violate the [Cloud Marketplace Terms of Service](/terms/marketplace/launcher).\n\nTo revoke a subscription, select one of the following options: \n\nConsole\n\n1. In the Google Cloud console, go to the **Sharing (Analytics Hub)** page.\n\n [Go to Sharing (Analytics Hub)](https://console.cloud.google.com/bigquery/analytics-hub)\n\n A page appears that lists all data exchanges that you can access.\n2. Click the data exchange name in which you want to create the listing.\n\n3. Click the **Subscriptions** tab to view all the subscriptions to the data\n exchange.\n\n4. Select the checkbox next to the subscriptions that you want to revoke, or\n select all subscriptions.\n\n5. Click **Revoke subscriptions**.\n\nAPI\n\nTo revoke a subscription, use the\n[`projects.locations.subscriptions.revoke` method](/bigquery/docs/reference/analytics-hub/rest/v1/projects.locations.subscriptions/revoke). \n\n```\nPOST https://analyticshub.googleapis.com/v1/projects/PROJECT_ID/location/LOCATION/subscriptions/SUBSCRIPTION_ID:revoke\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID of the subscription that you want to revoke.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location of the subscription.\n- \u003cvar translate=\"no\"\u003eSUBSCRIPTION_ID\u003c/var\u003e: the ID of the subscription that you want to revoke.\n\nLimitations\n\nSubscriptions are subject to the following limitations:\n\n- Linked datasets created before July 25, 2023 are not backfilled. Only subscriptions created after July 25, 2023 work with the API methods.\n\nWhat's next\n\n- Read about [BigQuery sharing architecture](/bigquery/docs/analytics-hub-introduction#architecture).\n- Learn how to [view and subscribe to listings](/bigquery/docs/analytics-hub-view-subscribe-listings).\n- Learn about [Analytics Hub user roles](/bigquery/docs/analytics-hub-grant-roles#user_roles).\n- Learn about [creating datasets](/bigquery/docs/datasets).\n- Learn about [BigQuery sharing audit logging](/bigquery/docs/analytics-hub-audit-logging)."]]