실제 개발자들이 default 가 아닌 확장 컬럼을 사용할 수 도 있을 것 같습니다.
그래서, 별도로 본인들의 lake를 구성할 수 있는 여지를 줘야합니다.
이 API는 새 Datalake를 생성한다. Lake를 생성할 때 기본 데이터인 tag_name, time, value외의 추가 칼럼을 지정할 수 있다. 한번 생성한 lake의 추가 칼럼값들을 변경할 수 없으므로 lake를 생성할때 주의를 기울여야 한다. 데이터레이크를 생성하면 추가 비용이 발생한다. 자세한 내용은 링크에 기술되어 있다.
HTTP Request
POST https://${CloudVendor}.${CountryCode}.machlake.com/lakes Content-Type: application/json; charset=utf8 x-api-key: {API Key} { "lake_info" : { "lake_name" : "{lake_name}", "lake_plan" : "{lake_plan}", "owner" : "{owner}", "region" : "{region}", "timezone" : "{timezone}", "storage_size" : "{storage size}" }, "tag_schema" : [ { "col_name" : "{column name}", "col_type" : "{column type}", "col_length" : "{column length}" }, ...... ], "value_schema" : [ { "col_name" : "{column name}", "col_type" : "{column type}", "col_length" : "{column length}" }, ...... ] } |
Parameters
Prerequisites | ||
---|---|---|
Key | Type | Description |
lake_name | string | lake name |
lake_plan | string | tiny / basic / business/ enterprise |
owner | string | Lake's Owner (When omitted, the user who calls the API) |
region | string | AWS region name |
timezone | string | |
storage_size | int | Storage size |
tag_schema | JSON | Columns for this lake's Tag meta. Each column have the three sub component: col_name, col_type, col_length. col_name : column name col_type : column type
col_length : if varchar type, assign the max length of column {'col_name': "name", 'col_type': "varchar", 'col_length': 40} The data type of the first column , “col_type” must be “varchar”. But, additional meta column can have any data type. |
value_schema | JSON | Columns for this lake’s values. In this field, you have to assign two essential columns for time and default value. The first column datatype must be “datetime”. The second column datatype must be “double” keeping numeric data as default. {'col_name': "time", 'col_type': "datetime"}, {'col_name': "value",'col_type': "double"} However, beginning with the third column information, you can have the option of specifying additional column information. |
Request Example
Copy Copy to clipboard POST https://aws1.us.machlake.com/lakes Content-Type: application/json; charset=utf8 x-api-key: {API Key} { "lake_info" : { "lake_name" : "My Lake", "lake_plan" : "basic", "owner" : "user01", "region" : "us-east-1", "timezone" : "America/Los_Angeles", "storage_size" : 60 }, "tag_schema" : [ { "col_name" : "name", "col_type" : "varchar", "col_length" : 40 } ], "value_schema" : [ { "col_name" : "time", "col_type" : "datetime" }, { "col_name" : "value", "col_type" : "double" } ] }
Response Example
Status 200 { "status": true, "data" : {lake id} }