Partilhar via


Event Routes - Add

Adds or replaces an event route. Status codes:

  • 204 No Content
  • 400 Bad Request
    • EventRouteEndpointInvalid - The endpoint provided does not exist or is not active.
    • EventRouteFilterInvalid - The event route filter is invalid.
    • EventRouteIdInvalid - The event route id is invalid.
    • LimitExceeded - The maximum number of event routes allowed has been reached.
PUT https://digitaltwins-hostname/eventroutes/{id}?api-version=2023-10-31

URI Parameters

Name In Required Type Description
id
path True

string

The id for an event route. The id is unique within event routes and case sensitive.

api-version
query True

string

The requested API version.

Request Header

Name Required Type Description
traceparent

string

Identifies the request in a distributed tracing system.

tracestate

string

Provides vendor-specific trace identification information and is a companion to traceparent.

Request Body

Name Required Type Description
endpointName True

string

The name of the endpoint this event route is bound to.

filter True

string

An expression which describes the events which are routed to the endpoint.

Responses

Name Type Description
204 No Content

Success

Other Status Codes

ErrorResponse

Default response.

Headers

x-ms-error-code: string

Security

oauth2

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize?resource=0b07f429-9f4b-4714-9392-cc5e8e80c8b0

Examples

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

Definitions

Name Description
Error

Error definition.

ErrorResponse

Error response.

EventRoute

A route which directs notification and telemetry events to an endpoint. Endpoints are a destination outside of Azure Digital Twins such as an EventHub.

InnerError

A more specific error description than was provided by the containing error.

Error

Error definition.

Name Type Description
code

string

Service specific error code which serves as the substatus for the HTTP error code.

details

Error[]

Internal error details.

innererror

InnerError

An object containing more specific information than the current object about the error.

message

string

A human-readable representation of the error.

ErrorResponse

Error response.

Name Type Description
error

Error

The error details.

EventRoute

A route which directs notification and telemetry events to an endpoint. Endpoints are a destination outside of Azure Digital Twins such as an EventHub.

Name Type Description
endpointName

string

The name of the endpoint this event route is bound to.

filter

string

An expression which describes the events which are routed to the endpoint.

id

string

The id of the event route.

InnerError

A more specific error description than was provided by the containing error.

Name Type Description
code

string

A more specific error code than was provided by the containing error.

innererror

InnerError

An object containing more specific information than the current object about the error.