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

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

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

GetApplicationRevision与 a 一起使用 CLI

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

CLI
AWS CLI

获取有关应用程序修订的信息

以下get-application-revision示例显示与指定应用程序关联的应用程序修订版的相关信息。

aws deploy get-application-revision \ --application-name WordPress_App \ --s3-location bucket=CodeDeployDemoBucket,bundleType=zip,eTag=dd56cfdEXAMPLE8e768f9d77fEXAMPLE,key=WordPressApp.zip

输出:

{ "applicationName": "WordPress_App", "revisionInfo": { "description": "Application revision registered by Deployment ID: d-A1B2C3111", "registerTime": 1411076520.009, "deploymentGroups": "WordPress_DG", "lastUsedTime": 1411076520.009, "firstUsedTime": 1411076520.009 }, "revision": { "revisionType": "S3", "s3Location": { "bundleType": "zip", "eTag": "dd56cfdEXAMPLE8e768f9d77fEXAMPLE", "bucket": "CodeDeployDemoBucket", "key": "WordPressApp.zip" } } }
PowerShell
用于 PowerShell

示例 1:此示例获取有关指定应用程序修订的信息。

$revision = Get-CDApplicationRevision -ApplicationName CodeDeployDemoApplication -S3Location_Bucket amzn-s3-demo-bucket -Revision_RevisionType S3 -S3Location_Key 5xd27EX.zip -S3Location_BundleType zip -S3Location_ETag 4565c1ac97187f190c1a90265EXAMPLE Write-Output ("Description = " + $revision.RevisionInfo.Description + ", RegisterTime = " + $revision.RevisionInfo.RegisterTime)

输出:

Description = Application revision registered by Deployment ID: d-CX9CHN3EX, RegisterTime = 07/20/2015 23:46:42