Device Templates - Get

ID ごとにデバイス テンプレートを取得します

GET https://{subdomain}.{baseDomain}/api/deviceTemplates/{deviceTemplateId}?api-version=2022-07-31

URI パラメーター

名前 / 必須 説明
baseDomain
path True

string

すべての Azure IoT Central サービス要求の基本ドメイン。

deviceTemplateId
path True

string

デバイス テンプレートの一意の デジタル ツイン モデル識別子

subdomain
path True

string

アプリケーション サブドメイン。

api-version
query True

string

呼び出される API のバージョン。

応答

名前 説明
200 OK

DeviceTemplate

Success

Other Status Codes

Error

IoT Central サービスから受信したエラー応答。

Headers

x-ms-error-code: string

セキュリティ

azure_auth

Azure Active Directory OAuth2 フロー

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名前 説明
user_impersonation ユーザー アカウントの借用

Get a device template by ID

Sample Request

GET https://appsubdomain.azureiotcentral.com/api/deviceTemplates/dtmi:contoso:testDeviceTemplate;1?api-version=2022-07-31

Sample Response

{
  "etag": "\"~FeoA18iSWEoC7QR3Xf33BmlVQoXvM6toNHamHuGdBs8=\"",
  "displayName": "Test Contoso Definition",
  "capabilityModel": {
    "@id": "dtmi:contoso:testCapabilityModel;1",
    "@type": "Interface",
    "contents": [
      {
        "@id": "dtmi:contoso:testCapabilityModel:settings;1",
        "@type": "Component",
        "displayName": "Settings",
        "name": "settings",
        "schema": {
          "@id": "dtmi:contoso:settings;1",
          "@type": "Interface",
          "contents": [
            {
              "@type": "Telemetry",
              "displayName": "Test Component Telemetry",
              "name": "testComponentTelemetry",
              "schema": "double"
            },
            {
              "@type": [
                "Property",
                "Initialized"
              ],
              "displayName": "Temperature Threshold",
              "name": "threshold",
              "schema": "double",
              "writable": true,
              "initialValue": "100"
            }
          ],
          "displayName": "Settings"
        }
      },
      {
        "@type": [
          "Telemetry",
          "Humidity"
        ],
        "displayName": "Humidity",
        "name": "humidity",
        "schema": "double"
      },
      {
        "@type": [
          "Property",
          "Cloud"
        ],
        "displayName": "Online Status",
        "name": "status",
        "schema": {
          "@type": "Enum",
          "enumValues": [
            {
              "displayName": "Offline",
              "enumValue": 1,
              "name": "offline"
            },
            {
              "displayName": "Online",
              "enumValue": 2,
              "name": "online"
            }
          ],
          "valueSchema": "integer"
        }
      }
    ],
    "displayName": "Test Capability Model",
    "extends": [
      {
        "@id": "dtmi:contoso:testInterface;1",
        "@type": [
          "Interface",
          "NamedInterface"
        ],
        "contents": [
          {
            "@type": "Telemetry",
            "displayName": "Test Telemetry",
            "name": "testTelemetry",
            "schema": "double"
          },
          {
            "@type": [
              "EventValue",
              "Telemetry",
              "Event"
            ],
            "displayName": "Test Event",
            "name": "testEvent",
            "schema": "integer",
            "severity": "warning"
          },
          {
            "@type": [
              "Initialized",
              "Property"
            ],
            "displayName": "Test Property",
            "name": "testProperty",
            "schema": "string",
            "writable": true,
            "initialValue": "initialValue1"
          },
          {
            "@type": "Property",
            "displayName": "Test Read-Only Property",
            "name": "testReadOnly",
            "schema": "string"
          },
          {
            "@type": "Property",
            "displayName": "Test Complex Property",
            "name": "testComplex",
            "schema": {
              "@id": "dtmi:contoso:testComplex;1",
              "@type": "Object",
              "displayName": "Object",
              "fields": [
                {
                  "displayName": "First",
                  "name": "first",
                  "schema": "string"
                },
                {
                  "displayName": "Second",
                  "name": "second",
                  "schema": "string"
                }
              ]
            },
            "writable": true
          },
          {
            "@type": "Command",
            "commandType": "synchronous",
            "displayName": "Test Command",
            "name": "testCommand",
            "request": {
              "@type": "CommandPayload",
              "displayName": "Test Request",
              "name": "testRequest",
              "schema": "double"
            },
            "response": {
              "@type": "CommandPayload",
              "displayName": "Test Response",
              "name": "testResponse",
              "schema": "geopoint"
            }
          },
          {
            "@type": "Property",
            "displayName": "Test Enum",
            "name": "testEnum",
            "schema": {
              "@id": "dtmi:contoso:testEnum;1",
              "@type": "Enum",
              "displayName": "Enum",
              "enumValues": [
                {
                  "displayName": "First",
                  "enumValue": 1,
                  "name": "first"
                },
                {
                  "displayName": "Second",
                  "enumValue": 2,
                  "name": "second"
                }
              ],
              "valueSchema": "integer"
            },
            "writable": true
          }
        ],
        "displayName": "Test Interface",
        "name": "contoso_testInterface"
      }
    ]
  },
  "@id": "dtmi:modelDefinition:contoso;1",
  "@type": [
    "ModelDefinition",
    "DeviceModel"
  ]
}

定義

名前 説明
DeviceTemplate

デバイス テンプレート定義。

Error

応答エラーの定義。

ErrorDetails

エラーの詳細情報。

DeviceTemplate

デバイス テンプレート定義。

名前 説明
@id

string

デバイス テンプレートの一意の ID。

@type

string[]

このデバイス テンプレートの JSON-LD 型。

capabilityModel

object

このデバイス テンプレートで使用される機能モデル。

description

string

デバイス テンプレートの詳細な説明。

displayName

string

デバイス テンプレートの表示名。

etag

string

デバイス テンプレートの更新での競合を防ぐために使用される ETag。

Error

応答エラーの定義。

名前 説明
error

ErrorDetails

現在の要求のエラーの詳細。

ErrorDetails

エラーの詳細情報。

名前 説明
code

string

エラー コード。

message

string

エラー メッセージの詳細。

requestId

string

現在の要求の関連付け ID。

time

string

エラー要求が失敗した時刻。