AWS 文档 AWS SDK示例 GitHub 存储库中还有更多SDK示例
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
GetDeploymentInstance
与 a 一起使用 CLI
以下代码示例演示如何使用 GetDeploymentInstance
。
- CLI
-
- AWS CLI
-
获取有关部署实例的信息
以下
get-deployment-instance
示例显示与指定部署关联的部署实例的相关信息。aws deploy get-deployment-instance --deployment-id
d-QA4G4F9EX
--instance-idi-902e9fEX
输出:
{ "instanceSummary": { "instanceId": "arn:aws:ec2:us-east-1:80398EXAMPLE:instance/i-902e9fEX", "lifecycleEvents": [ { "status": "Succeeded", "endTime": 1408480726.569, "startTime": 1408480726.437, "lifecycleEventName": "ApplicationStop" }, { "status": "Succeeded", "endTime": 1408480728.016, "startTime": 1408480727.665, "lifecycleEventName": "DownloadBundle" }, { "status": "Succeeded", "endTime": 1408480729.744, "startTime": 1408480729.125, "lifecycleEventName": "BeforeInstall" }, { "status": "Succeeded", "endTime": 1408480730.979, "startTime": 1408480730.844, "lifecycleEventName": "Install" }, { "status": "Failed", "endTime": 1408480732.603, "startTime": 1408480732.1, "lifecycleEventName": "AfterInstall" }, { "status": "Skipped", "endTime": 1408480732.606, "lifecycleEventName": "ApplicationStart" }, { "status": "Skipped", "endTime": 1408480732.606, "lifecycleEventName": "ValidateService" } ], "deploymentId": "d-QA4G4F9EX", "lastUpdatedAt": 1408480733.152, "status": "Failed" } }
-
有关API详细信息,请参阅 “GetDeploymentInstance AWS CLI
命令参考”。
-
- PowerShell
-
- 用于 PowerShell
-
示例 1:此示例获取有关指定部署的指定实例的信息。
Get-CDDeploymentInstance -DeploymentId d-QZMRGSTEX -InstanceId i-254e22EX
输出:
DeploymentId : d-QZMRGSTEX InstanceId : arn:aws:ec2:us-east-1:80398EXAMPLE:instance/i-254e22EX LastUpdatedAt : 7/23/2015 11:25:24 PM LifecycleEvents : {ApplicationStop, DownloadBundle, BeforeInstall, Install...} Status : Succeeded
-
有关API详细信息,请参阅 AWS Tools for PowerShell Cmdlet 参考GetDeploymentInstance中的。
-
GetDeploymentGroup
GetOnPremisesInstance