GetOnPremisesInstance与 a 一起使用 CLI - AWS SDK代码示例

AWS 文档 AWS SDK示例 GitHub 存储库中还有更多SDK示例

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

GetOnPremisesInstance与 a 一起使用 CLI

以下代码示例演示如何使用 GetOnPremisesInstance

CLI
AWS CLI

获取有关本地实例的信息

以下get-on-premises-instance示例检索有关指定本地实例的信息。

aws deploy get-on-premises-instance --instance-name AssetTag12010298EX

输出:

{ "instanceInfo": { "iamUserArn": "arn:aws:iam::123456789012:user/AWS/CodeDeploy/AssetTag12010298EX", "tags": [ { "Value": "CodeDeployDemo-OnPrem", "Key": "Name" } ], "instanceName": "AssetTag12010298EX", "registerTime": 1425579465.228, "instanceArn": "arn:aws:codedeploy:us-east-1:123456789012:instance/AssetTag12010298EX_4IwLNI2Alh" } }
PowerShell
用于 PowerShell

示例 1:此示例获取有关指定本地实例的信息。

Get-CDOnPremiseInstance -InstanceName AssetTag12010298EX

输出:

DeregisterTime : 1/1/0001 12:00:00 AM IamUserArn : arn:aws:iam::80398EXAMPLE:user/CodeDeployDemoUser InstanceArn : arn:aws:codedeploy:us-east-1:80398EXAMPLE:instance/AssetTag12010298EX_rDH556dxEX InstanceName : AssetTag12010298EX RegisterTime : 4/3/2015 6:36:24 PM Tags : {Name}