AWS 文档 SDK 示例
将 GetMaintenanceWindow 与 CLI 配合使用
以下代码示例演示如何使用 GetMaintenanceWindow。
- CLI
-
- AWS 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" }有关更多信息,请参阅《AWS Systems Manager 用户指南》中的查看有关维护时段的信息(AWS CLI)。
-
有关 API 详细信息,请参阅《AWS CLI Command Reference》中的 GetMaintenanceWindow
。
-
- PowerShell
-
- Tools for PowerShell V4
-
示例 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 详细信息,请参阅《AWS Tools for PowerShell Cmdlet Reference(V4)》中的 GetMaintenanceWindow。
-
- Tools for PowerShell V5
-
示例 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 详细信息,请参阅《AWS Tools for PowerShell Cmdlet Reference (V5)》中的 GetMaintenanceWindow。
-
GetInventorySchema
GetMaintenanceWindowExecution