Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅
中国的 Amazon Web Services 服务入门
(PDF)。
Amazon Systems Manager Change Manager 不再向新客户开放。现有客户可以继续正常使用该服务。有关更多信息,请参阅 Amazon Systems Manager Change Manager 可用性变更。
将 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
-
- 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
- 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
有关 Amazon SDK 开发人员指南和代码示例的完整列表,请参阅 将此服务与 Amazon 开发工具包结合使用。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。