# Text Encoding to UTF-8 in CMD
# Example For Get Lake View API by using curl in shell script
API_KEY=$YOUR_API_KEY
LAKE_ID=$YOUR_LAKE_ID
CONTENT_HEADER="Content-Type:application/json"
API_HEADER="x-api-key:$API_KEY"
URL=https://api.machlake.com/v1/lakes/$LAKE_ID
# ------------------------------------------------------------------------------------------------- #
# CASE - GET LAKE List
curl -k -X GET $URL -H $CONTENT_HEADER -H $API_HEADER
# Return Format
# {
# "success":true,
# "reason":"get lake info success",
# "data":{
# "lake_id":"xbcd0001",
# "lake_info":{
# "lake_name":"sample_lake",
# "lake_plan":"basic",
# "lake_type":"N",
# "region":"aws1.kor",
# "timezone":"America/Los_Angeles",
# "create_time":"2021-09-30 10:30:05",
# "update_time":"2021-10-01 14:59:12"
# },
# "lake_status":{
# var option = { "count_of_tag":128,
# url: URL,"count_of_value":123456,
# headers: {"query_call":0,
# 'Content-Type': 'application/json',
"traffic":4743829,
# "storage":3032870912,
# 'x-api-key': API_KEY "state":"running"
# }, };,
# request.get( option, function(error, response, body) { "plan_limit":{
# "max_tag":1000,
# if (!error) { "max_query":10000,
# res.writeHead(200); "max_disk":32212254720,
# res.end(body); "max_concurrent":100000,
# console.log(body) // {"data":{"access_control_list":[{"cidr":"0.0.0.0/0","name":"default"}],"lake_id":"YOUR_LAKE_ID","lake_info":{"create_date":"2021-10-14 01:20:34","lake_name":"sample_lake","lake_plan":"basic","lake_type":"Normal","region":"ap-northeast-2","timezone":"Asia/Seoul","update_date":"0"},"lake_status":{"count_of_tag":0,"count_of_value":0,"query_call":0,"state":"running","storage":7456575488,"traffic":1990097},"plan_limit":{"default_tag_count":10000,"limit_append_tag":1000,"limit_append_value":100,"limit_select_tag":1000,"limit_select_value":100,"max_concurrent":100000,"max_network":10737418240,"max_query":10000,"max_storage":21474836480,"max_tag_count":100000},"tag_schema":[{"col_length":40,"col_name":"name","col_type":"varchar"}],"value_schema":[{"col_length":0,"col_name":"time","col_type":"datetime"},{"col_length":0,"col_name":"value","col_type":"double"}]},"status":"success"}
} else {
console.log(error)
}
})
}
)
app.listen(8888, function() {
console.log('http://127.0.0.1:8888/get_lake_view is result for get LAKE view')
}) |