Query historical metrics¶
Query metrics for a couple of devices in certain time range.
Request format¶
METHOD {URI-scheme}://{apigw-address}/solar-api/{version}/metricService/multiMetrics
Request Parameters¶
Name | Location | Required | Datatype | Description |
---|---|---|---|---|
token | Query | false | String | token, required when user account calls Solar API |
orgId | Query | false | String | orgnization Id, required when service account calls Solar API |
mdmids | Query | true | String | mdm ids with comma as splitter |
metrics | Query | true | String | metric names with comma as splitter |
begin_time | Query | true | String | Begin time |
end_time | Query | true | String | End time |
time_group | Query | true | String | group type in time, D: day, M: month, Y: year, T: total |
Response Parameters¶
Name | Datatype | Description |
---|---|---|
timestamp | String | time |
mdmId | String | mdm id |
metrics… | String | metrics… |
Error Codes¶
See Common response code.
Example¶
Request Example¶
GET
https://{apigw-address}/solar-api/v1.0/metricService/multiMetrics?mdmids=Ln****G&token=APP_PORTAL_S_LVtNJAj******3KLD&metrics=SITE.a,SITE.b,SITE.c&begin_time=2019-01-01 00:00:00&end_time=2019-12-31 00:00:00&time_group=M
Response Example¶
{
"metrics": [
{
"SITE.a": "9999.000000",
"SITE.b": "0.3717",
"SITE.c": "223",
"mdmId": "Ln1AUCsG",
"timestamp": "2019-01"
},
{
"SITE.a": "9999.000000",
"SITE.b": "0.0417",
"SITE.c": "25",
"mdmId": "Ln1AUCsG",
"timestamp": "2019-02"
}
],
"status": 0,
"msg": "success"
}