Gunakan GetApplicationRevision dengan AWS SDK atau CLI - AWS SDKContoh Kode

Ada lebih banyak AWS SDK contoh yang tersedia di GitHub repo SDKContoh AWS Dokumen.

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

Gunakan GetApplicationRevision dengan AWS SDK atau CLI

Contoh kode berikut menunjukkan cara menggunakanGetApplicationRevision.

CLI
AWS CLI

Untuk mendapatkan informasi tentang revisi aplikasi

get-application-revisionContoh berikut menampilkan informasi tentang revisi aplikasi yang terkait dengan aplikasi yang ditentukan.

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

Output:

{ "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
Alat untuk PowerShell

Contoh 1: Contoh ini mendapatkan informasi tentang revisi aplikasi yang ditentukan.

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

Output:

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