เริ่มต้นใช้งาน
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เมื่อคุณทำงานร่วมกับฝ่ายขายหรือฝ่ายสนับสนุนเพื่อตั้งค่าการเข้าถึงการโอนข้อมูลเวอร์ชัน 2.0
คุณจะได้รับชื่อที่เก็บข้อมูล คุณจะต้องระบุข้อมูลติดต่อของฝ่ายขาย
Google Group ซึ่งให้คุณควบคุม
เข้าถึงไฟล์ข้อมูลใน Google Cloud Storage
คุณสามารถเลือกเข้าถึงข้อมูลโดยใช้ยูทิลิตี
หรือคุณจะเขียนรหัสของคุณเองก็ได้
เข้าถึงข้อมูลโดยใช้ gsutil
เครื่องมือ gsutil คือแอปพลิเคชันบรรทัดคำสั่งที่เขียนด้วยภาษา Python ซึ่ง
ทำให้คุณเข้าถึงข้อมูลได้โดยไม่ต้องเขียนโค้ดใดๆ คุณ
ตัวอย่างเช่น ใช้ gsutil เป็นส่วนหนึ่งของไฟล์สคริปต์หรือไฟล์กลุ่มแทนที่จะใช้
การสร้างแอปพลิเคชันที่กำหนดเอง
ในการเริ่มต้นใช้งาน gsutil โปรดอ่าน gsutil
เอกสารประกอบ เครื่องมือจะแสดงข้อความแจ้งให้คุณกรอกข้อมูลเข้าสู่ระบบเป็นครั้งแรก
คุณใช้ผลิตภัณฑ์นั้นแล้วเก็บไว้ใช้ในภายหลัง
ตัวอย่าง gsutil
คุณระบุไฟล์ทั้งหมดได้โดยใช้ gsutil ดังนี้
gsutil ls gs://[bucket_name]/[object name/file name]
gsutil ใช้ไวยากรณ์ส่วนใหญ่เดียวกันกับ UNIX รวมถึงไวลด์การ์ด
เครื่องหมายดอกจัน (*) คุณจึงสามารถแสดงรายการไฟล์ Networkimpressions ทั้งหมดได้ดังนี้
gsutil ls gs://[bucket_name]/dcm_account6837_impression_*
การดาวน์โหลดไฟล์ยังทำได้ง่ายๆ ดังนี้
gsutil cp gs://[bucket_name]/dcm_account6837_impression_2015120100.log.gz
คุณคัดลอกไฟล์จากที่เก็บข้อมูล Google ของ DT ที่กระจายอยู่ไปยังที่เก็บข้อมูล GCS ของ Google API ของคุณเองได้
โดยใช้สคริปต์ Shell ของ Unix จะมีสองตัวเลือก:
เข้าถึงข้อมูลแบบเป็นโปรแกรม
Google Cloud Storage มี API และตัวอย่างสำหรับการเขียนโปรแกรมมากมาย
ภาษาที่ช่วยให้คุณเข้าถึงข้อมูล
แบบเป็นโปรแกรมได้ ด้านล่างนี้คือ
ขั้นตอนสำหรับการโอนข้อมูลเวอร์ชัน 2.0 ที่คุณต้องทำเพื่อสร้าง
ของคุณ
รับบัญชีบริการ
ก่อนที่จะเริ่มต้นใช้งานการโอนข้อมูลเวอร์ชัน 2.0
ใช้
เครื่องมือตั้งค่า ซึ่งจะแนะนำขั้นตอนการสร้างโปรเจ็กต์ใน
คอนโซล Google API, การเปิดใช้ API และการสร้างข้อมูลเข้าสู่ระบบ
วิธีตั้งค่าบัญชีบริการใหม่มีดังนี้
- คลิกสร้างข้อมูลเข้าสู่ระบบ > คีย์บัญชีบริการ
- เลือกว่าจะดาวน์โหลดคีย์สาธารณะ/ส่วนตัวของบัญชีบริการเป็น
ไฟล์ P12 มาตรฐาน หรือเป็นไฟล์ JSON ที่โหลดโดยไคลเอ็นต์ Google API ได้
ไลบรารี
จะมีการสร้างคู่คีย์สาธารณะ/ส่วนตัวใหม่และดาวน์โหลดลงในเครื่องของคุณ โดยจะเป็นสำเนาเพียงรายการเดียวของคีย์นี้ คุณมีหน้าที่รับผิดชอบในการจัดเก็บข้อมูล
ได้อย่างปลอดภัย
โปรดเปิดหน้าต่างนี้ค้างไว้ คุณจะต้องใช้อีเมลของบัญชีบริการ
ในขั้นตอนถัดไป
เพิ่มบัญชีบริการลงในกลุ่ม
- ไปที่ Google Group
- คลิกที่ "กลุ่มของฉัน" แล้วเลือกกลุ่มที่คุณใช้ในการจัดการการเข้าถึง
ไปยังที่เก็บข้อมูล Cloud Storage ของ DT v2.0
- คลิก "จัดการ"
- อย่าคลิกเชิญสมาชิก
- คลิกเพิ่มสมาชิกโดยตรง
- คัดลอกอีเมลบัญชีบริการจากขั้นตอนก่อนหน้าลงใน
ช่องสมาชิก
- เลือก "ไม่มีอีเมล"
- คลิกปุ่ม เพิ่ม
ฉันคลิก "เชิญสมาชิก" โดยไม่ได้ตั้งใจ
เพิ่มเติม...
- ไม่ต้องตกใจ คุณแก้ไขได้
- กลับไปที่หน้าจอจัดการตามเดิม
- คลิกข้อความเชิญที่ค้างอยู่
- ค้นหาและเลือกบัญชีบริการ
- คลิก "เพิกถอนคำเชิญ" ที่ด้านบนของหน้าจอ
- คลิก "เพิ่มสมาชิกโดยตรง" แล้วทำต่อตามขั้นตอนข้างต้น
ขอบเขต
ขอบเขตทั้งหมดที่ส่งไปยัง Cloud Storage ต้องเป็นแบบอ่านอย่างเดียว
ตัวอย่างเช่น เมื่อใช้ไลบรารีของไคลเอ็นต์ Java ขอบเขตที่ถูกต้องสำหรับ
การใช้งานคือ:
StorageScopes.DEVSTORAGE_READ_ONLY
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-08-31 UTC"],[[["\u003cp\u003eData Transfer v2.0 provides access to your data files stored in a designated Google Cloud Storage bucket.\u003c/p\u003e\n"],["\u003cp\u003eYou can control access to your data by providing a Google Group to your sales contact during setup.\u003c/p\u003e\n"],["\u003cp\u003eTwo primary methods for accessing your data are available: using the gsutil command-line utility or programmatically via Google Cloud Storage APIs.\u003c/p\u003e\n"],["\u003cp\u003eProgrammatic access requires setting up a service account and granting it read-only access to your data within the designated Google Group.\u003c/p\u003e\n"]]],["Data Transfer v2.0 access requires a bucket name and a Google Group for control. Access data via the `gsutil` command-line tool, using commands like `gsutil ls` (list files) and `gsutil cp` (copy files), or programmatically using Google Cloud Storage APIs. For programmatic access, create a service account, download its key, and add it to your Google Group for bucket access. Ensure the service account's scope is set to \"read-only,\" for example: `StorageScopes.DEVSTORAGE_READ_ONLY`. You can copy files between buckets using scripts.\n"],null,["# Getting Started\n\nWhen you work with your sales or support contact to setup access to Data Transfer v2.0,\nyou will be provided with a bucket name. You will need to provide your sales contact a\n[Google Group](http://groups.google.com/) which enables you to control\naccess to your data files in [Google Cloud Storage](//cloud.google.com/storage/).\n\n\nYou can choose to access your data using a [utility](#access-data-using-gsutil)\nor you can write your own [code.](#access-data-programmatically)\n\nAccess data using gsutil\n------------------------\n\nThe gsutil tool is a command-line application, written in Python, that\nlets you access your data without having to do any coding. You\ncould, for example, use gsutil as part of a script or batch file instead of\ncreating custom applications.\n\n\nTo get started with gsutil read the [gsutil\ndocumentation](/storage/docs/gsutil). The tool will prompt you for your credentials the first time\nyou use it and then store them for use later on.\n\n### gsutil examples\n\nYou can list all of your files using gsutil as follows:\n`gsutil ls gs://[bucket_name]/[object name/file name]`\n\ngsutil uses much of the same syntax as UNIX, including the wildcard\nasterisk (\\*), so you can list all NetworkImpression files:\n`gsutil ls gs://[bucket_name]/dcm_account6837_impression_*`\n\nIt's also easy to download a file:\n`gsutil cp gs://[bucket_name]/dcm_account6837_impression_2015120100.log.gz`\n\nYou can copy your files from the dispersed DT Google buckets to your own Google API GCS Bucket\nusing a Unix shell script, there are two options:\n\n- In gsutil, if you are using a Unix System, run the following for all your buckets daily:\n\n ```bash\n $ day=$(date --date=\"1 days ago\" +\"%m-%d-%Y\")\n $ gsutil -m cp gs://{\u003cdcmhashid_A\u003e,\u003cdcmhashid_B\u003e,etc.}/*$day*.log.gz gs://\u003cclient_bucket\u003e/\n ```\n- Alternatively, a solution that is a little trickier is to use a bash file:\n\n ```bash\n #!/bin/bash\n\n set -x\n\n buckets={dfa_-hasid_A dfa_-hashid_B,...} #include all hash ids\n day=$(date --date=\"1 days ago\" +\"%m-%d-%Y\")\n for b in ${buckets[@]}; do /\n gsutil -m cp gs://$b/*$day*.log.gz gs:/// /\n done\n ```\n\nAccess data programmatically\n----------------------------\n\n\n[Google Cloud Storage](/storage) has APIs and [samples](/storage/docs/json_api/v1/libraries) for many programming\nlanguages that allow you to access your data in a programmatic way. Below are\nthe steps specific to Data Transfer v2.0 that you must take to build a\nworking integration.\n\n### Get a service account\n\n\nTo get started using Data Transfer v2.0, you need to first\n[use\nthe setup tool](https://console.cloud.google.com/start/api?id=storage_component&credential=client_key), which guides you through creating a project in the\nGoogle API Console, enabling the API, and creating credentials.\n\n\u003cbr /\u003e\n\n\nTo set up a new service account, do the following:\n\n1. Click **Create credentials \\\u003e Service account key**.\n2. Choose whether to download the service account's public/private key as a standard P12 file, or as a JSON file that can be loaded by a Google API client library.\n\nYour new public/private key pair is generated and downloaded to your machine;\nit serves as the only copy of this key. You are responsible for storing it\nsecurely.\n\n\u003cbr /\u003e\n\n|\n| **Note:** If you plan to access Google Cloud Storage using the\n| [JSON API](/storage/docs/json_api), then you must also verify\n| that the [Google Cloud Storage JSON API](//console.developers.google.com//project/_/apiui/apiview/storage_api/overview) component is activated as well.\n\nBe sure to keep this window open, you will need the service account email\nin the next step.\n\n\n### Add a service account to your group\n\n- Go to [Google Group](http://groups.google.com/)\n- Click on My Groups and select the group you use for managing access to your DT v2.0 Cloud Storage Bucket\n- Click Manage\n- **Do not click Invite Members!**\n- Click Direct add members\n- Copy the service account email from the previous step into the members box\n- Select No email\n- Click the Add button\n\n#### I accidentally clicked Invite Members\n\n[More...]()\n\n- Don't Panic! You can fix it\n- Head back to the Manage screen as before\n- Click on Outstanding Invitations\n- Find the service account and select it\n- Click Revoke invitation at the top of the screen\n- Click Direct add members and resume steps above\n\n### Scope\n\n\n**Any scopes passed to Cloud Storage must be Read Only**\n\nFor example, when using the Java client library the correct scope to\nuse is: \n\n```scdoc\nStorageScopes.DEVSTORAGE_READ_ONLY\n```\n\n\u003cbr /\u003e"]]