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

Sensitivity Labels - Create Or Update

创建或更新给定列的敏感度标签

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/current?api-version=2023-08-01

URI 参数

名称 必需 类型 说明
columnName
path True

string

列的名称。

databaseName
path True

string

数据库的名称。

resourceGroupName
path True

string

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

schemaName
path True

string

架构的名称。

sensitivityLabelSource
path True

CurrentSensitivityLabelSource

敏感度标签的来源。

serverName
path True

string

服务器的名称。

subscriptionId
path True

string

标识 Azure 订阅的订阅 ID。

tableName
path True

string

表的名称。

api-version
query True

string

要用于请求的 API 版本。

请求正文

名称 类型 说明
properties.clientClassificationSource

ClientClassificationSource

properties.informationType

string

信息类型。

properties.informationTypeId

string

信息类型 ID。

properties.labelId

string

标签 ID。

properties.labelName

string

标签名称。

properties.rank

SensitivityLabelRank

响应

名称 类型 说明
200 OK

SensitivityLabel

已成功更新敏感度标签。

201 Created

SensitivityLabel

已成功创建敏感度标签。

Other Status Codes

ErrorResponse

错误响应: ***

  • 400 DatawarehouseDatabaseIsDeactivated - 无法执行数据分类作,因为数据库已暂停。 请继续。

  • 400 SensitivityLabelSourceNameNotSupported - 指定的敏感度标签源无效

  • 400 InvalidSensitivityLabelResource - 指定的敏感度标签资源无效

  • 400 SensitivityLabelLabelNameAndInfoTypeNotProvided - 必须至少指定一个 LabelName 和 InformationType

  • 400 LabelNameTooLong - 标签名称不能超过 {0} 个字符

  • 400 InformationTypeTooLong - 信息类型不能超过 {0} 个字符

  • 400 LabelIdMustBeGuid - 提供的“labelId”无效。 值必须是 GUID

  • 400 InformationTypeIdMustBeGuid - 提供的“informationTypeId”无效。 值必须是 GUID

  • 400 LabelMissing - 标签是必需的。 必须至少提供一个“labelName”或“labelId”

  • 400 InformationTypeMissing - 信息类型是必需的。 必须至少提供一个“informationType”或“informationTypeId”

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

  • 404 SensitivityLabelsSchemaNotFound - 找不到架构 {0}

  • 404 SensitivityLabelsTableNotFound - 无法在架构 {0} 中找到表 {1}

  • 404 SensitivityLabelsColumnNotFound - 无法在表 {0}中找到列 {2}。{1}

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

  • 404 SensitivityLabelsLabelNotFound - 找不到指定的敏感度标签

  • 501 SensitivityLabelRecommendedSourceNameNotSupported - 尚不支持“推荐”敏感度标签源

  • 501 SensitivityLabelRecommendedSourceNameNotSupported - 尚不支持“推荐”敏感度标签源

示例

Updates the sensitivity label of a given column with all parameters

示例请求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/myServer/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn/sensitivityLabels/current?api-version=2023-08-01

{
  "properties": {
    "informationType": "PhoneNumber",
    "informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646",
    "labelId": "bf91e08c-f4f0-478a-b016-25164b2a65ff",
    "labelName": "PII",
    "rank": "Low",
    "clientClassificationSource": "Native"
  }
}

示例响应

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/myServer/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn/sensitivityLabels/current",
  "name": "current",
  "type": "Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels",
  "properties": {
    "schemaName": "dbo",
    "tableName": "myTable",
    "columnName": "myColumn",
    "informationType": "PhoneNumber",
    "informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646",
    "labelId": "bf91e08c-f4f0-478a-b016-25164b2a65ff",
    "labelName": "PII",
    "rank": "Medium"
  }
}
{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/myRG/providers/Microsoft.Sql/servers/myServer/databases/myDatabase/schemas/dbo/tables/myTable/columns/myColumn/sensitivityLabels/current",
  "name": "current",
  "type": "Microsoft.Sql/servers/databases/schemas/tables/columns/sensitivityLabels",
  "properties": {
    "informationType": "PhoneNumber",
    "informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646",
    "labelId": "bf91e08c-f4f0-478a-b016-25164b2a65ff",
    "labelName": "PII",
    "rank": "High"
  }
}

定义

名称 说明
ClientClassificationSource
CurrentSensitivityLabelSource

敏感度标签的来源。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

SensitivityLabel

敏感度标签。

SensitivityLabelRank

ClientClassificationSource

说明
MIP
Native
None
Recommended

CurrentSensitivityLabelSource

敏感度标签的来源。

说明
current

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

SensitivityLabel

敏感度标签。

名称 类型 说明
id

string

资源 ID。

managedBy

string

管理敏感度标签的资源。

name

string

资源名称。

properties.clientClassificationSource

ClientClassificationSource

properties.columnName

string

列名。

properties.informationType

string

信息类型。

properties.informationTypeId

string

信息类型 ID。

properties.isDisabled

boolean

是否禁用敏感度建议。 仅适用于建议的敏感度标签。 指定是否禁用此列的敏感度建议(已消除)。

properties.labelId

string

标签 ID。

properties.labelName

string

标签名称。

properties.rank

SensitivityLabelRank

properties.schemaName

string

架构名称。

properties.tableName

string

表名称。

type

string

资源类型。

SensitivityLabelRank

说明
Critical
High
Low
Medium
None