

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 查看连接详细信息
<a name="connections-view-details"></a>

您可以使用开发工具控制台或 AWS Command Line Interface (AWS CLI) 中的 **get-connection** 命令来查看连接的详细信息。要使用 AWS CLI，您必须已经安装了的最新版本 AWS CLI 或已更新到当前版本。有关更多信息，请参阅《AWS Command Line Interface 用户指南》**中的[安装 AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/installing.html)。

**要查看连接（控制台）**

1. 在 [https://console.aws.amazon.com/codesuite/settings/connections](https://console.aws.amazon.com/codesuite/settings/connections) 打开开发工具控制台。

1. 选择 **Settings > Connections (设置 > 连接)**。

1. 选择要查看的连接旁边的按钮，然后选择 **View details (查看详细信息)**。

1. 此时将显示以下连接信息：
   + 连接名称。
   + 连接的提供程序类型。
   + 连接状态。
   + 连接 ARN。
   + 如果连接是为已安装的提供商（例如 En GitHub terprise Server）创建的，则为与该连接关联的主机信息。
   + 如果连接是为已安装的提供商（例如 En GitHub terprise Server）创建的，则需要与该连接的主机关联的端点信息。

1. 如果连接位于 **Pending (待处理)** 状态，要完成连接，请选择 **Update pending connection (更新待处理的连接)**。有关更多信息，请参阅[更新待处理的连接](connections-update.md)。

**要查看连接 (CLI)**
+ 在终端或命令行中，运行 **get-connection** 命令。例如，使用以下命令可查看 ARN 值为 `arn:aws:codestar-connections:us-west-2:account_id:connection/aEXAMPLE-8aad-4d5d-8878-dfcab0bc441f` 的连接的详细信息。

  ```
  aws codeconnections get-connection --connection-arn arn:aws:codeconnections:us-west-2:account_id:connection/aEXAMPLE-8aad-4d5d-8878-dfcab0bc441f
  ```

  如果成功，则此命令会返回连接详细信息。

  Bitbucket 连接的输出示例：

  ```
  {
      "Connection": {
          "ConnectionName": "MyConnection",
          "ConnectionArn": "arn:aws:codeconnections:us-west-2:account_id:connection/cdacd948-EXAMPLE",
          "ProviderType": "Bitbucket",
          "OwnerAccountId": "account_id",
          "ConnectionStatus": "AVAILABLE"
      }
  }
  ```

   GitHub 连接的输出示例：

  ```
  {
      "Connection": {
          "ConnectionName": "MyGitHubConnection",
          "ConnectionArn": "arn:aws:codeconnections:us-west-2:account_id:connection/ebcd4a13-EXAMPLE",
          "ProviderType": "GitHub",
          "OwnerAccountId": "account_id",
          "ConnectionStatus": "AVAILABLE"
      }
  }
  ```

   GitHub 企业服务器连接的输出示例：

  ```
  {
      "Connection": {
          "ConnectionName": "MyConnection",
          "ConnectionArn": "arn:aws:codeconnections:us-west-2:account_id:connection/2d178fb9-EXAMPLE",
          "ProviderType": "GitHubEnterpriseServer",
          "OwnerAccountId": "account_id",
          "ConnectionStatus": "PENDING",
          "HostArn": "arn:aws:ccodeconnections:us-west-2:account_id:host/sdfsdf-EXAMPLE"
      }
  }
  ```