

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 檢視或編輯套件群組
<a name="view-edit-package-group"></a>

您可以使用 CodeArtifact 主控台或 AWS Command Line Interface () 來檢視所有套件群組的清單、檢視特定套件群組的詳細資訊，或編輯套件群組的詳細資訊或組態AWS CLI。

## 檢視或編輯套件群組 （主控台）
<a name="view-edit-package-group-console"></a>

1. 開啟位於 [https://console.aws.amazon.com/codesuite/codeartifact/home](https://console.aws.amazon.com/codesuite/codeartifact/home) 的 AWS CodeArtifact 主控台。

1. 在導覽窗格中，選擇**網域**，然後選擇包含您要檢視或編輯之套件群組的網域。

1. 選擇**套件群組**，然後選擇您要檢視或編輯的套件群組。

1. 在**詳細資訊**中，檢視套件群組的相關資訊，包括其父群組、描述、ARN、聯絡人電子郵件和套件原始伺服器控制項。

1. 在**子群組**中，檢視將此群組做為父群組的套件群組清單。此清單中的套件群組可以從此套件群組繼承設定。如需詳細資訊，請參閱[套件群組階層和模式特異性](package-group-definition-syntax-matching-behavior.md#package-group-hierarchy-pattern-specificity)。

1. 在**套件**中，根據套件群組定義檢視屬於此套件群組的套件。在**強度**欄中，您可以看到套件關聯的強度。如需詳細資訊，請參閱[套件群組階層和模式特異性](package-group-definition-syntax-matching-behavior.md#package-group-hierarchy-pattern-specificity)。

1. 若要編輯套件群組資訊，請選擇**編輯套件群組**。

   1. 在**資訊**中，更新套件群組的描述或聯絡資訊。您無法編輯套件群組的定義。

   1. 在**套件群組原始伺服器控制**中，更新套件群組的原始伺服器控制設定，以決定相關聯的套件如何在網域中輸入儲存庫。如需詳細資訊，請參閱[套件群組原始伺服器控制](package-group-origin-controls.md)。

## 檢視或編輯套件群組 (AWS CLI)
<a name="view-edit-package-group-cli"></a>

使用下列命令，透過 檢視或編輯套件群組 AWS CLI。如果您尚未設定 ， AWS CLI 請依照中的步驟進行設定[使用 AWS CodeArtifact 設定](get-set-up-for-codeartifact.md)。

若要檢視網域中的所有套件群組，請使用 `list-package-groups`命令。

```
aws codeartifact list-package-groups \
         --domain {{my_domain}} \
         --domain-owner {{111122223333}}
```

若要檢視套件群組的詳細資訊，請使用 `describe-package-group`命令。如需套件群組定義的詳細資訊，請參閱 [套件群組定義語法和範例](package-group-definition-syntax-matching-behavior.md#package-group-definition-syntax-examples)。

```
aws codeartifact describe-package-group \
         --domain {{my_domain}} \
         --domain-owner {{111122223333}} \
         --package-group {{'/nuget/*'}}
```

若要檢視套件群組的子套件群組，請使用 `list-sub-package-groups`命令。

```
aws codeartifact list-sub-package-groups \
         --domain {{my_domain}} \
         --domain-owner {{111122223333}} \
         --package-group {{'/nuget/*'}} \
```

若要檢視與套件相關聯的套件群組，請使用 `get-associated-package-group`命令。您必須使用 NuGet、Python 和 Swift 套件格式的標準化套件名稱和命名空間。如需套件名稱和命名空間如何標準化的詳細資訊，請參閱 [NuGet](nuget-name-normalization.md)、[Python](python-name-normalization.md) 和 [Swift](swift-name-normalization.md) 名稱標準化文件。

```
aws codeartifact get-associated-package-group \
         --domain {{my_domain}} \
         --domain-owner {{111122223333}} \
         --format {{npm}} \
         --package {{packageName}} \
         --namespace {{scope}}
```

若要編輯套件群組，請使用 `update-package-group`命令。此命令用於更新套件群組的聯絡資訊或描述。如需套件群組原始伺服器控制設定，以及新增或編輯這些設定的詳細資訊，請參閱 [套件群組原始伺服器控制](package-group-origin-controls.md)。如需套件群組定義的詳細資訊，請參閱 [套件群組定義語法和範例](package-group-definition-syntax-matching-behavior.md#package-group-definition-syntax-examples)

```
aws codeartifact update-package-group \
         --domain {{my_domain}} \
         --package-group {{'/nuget/*'}} \
         --domain-owner {{111122223333}} \
         --contact-info {{contact@email.com}} \
         --description {{"updated package group description"}}
```