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

使用 AWS CLI 的 AWS Outposts示例

以下代码示例演示了如何通过将 AWS Command Line Interface与 AWS Outposts 结合使用,来执行操作和实现常见场景。

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

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

主题

操作

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

AWS CLI

获取 Outpost 上的实例类型

以下 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" }

有关更多信息,请参阅《AWS Outposts 用户指南》中的在 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": {} } }

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

  • 有关 API 详细信息,请参阅《AWS CLI 命令参考》中的 GetOutpost

以下代码示例演示如何使用 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": {} } ] }

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

  • 有关 API 详细信息,请参阅《AWS CLI 命令参考》中的 ListOutposts

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

AWS CLI

列出站点

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

aws outposts list-sites

输出:

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

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

  • 有关 API 详细信息,请参阅《AWS CLI 命令参考》中的 ListSites