AWS Outposts 使用示例 AWS CLI - AWS Command Line Interface

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

AWS Outposts 使用示例 AWS CLI

以下代码示例向您展示了如何使用with来执行操作和实现常见场景 AWS Outposts。 AWS Command Line Interface

操作是大型程序的代码摘录,必须在上下文中运行。您可以通过操作了解如何调用单个服务函数,还可以通过函数相关场景的上下文查看操作。

每个示例都包含一个指向完整源代码的链接,您可以在其中找到有关如何在上下文中设置和运行代码的说明。

主题

操作

以下代码示例显示了如何使用get-outpost-instance-types

AWS CLI

要获取前哨基地上的实例类型

以下get-outpost-instance-types示例获取了指定 Outpost 的实例类型。

aws outposts get-outpost-instance-types \ --outpost-id op-0ab23c4567EXAMPLE

输出:

{ "InstanceTypes": [ { "InstanceType": "c5d.large" }, { "InstanceType": "i3en.24xlarge" }, { "InstanceType": "m5d.large" }, { "InstanceType": "r5d.large" } ], "OutpostId": "op-0ab23c4567EXAMPLE", "OutpostArn": "arn:aws:outposts:us-west-2:123456789012:outpost/op-0ab23c4567EXAMPLE" }

欲了解更多信息,请参阅 Outp o AWS st s 用户指南中的在你的 Outpost 上启动实例

以下代码示例显示了如何使用get-outpost

AWS CLI

要获取 Outpost 的详细信息

以下get-outpost示例显示了指定 Outpost 的详细信息。

aws outposts get-outpost \ --outpost-id op-0ab23c4567EXAMPLE

输出:

{ "Outpost": { "OutpostId": "op-0ab23c4567EXAMPLE", "OwnerId": "123456789012", "OutpostArn": "arn:aws:outposts:us-west-2:123456789012:outpost/op-0ab23c4567EXAMPLE", "SiteId": "os-0ab12c3456EXAMPLE", "Name": "EXAMPLE", "LifeCycleStatus": "ACTIVE", "AvailabilityZone": "us-west-2a", "AvailabilityZoneId": "usw2-az1", "Tags": {} } }

有关更多信息,请参阅《Outposts 用户指南》中的 “使用 Outpost s AWS ”。

以下代码示例显示了如何使用list-outposts

AWS CLI

列出 Outposts

以下list-outposts示例列出了您 AWS 账户中的Outposts。

aws outposts list-outposts

输出:

{ "Outposts": [ { "OutpostId": "op-0ab23c4567EXAMPLE", "OwnerId": "123456789012", "OutpostArn": "arn:aws:outposts:us-west-2:123456789012:outpost/op-0ab23c4567EXAMPLE", "SiteId": "os-0ab12c3456EXAMPLE", "Name": "EXAMPLE", "Description": "example", "LifeCycleStatus": "ACTIVE", "AvailabilityZone": "us-west-2a", "AvailabilityZoneId": "usw2-az1", "Tags": { "Name": "EXAMPLE" } }, { "OutpostId": "op-4fe3dc21baEXAMPLE", "OwnerId": "123456789012", "OutpostArn": "arn:aws:outposts:us-west-2:123456789012:outpost/op-4fe3dc21baEXAMPLE", "SiteId": "os-0ab12c3456EXAMPLE", "Name": "EXAMPLE2", "LifeCycleStatus": "ACTIVE", "AvailabilityZone": "us-west-2a", "AvailabilityZoneId": "usw2-az1", "Tags": {} } ] }

有关更多信息,请参阅《Outposts 用户指南》中的 “使用 Outpost s AWS ”。

以下代码示例显示了如何使用list-sites

AWS CLI

列出网站

以下list-sites示例列出了您 AWS 账户中可用的 Outpost 站点。

aws outposts list-sites

输出:

{ "Sites": [ { "SiteId": "os-0ab12c3456EXAMPLE", "AccountId": "123456789012", "Name": "EXAMPLE", "Description": "example", "Tags": {} } ] }

有关更多信息,请参阅《Outposts 用户指南》中的 “使用 Outpost s AWS ”。