查看命名空间列表 - Amazon Cloud Map
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

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

查看命名空间列表

要查看命名空间列表,请执行以下过程。

Amazon Web Services Management Console
  1. 登录Amazon Web Services Management Console并打开Amazon Cloud Map主机,网址为 https://console.aws.amazon.com/cloudmap/

  2. 在导航窗格中,选择 Namespaces (命名空间)

Amazon CLI
  • 使用list-namespaces命令列出命名空间。

    aws servicediscovery list-namespaces
Amazon SDK for Python (Boto3)
  1. 如果您尚未Boto3安装,可以在Boto3此处找到安装、配置和使用说明。

  2. 导入Boto3并用servicediscovery作您的服务。

    import boto3 client = boto3.client('servicediscovery')
  3. 使用列出命名空间list_namespaces()

    response = client.list_namespaces() # If you want to see the response print(response)

    示例响应输出

    { 'Namespaces': [ { 'Arn': 'arn:aws::servicediscovery:us-west-2:123456789012:namespace/ns-xxxxxxxxxxxxxxx', 'CreateDate': 1585354387.357, 'Id': 'ns-xxxxxxxxxxxxxxx', 'Name': 'myFirstNamespace', 'Properties': { 'DnsProperties': { 'HostedZoneId': 'Z06752353VBUDTC32S84S', }, 'HttpProperties': { 'HttpName': 'myFirstNamespace', }, }, 'Type': 'DNS_PRIVATE', }, { 'Arn': 'arn:aws::servicediscovery:us-west-2:123456789012:namespace/ns-xxxxxxxxxxxxxxx', 'CreateDate': 1586468974.698, 'Description': 'My second namespace', 'Id': 'ns-xxxxxxxxxxxxxxx', 'Name': 'mySecondNamespace.com', 'Properties': { 'DnsProperties': { }, 'HttpProperties': { 'HttpName': 'mySecondNamespace.com', }, }, 'Type': 'HTTP', }, { 'Arn': 'arn:aws::servicediscovery:us-west-2:123456789012:namespace/ns-xxxxxxxxxxxxxxx', 'CreateDate': 1587055896.798, 'Id': 'ns-xxxxxxxxxxxxxxx', 'Name': 'myThirdNamespace.com', 'Properties': { 'DnsProperties': { 'HostedZoneId': 'Z09983722P0QME1B3KC8I', }, 'HttpProperties': { 'HttpName': 'myThirdNamespace.com', }, }, 'Type': 'DNS_PRIVATE', }, ], 'ResponseMetadata': { '...': '...', }, }