你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Database Advanced Threat Protection Settings - Create Or Update

创建或更新数据库的高级威胁防护状态。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/Default?api-version=2023-08-01

URI 参数

名称 必需 类型 说明
advancedThreatProtectionName
path True

AdvancedThreatProtectionName

高级威胁防护状态的名称。

databaseName
path True

string

数据库的名称。

resourceGroupName
path True

string

包含资源的资源组的名称。 可以从 Azure 资源管理器 API 或门户获取此值。

serverName
path True

string

服务器的名称。

subscriptionId
path True

string

标识 Azure 订阅的订阅 ID。

api-version
query True

string

要用于请求的 API 版本。

请求正文

名称 必需 类型 说明
properties.state True

AdvancedThreatProtectionState

指定高级威胁防护的状态,无论是启用或禁用还是尚未在特定数据库或服务器上应用状态。

响应

名称 类型 说明
200 OK

DatabaseAdvancedThreatProtection

成功设置数据库高级威胁防护状态。

201 Created

DatabaseAdvancedThreatProtection

已成功创建数据库高级威胁防护状态。

Other Status Codes

ErrorResponse

错误响应: ***

  • 400 AdvancedThreatProtectionInsufficientDiskSpace - 磁盘空间不足,无法保存数据库中的高级威胁防护设置元数据

  • 400 UpdateNotAllowedOnPausedDatabase - 用户尝试对暂停的数据库执行更新。

  • 400 InvalidDatabaseAdvancedThreatProtectionCreateRequest - 创建数据库高级威胁防护请求不存在或没有属性对象

  • 400 AdvancedThreatProtectionInvalidUserSuppliedParameter - 客户端提供了无效的参数值

  • 400 UpsertDatabaseAdvancedThreatProtectionFailed - 保存高级威胁防护设置时出错,请稍后重试

  • 400 UpsertDatabaseAdvancedThreatProtectionFailed - 保存高级威胁防护设置时出错,请稍后重试

  • 404 SubscriptionDoesNotHaveServer - 找不到请求的服务器

  • 404 DatabaseDoesNotExist - 用户已指定此服务器实例上不存在的数据库名称。

  • 404 UpsertDatabaseAdvancedThreatProtectionFailed - 保存高级威胁防护设置时出错,请稍后重试

  • 409 DatabaseAdvancedThreatProtectionInProgress - 设置数据库高级威胁防护已在进行中

  • 409 UpsertDatabaseAdvancedThreatProtectionFailed - 保存高级威胁防护设置时出错,请稍后重试

  • 500 DatabaseIsUnavailable - 加载失败。 请稍后重试。

  • 500 UpsertDatabaseAdvancedThreatProtectionFailed - 保存高级威胁防护设置时出错,请稍后重试

  • 500 GetDatabaseAdvancedThreatProtectionFailed - 无法获取高级威胁防护设置

示例

Update a database's Advanced Threat Protection settings with all parameters
Update a database's Advanced Threat Protection settings with minimal parameters

Update a database's Advanced Threat Protection settings with all parameters

示例请求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/servers/threatprotection-6440/databases/testdb/advancedThreatProtectionSettings/Default?api-version=2023-08-01

{
  "properties": {
    "state": "Enabled"
  }
}

示例响应

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/servers/threatprotection-6440/advancedThreatProtectionSettings/Default",
  "name": "Default",
  "type": "Microsoft.Sql/servers/databases/advancedThreatProtectionSettings",
  "systemData": {
    "createdBy": "string",
    "createdByType": "User",
    "createdAt": "2022-04-03T04:41:33.937Z",
    "lastModifiedBy": "string",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2022-04-03T04:41:33.937Z"
  },
  "properties": {
    "state": "Enabled",
    "creationTime": "2022-04-03T04:41:33.937Z"
  }
}
{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/servers/threatprotection-6440/advancedThreatProtectionSettings/Default",
  "name": "Default",
  "type": "Microsoft.Sql/servers/databases/advancedThreatProtectionSettings",
  "systemData": {
    "createdBy": "string",
    "createdByType": "User",
    "createdAt": "2022-04-03T04:41:33.937Z",
    "lastModifiedBy": "string",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2022-04-03T04:41:33.937Z"
  },
  "properties": {
    "state": "Enabled",
    "creationTime": "2022-04-03T04:41:33.937Z"
  }
}

Update a database's Advanced Threat Protection settings with minimal parameters

示例请求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/servers/threatprotection-6440/databases/testdb/advancedThreatProtectionSettings/Default?api-version=2023-08-01

{
  "properties": {
    "state": "Disabled"
  }
}

示例响应

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/servers/threatprotection-6440/advancedThreatProtectionSettings/Default",
  "name": "Default",
  "type": "Microsoft.Sql/servers/databases/advancedThreatProtectionSettings",
  "systemData": {
    "createdBy": "string",
    "createdByType": "User",
    "createdAt": "2022-04-03T04:41:33.937Z",
    "lastModifiedBy": "string",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2022-04-03T04:41:33.937Z"
  },
  "properties": {
    "state": "Disabled",
    "creationTime": "2022-04-03T04:41:33.937Z"
  }
}
{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/threatprotection-4799/providers/Microsoft.Sql/servers/threatprotection-6440/advancedThreatProtectionSettings/Default",
  "name": "Default",
  "type": "Microsoft.Sql/servers/databases/advancedThreatProtectionSettings",
  "systemData": {
    "createdBy": "string",
    "createdByType": "User",
    "createdAt": "2022-04-03T04:41:33.937Z",
    "lastModifiedBy": "string",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2022-04-03T04:41:33.937Z"
  },
  "properties": {
    "state": "Disabled",
    "creationTime": "2022-04-03T04:41:33.937Z"
  }
}

定义

名称 说明
AdvancedThreatProtectionName

高级威胁防护状态的名称。

AdvancedThreatProtectionState

指定高级威胁防护的状态,无论是启用或禁用还是尚未在特定数据库或服务器上应用状态。

createdByType

创建资源的标识的类型。

DatabaseAdvancedThreatProtection

数据库高级威胁防护。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

systemData

与创建和上次修改资源相关的元数据。

AdvancedThreatProtectionName

高级威胁防护状态的名称。

说明
Default

AdvancedThreatProtectionState

指定高级威胁防护的状态,无论是启用或禁用还是尚未在特定数据库或服务器上应用状态。

说明
New
Enabled
Disabled

createdByType

创建资源的标识的类型。

说明
User
Application
ManagedIdentity
Key

DatabaseAdvancedThreatProtection

数据库高级威胁防护。

名称 类型 说明
id

string

资源 ID。

name

string

资源名称。

properties.creationTime

string (date-time)

指定策略的 UTC 创建时间。

properties.state

AdvancedThreatProtectionState

指定高级威胁防护的状态,无论是启用或禁用还是尚未在特定数据库或服务器上应用状态。

systemData

systemData

AdvancedThreatProtectionResource 的 SystemData。

type

string

资源类型。

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

systemData

与创建和上次修改资源相关的元数据。

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

上次修改的资源时间戳(UTC)

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

上次修改资源的标识的类型。