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

Hunt Relations - Create Or Update

创建或更新搜寻关系。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/hunts/{huntId}/relations/{huntRelationId}?api-version=2025-04-01-preview

URI 参数

名称 必需 类型 说明
huntId
path True

string

搜寻 ID (GUID)

huntRelationId
path True

string

搜寻关系 ID (GUID)

resourceGroupName
path True

string

minLength: 1
maxLength: 90

资源组的名称。 此名称不区分大小写。

subscriptionId
path True

string (uuid)

目标订阅的 ID。 该值必须是 UUID。

workspaceName
path True

string

minLength: 1
maxLength: 90
pattern: ^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$

工作区的名称。

api-version
query True

string

minLength: 1

用于此作的 API 版本。

请求正文

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

string

相关资源的 ID

etag

string

Azure 资源的 Etag

properties.labels

string[]

与此搜寻相关的标签列表

响应

名称 类型 说明
200 OK

HuntRelation

创建或更新搜寻关系

201 Created

HuntRelation

已创建

Other Status Codes

CloudError

描述操作失败的原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

Creates or updates a hunt relation.

示例请求

PUT https://management.azure.com/subscriptions/bd794837-4d29-4647-9105-6339bfdb4e6a/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/hunts/163e7b2a-a2ec-4041-aaba-d878a38f265f/relations/2216d0e1-91e3-4902-89fd-d2df8c535096?api-version=2025-04-01-preview

{
  "properties": {
    "relatedResourceId": "/subscriptions/bd794837-4d29-4647-9105-6339bfdb4e6a/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/workspaces/avdvirint/providers/Microsoft.SecurityInsights/Bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096",
    "labels": [
      "Test Label"
    ]
  }
}

示例响应

{
  "id": "/subscriptions/bd794837-4d29-4647-9105-6339bfdb4e6a/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/workspaces/avdvirint/providers/Microsoft.SecurityInsights/hunts/163e7b2a-a2ec-4041-aaba-d878a38f265f/relations/2216d0e1-91e3-4902-89fd-d2df8c535096",
  "name": "2216d0e1-91e3-4902-89fd-d2df8c535096",
  "etag": "\"26012da2-0000-0c00-0000-627ad2760000\"",
  "type": "Microsoft.SecurityInsights/hunts/relations",
  "properties": {
    "relatedResourceId": "/subscriptions/bd794837-4d29-4647-9105-6339bfdb4e6a/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/workspaces/avdvirint/providers/Microsoft.SecurityInsights/Bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096",
    "relatedResourceName": "2216d0e1-91e3-4902-89fd-d2df8c535096",
    "relatedResourceType": "Microsoft.SecurityInsights/Bookmarks",
    "labels": [
      "Test Label"
    ]
  }
}
{
  "id": "/subscriptions/bd794837-4d29-4647-9105-6339bfdb4e6a/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/workspaces/avdvirint/providers/Microsoft.SecurityInsights/hunts/163e7b2a-a2ec-4041-aaba-d878a38f265f/relations/2216d0e1-91e3-4902-89fd-d2df8c535096",
  "name": "2216d0e1-91e3-4902-89fd-d2df8c535096",
  "etag": "\"26012da2-0000-0c00-0000-627ad2760000\"",
  "type": "Microsoft.SecurityInsights/hunts/relations",
  "properties": {
    "relatedResourceId": "/subscriptions/bd794837-4d29-4647-9105-6339bfdb4e6a/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/workspaces/avdvirint/providers/Microsoft.SecurityInsights/Bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096",
    "relatedResourceName": "2216d0e1-91e3-4902-89fd-d2df8c535096",
    "relatedResourceType": "Microsoft.SecurityInsights/Bookmarks",
    "labels": [
      "Test Label"
    ]
  }
}

定义

名称 说明
CloudError

错误响应结构。

CloudErrorBody

错误详细信息。

createdByType

创建资源的标识的类型。

HuntRelation

表示 Azure 安全见解中的搜寻关系。

systemData

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

CloudError

错误响应结构。

名称 类型 说明
error

CloudErrorBody

错误数据

CloudErrorBody

错误详细信息。

名称 类型 说明
code

string

错误的标识符。 代码是固定的,旨在以编程方式使用。

message

string

描述错误的消息,旨在适合在用户界面中显示。

createdByType

创建资源的标识的类型。

说明
User
Application
ManagedIdentity
Key

HuntRelation

表示 Azure 安全见解中的搜寻关系。

名称 类型 说明
etag

string

Azure 资源的 Etag

id

string (arm-id)

资源的完全限定资源 ID。 例如“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}”

name

string

资源的名称

properties.labels

string[]

与此搜寻相关的标签列表

properties.relatedResourceId

string

相关资源的 ID

properties.relatedResourceKind

string

关系与该关系相关的资源

properties.relatedResourceName

string

相关资源的名称

properties.relationType

string

搜寻关系的类型

systemData

systemData

包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。

type

string

资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

systemData

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

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

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

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

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