管理 Gemini Code Assist 授權

貴機構中的每位使用者都必須取得授權,才能使用 Gemini Code Assist。

如果是新的訂閱方案,預設必須手動指派授權。設定特定 Gemini for Google Cloud 產品後,您可以選擇手動自動指派授權。

事前準備

變更訂閱方案中的 Gemini Code Assist 授權數量

您可以直接透過 Google Cloud 控制台,或透過 Google 帳戶代表或授權經銷商,新增或移除 Gemini for Google Cloud 授權。

如要變更訂閱方案中的授權數量,請按照下列步驟操作:

  1. 請確認您擁有以下身分和存取權管理權限,才能管理擁有訂閱項目的帳單帳戶:

    • billing.accounts.get
    • consumerprocurement.orders.get
    • consumerprocurement.orders.modify
    • resourcemanager.projects.get
  2. 前往 Google Cloud 控制台的「Gemini 管理員」頁面。

    前往 Gemini 版 Google Cloud

  3. 選擇要變更的訂閱項目,然後選取「修改訂閱項目」

  4. 輸入所需的授權數量。系統會顯示下列資訊:

    • 購買後的授權總數。
    • 購買後可指派的授權數量。
    • 每個學期的新訂閱價格。新增授權的額外金額會依據目前期限剩餘的時間按比例計算。
  5. 選取「儲存」

查看 Gemini Code Assist 授權指派

選取下列其中一個選項:

主控台API
  1. 請確認您擁有擁有訂閱項目的結帳帳戶的下列身分與存取權管理權限:

    • billing.accounts.get
    • consumerprocurement.orders.get
    • consumerprocurement.licensePools.get
    • consumerprocurement.licensePools.enumerateLicensedUsers
    • resourcemanager.projects.get
  2. 前往 Gemini 管理員頁面。

    前往 Gemini 版 Google Cloud

  3. 選擇要變更的訂閱項目,然後選取「修改訂閱項目」

    每位已指派授權的使用者都能查看以下資訊:

    • 名稱。
    • 授權日期。
    • 上次使用授權的日期和時間。
  4. 如要尋找特定使用者組合,您可以按照下列方式篩選及排序清單:

    • 如要篩選清單,請在「Filter」欄位中輸入屬性和值。
    • 如要排序清單,請選取要排序的欄標題。舉例來說,如要依使用者名稱排序,請選取「Name」資料欄標題。

如要查看 Gemini Code Assist 授權指派,請使用 billingAccounts.orders.licensePool.enumerateLicensedUsers 方法

如要執行這項工作,您必須具備擁有訂閱項目的帳單帳戶的 consumerprocurement.licensePools.enumerateLicensedUsers 權限。

GET https://cloudcommerceconsumerprocurement.googleapis.com/v1/billingAccounts/BILLING_ACCOUNT_ID/orders/ORDER_ID/licensePool:enumerateLicensedUsers/

更改下列內容:

  • BILLING_ACCOUNT_ID:帳單帳戶 ID
  • ORDER_ID:IAM 政策

如果指令成功執行,則會傳回下列格式的 licensedUsers 輸出內容:

{
  "licensedUsers": [
      {
          "username": "dana@example.com",
          "assignTime": "2024-09-26T16:24:40.559222Z"
      },
      {
          "username": "lee@example.com",
          "assignTime": "2024-09-26T16:24:40.559222Z"
      },
      {
          "username": "taylor@example.com",
          "assignTime": "2024-09-26T16:24:40.559222Z"
      },
      {
          "username": "bola@example.com",
          "assignTime": "2024-09-26T16:24:14.610828Z"
      }
  ]
}

如果沒有 Gemini Code Assist 授權指派,或是 ORDER_ID 無效,系統會以以下格式傳回 licensedUsers 輸出內容:

{}

手動將 Gemini Code Assist 授權指派給個別使用者

選取下列其中一個選項:

主控台API
  1. 請確認您擁有擁有訂閱項目的結帳帳戶的下列身分與存取權管理權限:

    • billing.accounts.get
    • consumerprocurement.orders.get
    • consumerprocurement.licensePools.get
    • consumerprocurement.licensePools.enumerateLicensedUsers
    • consumerprocurement.licensePools.assign
    • resourcemanager.projects.get
  2. 前往 Gemini 管理員頁面。

    前往 Gemini 版 Google Cloud

  3. 選取「管理 Gemini Code Assist」,然後選取「修改訂閱」

  4. 針對這個 Gemini Code Assist 訂閱,請務必將「授權指派」設為「手動指派授權」。如果 Gemini Code Assist 訂閱方案設為「自動指派授權」,您就無法管理個別授權。將此帳單帳戶切換為「手動指派授權」後,系統會關閉自動授權指派功能,但不會影響先前建立的授權指派。

  5. 選取「指派授權」。系統隨即會顯示使用者選取對話方塊。如要搜尋特定使用者,請輸入他們的電子郵件地址,然後選取「下一步」

  6. 選取「指派授權」

  7. 請務必為授權使用者授予「Gemini for Google Cloud 使用者」和「服務使用者」IAM 角色

如要指派 Gemini Code Assist 授權,請使用 billingAccounts.orders.licensePool.assign 方法

如要執行這項工作,請確認您在擁有訂閱項目的付款帳戶中具備下列權限:

  • billing.accounts.get
  • consumerprocurement.licensePools.assign
  • consumerprocurement.licensePools.get
  • consumerprocurement.licensePools.unassign
  • consumerprocurement.orders.get
POST https://cloudcommerceconsumerprocurement.googleapis.com/v1/billingAccounts/BILLING_ACCOUNT_ID/orders/ORDER_ID/licensePool:assign/

{
  "usernames": [
            "dana@example.com",
            "lee@example.com"
  ]
}

更改下列內容:

  • BILLING_ACCOUNT_ID:帳單帳戶 ID
  • ORDER_ID:IAM 政策

如果指令成功,則會以以下格式傳回空白的回應主體:

{}

如要驗證指派作業,請查看指派作業清單

接著,請務必為授權使用者授予 Gemini for Google Cloud 使用者和服務使用者消費者 IAM 角色

自動指派 Gemini Code Assist 授權

您可以透過「授權指派」頁面,自動將授權指派給機構內需要存取 Gemini Code Assist 的任何使用者。自動指派授權功能會為每個訂閱項目個別設定。

如果您選擇自動指派 Gemini Code Assist 的授權,就無法移除或新增該帳戶下的個別使用者授權。已指派授權的使用者如果未使用任何 Gemini Code Assist 功能,且在管理員設定的指定天數內未使用,系統會在帳單週期結束時自動取消其授權。

  1. 前往 Google Cloud 控制台的「Gemini 管理員」頁面。

    前往 Gemini 版 Google Cloud

  2. 依序選取「管理 Gemini Code Assist」和「管理訂閱方案」

  3. 選取「授權管理」,然後選取「啟用自動授權指派」。系統會顯示「啟用自動授權」對話方塊。

    將此訂閱項目切換為自動指派授權後,系統會在變更後關閉手動授權指派功能,但不會影響先前建立的授權指派。

  4. 設定授權的取消指派時間長度 (如果指派對象處於停用狀態),然後選取「確認變更」。畫面上會顯示「已啟用自動指派授權功能」對話方塊。

  5. 選取「關閉」

  6. 請務必為授權使用者授予「Gemini for Google Cloud 使用者」和「服務使用者」IAM 角色

    當具備 cloudaicompanion.licenses.selfAssign 權限的使用者首次在帳單帳戶支付的專案中存取 Gemini Code Assist 時,系統會自動為他們指派授權。該帳單帳戶必須具備有效的訂閱項目,且已設定自動指派授權功能,並在帳單帳戶中提供可用的授權。

如要停用自動授權指派功能,請按照下列步驟操作:

  1. 前往 Google Cloud 控制台的「Gemini 管理員」頁面。

    前往 Gemini 版 Google Cloud

  2. 依序選取「管理 Gemini Code Assist」和「管理訂閱方案」

  3. 依序選取「License Management」和「Manage Automatic License Assignment」。畫面上會顯示「管理自動授權指派」對話方塊。

  4. 選取「Disable automatic license management」(停用自動授權管理)

  5. 選取「確認變更」

手動取消指派 Gemini Code Assist 授權

選取下列其中一個選項:

主控台API
  1. 請確認您擁有擁有訂閱項目的結帳帳戶的下列身分與存取權管理權限:

    • billing.accounts.get
    • consumerprocurement.orders.get
    • consumerprocurement.licensePools.get
    • consumerprocurement.licensePools.enumerateLicensedUsers
    • consumerprocurement.licensePools.unassign
    • resourcemanager.projects.get
  2. 前往 Gemini 管理員頁面。

    前往 Gemini 版 Google Cloud

  3. 依序選取「管理 Gemini Code Assist」和「管理訂閱方案」

  4. 依序選取「License Management」和「Manage Automatic License Assignment」。畫面上會顯示「管理自動授權指派」對話方塊。

  5. 選取要取消授權的使用者,然後選取「取消授權」

  6. 選取「確認」

如要取消指派 Gemini Code Assist 授權,請使用 billingAccounts.orders.licensePool.unassign 方法

如要執行這項工作,您必須具備擁有訂閱項目的帳單帳戶的 consumerprocurement.licensePools.unassign 權限。

POST https://cloudcommerceconsumerprocurement.googleapis.com/v1/billingAccounts/BILLING_ACCOUNT_ID/orders/ORDER_ID/licensePool:unassign/

{
  "usernames": [
            "dana@example.com",
            "lee@example.com"
  ]
}

更改下列內容:

  • BILLING_ACCOUNT_ID:帳單帳戶 ID
  • ORDER_ID:IAM 政策

如果指令成功,則會以以下格式傳回空白的回應主體:

{}

如要確認未指派的作業,請查看作業清單

轉移 Gemini Code Assist 授權

Gemini Code Assist 授權無法直接在使用者之間轉移。請改為取消指派授權,然後指派授權給新使用者。

禁止跨機構使用授權

Gemini Code Assist 授權會指派給個別使用者,而非機構或專案,讓個別使用者可在多個機構中使用 Gemini Code Assist。

任何透過 Gemini Code Assist 產生的記錄,都會與發生用量的專案相關聯,而非與授權使用者相關聯。此外,Gemini Code Assist 的任何自訂或設定 (例如程式碼自訂) 都是在專案層級完成,而非在授權或訂閱層級。

如要進一步防止在專案中跨組織使用 Gemini Code Assist,您可以執行下列任一操作:

  • 在專案中停用 Gemini for Google Cloud API。
  • 使用權限拒絕使用者存取專案。

限制