将 ListAssociationVersions
与 CLI 配合使用
以下代码示例演示如何使用 ListAssociationVersions
。
- CLI
-
- Amazon CLI
-
列出特定关联 ID 的关联的所有版本
以下
list-association-versions
示例列出指定关联的所有版本。aws ssm list-association-versions \ --association-id
"8dfe3659-4309-493a-8755-0123456789ab"
输出:
{ "AssociationVersions": [ { "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", "AssociationVersion": "1", "CreatedDate": 1550505536.726, "Name": "AWS-UpdateSSMAgent", "Parameters": { "allowDowngrade": [ "false" ], "version": [ "" ] }, "Targets": [ { "Key": "InstanceIds", "Values": [ "i-1234567890abcdef0" ] } ], "ScheduleExpression": "cron(0 00 12 ? * SUN *)", "AssociationName": "UpdateSSMAgent" } ] }
有关更多信息,请参阅《Amazon Systems Manager 用户指南》中的在 Systems Manager 中使用关联。
-
有关 API 详细信息,请参阅《Amazon CLI Command Reference》中的 ListAssociationVersions
。
-
- PowerShell
-
- 适用于 PowerShell 的工具
-
示例 1:此示例检索所提供关联的所有版本。
Get-SSMAssociationVersionList -AssociationId 123a45a0-c678-9012-3456-78901234db5e
输出:
AssociationId : 123a45a0-c678-9012-3456-78901234db5e AssociationName : AssociationVersion : 2 ComplianceSeverity : CreatedDate : 3/12/2019 9:21:01 AM DocumentVersion : MaxConcurrency : MaxErrors : Name : AWS-GatherSoftwareInventory OutputLocation : Parameters : {} ScheduleExpression : Targets : {InstanceIds} AssociationId : 123a45a0-c678-9012-3456-78901234db5e AssociationName : test-case-1234567890 AssociationVersion : 1 ComplianceSeverity : CreatedDate : 3/2/2019 8:53:29 AM DocumentVersion : MaxConcurrency : MaxErrors : Name : AWS-GatherSoftwareInventory OutputLocation : Parameters : {} ScheduleExpression : rate(30minutes) Targets : {InstanceIds}
-
有关 API 详细信息,请参阅《Amazon Tools for PowerShell Cmdlet Reference》中的 ListAssociationVersions。
-
有关 Amazon SDK 开发人员指南和代码示例的完整列表,请参阅 将此服务与 Amazon SDK 结合使用。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。
GetPatchBaselineForPatchGroup
ListAssociations