Search Site¶
Get the basic information of 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 |
Request Parameters (URI)¶
Name | Location (Path/Query) | Required/Optional | Data Type | Description |
---|---|---|---|---|
orgId | Query | Required | String | The organization ID which the site belongs to. How to get orgId>> |
Request Parameters (Body)¶
Name | Required/Optional | Data Type | Description |
---|---|---|---|
expression | Optional | String | The expressions used for the search. The fields that are supported for search include the below.
|
siteTypeId | Optional | String | The identifier of the site type. Get the information of all type sites if blank. |
pagination | Optional | pagination Request Parameters | 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. |
Response Parameters¶
Name | Data Type | Description |
---|---|---|
data | Site Struct Array | The information of the site. |
Site Struct¶
Name | Data Type | Description |
---|---|---|
assetId | String | The asset ID of the site. |
name | StringI18n | The name of the site. |
modelId | String | The model ID of the site. |
timezone | String | The timezone of the site. |
description | String | The description of the site. |
attributes | Map (Key is of String type, Value is Object) |
|
tags | Map (Key is of String type, Value is of String type) |
|
typeInfo | Metadata Struct | The information of the site type. |
Metadata Struct¶
Name | Data Type | Description |
---|---|---|
identifier | String | The identifier of the site type. |
name | StringI18n | The name of the site. |
type | String | The business object category of the site: SITE. |
Error Codes¶
Code | Message | Description |
---|---|---|
99500 | Internal server error | Internal server error. Contact EnOS support. |
99400 | Invalid pagination parameters | pagination parameters are 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 | Expression syntax error | Expression syntax error. Check the expressions. |
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/site?action=search&orgId=yourOrgId
method: POST
requestBody:
{
"pagination":{
"pageNo":1,
"pageSize":10
},
"expression":"attributes.altitude = 123.000000"
}
Response Sample¶
{
"code":0,
"msg":null,
"requestId":"f3bf3b13-058a-481d-88c0-06087fd36554",
"data":[
{
"assetId":"HnfxM8Rc",
"name":{
"defaultValue":"123",
"i18nValue":{
}
},
"modelId":"EnOS_Solar_Site",
"timezone":"+08:00",
"description":null,
"attributes":{
"altitude":123,
"latitude":123,
"combinerBoxAmount":1,
"capacity":123,
"omtAmount":1,
"bxtfAmount":1,
"emtAmount":1,
"wstAmount":1,
"acCbxAmount":2,
"equipmentAmount":1,
"gmtAmount":1,
"strInvAmount":0,
"longitude":123
},
"tags":{
"amc_source":"amc",
"amc_deviceType":"SolarSite",
"amc_classType":"Site"
},
"typeInfo":{
"identifier":"SolarSite",
"name":{
"defaultValue":"Solar Site",
"i18nValue":{
}
},
"type":"Site"
}
}
],
"pagination":{
"sortedBy":null,
"pageNo":1,
"pageSize":10,
"totalSize":1
}
}