Sono disponibili altri esempi AWS SDK nel repository AWS Doc SDK
Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.
Utilizzare ListAssociationVersions con una CLI
Gli esempi di codice seguenti mostrano come utilizzare ListAssociationVersions.
- CLI
-
- AWS CLI
-
Come recuperare tutte le versioni di un’associazione per un determinato ID di associazione
L’esempio seguente
list-association-versionselenca tutte le versioni delle associazioni specificate.aws ssm list-association-versions \ --association-id"8dfe3659-4309-493a-8755-0123456789ab"Output:
{ "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" } ] }Per ulteriori informazioni, consulta Utilizzo delle associazioni in Systems Manager nella AWS Guida per l’utente di Systems Manager.
-
Per i dettagli sull'API, consulta ListAssociationVersions AWS CLI
Command Reference.
-
- PowerShell
-
- Strumenti per PowerShell V4
-
Esempio 1: questo esempio recupera tutte le versioni dell’associazione fornita.
Get-SSMAssociationVersionList -AssociationId 123a45a0-c678-9012-3456-78901234db5eOutput:
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}-
Per i dettagli sull'API, vedere ListAssociationVersionsin AWS Strumenti per PowerShell Cmdlet Reference (V4).
-
- Strumenti per V5 PowerShell
-
Esempio 1: questo esempio recupera tutte le versioni dell’associazione fornita.
Get-SSMAssociationVersionList -AssociationId 123a45a0-c678-9012-3456-78901234db5eOutput:
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}-
Per i dettagli sull'API, vedere ListAssociationVersionsin AWS Strumenti per PowerShell Cmdlet Reference (V5).
-