Saat ini, dengan Analytics Hub, Anda dapat membuat listingan yang hanya mereferensikan set data BigQuery. Setelah berlangganan listingan untuk set data BigQuery, Analytics Hub akan membuat set data tertaut di project pelanggan.
Permintaan HTTP
POST https://analyticshub.googleapis.com/v1/{name=projects/*/locations/*/dataExchanges/*/listings/*}:subscribe
Wajib. Nama resource listingan yang ingin Anda langgani, misalnya projects/myproject/locations/US/dataExchanges/123/listings/456.
Isi permintaan
Isi permintaan memuat data dengan struktur berikut:
Representasi JSON
{// Union field destination can be only one of the following:"destinationDataset": {object (DestinationDataset)}// End of list of possible types for union field destination.}
Kolom
Kolom union destination. Hasil tujuan listingan yang Anda ikuti. destination hanya ada berupa salah satu diantara berikut:
Wajib. Referensi yang mengidentifikasi set data tujuan.
friendlyName
string
Opsional. Nama deskriptif untuk set data.
description
string
Opsional. Deskripsi {i>dataset<i} yang mudah digunakan.
labels
map (key: string, value: string)
Opsional. Label yang terkait dengan set data ini. Anda dapat menggunakannya untuk mengatur dan mengelompokkan {i>dataset<i} Anda. Anda dapat menetapkan properti ini saat menyisipkan atau memperbarui set data. Lihat https://cloud.google.com/resource-manager/docs/creating-managing-labels untuk mengetahui informasi selengkapnya.
Objek yang berisi daftar pasangan "key": value. Contoh: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
Berisi referensi yang mengidentifikasi set data bigquery tujuan.
Representasi JSON
{"datasetId": string,"projectId": string}
Kolom
datasetId
string
Wajib. ID unik untuk set data ini, tanpa nama project. ID hanya boleh berisi huruf (a-z, A-Z), angka (0-9), atau garis bawah (_). Panjang maksimum adalah 1.024 karakter.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2024-04-19 UTC."],[[["\u003cp\u003eThis document outlines how to subscribe to a listing within Google Cloud's Analytics Hub, allowing users to access shared BigQuery datasets.\u003c/p\u003e\n"],["\u003cp\u003eThe subscription process involves sending a POST request to a specific URL, defined using gRPC Transcoding syntax, and includes required path parameters such as the listing's resource name.\u003c/p\u003e\n"],["\u003cp\u003eSubscribers can specify either a BigQuery dataset or a Pub/Sub subscription as the destination for the subscribed data, which involves setting parameters for \u003ccode\u003eDestinationDataset\u003c/code\u003e or \u003ccode\u003eDestinationPubSubSubscription\u003c/code\u003e respectively.\u003c/p\u003e\n"],["\u003cp\u003eThe response to a successful subscription request contains a \u003ccode\u003eSubscription\u003c/code\u003e object, detailing the newly created subscription and its configuration.\u003c/p\u003e\n"],["\u003cp\u003eThe subscription setup requires specific OAuth scopes and IAM permissions on the listing resource, specifically \u003ccode\u003eanalyticshub.listings.subscribe\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.dataExchanges.listings.subscribe\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.SubscribeListingResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [DestinationPubSubSubscription](#DestinationPubSubSubscription)\n - [JSON representation](#DestinationPubSubSubscription.SCHEMA_REPRESENTATION)\n- [PubSubSubscription](#PubSubSubscription)\n - [JSON representation](#PubSubSubscription.SCHEMA_REPRESENTATION)\n- [PushConfig](#PushConfig)\n - [JSON representation](#PushConfig.SCHEMA_REPRESENTATION)\n- [OidcToken](#OidcToken)\n - [JSON representation](#OidcToken.SCHEMA_REPRESENTATION)\n- [PubsubWrapper](#PubsubWrapper)\n- [NoWrapper](#NoWrapper)\n - [JSON representation](#NoWrapper.SCHEMA_REPRESENTATION)\n- [BigQueryConfig](#BigQueryConfig)\n - [JSON representation](#BigQueryConfig.SCHEMA_REPRESENTATION)\n- [CloudStorageConfig](#CloudStorageConfig)\n - [JSON representation](#CloudStorageConfig.SCHEMA_REPRESENTATION)\n- [TextConfig](#TextConfig)\n- [AvroConfig](#AvroConfig)\n - [JSON representation](#AvroConfig.SCHEMA_REPRESENTATION)\n- [ExpirationPolicy](#ExpirationPolicy)\n - [JSON representation](#ExpirationPolicy.SCHEMA_REPRESENTATION)\n- [DeadLetterPolicy](#DeadLetterPolicy)\n - [JSON representation](#DeadLetterPolicy.SCHEMA_REPRESENTATION)\n- [RetryPolicy](#RetryPolicy)\n - [JSON representation](#RetryPolicy.SCHEMA_REPRESENTATION)\n- [MessageTransform](#MessageTransform)\n - [JSON representation](#MessageTransform.SCHEMA_REPRESENTATION)\n- [JavaScriptUDF](#JavaScriptUDF)\n - [JSON representation](#JavaScriptUDF.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nSubscribes to a listing.\n\nCurrently, 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.\n\n### HTTP request\n\n`POST https://analyticshub.googleapis.com/v1/{name=projects/*/locations/*/dataExchanges/*/listings/*}:subscribe`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nMessage for response when you subscribe to a listing.\n\nIf successful, the response body contains data with the following structure:\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/bigquery`\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp).\n\nDestinationPubSubSubscription\n-----------------------------\n\nDefines the destination Pub/Sub subscription.\n\nPubSubSubscription\n------------------\n\nDefines the destination Pub/Sub subscription. If none of `pushConfig`, `bigqueryConfig`, `cloudStorageConfig`, `pubsubExportConfig`, or `pubsubliteExportConfig` is set, then the subscriber will pull and ack messages using API methods. At most one of these fields may be set.\n\nPushConfig\n----------\n\nConfiguration for a push delivery endpoint.\n\nOidcToken\n---------\n\nContains information needed for generating an [OpenID Connect token](https://developers.google.com/identity/protocols/OpenIDConnect).\n\nPubsubWrapper\n-------------\n\nThis type has no fields.\nThe payload to the push endpoint is in the form of the JSON representation of a PubsubMessage (\u003chttps://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pubsubmessage)\u003e.\n\nNoWrapper\n---------\n\nSets the `data` field as the HTTP body for delivery.\n\nBigQueryConfig\n--------------\n\nConfiguration for a BigQuery subscription.\n\nCloudStorageConfig\n------------------\n\nConfiguration for a Cloud Storage subscription.\n\nTextConfig\n----------\n\nThis type has no fields.\nConfiguration for writing message data in text format. Message payloads will be written to files as raw text, separated by a newline.\n\nAvroConfig\n----------\n\nConfiguration for writing message data in Avro format. Message payloads and metadata will be written to files as an Avro binary.\n\nExpirationPolicy\n----------------\n\nA policy that specifies the conditions for resource expiration (i.e., automatic resource deletion).\n\nDeadLetterPolicy\n----------------\n\nDead lettering is done on a best effort basis. The same message might be dead lettered multiple times.\n\nIf validation on any of the fields fails at subscription creation/updation, the create/update subscription request will fail.\n\nRetryPolicy\n-----------\n\nA policy that specifies how Pub/Sub retries message delivery.\n\nRetry delay will be exponential based on provided minimum and maximum backoffs. \u003chttps://en.wikipedia.org/wiki/Exponential_backoff\u003e.\n\nRetryPolicy will be triggered on NACKs or acknowledgement deadline exceeded events for a given message.\n\nRetry Policy is implemented on a best effort basis. At times, the delay between consecutive deliveries may not match the configuration. That is, delay can be more or less than configured backoff.\n\nMessageTransform\n----------------\n\nAll supported message transforms types.\n\nJavaScriptUDF\n-------------\n\nUser-defined JavaScript function that can transform or filter a Pub/Sub message."]]