AWS 文檔 AWS SDK示例 GitHub 回購中有更多SDK示例
本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
搭GetMaintenanceWindow
配 AWS SDK或使用 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 指令參考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細資訊,請參閱AWS Tools for PowerShell 指令程GetMaintenanceWindow式參考中的。
-
GetInventorySchema
GetMaintenanceWindowExecution