将 GetPatchBaseline 与 CLI 配合使用 - AWS Systems Manager

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 Command Reference》中的 GetPatchBaseline

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 Reference》中的 GetPatchBaseline

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