文档 AWS SDK 示例 GitHub 存储库中还有更多 S AWS DK 示例
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
AWS Outposts 使用示例 AWS CLI
以下代码示例向您展示了如何使用with来执行操作和实现常见场景 AWS Outposts。 AWS Command Line Interface
操作是大型程序的代码摘录,必须在上下文中运行。您可以通过操作了解如何调用单个服务函数,还可以通过函数相关场景的上下文查看操作。
每个示例都包含一个指向完整源代码的链接,您可以从中找到有关如何在上下文中设置和运行代码的说明。
主题
操作
以下代码示例演示如何使用 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 中启动实例。
-
有关 API 的详细信息,请参阅AWS CLI 命令参考GetOutpostInstanceTypes
中的。
-
以下代码示例演示如何使用 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
中的。
-