

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

# GuardDuty 2023 年 3 月的 API 变更
<a name="guardduty-feature-object-api-changes-march2023"></a>

 GuardDuty APIs 配置不属于列表的保护功能[GuardDuty 基础数据源](guardduty_data-sources.md)。功能对象包含功能详细信息，例如功能名称和状态，此外还可能包含某些防护计划的额外配置。此次迁移会影响 *Amazon GuardDuty API 参考 APIs *中的以下内容：
+ [CreateDetector](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_CreateDetector.html)
+ [GetDetector](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_GetDetector.html)
+ [UpdateDetector](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_UpdateDetector.html)
+ [GetMemberDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_GetMemberDetectors.html)
+ [UpdateMemberDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_UpdateMemberDetectors.html)
+ [DescribeOrganizationConfiguration](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_DescribeOrganizationConfiguration.html)
+ [UpdateOrganizationConfiguration](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_UpdateOrganizationConfiguration.html)
+ [GetRemainingFreeTrialDays](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_GetRemainingFreeTrialDays.html)
+ [GetUsageStatistics](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_GetUsageStatistics.html)

## 功能与数据来源的比较
<a name="comparison-datasources-features-activation"></a>

过去，所有 GuardDuty 功能都是通过 API 中的`dataSources`对象传递的。从 2023 年 3 月起，在 API 中 GuardDuty 首选`features``dataSources`对象而不是对象。所有较早的数据来源都有相应的功能，但较新的功能可能没有相应的数据来源。

以下列表显示了通过 API 传递时 `dataSources` 和 `features` 对象之间的比较：
+ `dataSources` 对象包含每种保护类型及其状态的对象。该`features`对象是与其中的每种保护类型相对应的可用功能列表 GuardDuty。

  从 2023 年 3 月起，功能激活将是在您的 AWS 环境中配置新 GuardDuty功能的唯一方法。
+ API 请求或响应中的`dataSources`架构在每个可用 AWS 区域 的地方 GuardDuty 都相同。但并非所有功能在每个区域都可用。因此，可用功能的名称可能因区域而异。

## 了解 APIs 功能的工作原理
<a name="understanding-how-feature-activation-works"></a>

 GuardDuty APIs 将继续返回适用的`dataSources`对象，它们还将以不同的格式返回一个包含相同信息的`features`对象。 GuardDuty 2023 年 3 月之前推出的功能将通过`dataSources`物体和`features`物体提供。 GuardDuty 自 2023 年 3 月起推出的功能只能通过该`features`对象使用。你不能创建或更新探测器，也不能描述你在同一 API 请求中同时 AWS Organizations 使用两者`dataSources`兼而有之的`features`对象表示法。要启用 GuardDuty 保护类型，您需要使用现在也包含该`features`对象的相同 APIs 数据源将现有数据源迁移到`features`对象。

**注意**  
GuardDuty 修改后不会添加新的数据源。

GuardDuty 已弃用与保护计划相关的数据源。但仍然支持 [GuardDuty 基础数据源](guardduty_data-sources.md)。 GuardDuty 最佳做法建议使用功能来启用或编辑账户中任何保护计划的配置。

## 将功能更改纳入 APIs
<a name="features-activation-incorporating-changes"></a>
+ 如果您通过 APIs SDKs、或 CloudFormation 模板管理 GuardDuty 配置，并且想要启用潜在的新 GuardDuty 功能，则需要分别修改代码和模板。有关更多信息，请参阅 *[Amazon GuardDuty API 参考 APIs ](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_Operations.html)*中更新的内容。
+ 对于在此升级之前配置的 GuardDuty 功能，您可以继续使用 APIs SDKs、或 CloudFormation 模板。但我们建议您改用 `feature` 对象。

  所有数据来源都有一个等效的功能对象。有关更多信息，请参阅 [将 `dataSources` 映射到 `features`](#guardduty-feature-enablement-datasource-relation)。
+ 目前，`features` 对象中的 `additionalConfiguration` 仅适用于某些保护类型。
  + 对于此类保护类型，如果您的功能设置`AdditionalConfiguration``status`为，`ENABLED`但您的功能配置`status`未设置为`ENABLED`，则在这种情况下 GuardDuty 不会采取任何操作。
  + 以下内容 APIs 会受到此影响：
    + [UpdateDetector](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_UpdateDetector.html)
    + [UpdateMemberDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_UpdateMemberDetectors.html)
    + [UpdateOrganizationConfiguration](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_UpdateOrganizationConfiguration.html) 

## 将 `dataSources` 映射到 `features`
<a name="guardduty-feature-enablement-datasource-relation"></a>

下表显示保护类型、`dataSources` 和 `features` 的映射。

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/guardduty/latest/ug/guardduty-feature-object-api-changes-march2023.html)

\$1GetUsageStatistics 使用自己的 `dataSource` 名称。有关更多信息，请参阅 [监控 GuardDuty 使用情况和估算成本](monitoring_costs.md)或 [https://docs.aws.amazon.com/guardduty/latest/APIReference/API_GetUsageStatistics.html](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_GetUsageStatistics.html)。