刪除存放區
    
    
      
    
    
      
      透過集合功能整理內容
    
    
      
      你可以依據偏好儲存及分類內容。
    
  
  
      
    
  
  
  
  
    
  
  
    
    
    
    
必要的角色
  
  
  
  
  
  
  
    
    
    
    
    
    
      
      
        
        
        
        
        
      
    
      
      
        
        
        
        
        
      
    
    
    
    
    
  
  
    
      如要取得刪除存放區所需的權限,請要求管理員授予下列 IAM 角色:
  
  
  
    
      
          
            - 
  
  
    
      Secure Source Manager 執行個體存取者   (
roles/securesourcemanager.instanceAccessor)
    
              在 Secure Source Manager 執行個體上 
          
            - 
  
  
    
      Secure Source Manager 存放區管理員  (
roles/securesourcemanager.repoAdmin)
    
              存放區 
          
        
      
    
    
  
  
  如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和機構的存取權」。
  
  
  
  
      
      
      
        您或許還可透過自訂角色或其他預先定義的角色取得必要權限。
    
  
  
 
如要瞭解如何授予 Secure Source Manager 角色,請參閱「使用 IAM 控管存取權」和「授予使用者執行個體存取權」。
刪除存放區
如要刪除存放區和所有相關聯的資料,請使用下列 HTTP 方法和網址。
  
  
  
  
  
  
    
  
  使用任何要求資料之前,請先替換以下項目:
  
  - PROJECT_ID:執行 Secure Source Manager 的 Google Cloud 專案專案 ID。
 
  - LOCATION:執行個體所在的區域。如要瞭解支援的位置,請參閱「位置」。
 
  - REPOSITORY_ID:存放區 ID。
 
  
  HTTP 方法和網址:
  DELETE https://securesourcemanager.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/repositories/REPOSITORY_ID
如要傳送要求,請展開以下其中一個選項:
  curl (Linux、macOS 或 Cloud Shell)
  
  
    
      
    
  
  
  執行下列指令:
  
  
  
  
    
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  curl -X DELETE \
     -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     "https://securesourcemanager.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/repositories/REPOSITORY_ID"
  PowerShell (Windows)
  
  
    
      
    
  
  
  執行下列指令:
  
  
  
  
    
  
  
  
  
  
    
    
  
  
  
  
  
  
  
  
  
  
  
  
    
  
  
  
  
  
  
  
  
    
  
  $cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
    -Method DELETE `
    -Headers $headers `
    -Uri "https://securesourcemanager.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/repositories/REPOSITORY_ID" | Select-Object -Expand Content
    您應該會收到如下的 JSON 回應:
    
  
"name":"operations/cc3ea26c-9b57-11ed-be0a-2e3b5910efef","metadata":{"@type":"type.googleapis.com/google.cloud.securesourcemanager.v1.OperationMetadata","createTime":"2023-01-23T19:54:49.904779921Z","endTime":"2023-01-23T19:54:50.947030402Z","target":"projects/my-project/locations/us-central1/repositories/my-repo","verb":"delete","apiVersion":"v1"},"done":true,"response":{"@type":"type.googleapis.com/google.protobuf.Empty"}
```
後續步驟
  
  
  
  
    
  
 
  
    
    
      
    
    
  
       
         
  
       
    
    
  
  
  除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
  上次更新時間:2025-10-19 (世界標準時間)。
  
  
    
    
    
      
  
    
  
  
    
      [[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-10-19 (世界標準時間)。"],[],[]]