標籤總覽
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
標籤是您定義的中繼資料,可協助使用者管理及尋找 Google 雲端硬碟中的檔案,以及為檔案套用政策。開發人員可透過雲端硬碟 API,為檔案和資料夾套用標籤、設定標籤欄位值、讀取檔案的標籤和欄位值,以及使用自訂標籤分類定義的中繼資料字詞搜尋檔案。
雲端硬碟標籤可將中繼資料附加至檔案和資料夾,支援業務流程。標籤的常見用途包括:
依資訊管理策略分類內容:建立標籤,找出敏感內容或需要特殊處理的資料。舉例來說,您可以建立名為「機密程度」的標籤 (含有以顏色編碼的選項值),並將值設為「極機密」、「機密」和「公開」。
將政策套用至雲端硬碟中的項目:建立標籤,在整個生命週期中管理雲端硬碟內容,並確保內容符合貴機構的記錄保留程序。舉例來說,您可以使用標籤管理資料遺失防護 (DLP) 政策,禁止使用者下載「機密程度」標籤設為「極機密」的檔案。
整理及尋找檔案:建立標籤,讓貴機構使用者根據標籤和欄位尋找項目,進而提升貴公司內容的搜尋效率。舉例來說,您可以為「待簽署」套用「簽署狀態」標籤組,找出所有在特定日期前待簽署的合約。這樣一來,當有人搜尋「待簽署」時,雲端硬碟搜尋功能就會傳回這些合約。
以下是雲端硬碟標籤的常用字詞:
- 標籤
雲端硬碟檔案的結構化中繼資料。
雲端硬碟使用者可以為檔案指派標籤,並設定標籤欄位值。標籤由下列項目組成:
- 標籤名稱
- 標籤的資源名稱。標籤 ID 是標籤名稱的一部分。視要求而定,名稱格式為
labels/{id}
或 labels/{id}@{revisionId}
。詳情請參閱下方的「標籤修訂」一節。
- 標籤 ID
- 唱片的全球專屬 ID。ID 是標籤名稱的一部分,但與名稱不同,ID 在修訂版本之間會保持一致。
- 欄位
標籤中可設定的個別元件,並具有型別。標籤可以有零個或多個相關聯的欄位。如果欄位在 Google 雲端硬碟標籤 API 中設定為 ListOptions
,選取和使用者欄位可以設定多個值。
- 欄位類型
- 與欄位相關聯的值的資料類型。可設定為整數、dateString、文字、使用者或選取項目。所選類型會影響適用於雲端硬碟項目的有效值,以及可用的搜尋查詢選項。
- 標籤分類
使用者可將設定的標籤欄位套用至雲端硬碟檔案。可透過 Drive Labels API 讀取及寫入。也稱為標籤架構。
- 標籤修訂
標籤的執行個體。每當建立、更新、發布或淘汰標籤時,標籤修訂版本就會遞增。
- 草稿修訂版本
- 目前標籤草稿執行個體的修訂號碼。您可以對標籤進行多次更新,每次更新都會增加草稿修訂版本號碼,但不會影響已發布的修訂版本。草稿標籤功能可讓您先測試標籤更新,再發布更新。
- 已發布的修訂版本
- 已發布標籤版本的修訂版本號碼。發布的標籤是使用者可用的標籤例項。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-04 (世界標準時間)。
[null,null,["上次更新時間:2025-08-04 (世界標準時間)。"],[],[],null,["# Labels overview\n\n*Labels* are metadata that you define to help users organize, find, and apply\npolicy to files in Google Drive. The Drive API allows developers to\napply labels to files and folders, set label field values, read labels and field\nvalues on files, and search for files using metadata terms defined by the custom\nlabel taxonomy.\n\nDrive labels can support business processes by attaching metadata\nto files and folders. Common uses for labels are:\n\n- **Classify content to follow an information governance strategy**---Create a\n label to identify sensitive content or data that requires special handling.\n For example, you might create a badged label (a label with color-coded\n option values) titled \"Sensitivity\" with the values of \"Top Secret,\"\n \"Confidential,\" and \"Public.\"\n\n- **Apply policy to items in Drive**---Create labels to manage\n Drive content throughout its lifecycle and ensure it adheres\n to your organization's record keeping practices. For example, use labels to\n manage a data loss policy (DLP) whereby users can't download files with a\n \"Sensitivity\" label set to \"Top Secret\".\n\n- **Curate and find files**---Create labels to increase searchability of your\n company's content by letting people in your organization find items based on\n labels and their fields. For example, apply a \"Signature Status\" label set\n to \"Awaiting Signature\" to all contracts awaiting signature by a specific\n date. Drive search can then return these contracts when\n someone searches \"awaiting signature\".\n\nBelow is a list of common terms used by Drive labels:\n\n*Label*\n\n: Structured metadata placed on a Drive file.\n Drive users can assign labels and set label field values\n for files. Labels are composed of:\n\n *Label name*\n : The resource name of the label. The *label ID* is part of the\n Label name. Depending on the request, the name is in the form of either:\n `labels/{id}` or `labels/{id}@{revisionId}`. For more information, see\n [Label revision](#revision) below.\n\n *Label ID*\n : A globally unique identifier for the label. The ID is part of the\n label name, but unlike the name, it's consistent between revisions.\n\n*Field*\n\n: An individual typed, settable component of a label. A label can have zero or\n more fields associated with it. Selection and user fields can be set with\n multiple values if the field is configured with\n [`ListOptions`](/workspace/drive/labels/reference/rest/v2/labels#listoptions) in the\n [Google Drive Labels API](/workspace/drive/labels/guides/overview).\n\n *Field type*\n : The data type of the value associated with the *field*. Configurable as\n integer, dateString, text, user, or selection. The type chosen impacts\n both the valid values applicable to Drive items and the\n search query options available.\n\n*Label taxonomy*\n\n: The configured label fields available to users for application to\n Drive files. Readable and writable through the\n Drive Labels API. Also known as the label schema.\n\n*Label revision*\n\n: An instance of the label. Anytime a label is created, updated, published, or\n deprecated, the label revision increments.\n\n *Draft revision*\n : The revision number of the current draft instance of the label. You can\n make several updates to a label, each incrementing its draft revision\n number, without affecting the published revision. The ability to have\n draft labels lets you test label updates before publishing.\n\n *Published revision*\n : The revision number of the published version of a label. The published\n label is the instance of the label available to users.\n\nRelated topics\n--------------\n\n- To learn about using labels in Drive, see [Set a label field\n on a file](/workspace/drive/api/guides/set-label).\n- Learn more about the [Drive Labels API](/workspace/drive/labels/guides/overview)."]]