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

Event Hub Configuration Operations - Create Or Replace Event Hub Configuration

创建或替换 EventHub 配置。

PUT {endpoint}/videotranslation/configurations/event-hub?api-version=2025-05-20

URI 参数

名称 必需 类型 说明
endpoint
path True

string

支持的认知服务终结点(协议和主机名,例如:https://eastus.api.cognitive.microsoft.com)。

api-version
query True

string

minLength: 1

用于此操作的 API 版本。

请求正文

名称 必需 类型 说明
enabledEvents True

EventHubVideoTranslationEventKind[]

启用了通知的事件类型。

eventHubName True

string

EventHub 名称。

eventHubNamespaceHostName True

string

EventHub 命名空间主机名,例如:[YourNamespace].servicebus.windows.net

isEnabled True

boolean

指示是否启用向 EventHub 发送事件。

managedIdentityClientId

string

pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

用户分配的托管标识的托管标识客户端 ID(如果未指定),API 将使用系统分配的托管标识。

响应

名称 类型 说明
200 OK

EventHubConfiguration

请求已成功。

Other Status Codes

Azure.Core.Foundations.ErrorResponse

意外的错误响应。

标头

x-ms-error-code: string

安全性

Ocp-Apim-Subscription-Key

在此处提供语音资源密钥。

类型: apiKey
在: header

AADToken

这些是 标识平台流Microsoft

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

作用域

名称 说明
https://cognitiveservices.azure.com/.default

示例

Create or replace EventHub configuration

示例请求

PUT {endpoint}/videotranslation/configurations/event-hub?api-version=2025-05-20

{
  "isEnabled": true,
  "eventHubNamespaceHostName": "your-event-hub-namespace.servicebus.windows.net",
  "eventHubName": "your-event-hub-name",
  "managedIdentityClientId": "4b9ccd1c-c751-4afa-a430-a49a5471fd68",
  "enabledEvents": [
    "TranslationCompletion",
    "IterationCompletion"
  ]
}

示例响应

{
  "isEnabled": true,
  "eventHubNamespaceHostName": "your-event-hub-namespace.servicebus.windows.net",
  "eventHubName": "your-event-hub-name",
  "managedIdentityClientId": "4b9ccd1c-c751-4afa-a430-a49a5471fd68",
  "enabledEvents": [
    "TranslationCompletion",
    "IterationCompletion"
  ]
}

定义

名称 说明
Azure.Core.Foundations.Error

错误对象。

Azure.Core.Foundations.ErrorResponse

包含错误详细信息的响应。

Azure.Core.Foundations.InnerError

包含有关错误的更具体信息的对象。 根据Microsoft一个 API 指南 - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors

EventHubConfiguration

EventHub 配置。

EventHubVideoTranslationEventKind

EventHub 事件类型。

Azure.Core.Foundations.Error

错误对象。

名称 类型 说明
code

string

服务器定义的错误代码集之一。

details

Azure.Core.Foundations.Error[]

导致此报告错误的特定错误的详细信息数组。

innererror

Azure.Core.Foundations.InnerError

包含与当前对象有关错误的更具体信息的对象。

message

string

错误的人工可读表示形式。

target

string

错误的目标。

Azure.Core.Foundations.ErrorResponse

包含错误详细信息的响应。

名称 类型 说明
error

Azure.Core.Foundations.Error

错误对象。

Azure.Core.Foundations.InnerError

包含有关错误的更具体信息的对象。 根据Microsoft一个 API 指南 - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors

名称 类型 说明
code

string

服务器定义的错误代码集之一。

innererror

Azure.Core.Foundations.InnerError

内部错误。

EventHubConfiguration

EventHub 配置。

名称 类型 说明
enabledEvents

EventHubVideoTranslationEventKind[]

启用了通知的事件类型。

eventHubName

string

EventHub 名称。

eventHubNamespaceHostName

string

EventHub 命名空间主机名,例如:[YourNamespace].servicebus.windows.net

isEnabled

boolean

指示是否启用向 EventHub 发送事件。

managedIdentityClientId

string

pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$

用户分配的托管标识的托管标识客户端 ID(如果未指定),API 将使用系统分配的托管标识。

EventHubVideoTranslationEventKind

EventHub 事件类型。

说明
IterationCompletion

在迭代完成或失败时将事件发送到 EventHub。

Ping

请求 ping API 时将事件发送到 EventHub。

TranslationCompletion

翻译完成或失败时将事件发送到 EventHub。