Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅
中国的 Amazon Web Services 服务入门
(PDF)。
将 ListDocumentVersions
与 CLI 配合使用
以下代码示例演示如何使用 ListDocumentVersions
。
- CLI
-
- Amazon 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"
}
]
}
有关更多信息,请参阅《Amazon Systems Manager 用户指南》中的发送使用文档版本参数的命令。
- PowerShell
-
- 适用于 PowerShell 的工具
-
示例 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
有关 Amazon SDK 开发人员指南和代码示例的完整列表,请参阅 将此服务与 Amazon SDK 结合使用。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。