AWS Systems ManagerChange Manager 不再開放給新客戶。現有客戶可以繼續正常使用該服務。如需詳細資訊,請參閱AWS Systems ManagerChange Manager可用性變更。
本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
搭配使用 ListDocumentVersions 與 CLI
下列程式碼範例示範如何使用 ListDocumentVersions。
- CLI
-
- AWS CLI
-
列出文件版本
下列
list-document-versions範例列出了 Systems Manager 文件的所有版本。aws ssm list-document-versions \ --name"Example"輸出:
{ "DocumentVersions": [ { "Name": "Example", "DocumentVersion": "1", "CreatedDate": 1583257938.266, "IsDefaultVersion": true, "DocumentFormat": "YAML", "Status": "Active" } ] }如需詳細資訊,請參閱《AWS Systems Manager 使用者指南》中的 Sending Commands that Use the Document Version Parameter。
-
如需 API 詳細資訊,請參閱《AWS CLI 命令參考》中的 ListDocumentVersion
。
-
- PowerShell
-
- Tools for PowerShell V4
-
範例 1:此範例列出了文件的所有版本。
Get-SSMDocumentVersionList -Name "AWS-UpdateSSMAgent"輸出:
CreatedDate : 6/1/2021 5:19:10 PM DocumentFormat : JSON DocumentVersion : 1 IsDefaultVersion : True Name : AWS-UpdateSSMAgent Status : Active-
如需 API 詳細資訊,請參閱 AWS Tools for PowerShell Cmdlet Reference (V4) 中的 ListDocumentVersions。
-
- Tools for PowerShell V5
-
範例 1:此範例列出了文件的所有版本。
Get-SSMDocumentVersionList -Name "AWS-UpdateSSMAgent"輸出:
CreatedDate : 6/1/2021 5:19:10 PM DocumentFormat : JSON DocumentVersion : 1 IsDefaultVersion : True Name : AWS-UpdateSSMAgent Status : Active-
如需 API 詳細資訊,請參閱 AWS Tools for PowerShell Cmdlet Reference (V5) 中的 ListDocumentVersions。
-
如需 AWS SDK 開發人員指南和程式碼範例的完整清單,請參閱 搭配 AWS SDK 使用此服務。此主題也包含有關入門的資訊和舊版 SDK 的詳細資訊。
ListComplianceSummaries
ListDocuments