GetPatchBaseline与 a 一起使用 CLI - AWS SDK代码示例

AWS 文档 AWS SDK示例 GitHub 存储库中还有更多SDK示例

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

GetPatchBaseline与 a 一起使用 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 用户指南》中的关于补丁基准

PowerShell
用于 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中的。