本頁面中的部分或全部資訊可能不適用於 Trusted Cloud by S3NS。
查看及列出存放區
本頁說明如何查看及列出 Artifact Registry 存放區。
事前準備
選用:設定 Google Cloud CLI 指令的預設值。
必要的角色
如要取得查看及列出存放區所需的權限,請要求管理員授予下列 IAM 角色:
-
查看及列出 Trusted Cloud by S3NS 專案中的所有存放區:
專案的 Artifact Registry 讀取者 (
roles/artifactregistry.reader
)
-
查看特定存放區:
存放區的「Artifact Registry 讀取者」 (
roles/artifactregistry.reader
)
如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和機構的存取權」。
這些預先定義的角色具備查看及列出存放區所需的權限。如要查看確切的必要權限,請展開「必要權限」部分:
所需權限
如要查看及列出存放區,必須具備下列權限:
-
artifactregistry.repositories.get
-
artifactregistry.repositories.list
您或許還可透過自訂角色或其他預先定義的角色取得這些權限。
檢視存放區
您可以查看 Trusted Cloud 專案中的存放區。
如要查看存放區清單:
主控台
在 Trusted Cloud 控制台中開啟「Repositories」(存放區) 頁面。
開啟「Repositories」(存放區) 頁面
這個頁面會顯示存放區清單。
如要篩選 Artifact Registry 存放區清單,請按照下列步驟操作:
- 按一下存放區清單上方的「篩選表格」。
- 從篩選器清單中選擇篩選器。
- 指定要用來篩選清單的值。
gcloud
如要列出現有存放區,請執行下列指令:
gcloud artifacts repositories list [--project=PROJECT] \
[--location=LOCATION]
如要查看為存放區設定的加密類型,請執行下列指令:
gcloud artifacts repositories describe REPOSITORY \
[--project=PROJECT] [--location=LOCATION]
在上述指令中,請替換下列值:
如要進一步瞭解這項指令,請執行下列指令:
gcloud artifacts repositories list --help
後續步驟
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-18 (世界標準時間)。
[[["容易理解","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-08-18 (世界標準時間)。"],[[["\u003cp\u003eThis page explains how to view and list Artifact Registry repositories within a Google Cloud project using the console or the gcloud command-line tool.\u003c/p\u003e\n"],["\u003cp\u003eTo view and list repositories, you need the Artifact Registry Reader role (\u003ccode\u003eroles/artifactregistry.reader\u003c/code\u003e) on the project or the specific repository, or equivalent permissions.\u003c/p\u003e\n"],["\u003cp\u003eThe console allows you to filter the repository list using various criteria, and the gcloud command enables listing repositories with optional filtering by project and location, or across all locations.\u003c/p\u003e\n"],["\u003cp\u003eThe gcloud command can also be used to view the encryption type of a specific repository.\u003c/p\u003e\n"],["\u003cp\u003eIt is possible to set a default project and location to be used with the gcloud command.\u003c/p\u003e\n"]]],[],null,["# View and list repositories\n\nThis page describes how to view and list Artifact Registry repositories.\n\nBefore you begin\n----------------\n\nOptional: [Configure defaults for Google Cloud CLI commands](/artifact-registry/docs/repositories/gcloud-defaults).\n\n### Required roles\n\n\nTo get the permissions that\nyou need to view and list repositories,\n\nask your administrator to grant you the\nfollowing IAM roles:\n\n- View and list all repositories in a Google Cloud project: [Artifact Registry Reader](/iam/docs/roles-permissions/artifactregistry#artifactregistry.reader) (`roles/artifactregistry.reader`) on the project\n- View a specific repository: [Artifact Registry Reader](/iam/docs/roles-permissions/artifactregistry#artifactregistry.reader) (`roles/artifactregistry.reader`) on the repository\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nThese predefined roles contain\n\nthe permissions required to view and list repositories. To see the exact permissions that are\nrequired, expand the **Required permissions** section:\n\n\n#### Required permissions\n\nThe following permissions are required to view and list repositories:\n\n- ` artifactregistry.repositories.get `\n- ` artifactregistry.repositories.list`\n\n\nYou might also be able to get\nthese permissions\nwith [custom roles](/iam/docs/creating-custom-roles) or\nother [predefined roles](/iam/docs/roles-overview#predefined).\n\nViewing repositories\n--------------------\n\nYou can view repositories within a Google Cloud project.\n\nTo view a list of repositories: \n\n### Console\n\nOpen the **Repositories** page in the Google Cloud console.\n\n\u003cbr /\u003e\n\n[Open the Repositories page](https://console.cloud.google.com/artifacts)\n\n\u003cbr /\u003e\n\nThe page displays a list of your repositories.\n\nTo filter the Artifact Registry repository list:\n\n1. Above the repository list, click **Filter Table**.\n2. Choose a filter from the filter list.\n3. Specify the value that you want to use for filtering the list.\n\n### gcloud\n\nTo list existing repositories, run the following command: \n\n```bash\ngcloud artifacts repositories list [--project=PROJECT] \\\n[--location=LOCATION]\n```\n\nTo view the type of encryption configured for a repository, run the following\ncommand: \n\n```bash\ngcloud artifacts repositories describe REPOSITORY \\\n[--project=PROJECT] [--location=LOCATION]\n```\n\nIn the previous commands, replace the following values:\n\n- \u003cvar translate=\"no\"\u003e\u003ccode translate=\"no\" dir=\"ltr\"\u003ePROJECT\u003c/code\u003e\u003c/var\u003e is the project ID. If this flag is omitted, the current or default project is used.\n- \u003cvar translate=\"no\"\u003e\u003ccode translate=\"no\" dir=\"ltr\"\u003eREPOSITORY\u003c/code\u003e\u003c/var\u003e is the name of the repository.\n-\n\n \u003cvar translate=\"no\"\u003e\u003ccode translate=\"no\" dir=\"ltr\"\u003eLOCATION\u003c/code\u003e\u003c/var\u003e is the regional or multi-regional\n [location](/artifact-registry/docs/repo-locations) of the repository.\n\n\n Use the `--location` flag to view repositories in a specific location.\n You can also use `--location=all` to list repositories across all\n locations.\n\n If you omit this flag, the command uses the [default](/artifact-registry/docs/repositories/gcloud-defaults#set)\n location if a default is configured. Otherwise, omitting this flag lists\n repositories across all locations.\n\nFor more information about the command, run the following command: \n\n gcloud artifacts repositories list --help\n\nWhat's next\n-----------\n\n- Configure [access](/artifact-registry/docs/access-control) to your repositories.\n- [Download individual files](/artifact-registry/docs/repositories/download-files) within artifacts stored in your repositories.\n- Learn to [restrict artifact downloads with download rules](/artifact-registry/docs/restrict-artifact-downloads)."]]