本页面介绍如何启用和停用 Artifact Registry。
如果您使用 Container Registry,可以在同一项目中启用 Artifact Registry。每项服务都独立运行。如需了解 Artifact Registry 的费用,请参阅价格。
如需了解如何启用 Artifact Analysis API 以及漏洞扫描的价格,请参阅 Artifact Analysis 文档。
启用服务
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
 - 
    
    
      
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
 - 
      Create a project: To create a project, you need the Project Creator
      (
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles. 
 - 
  
    
Verify that billing is enabled for your Google Cloud project.
 - 
    
    
      
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
 - 
      Create a project: To create a project, you need the Project Creator
      (
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles. 
 - 
  
    
Verify that billing is enabled for your Google Cloud project.
 - 如果尚未安装 Google Cloud CLI,请安装并初始化。对于现有安装,请使用以下命令更新 Google Cloud CLI 的组件:
    
gcloud components update。如需查看 gcloud CLI 的版本,请运行以下命令:
gcloud version
 - 通过 Google Cloud 控制台或以下 
gcloud命令启用该 API:gcloud services enable artifactregistry.googleapis.com
 - 代码库和代码库中的工件将无法访问。
 - API 被停用后,系统会在 7 天内删除数据。
 - 前往 Artifact Registry 的 API 概览页面。
 - 选择已启用该 API 的项目。
 - 点击管理。
 - 点击停用 API。
 
停用服务
在停用 Artifact Registry API 之前,请确保要保留的任何工件在其他位置提供。建议您在停用 API 之前先删除代码库。
在停用 Artifact Registry API 之时,以下条件适用:
如需通过 Google Cloud 控制台停用 API,请执行以下操作:
控制台
gcloud
运行以下命令来为当前项目停用该 API:
gcloud services disable artifactregistry.googleapis.com