通过


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

Iot Connectors - Create Or Update

使用指定的参数创建或更新 IoT 连接器资源。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}?api-version=2022-06-01

URI 参数

名称 必需 类型 说明
iotConnectorName
path True

string

minLength: 3
maxLength: 24

IoT 连接器资源的名称。

resourceGroupName
path True

string

minLength: 1
maxLength: 90
pattern: ^[-\w\._\(\)]+$

包含服务实例的资源组的名称。

subscriptionId
path True

string

订阅标识符。

workspaceName
path True

string

minLength: 3
maxLength: 24

工作区资源的名称。

api-version
query True

string

客户端 API 版本。

请求正文

名称 类型 说明
etag

string

与资源关联的 etag,在编辑资源时用于乐观并发。

identity

Identity

指示服务是否具有与之关联的托管标识的设置。

location

string

资源位置。

properties.deviceMapping

IotMappingProperties

设备映射。

properties.ingestionEndpointConfiguration

IotEventHubIngestionEndpointConfiguration

源配置。

tags

object

资源标记。

响应

名称 类型 说明
200 OK

IotConnector

已更新 - 接受放置请求并更新现有资源。

201 Created

IotConnector

创建 - 接受放置请求并异步创建现有资源。

202 Accepted

IotConnector

已接受 - 接受请求,现有资源正在异步更新。

Other Status Codes

ErrorDetails

描述作失败的原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流

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

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

Create an IoT Connector

示例请求

PUT https://management.azure.com/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/iotconnectors/blue?api-version=2022-06-01

{
  "location": "westus",
  "tags": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "identity": {
    "type": "SystemAssigned"
  },
  "properties": {
    "ingestionEndpointConfiguration": {
      "eventHubName": "MyEventHubName",
      "consumerGroup": "ConsumerGroupA",
      "fullyQualifiedEventHubNamespace": "myeventhub.servicesbus.windows.net"
    },
    "deviceMapping": {
      "content": {
        "templateType": "CollectionContent",
        "template": [
          {
            "templateType": "JsonPathContent",
            "template": {
              "typeName": "heartrate",
              "typeMatchExpression": "$..[?(@heartrate)]",
              "deviceIdExpression": "$.deviceid",
              "timestampExpression": "$.measurementdatetime",
              "values": [
                {
                  "required": "true",
                  "valueExpression": "$.heartrate",
                  "valueName": "hr"
                }
              ]
            }
          }
        ]
      }
    }
  }
}

示例响应

{
  "name": "blue",
  "id": "/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/iotconnectors/blue",
  "type": "Microsoft.HealthcareApis/workspaces/iotconnectors",
  "location": "westus",
  "etag": "00000000-0000-0000-f5ac-912ca49e01d6",
  "tags": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "identity": {
    "type": "SystemAssigned"
  },
  "properties": {
    "provisioningState": "Succeeded",
    "ingestionEndpointConfiguration": {
      "eventHubName": "MyEventHubName",
      "consumerGroup": "ConsumerGroupA",
      "fullyQualifiedEventHubNamespace": "myeventhub.servicesbus.windows.net"
    },
    "deviceMapping": {
      "content": {
        "templateType": "CollectionContent",
        "template": [
          {
            "templateType": "JsonPathContent",
            "template": {
              "typeName": "heartrate",
              "typeMatchExpression": "$..[?(@heartrate)]",
              "deviceIdExpression": "$.deviceid",
              "timestampExpression": "$.measurementdatetime",
              "values": [
                {
                  "required": "true",
                  "valueExpression": "$.heartrate",
                  "valueName": "hr"
                }
              ]
            }
          }
        ]
      }
    }
  },
  "systemData": {
    "createdBy": "string",
    "createdAt": "2021-01-28T19:26:24.072Z",
    "lastModifiedBy": "string",
    "lastModifiedAt": "2021-01-28T19:26:24.072Z"
  }
}
{
  "name": "blue",
  "id": "/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/iotconnectors/blue",
  "type": "Microsoft.HealthcareApis/workspaces/iotconnectors",
  "location": "westus",
  "etag": "00000000-0000-0000-f5ac-912ca49e01d6",
  "tags": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "identity": {
    "type": "SystemAssigned"
  },
  "properties": {
    "provisioningState": "Creating",
    "ingestionEndpointConfiguration": {
      "eventHubName": "MyEventHubName",
      "consumerGroup": "ConsumerGroupA",
      "fullyQualifiedEventHubNamespace": "myeventhub.servicesbus.windows.net"
    },
    "deviceMapping": {
      "content": {
        "templateType": "CollectionContent",
        "template": [
          {
            "templateType": "JsonPathContent",
            "template": {
              "typeName": "heartrate",
              "typeMatchExpression": "$..[?(@heartrate)]",
              "deviceIdExpression": "$.deviceid",
              "timestampExpression": "$.measurementdatetime",
              "values": [
                {
                  "required": "true",
                  "valueExpression": "$.heartrate",
                  "valueName": "hr"
                }
              ]
            }
          }
        ]
      }
    }
  },
  "systemData": {
    "createdBy": "string",
    "createdAt": "2021-01-28T19:26:24.072Z",
    "lastModifiedBy": "string",
    "lastModifiedAt": "2021-01-28T19:26:24.072Z"
  }
}
{
  "name": "blue",
  "id": "/subscriptions/subid/resourceGroups/testRG/providers/Microsoft.HealthcareApis/workspaces/workspace1/iotconnectors/blue",
  "type": "Microsoft.HealthcareApis/workspaces/iotconnectors",
  "location": "westus",
  "etag": "00000000-0000-0000-f5ac-912ca49e01d6",
  "tags": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "identity": {
    "type": "SystemAssigned"
  },
  "properties": {
    "provisioningState": "Accepted",
    "ingestionEndpointConfiguration": {
      "eventHubName": "MyEventHubName",
      "consumerGroup": "ConsumerGroupA",
      "fullyQualifiedEventHubNamespace": "myeventhub.servicesbus.windows.net"
    },
    "deviceMapping": {
      "content": {
        "templateType": "CollectionContent",
        "template": [
          {
            "templateType": "JsonPathContent",
            "template": {
              "typeName": "heartrate",
              "typeMatchExpression": "$..[?(@heartrate)]",
              "deviceIdExpression": "$.deviceid",
              "timestampExpression": "$.measurementdatetime",
              "values": [
                {
                  "required": "true",
                  "valueExpression": "$.heartrate",
                  "valueName": "hr"
                }
              ]
            }
          }
        ]
      }
    }
  },
  "systemData": {
    "createdBy": "string",
    "createdAt": "2021-01-28T19:26:24.072Z",
    "lastModifiedBy": "string",
    "lastModifiedAt": "2021-01-28T19:26:24.072Z"
  }
}

定义

名称 说明
createdByType

创建资源的标识的类型。

ErrorDetails

错误详细信息。

ErrorDetailsInternal

错误详细信息。

Identity

指示服务是否具有与之关联的托管标识的设置。

IotConnector

IoT 连接器定义。

IotEventHubIngestionEndpointConfiguration

事件中心引入终结点配置

IotMappingProperties

映射内容。

provisioningState

预配状态。

ServiceManagedIdentityType

指定的标识类型,当前允许 SystemAssigned 和 None。

systemData

与创建和上次修改资源相关的元数据。

UserAssignedIdentity

用户分配的标识属性

createdByType

创建资源的标识的类型。

说明
User
Application
ManagedIdentity
Key

ErrorDetails

错误详细信息。

名称 类型 说明
error

ErrorDetailsInternal

错误详细信息

ErrorDetailsInternal

错误详细信息。

名称 类型 说明
code

string

错误代码。

message

string

错误消息。

target

string

特定错误的目标。

Identity

指示服务是否具有与之关联的托管标识的设置。

名称 类型 说明
principalId

string (uuid)

系统分配标识的服务主体 ID。 此属性仅针对系统分配的标识提供。

tenantId

string (uuid)

系统分配标识的租户 ID。 此属性仅针对系统分配的标识提供。

type

ServiceManagedIdentityType

指定的标识类型,当前允许 SystemAssigned 和 None。

userAssignedIdentities

<string,  UserAssignedIdentity>

User-Assigned 标识
与资源关联的用户分配标识集。 userAssignedIdentities 字典密钥将为 ARM 资源 ID,格式为“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。 字典值可以是请求中的空对象({})。

IotConnector

IoT 连接器定义。

名称 类型 说明
etag

string

与资源关联的 etag,在编辑资源时用于乐观并发。

id

string

资源标识符。

identity

Identity

指示服务是否具有与之关联的托管标识的设置。

location

string

资源位置。

name

string

pattern: ^[a-z0-9][a-z0-9-]{1,21}[a-z0-9]$

资源名称。

properties.deviceMapping

IotMappingProperties

设备映射。

properties.ingestionEndpointConfiguration

IotEventHubIngestionEndpointConfiguration

源配置。

properties.provisioningState

provisioningState

预配状态。

systemData

systemData

与创建和上次修改资源相关的元数据。

tags

object

资源标记。

type

string

资源类型。

IotEventHubIngestionEndpointConfiguration

事件中心引入终结点配置

名称 类型 说明
consumerGroup

string

要连接到的事件中心的使用者组。

eventHubName

string

要连接到的事件中心名称。

fullyQualifiedEventHubNamespace

string

要连接到的事件中心的完全限定命名空间。

IotMappingProperties

映射内容。

名称 类型 说明
content

object

映射。

provisioningState

预配状态。

说明
Deleting
Succeeded
Creating
Accepted
Verifying
Updating
Failed
Canceled
Deprovisioned
Moving
Suspended
Warned
SystemMaintenance

ServiceManagedIdentityType

指定的标识类型,当前允许 SystemAssigned 和 None。

说明
None
SystemAssigned
UserAssigned
SystemAssigned,UserAssigned

systemData

与创建和上次修改资源相关的元数据。

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

上次修改的资源时间戳(UTC)

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

上次修改资源的标识的类型。

UserAssignedIdentity

用户分配的标识属性

名称 类型 说明
clientId

string (uuid)

分配的标识的客户端 ID。

principalId

string (uuid)

已分配标识的主体 ID。