Get Thing Model


Get the thing model via the modelId.

Operation Permissions

Required Authorization Required Operation Permission
Model Management Read

Request Format

GET https://{apigw-address}/model-service/v2.1/thing-models?action=get

Request Parameters (URI)

Name Location (Path/Query) Mandatory/Optional Data Type Description
orgId Query Mandatory String The organization ID which the asset belongs to. How to get orgId>>
scope Query Optional Integer
  • 0 = Only search from the organization specified by the orgId.
  • 1 (default) = Search from the organization specified by the orgId as well as the organizations with public models.
modelId Query Mandatory String The model ID which the asset belongs to. How to get modelID>>

Response Parameters

Name Data Type Description
data ThingModel Struct The thing model. For more information on ThingModel struct, see ThingModel Struct>>

Samples

Request Sample

url: https://{apigw-address}/model-service/v2.1/thing-models?action=get&orgId=yourOrgId&modelId=yourModelId
method: GET

Response Sample

{
   "code":0,
   "msg":"OK",
   "requestId":"41e3da4c-9e40-47e5-b202-58f946b294c5",
   "data":{
      "modelId":"jw-test1112",
      "modelIdPath":"/jw-test1112",
      "orgId":"yourOrgId",
      "name":{
         "defaultValue":"jw-test1112",
         "i18nValue":{
            "en_US":"",
            "zh_CN":""
         }
      },
      "desc":"jw-test1112",
      "tags":{

      },
      "attributes":{
         "capacity":{
            "identifier":"capacity",
            "name":{
               "defaultValue":"capacity",
               "i18nValue":{
                  "en_US":"capacity",
                  "zh_CN":"容量"
               }
            },
            "desc":"capacity",
            "tags":{

            },
            "stdElementId":"urn:user:modelelement:std:atom-property-int:1.0",
            "isStdElement":true,
            "dataType":"INT",
            "unit":{
               "unitId":"G",
               "multiplier":"ONE"
            },
            "dataDefinition":null,
            "isRequired":true,
            "defaultValue":111
         }
      },
      "measurepoints":{
         "ActiveSC":{
            "identifier":"ActiveSC",
            "name":{
               "defaultValue":"活动状态字",
               "i18nValue":{
                  "en_US":"ActiveSC_Name"
               }
            },
            "desc":"",
            "tags":{

            },
            "stdElementId":null,
            "isStdElement":false,
            "dataType":"INT",
            "unit":null,
            "dataDefinition":null,
            "hasQuality":false,
            "signalType":"DI"
         },
         "windspeed_90":{
            "identifier":"windspeed_90",
            "name":{
               "defaultValue":"windspeed_90",
               "i18nValue":{
                  "en_US":"windspeed_90"
               }
            },
            "desc":"90m wind speed",
            "tags":{

            },
            "stdElementId":null,
            "isStdElement":false,
            "dataType":"DOUBLE",
            "unit":{
               "unitId":"m/s",
               "multiplier":"ONE"
            },
            "dataDefinition":null,
            "hasQuality":false,
            "signalType":"Generic"
         },
         "windspeed_80_identity":{
            "identifier":"windspeed_80_identity",
            "name":{
               "defaultValue":"windspeed_80",
               "i18nValue":{
                  "en_US":"windspeed_80"
               }
            },
            "desc":"80m风速",
            "tags":{

            },
            "stdElementId":null,
            "isStdElement":false,
            "dataType":"DOUBLE",
            "unit":{
               "unitId":"m/s",
               "multiplier":"ONE"
            },
            "dataDefinition":null,
            "hasQuality":false,
            "signalType":"Generic"
         },
         "windspeed_110":{
            "identifier":"windspeed_110",
            "name":{
               "defaultValue":"windspeed_110",
               "i18nValue":{
                  "en_US":"windspeed_110"
               }
            },
            "desc":"",
            "tags":{

            },
            "stdElementId":null,
            "isStdElement":false,
            "dataType":"DOUBLE",
            "unit":{
               "unitId":"m/s",
               "multiplier":"ONE"
            },
            "dataDefinition":null,
            "hasQuality":false,
            "signalType":"AI"
         },
         "system_start":{
            "identifier":"system_start",
            "name":{
               "defaultValue":"启动指令",
               "i18nValue":{
                  "en_US":"",
                  "zh_CN":""
               }
            },
            "desc":"",
            "tags":{
               "control":"true"
            },
            "stdElementId":null,
            "isStdElement":false,
            "dataType":"ENUM",
            "unit":null,
            "dataDefinition":{
                 "enumDesc": {
                    "0": {
                          "defaultValue": "关闭",
                           "i18nValue": {}
                    },
                   "1": {
                          "defaultValue": "打开",
                          "i18nValue": {}
                    },
                   "2": {
                          "defaultValue": "不定态",
                          "i18nValue": {}
                    },
                   "3": {
                          "defaultValue": "会不定态",
                          "i18nValue": {}
                    }
                  },
                 "enumType": "INT"
            },
            "hasQuality":false,
            "signalType":"Generic"
         },
         "windspeed_140":{
            "identifier":"windspeed_140",
            "name":{
               "defaultValue":"windspeed_140",
               "i18nValue":{
                  "en_US":"windspeed_140"
               }
            },
            "desc":"",
            "tags":{

            },
            "stdElementId":null,
            "isStdElement":false,
            "dataType":"DOUBLE",
            "unit":{
               "unitId":"m/s",
               "multiplier":"ONE"
            },
            "dataDefinition":null,
            "hasQuality":false,
            "signalType":"AI"
         },
         "cedianforsolar":{
            "identifier":"cedianforsolar",
            "name":{
               "defaultValue":"cediantedsst",
               "i18nValue":{
                  "en_US":"cediantedsst"
               }
            },
            "desc":"",
            "tags":{

            },
            "stdElementId":null,
            "isStdElement":false,
            "dataType":"DOUBLE",
            "unit":null,
            "dataDefinition":null,
            "hasQuality":false,
            "signalType":"Generic"
         }
      },
      "services":{
         "speedup":{
            "identifier":"speedup",
            "name":{
               "defaultValue":"speedup",
               "i18nValue":{
                  "en_US":"speedup"
               }
            },
            "desc":"t",
            "tags":null,
            "stdElementId":null,
            "isStdElement":false,
            "outputData":[
               {
                  "identifier":"delta",
                  "name":{
                     "defaultValue":"delta",
                     "i18nValue":{
                        "en_US":"delta"
                     }
                  },
                  "desc":"",
                  "tags":{

                  },
                  "stdElementId":null,
                  "isStdElement":false,
                  "dataType":"INT",
                  "unit":null,
                  "dataDefinition":null
               }
            ],
            "inputData":[
               {
                  "identifier":"delta",
                  "name":{
                     "defaultValue":"delta",
                     "i18nValue":{
                        "en_US":"delta"
                     }
                  },
                  "desc":"",
                  "tags":{

                  },
                  "stdElementId":null,
                  "isStdElement":false,
                  "dataType":"INT",
                  "unit":{
                     "unitId":"rpm",
                     "multiplier":"ONE"
                  },
                  "dataDefinition":null
               }
            ],
            "callType":"ASYNC"
         }
      },
      "events":{
         "alert":{
            "identifier":"alert",
            "name":{
               "defaultValue":"alert",
               "i18nValue":{
                  "en_US":"alert"
               }
            },
            "desc":"e",
            "tags":null,
            "stdElementId":null,
            "isStdElement":false,
            "outputData":[
               {
                  "identifier":"event1",
                  "name":{
                     "defaultValue":"event1",
                     "i18nValue":{
                        "en_US":"event1"
                     }
                  },
                  "desc":"",
                  "tags":{

                  },
                  "stdElementId":null,
                  "isStdElement":false,
                  "dataType":"INT",
                  "unit":null,
                  "dataDefinition":null
               }
            ],
            "eventType":"ERROR"
         }
      }
   }
}

Java SDK Sample

public class GetThingModel {
    private static String accessKey = "AccessKey of your APP";
    private static String secretKey = "SecretKey of your APP";
    private static String orgId = "yourOrgId";
    private static String url = "https://{apigw-address}";
    public static void main(String[] args) {
        GetThingModelRequest request = new GetThingModelRequest();
        request.setOrgId(orgId);
        request.setModelId("planet");
        request.setScope(1);
        GetThingModelResponse response = Poseidon.config(PConfig.init().appKey(accessKey).appSecret(secretKey).debug())
                .url(url)
                .getResponse(request, request.getResponseClass());
        System.out.println(response.getData());
    }
}