Device Templates - List

基本的な ODATA サポート ($top、$filter、$orderby) を使用して、アプリケーション内のデバイステンプレートの一覧を取得します。詳細については、 こちらを参照してください。

GET https://{subdomain}.{baseDomain}/api/deviceTemplates?api-version=1.1-preview
GET https://{subdomain}.{baseDomain}/api/deviceTemplates?api-version=1.1-preview&$filter={$filter}&$top={$top}&$orderby={$orderby}

URI パラメーター

Name In Required Type Description
baseDomain
path True
  • string

すべての Azure IoT Central service 要求のベースドメイン。

subdomain
path True
  • string

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

api-version
query True
  • string

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

$filter
query
  • string

結果のフィルター文字列。

$orderby
query
  • string

結果の order by 文字列。

$top
query
  • integer

返された結果のページサイズ。

応答

Name Type Description
200 OK

Success

List device templates

Sample Request

GET https://appsubdomain.azureiotcentral.com/api/deviceTemplates?api-version=1.1-preview

Sample Response

{
  "value": [
    {
      "@id": "dtmi:contoso:testDeviceTemplate;1",
      "@type": [
        "ModelDefinition",
        "DeviceModel",
        "EdgeModel"
      ],
      "displayName": "Test Definition",
      "etag": "\"~jbzfGhYctc9wtzNZXVmVua5JjTHO/FfjMUJvk9hqkRY=\"",
      "capabilityModel": {
        "@id": "dtmi:contoso:testCapabilityModel;1",
        "@type": "Interface",
        "displayName": "Test Capability Model",
        "extends": [
          {
            "@id": "dtmi:contoso:testInterface;1",
            "@type": "Interface",
            "displayName": "Test Interface",
            "contents": [
              {
                "@type": "Telemetry",
                "displayName": "Test Telemetry",
                "name": "testTelemetry",
                "schema": "double"
              },
              {
                "@type": [
                  "Telemetry",
                  "Event",
                  "EventValue"
                ],
                "displayName": "Test Event",
                "name": "testEvent",
                "schema": "integer",
                "severity": "warning"
              },
              {
                "@type": [
                  "Property",
                  "Initialized"
                ],
                "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": {
                  "displayName": "Test Request",
                  "name": "testRequest",
                  "schema": "double"
                },
                "response": {
                  "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
              }
            ]
          }
        ],
        "contents": [
          {
            "@type": [
              "Relationship",
              "EdgeModule"
            ],
            "displayName": "Test Module",
            "maxMultiplicity": 1,
            "name": "testModule",
            "target": [
              {
                "@id": "dtmi:contoso:testModuleCapabilityModel;1",
                "@type": "Interface",
                "displayName": "Test Module Capability Model",
                "extends": [
                  {
                    "@id": "dtmi:contoso:testModuleInterface;1",
                    "@type": "Interface",
                    "contents": [
                      {
                        "@type": "Telemetry",
                        "displayName": "Test Module Telemetry",
                        "name": "testModuleTelemetry",
                        "schema": "double"
                      },
                      {
                        "@type": "Property",
                        "displayName": "Test Module Property",
                        "name": "testModuleProperty",
                        "schema": "string",
                        "writable": true
                      }
                    ],
                    "displayName": "Test Module Interface"
                  }
                ]
              }
            ]
          },
          {
            "@type": [
              "Cloud",
              "Property"
            ],
            "displayName": "Test Cloud Property",
            "name": "testCloudProperty",
            "schema": "dateTime"
          }
        ]
      },
      "deploymentManifest": {
        "modulesContent": {
          "$edgeAgent": {
            "properties.desired": {
              "schemaVersion": "1.1",
              "runtime": {
                "type": "docker",
                "settings": {
                  "minDockerVersion": "v1.25",
                  "loggingOptions": "",
                  "registryCredentials": {
                    "ContosoRegistry": {
                      "username": "myacr",
                      "password": "<password>",
                      "address": "myacr.azurecr.io"
                    }
                  }
                }
              },
              "systemModules": {
                "edgeAgent": {
                  "type": "docker",
                  "settings": {
                    "image": "mcr.microsoft.com/azureiotedge-agent:1.1",
                    "createOptions": "{}"
                  }
                },
                "edgeHub": {
                  "type": "docker",
                  "status": "running",
                  "restartPolicy": "always",
                  "startupOrder": 0,
                  "settings": {
                    "image": "mcr.microsoft.com/azureiotedge-hub:1.1",
                    "createOptions": "{\"HostConfig\":{\"PortBindings\":{\"443/tcp\":[{\"HostPort\":\"443\"}],\"5671/tcp\":[{\"HostPort\":\"5671\"}],\"8883/tcp\":[{\"HostPort\":\"8883\"}]}}}"
                  }
                }
              },
              "modules": {
                "SimulatedTemperatureSensor": {
                  "version": "1.0",
                  "type": "docker",
                  "status": "running",
                  "restartPolicy": "always",
                  "startupOrder": 2,
                  "settings": {
                    "image": "mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0",
                    "createOptions": "{}"
                  }
                },
                "testModule": {
                  "version": "1.0",
                  "type": "docker",
                  "status": "running",
                  "restartPolicy": "always",
                  "startupOrder": 1,
                  "env": {
                    "tempLimit": {
                      "value": "100"
                    }
                  },
                  "settings": {
                    "image": "myacr.azurecr.io/testModule:latest",
                    "createOptions": "{}"
                  }
                }
              }
            }
          },
          "$edgeHub": {
            "properties.desired": {
              "schemaVersion": "1.1",
              "routes": {
                "sensorToFilter": {
                  "route": "FROM /messages/modules/SimulatedTemperatureSensor/outputs/temperatureOutput INTO BrokeredEndpoint(\"/modules/testModule/inputs/input1\")",
                  "priority": 0,
                  "timeToLiveSecs": 1800
                },
                "filterToIoTHub": {
                  "route": "FROM /messages/modules/testModule/outputs/output1 INTO $upstream",
                  "priority": 1,
                  "timeToLiveSecs": 1800
                }
              },
              "storeAndForwardConfiguration": {
                "timeToLiveSecs": 100
              }
            }
          }
        }
      }
    }
  ]
}

定義

DeviceTemplate
DeviceTemplateCollection

DeviceTemplate

Name Type Description
@id
  • string

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

@type
  • string[]

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

capabilityModel
  • object

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

deploymentManifest
  • object

このデバイステンプレートに関連付けられている配置マニフェスト。

description
  • string

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

displayName
  • string

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

etag
  • string

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

DeviceTemplateCollection

Name Type Description
nextLink
  • string

デバイステンプレートの次のページを取得するための URL です。

value

デバイステンプレートのコレクション。