Search Device


Get the basic information of devices on all or specified sites.

Operation Permissions


Before invoking this API, ensure that the service account has been authorized the policy that includes the following service(s) and action permission(s). For how to authorize the service account, see Managing Service Accounts.

Required Policy Required Permission
Device Management Read

Before You Start


The OU has been bounded with an OU template.

Request Format


POST https://{apigw-address}/amc/v1.0/device?action=search

Request Parameters (URI)


Name Location (Path/Query) Required/Optional Data Type Description
orgId Query Optional String The organization ID which the device belongs to. How to get orgId>>
siteAssetId Query Optional. To be used with orgId. String The asset ID of the site which the device belongs to. Get the information of devices on all sites if blank.

Request Parameters (Body)


Name Required/Optional Data Type Description
deviceTypes Optional List The identifier list of device types.
queryTopologyParams Optional QueryTopologyParam Struct The information of device topologies. siteAssetId will be ignored if using this parameter.
pagination Optional Pagination request struct Lists the paging requirements in a request. The max records per page is 200. The default records per page is 100. Supports only pageNo and pageSize. The earlier the device was created, the higher the results displayed.

QueryTopologyParam Struct

Name Required/Optional Data Type Description
topologyId Required String The topology ID where the device is mounted.
parentAssetId Optional String The asset ID of the parent node of the device on the topology.

Response Parameters


Name Data Type Description
data Device Struct Array The device information on the specified site in the specified topology.

Device Struct


Name Data Type Description
assetId String The asset ID of the device.
name StringI18n The name of the device.
modelId String The model ID of the device.
timezone String The timezone of the device.
description String The description of the device.
attributes Map (Key is of String type, Value is Object)
The attributes of the device.
Key is the attribute ID, Value is the value of the attribute.
tags Map (Key and Value are both of String)
The tags of the device.
Key is the key of the tag, Value is the value of the tag.
typeInfo Metadata Struct The information of the device type.

Metadata Struct


Name Data Type Description
identifier String The identifier of the device type.
name StringI18n The name of the device type.
type String The business object category of the device: DEVICE.

Error Codes


Code Message Description
99500 Internal server error Internal server error. Contact EnOS support.
99400 Invalid pagination parameters pagination is invalid. Check the request parameters.
99400 Operators {xxx} are not supported. Please use these operators: {yyy} The operators are not supported. xxx is not supported. Please use yyy.
99400 PageSize value cannot exceed 200 The value of pageSize parameter in pagination can not exceed 200.

Samples

Request Sample

URL: https://{apigw-address}/amc/v1.0/device?action=search?orgId=yourOrgId

method: POST

requestBody:
{
    "pagination":{
        "pageNo":1,
        "pageSize":10
    },
    "queryTopologyParams":{
        "parentAssetId":"x4zeFkkf",
        "topologyId":"your topology Id"
    },
    "deviceTypes":[
        "WeatherStation"
    ]
}

Response Sample

{
    "code": 0,
    "msg": "OK",
    "requestId": "ea17e9e4-81b7-463c-944f-565dcb0dd4c7",
    "data": [{
        "assetId": "GUPUw1bM",
        "name": {
            "defaultValue": "1",
            "i18nValue": {}
        },
        "modelId": "EnOS_Solar_WST_Generic",
        "timezone": "+08:00",
        "description": "",
        "attributes": {
            "calcMode": "A"
        },
        "tags": {
            "amc_assetGroup_HnfxM8Rc": "HnfxM8Rc",
            "AMC_MOUNTED_hxaSSfM5": "hxaSSfM5",
            "amc_modelNo": "Others7",
            "amc_source": "amc",
            "amc_manufacturer": "ID099",
            "amc_deviceType": "WeatherStation",
            "amc_classType": "Device",
            "AMC_MOUNTED_LyQOvJa3": "LyQOvJa3"
        },
        "typeInfo": {
            "identifier": "WeatherStation",
            "name": {
                "defaultValue": "Weather Station",
                "i18nValue": {
                    "en_US": "Weather Station",
                    "zh_CN": "气象站"
                }
            },
            "type": "Device"
        }
    }],
    "pagination": {
        "sortedBy": null,
        "pageNo": 1,
        "pageSize": 10,
        "totalSize": 1
    }
}