你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Event Sources - Create Or Update
在指定环境中创建或更新事件源。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}/eventSources/{eventSourceName}?api-version=2020-05-15
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
environment
|
path | True |
string |
与指定资源组关联的时序见解环境的名称。 |
event
|
path | True |
string |
事件源的名称。 Regex pattern: |
resource
|
path | True |
string |
Azure 资源组的名称。 |
subscription
|
path | True |
string |
Azure 订阅 ID。 |
api-version
|
query | True |
string |
要与客户端请求一起使用的 API 的版本。 |
请求正文
请求正文可以为下列任一内容:
名称 | 说明 |
---|---|
Event |
提供给 EventHub 事件源的“创建或更新事件源”操作的参数。 |
Io |
提供给 IoTHub 事件源的“创建或更新事件源”操作的参数。 |
EventHubEventSourceCreateOrUpdateParameters
提供给 EventHub 事件源的“创建或更新事件源”操作的参数。
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
eventSourceResourceId | True |
string |
Azure 资源管理器中事件源的资源 ID。 |
kind | True |
string:
Microsoft. |
事件源的类型。 |
location | True |
string |
资源的位置。 |
properties.consumerGroupName | True |
string |
事件中心使用者组的名称,该使用者组包含要从中读取事件的分区。 |
properties.eventHubName | True |
string |
事件中心的名称。 |
properties.keyName | True |
string |
向时序见解服务授予对事件中心的访问权限的 SAS 密钥的名称。 此密钥的共享访问策略必须向事件中心授予“侦听”权限。 |
properties.serviceBusNamespace | True |
string |
包含事件中心的服务总线的名称。 |
properties.sharedAccessKey | True |
string |
向时序见解服务授予对事件中心的读取访问权限的共享访问密钥的值。 此属性不显示在事件源响应中。 |
ingressStartAt.time |
string |
) 可选ISO8601具有秒精度 (毫秒的 UTC 日期时间,用于指定用作事件使用的起点的日期和时间。 |
|
ingressStartAt.type |
ingressStartAt 的类型,可以是“EarliestAvailable”、“EventSourceCreationTime”、“CustomEnqueuedTime”。 |
||
localTimestamp |
一个表示本地时间戳属性的 对象。 它包含需要使用的本地时间戳格式和相应的时区偏移量信息。 如果未为 localTimestamp 指定值,或者如果为 null,则不会将本地时间戳与事件一起引入。 |
||
tags |
object |
资源的附加属性的键值对。 |
|
timestampPropertyName |
string |
用作事件源时间戳的事件属性。 如果未为 timestampPropertyName 指定值,或者指定 null 或空字符串,则会使用事件创建时间。 |
IoTHubEventSourceCreateOrUpdateParameters
提供给 IoTHub 事件源的“创建或更新事件源”操作的参数。
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
eventSourceResourceId | True |
string |
Azure 资源管理器中事件源的资源 ID。 |
kind | True |
string:
Microsoft. |
事件源的类型。 |
location | True |
string |
资源的位置。 |
properties.consumerGroupName | True |
string |
iot 中心的使用者组的名称,该使用者组包含要从中读取事件的分区。 |
properties.iotHubName | True |
string |
iot 中心的名称。 |
properties.keyName | True |
string |
向时序见解服务授予对 iot 中心的访问权限的共享访问策略密钥的名称。 此共享访问策略密钥必须授予对 iot 中心的“服务连接”权限。 |
properties.sharedAccessKey | True |
string |
向时序见解服务授予对 iot 中心的读取访问权限的共享访问策略密钥的值。 此属性不显示在事件源响应中。 |
ingressStartAt.time |
string |
) 可选ISO8601具有秒精度 (毫秒的 UTC 日期时间,用于指定用作事件使用的起点的日期和时间。 |
|
ingressStartAt.type |
ingressStartAt 的类型,可以是“EarliestAvailable”、“EventSourceCreationTime”、“CustomEnqueuedTime”。 |
||
localTimestamp |
一个表示本地时间戳属性的 对象。 它包含需要使用的本地时间戳格式和相应的时区偏移量信息。 如果未为 localTimestamp 指定值,或者如果为 null,则不会将本地时间戳与事件一起引入。 |
||
tags |
object |
资源的附加属性的键值对。 |
|
timestampPropertyName |
string |
用作事件源时间戳的事件属性。 如果未为 timestampPropertyName 指定值,或者指定 null 或空字符串,则会使用事件创建时间。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK | EventSourceResource: |
已成功更新现有事件源定义。 |
201 Created | EventSourceResource: |
已成功创建事件源。 |
Other Status Codes |
HTTP 400 (错误的请求) :给定的事件源请求正文无效;有关详细信息,请参阅响应中的错误代码和消息。 |
安全性
azure_auth
Azure Active Directory OAuth2 流
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名称 | 说明 |
---|---|
user_impersonation | 模拟用户帐户 |
示例
Create |
Event |
CreateEventHubEventSource
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.TimeSeriesInsights/environments/env1/eventSources/es1?api-version=2020-05-15
{
"location": "West US",
"kind": "Microsoft.EventHub",
"properties": {
"eventSourceResourceId": "somePathInArm",
"serviceBusNamespace": "sbn",
"consumerGroupName": "cgn",
"eventHubName": "ehn",
"keyName": "managementKey",
"sharedAccessKey": "someSecretvalue",
"timestampPropertyName": "someTimestampProperty",
"localTimestamp": {
"format": "TimeSpan",
"timeZoneOffset": {
"propertyName": "someEventPropertyName"
}
},
"ingressStartAt": {
"type": "EarliestAvailable"
}
}
}
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.TimeSeriesInsights/Environments/env1/eventSources/es1",
"location": "West US",
"name": "es1",
"type": "Microsoft.TimeSeriesInsights/Environments/EventSources",
"tags": {},
"kind": "Microsoft.EventHub",
"properties": {
"eventSourceResourceId": "somePathInArm",
"serviceBusNamespace": "sbn",
"consumerGroupName": "cgn",
"eventHubName": "ehn",
"keyName": "managementKey",
"provisioningState": "Succeeded",
"creationTime": "2017-04-18T19:20:33.2288820Z",
"localTimestamp": {
"format": "TimeSpan",
"timeZoneOffset": {
"propertyName": "someEventPropertyName"
}
},
"ingressStartAt": {
"type": "EarliestAvailable"
}
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.TimeSeriesInsights/Environments/env1/eventSources/es1",
"location": "West US",
"name": "es1",
"type": "Microsoft.TimeSeriesInsights/Environments/EventSources",
"tags": {},
"kind": "Microsoft.EventHub",
"properties": {
"eventSourceResourceId": "somePathInArm",
"serviceBusNamespace": "sbn",
"consumerGroupName": "cgn",
"eventHubName": "ehn",
"keyName": "managementKey",
"provisioningState": "Succeeded",
"creationTime": "2017-04-18T19:20:33.2288820Z",
"localTimestamp": {
"format": "TimeSpan",
"timeZoneOffset": {
"propertyName": "someEventPropertyName"
}
},
"ingressStartAt": {
"type": "EarliestAvailable"
}
}
}
EventSourcesCreateEventHubWithCustomEnquedTime
Sample Request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.TimeSeriesInsights/environments/env1/eventSources/es1?api-version=2020-05-15
{
"location": "West US",
"kind": "Microsoft.EventHub",
"properties": {
"eventSourceResourceId": "somePathInArm",
"serviceBusNamespace": "sbn",
"consumerGroupName": "cgn",
"eventHubName": "ehn",
"keyName": "managementKey",
"sharedAccessKey": "someSecretvalue",
"timestampPropertyName": "someTimestampProperty",
"ingressStartAt": {
"type": "CustomEnqueuedTime",
"time": "2017-04-01T19:20:33.2288820Z"
}
}
}
Sample Response
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.TimeSeriesInsights/Environments/env1/eventSources/es1",
"location": "West US",
"name": "es1",
"type": "Microsoft.TimeSeriesInsights/Environments/EventSources",
"tags": {},
"kind": "Microsoft.EventHub",
"properties": {
"eventSourceResourceId": "somePathInArm",
"serviceBusNamespace": "sbn",
"consumerGroupName": "cgn",
"eventHubName": "ehn",
"keyName": "managementKey",
"provisioningState": "Succeeded",
"creationTime": "2017-04-18T19:20:33.2288820Z",
"ingressStartAt": {
"type": "CustomEnqueuedTime",
"time": "2017-04-01T19:20:33.2288820Z"
}
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.TimeSeriesInsights/Environments/env1/eventSources/es1",
"location": "West US",
"name": "es1",
"type": "Microsoft.TimeSeriesInsights/Environments/EventSources",
"tags": {},
"kind": "Microsoft.EventHub",
"properties": {
"eventSourceResourceId": "somePathInArm",
"serviceBusNamespace": "sbn",
"consumerGroupName": "cgn",
"eventHubName": "ehn",
"keyName": "managementKey",
"provisioningState": "Succeeded",
"creationTime": "2017-04-18T19:20:33.2288820Z",
"ingressStartAt": {
"type": "CustomEnqueuedTime",
"time": "2017-04-01T19:20:33.2288820Z"
}
}
}
定义
名称 | 说明 |
---|---|
Cloud |
包含有关 API 错误的信息。 |
Cloud |
使用错误代码和消息描述特定的 API 错误。 |
Event |
提供给 EventHub 事件源的“创建或更新事件源”操作的参数。 |
Event |
从 Azure EventHub 接收其数据的事件源。 |
Ingress |
ingressStartAt 的类型,可以是“EarliestAvailable”、“EventSourceCreationTime”、“CustomEnqueuedTime”。 |
Io |
提供给 IoTHub 事件源的“创建或更新事件源”操作的参数。 |
Io |
从 Azure IoTHub 接收其数据的事件源。 |
Local |
一个表示本地时间戳属性的 对象。 它包含需要使用的本地时间戳格式和相应的时区偏移量信息。 如果未为 localTimestamp 指定值,或者如果为 null,则不会将本地时间戳与事件一起引入。 |
Local |
一个枚举,表示需要设置的本地时间戳属性的格式。 |
Provisioning |
资源的预配状态。 |
Time |
一个 对象,表示指定的本地时间戳格式的偏移信息。 不应为 LocalTimestampFormat - Embedded 指定。 |
CloudError
包含有关 API 错误的信息。
名称 | 类型 | 说明 |
---|---|---|
error |
使用错误代码和消息描述特定的 API 错误。 |
CloudErrorBody
使用错误代码和消息描述特定的 API 错误。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
描述错误条件的错误代码比 HTTP 状态代码更精确。 可用于以编程方式处理特定错误情况。 |
details |
包含与此错误相关的嵌套错误。 |
|
message |
string |
详细描述错误并提供调试信息的消息。 |
target |
string |
特定错误的目标 (例如,错误) 中属性的名称。 |
EventHubEventSourceCreateOrUpdateParameters
提供给 EventHub 事件源的“创建或更新事件源”操作的参数。
名称 | 类型 | 说明 |
---|---|---|
creationTime |
string |
创建资源的时间。 |
eventSourceResourceId |
string |
Azure 资源管理器中事件源的资源 ID。 |
ingressStartAt.time |
string |
) 可选ISO8601具有秒精度 (毫秒的 UTC 日期时间,用于指定用作事件使用的起点的日期和时间。 |
ingressStartAt.type |
ingressStartAt 的类型,可以是“EarliestAvailable”、“EventSourceCreationTime”、“CustomEnqueuedTime”。 |
|
kind |
string:
Microsoft. |
事件源的类型。 |
localTimestamp |
一个表示本地时间戳属性的 对象。 它包含需要使用的本地时间戳格式和相应的时区偏移量信息。 如果未为 localTimestamp 指定值,或者如果为 null,则不会将本地时间戳与事件一起引入。 |
|
location |
string |
资源的位置。 |
properties.consumerGroupName |
string |
事件中心使用者组的名称,该使用者组包含要从中读取事件的分区。 |
properties.eventHubName |
string |
事件中心的名称。 |
properties.keyName |
string |
向时序见解服务授予对事件中心的访问权限的 SAS 密钥的名称。 此密钥的共享访问策略必须向事件中心授予“侦听”权限。 |
properties.serviceBusNamespace |
string |
包含事件中心的服务总线的名称。 |
properties.sharedAccessKey |
string |
向时序见解服务授予对事件中心的读取访问权限的共享访问密钥的值。 此属性不显示在事件源响应中。 |
provisioningState |
资源的预配状态。 |
|
tags |
object |
资源的附加属性的键值对。 |
timestampPropertyName |
string |
用作事件源时间戳的事件属性。 如果未为 timestampPropertyName 指定值,或者指定 null 或空字符串,则会使用事件创建时间。 |
EventHubEventSourceResource
从 Azure EventHub 接收其数据的事件源。
名称 | 类型 | 说明 |
---|---|---|
creationTime |
string |
创建资源的时间。 |
eventSourceResourceId |
string |
Azure 资源管理器中事件源的资源 ID。 |
id |
string |
资源 ID |
ingressStartAt.time |
string |
) 可选ISO8601具有秒精度 (毫秒的 UTC 日期时间,用于指定用作事件使用的起点的日期和时间。 |
ingressStartAt.type |
ingressStartAt 的类型,可以是“EarliestAvailable”、“EventSourceCreationTime”、“CustomEnqueuedTime”。 |
|
kind |
string:
Microsoft. |
事件源的类型。 |
localTimestamp |
一个表示本地时间戳属性的 对象。 它包含需要使用的本地时间戳格式和相应的时区偏移量信息。 如果未为 localTimestamp 指定值,或者如果为 null,则不会将本地时间戳与事件一起引入。 |
|
location |
string |
资源位置 |
name |
string |
资源名称 |
properties.consumerGroupName |
string |
事件中心使用者组的名称,该使用者组包含要从中读取事件的分区。 |
properties.eventHubName |
string |
事件中心的名称。 |
properties.keyName |
string |
向时序见解服务授予对事件中心的访问权限的 SAS 密钥的名称。 此密钥的共享访问策略必须向事件中心授予“侦听”权限。 |
properties.serviceBusNamespace |
string |
包含事件中心的服务总线的名称。 |
provisioningState |
资源的预配状态。 |
|
tags |
object |
资源标记 |
timestampPropertyName |
string |
用作事件源时间戳的事件属性。 如果未为 timestampPropertyName 指定值,或者指定 null 或空字符串,则会使用事件创建时间。 |
type |
string |
资源类型 |
IngressStartAtType
ingressStartAt 的类型,可以是“EarliestAvailable”、“EventSourceCreationTime”、“CustomEnqueuedTime”。
名称 | 类型 | 说明 |
---|---|---|
CustomEnqueuedTime |
string |
|
EarliestAvailable |
string |
|
EventSourceCreationTime |
string |
IoTHubEventSourceCreateOrUpdateParameters
提供给 IoTHub 事件源的“创建或更新事件源”操作的参数。
名称 | 类型 | 说明 |
---|---|---|
creationTime |
string |
创建资源的时间。 |
eventSourceResourceId |
string |
Azure 资源管理器中事件源的资源 ID。 |
ingressStartAt.time |
string |
) 可选ISO8601具有秒精度 (毫秒的 UTC 日期时间,用于指定用作事件使用的起点的日期和时间。 |
ingressStartAt.type |
ingressStartAt 的类型,可以是“EarliestAvailable”、“EventSourceCreationTime”、“CustomEnqueuedTime”。 |
|
kind |
string:
Microsoft. |
事件源的类型。 |
localTimestamp |
一个表示本地时间戳属性的 对象。 它包含需要使用的本地时间戳格式和相应的时区偏移量信息。 如果未为 localTimestamp 指定值,或者如果为 null,则不会将本地时间戳与事件一起引入。 |
|
location |
string |
资源的位置。 |
properties.consumerGroupName |
string |
iot 中心的使用者组的名称,该使用者组包含要从中读取事件的分区。 |
properties.iotHubName |
string |
iot 中心的名称。 |
properties.keyName |
string |
向时序见解服务授予对 iot 中心的访问权限的共享访问策略密钥的名称。 此共享访问策略密钥必须授予对 iot 中心的“服务连接”权限。 |
properties.sharedAccessKey |
string |
向时序见解服务授予对 iot 中心的读取访问权限的共享访问策略密钥的值。 此属性不显示在事件源响应中。 |
provisioningState |
资源的预配状态。 |
|
tags |
object |
资源的附加属性的键值对。 |
timestampPropertyName |
string |
用作事件源时间戳的事件属性。 如果未为 timestampPropertyName 指定值,或者指定 null 或空字符串,则会使用事件创建时间。 |
IoTHubEventSourceResource
从 Azure IoTHub 接收其数据的事件源。
名称 | 类型 | 说明 |
---|---|---|
creationTime |
string |
创建资源的时间。 |
eventSourceResourceId |
string |
Azure 资源管理器中事件源的资源 ID。 |
id |
string |
资源 ID |
ingressStartAt.time |
string |
) 可选ISO8601具有秒精度 (毫秒的 UTC 日期时间,用于指定用作事件使用的起点的日期和时间。 |
ingressStartAt.type |
ingressStartAt 的类型,可以是“EarliestAvailable”、“EventSourceCreationTime”、“CustomEnqueuedTime”。 |
|
kind |
string:
Microsoft. |
事件源的类型。 |
localTimestamp |
一个表示本地时间戳属性的 对象。 它包含需要使用的本地时间戳格式和相应的时区偏移量信息。 如果未为 localTimestamp 指定值,或者如果为 null,则不会将本地时间戳与事件一起引入。 |
|
location |
string |
资源位置 |
name |
string |
资源名称 |
properties.consumerGroupName |
string |
iot 中心的使用者组的名称,该使用者组包含要从中读取事件的分区。 |
properties.iotHubName |
string |
iot 中心的名称。 |
properties.keyName |
string |
向时序见解服务授予对 iot 中心的访问权限的共享访问策略密钥的名称。 此共享访问策略密钥必须授予对 iot 中心的“服务连接”权限。 |
provisioningState |
资源的预配状态。 |
|
tags |
object |
资源标记 |
timestampPropertyName |
string |
用作事件源时间戳的事件属性。 如果未为 timestampPropertyName 指定值,或者指定 null 或空字符串,则会使用事件创建时间。 |
type |
string |
资源类型 |
LocalTimestamp
一个表示本地时间戳属性的 对象。 它包含需要使用的本地时间戳格式和相应的时区偏移量信息。 如果未为 localTimestamp 指定值,或者如果为 null,则不会将本地时间戳与事件一起引入。
名称 | 类型 | 说明 |
---|---|---|
format |
一个枚举,表示需要设置的本地时间戳属性的格式。 |
|
timeZoneOffset |
一个 对象,表示指定的本地时间戳格式的偏移信息。 不应为 LocalTimestampFormat - Embedded 指定。 |
LocalTimestampFormat
一个枚举,表示需要设置的本地时间戳属性的格式。
名称 | 类型 | 说明 |
---|---|---|
Embedded |
string |
ProvisioningState
资源的预配状态。
名称 | 类型 | 说明 |
---|---|---|
Accepted |
string |
|
Creating |
string |
|
Deleting |
string |
|
Failed |
string |
|
Succeeded |
string |
|
Updating |
string |
TimeZoneOffset
一个 对象,表示指定的本地时间戳格式的偏移信息。 不应为 LocalTimestampFormat - Embedded 指定。
名称 | 类型 | 说明 |
---|---|---|
propertyName |
string |
将包含用于计算本地时间戳的偏移量信息的事件属性。 当 LocalTimestampFormat 为 Iana 时,属性名称将包含包含 IANA 时区名称的列的名称 (例如:Americas/Los Angeles) 。 当 LocalTimestampFormat 为 Timespan 时,它包含属性的名称,其中包含表示偏移量的值 (例如:P1D 或 1.00:00:00) |