将 GetMaintenanceWindow 与 Amazon SDK 或 CLI 配合使用 - Amazon Systems Manager
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

GetMaintenanceWindow 与 Amazon SDK 或 CLI 配合使用

以下代码示例演示如何使用 GetMaintenanceWindow

CLI
Amazon CLI

查看有关维护时段的信息

以下 get-maintenance-window 示例将检索指定维护时段的详细信息。

aws ssm get-maintenance-window \ --window-id "mw-03eb9db428EXAMPLE"

输出:

{ "AllowUnassociatedTargets": true, "CreatedDate": 1515006912.957, "Cutoff": 1, "Duration": 6, "Enabled": true, "ModifiedDate": 2020-01-01T10:04:04.099Z, "Name": "My-Maintenance-Window", "Schedule": "rate(3 days)", "WindowId": "mw-03eb9db428EXAMPLE", "NextExecutionTime": "2020-02-25T00:08:15.099Z" }

有关更多信息,请参阅《Amazon Systems Manager 用户指南》中的查看有关维护时段的信息(Amazon CLI)

  • 有关 API 详细信息,请参阅《Amazon CLI Command Reference》中的 GetMaintenanceWindow

PowerShell
适用于 PowerShell 的工具

示例 1:此示例获取有关维护时段的详细信息。

Get-SSMMaintenanceWindow -WindowId "mw-03eb9db42890fb82d"

输出:

AllowUnassociatedTargets : False CreatedDate : 2/20/2017 6:14:05 PM Cutoff : 1 Duration : 2 Enabled : True ModifiedDate : 2/20/2017 6:14:05 PM Name : TestMaintWin Schedule : cron(0 */30 * * * ? *) WindowId : mw-03eb9db42890fb82d
  • 有关 API 详细信息,请参阅《Amazon Tools for PowerShell Cmdlet Reference》中的 GetMaintenanceWindow

有关 Amazon SDK 开发人员指南和代码示例的完整列表,请参阅 将 Systems Manager 与 Amazon SDK 配合使用。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。