/
Get time range for a single tag

Get time range for a single tag

  • 원하는 Tag들의 최소 시간값, 최대 시간값을 얻는 API이다.

HTTP Request

GET https://${CloudVendor}.${CountryCode}.machlake.com/lakes/${lake_id}/values/time_range Content-Type: application/json; charset=utf8 x-api-key: {API Key}

Parameters

Optional

Type

Description

Example

Optional

Type

Description

Example

tag_name

string

Tag의 이름. 여러개를 명시하려면 ',' 문자를 이용하여 나열할 수 있다.

&tag_name=tag1,tag2,tag3

date_format

string

Time값의 포멧 지정 DATE_FORMAT 혹은 timestamp 단위 ("SECOND", "MILLISECOND", "MICROSECOND", "NANOSECOND")

&date_format=YYYY-MM-DD HH24:MI:SS
or
&date_format=MILLISECOND

(default : YYYY-MM-DD HH24:MI:SS)

separator

string

매개변수의 tag_name, columns, and_condition들을 구분하는 구분자

&separator=| (default : ,)

value_return_form

int

결과 출력 방법

차트 라이브러리에서 입력받는 방식에 따라 변경하여 사용함

0 : separate standard (default)
or
1 : merged standard

Request Example

GET https://aws1.us.machlake.com/lakes/xbacd1234/values/time_range?tag_name=tag_01,tag_02&value_return_form=0 Content-Type: application/json; charset=utf8 x-api-key: {API Key}

Response Example

Status 200 // return format = 0 { "status": "success", "data": { "columns": [ {"length": 4096, "name": "MIN", "type": 5}, {"length": 4096, "name": "MAX", "type": 5} ], "samples": [ { "tag_name": "tag_02", "data": [ { "MAX": "2021-07-06 12:12:27", "MIN": "2021-06-16 11:36:44" } ] }, { "tag_name": "tag_01", "data": [ { "MAX": "2021-07-06 12:12:25", "MIN": "2021-06-15 17:52:35" } ] } ] } } // return format = 1 { "status": "success", "data": { "columns": [ {"length": 4096, "name": "MIN", "type": 5}, {"length": 4096, "name": "MAX", "type": 5} ], "samples": [ { "tag_name": "tag_02", "data": { "MAX": ["2021-07-06 12:12:27"], "MIN": ["2021-06-16 11:36:44"] } }, { "tag_name": "tag_01", "data": { "MAX": ["2021-07-06 12:12:25"], "MIN": ["2021-06-15 17:52:35"] } } ] } }

 

Sample Code

 

레이블 추가