搭配使用 GetPatchBaseline
與 CLI
下列程式碼範例示範如何使用 GetPatchBaseline
。
- CLI
-
- AWS CLI
-
顯示修補基準
下列
get-patch-baseline
範例示範擷取指定修補基準的詳細資訊。aws ssm get-patch-baseline \ --baseline-id
"pb-0123456789abcdef0"
輸出:
{ "BaselineId": "pb-0123456789abcdef0", "Name": "WindowsPatching", "OperatingSystem": "WINDOWS", "GlobalFilters": { "PatchFilters": [] }, "ApprovalRules": { "PatchRules": [ { "PatchFilterGroup": { "PatchFilters": [ { "Key": "PRODUCT", "Values": [ "WindowsServer2016" ] } ] }, "ComplianceLevel": "CRITICAL", "ApproveAfterDays": 0, "EnableNonSecurity": false } ] }, "ApprovedPatches": [], "ApprovedPatchesComplianceLevel": "UNSPECIFIED", "ApprovedPatchesEnableNonSecurity": false, "RejectedPatches": [], "RejectedPatchesAction": "ALLOW_AS_DEPENDENCY", "PatchGroups": [ "QA", "DEV" ], "CreatedDate": 1550244180.465, "ModifiedDate": 1550244180.465, "Description": "Patches for Windows Servers", "Sources": [] }
如需詳細資訊,請參閱《AWS Systems Manager 使用者指南》中的關於修補基準。
-
如需 API 詳細資訊,請參閱《AWS CLI 命令參考》中的 GetPatchBaseline
。
-
- PowerShell
-
- Tools for PowerShell
-
範例 1:此範例顯示修補基準的詳細資訊。
Get-SSMPatchBaselineDetail -BaselineId "pb-03da896ca3b68b639"
輸出:
ApprovalRules : Amazon.SimpleSystemsManagement.Model.PatchRuleGroup ApprovedPatches : {} BaselineId : pb-03da896ca3b68b639 CreatedDate : 3/3/2017 5:02:19 PM Description : Baseline containing all updates approved for production systems GlobalFilters : Amazon.SimpleSystemsManagement.Model.PatchFilterGroup ModifiedDate : 3/3/2017 5:02:19 PM Name : Production-Baseline PatchGroups : {} RejectedPatches : {}
-
如需 API 詳細資訊,請參閱《AWS Tools for PowerShell Cmdlet 參考》中的 GetPatchBaseline。
-
如需完整的 AWS SDK 開發人員指南和程式碼範例清單,請參閱透過 AWS SDK 使用此服務。此主題也包含有關入門的資訊和舊版 SDK 的詳細資訊。
GetParameters
GetPatchBaselineForPatchGroup