Event Routes - Add
加入或取代事件路由。 狀態碼:
- 204 沒有內容
- 400 不正確的要求
- EventRouteEndpointInvalid - 提供的端點不存在或未使用中。
- EventRouteFilterInvalid - 事件路由篩選無效。
- EventRouteIdInvalid - 事件路由識別碼無效。
- LimitExceeded - 已達到允許的事件路由數目上限。
PUT https://digitaltwins-hostname/eventroutes/{id}?api-version=2023-10-31
URI 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
id
|
path | True |
string |
事件路由的識別碼。 識別碼在事件路由內是唯一的,且區分大小寫。 |
api-version
|
query | True |
string |
要求的 API 版本。 |
要求標頭
名稱 | 必要 | 類型 | Description |
---|---|---|---|
traceparent |
string |
識別分散式追蹤系統中的要求。 |
|
tracestate |
string |
提供廠商特定的追蹤識別資訊,而且是追蹤親和的隨附專案。 |
要求本文
名稱 | 必要 | 類型 | Description |
---|---|---|---|
endpointName | True |
string |
這個事件路由所系結的端點名稱。 |
filter | True |
string |
運算式,描述路由至端點的事件。 |
回應
名稱 | 類型 | Description |
---|---|---|
204 No Content |
Success |
|
Other Status Codes |
預設回應。 Headers x-ms-error-code: string |
安全性
oauth2
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize?resource=0b07f429-9f4b-4714-9392-cc5e8e80c8b0
範例
Add an event route |
Add an event route (with filter) |
Add an event route
Sample Request
PUT https://digitaltwins-hostname/eventroutes/eventroute-001?api-version=2023-10-31
{
"endpointName": "endpoint-001",
"filter": "true"
}
Sample Response
Add an event route (with filter)
Sample Request
PUT https://digitaltwins-hostname/eventroutes/eventroute-001?api-version=2023-10-31
{
"endpointName": "endpoint-001",
"filter": "type = 'Microsoft.DigitalTwins.Twin.Create'"
}
Sample Response
定義
名稱 | Description |
---|---|
Error |
錯誤定義。 |
Error |
錯誤回應。 |
Event |
將通知和遙測事件導向至端點的路由。 端點是 Azure Digital Twins 以外的目的地,例如 EventHub。 |
Inner |
比包含的錯誤所提供的更具體錯誤描述。 |
Error
錯誤定義。
名稱 | 類型 | Description |
---|---|---|
code |
string |
服務特定的錯誤碼,可作為 HTTP 錯誤碼的子狀態。 |
details |
Error[] |
內部錯誤詳細資料。 |
innererror |
物件,包含比目前物件有關錯誤的更特定資訊。 |
|
message |
string |
人類看得懂的錯誤標記法。 |
ErrorResponse
錯誤回應。
名稱 | 類型 | Description |
---|---|---|
error |
錯誤詳細資料。 |
EventRoute
將通知和遙測事件導向至端點的路由。 端點是 Azure Digital Twins 以外的目的地,例如 EventHub。
名稱 | 類型 | Description |
---|---|---|
endpointName |
string |
這個事件路由所系結的端點名稱。 |
filter |
string |
運算式,描述路由至端點的事件。 |
id |
string |
事件路由的識別碼。 |
InnerError
比包含的錯誤所提供的更具體錯誤描述。
名稱 | 類型 | Description |
---|---|---|
code |
string |
比包含的錯誤所提供的更具體錯誤碼。 |
innererror |
物件,包含比目前物件有關錯誤的更特定資訊。 |
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應