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 |
启用了通知的事件类型。 |
|
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 |
请求已成功。 |
|
Other Status Codes |
意外的错误响应。 标头 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. |
错误对象。 |
Azure. |
包含错误详细信息的响应。 |
Azure. |
包含有关错误的更具体信息的对象。 根据Microsoft一个 API 指南 - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors。 |
Event |
EventHub 配置。 |
Event |
EventHub 事件类型。 |
Azure.Core.Foundations.Error
错误对象。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
服务器定义的错误代码集之一。 |
details |
导致此报告错误的特定错误的详细信息数组。 |
|
innererror |
包含与当前对象有关错误的更具体信息的对象。 |
|
message |
string |
错误的人工可读表示形式。 |
target |
string |
错误的目标。 |
Azure.Core.Foundations.ErrorResponse
包含错误详细信息的响应。
名称 | 类型 | 说明 |
---|---|---|
error |
错误对象。 |
Azure.Core.Foundations.InnerError
包含有关错误的更具体信息的对象。 根据Microsoft一个 API 指南 - https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
服务器定义的错误代码集之一。 |
innererror |
内部错误。 |
EventHubConfiguration
EventHub 配置。
名称 | 类型 | 说明 |
---|---|---|
enabledEvents |
启用了通知的事件类型。 |
|
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。 |