您只能刪除由您或擁有專案存取權限的人所新增的自訂映像檔。
如要保留映像檔備份,請先將自訂映像檔匯出至 Cloud Storage,再刪除映像檔。
事前準備
- 參閱映像檔文件。
-
如果尚未設定驗證,請先完成設定。
驗證可確認您的身分,以便存取 Trusted Cloud by S3NS 服務和 API。如要從本機開發環境執行程式碼或範例,可以選取下列任一選項,向 Compute Engine 進行驗證:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Trusted Cloud console to access Trusted Cloud by S3NS services and APIs, you don't need to set up authentication.
gcloud
-
安裝 Google Cloud CLI,然後 使用同盟身分登入 gcloud CLI。 登入後,請執行下列指令初始化 Google Cloud CLI:
gcloud init
- Set a default region and zone.
Python
如要在本機開發環境中使用本頁的 Python 範例,請安裝並初始化 gcloud CLI,然後使用使用者憑證設定應用程式預設憑證。
安裝 Google Cloud CLI,然後 使用同盟身分登入 gcloud CLI。
Create local authentication credentials for your user account:
gcloud auth application-default login
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
詳情請參閱 Set up authentication for a local development environment。
REST
如要在本機開發環境中使用本頁的 REST API 範例,請使用您提供給 gcloud CLI 的憑證。
安裝 Google Cloud CLI,然後 使用同盟身分登入 gcloud CLI。
詳情請參閱 Trusted Cloud 驗證說明文件中的「Authenticate for using REST」。
刪除自訂映像檔
請使用下列其中一種方法刪除圖片。
主控台
前往 Trusted Cloud 控制台的「Images」頁面。
找到您要刪除的映像檔,並勾選該映像檔左側的方塊。
按一下頁面頂端的 [Delete] (刪除),即可刪除映像檔。
gcloud
使用
gcloud compute images delete
指令刪除映像檔:gcloud compute images delete IMAGE_NAME
將
IMAGE_NAME
替換為要刪除的映像檔名稱。Go
Java
Python
REST
對
images().delete
方法發出POST
要求。指定要刪除的映像檔名稱。POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/images/RESOURCE_ID
更改下列內容:
PROJECT_ID
:圖片所屬的專案。RESOURCE_ID
:要刪除的映像檔名稱。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-09-30 (世界標準時間)。
[[["容易理解","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-09-30 (世界標準時間)。"],[],[],null,[]] -