๋ค์ํ ๋์๋ณด๋ ์์ฑ, ์กฐํ, ์์ , ์ญ์ ๊ธฐ๋ฅ์ ์ ๊ณตํ๋ RESTful API์ ๋๋ค.
| ์ธํฐํ์ด์ค๋ช | ์ธํฐํ์ด์ค ID | API ๋ช | API ์ค๋ช | Method | URI |
|---|---|---|---|---|---|
| Dashboard List ์กฐํ | DB0001 | Dashboard List ์กฐํ | Dashboard ์ ์ฒด List๋ฅผ ์กฐํ | GET | /api/v1.0/dashboards |
| Dashboard ์์ฑ | DB0002 | Dashboard ์์ฑ | Dashboard๋ฅผ ์์ฑํ๋ค. | POST | /api/v1.0/dashboards |
| Dashboard ์์ | DB0003 | Dashboard ์์ | Dashboard๋ฅผ ์์ ํ๋ค. | PUT | /api/v1.0/dashboards/{dashboardId} |
| Dashboard ์ญ์ | DB0004 | Dashboard ์ญ์ | Dashboard๋ฅผ ์ญ์ ํ๋ค. | DELETE | /api/v1.0/dashboards/{dashboardId} |
| Dashboard Chart List ์กฐํ | DB0005 | Dashboard Chart List ์กฐํ | Dashboard์ ์ ์ฒด Chart List๋ฅผ ์กฐํํ๋ค. | GET | /api/v1.0/dashboards/{dashboardId}/charts |
| Chart ์์ธ ์กฐํ | DB0006 | Chart ์์ธ ์กฐํ | Chart๋ฅผ ์์ธ ์กฐํํ๋ค. | GET | /api/v1.0/charts/{chartId} |
| Chart ์์ธ ์์ | DB0007 | Chart ์์ธ ์์ | Chart ์์ธ ์ ๋ณด๋ฅผ ์์ ํ๋ค. | PUT | /api/v1.0/charts/{chartId} |
| Chart ์์ฑ | DB0008 | Chart ์์ฑ | Dashboard์ Chart๋ฅผ ์์ฑํ๋ค. | POST | /api/v1.0/dashboards/{dashboardId}/charts |
| Chart ์ญ์ | DB0009 | Chart ์ญ์ | Chart๋ฅผ ์ญ์ ํ๋ค. | DELETE | /api/v1.0/charts/{chartId} |
| Chart ๋ณต์ | DB0010 | Chart ๋ณต์ | ํน์ Chart๋ฅผ ๋ณต์ ํ๋ค. | POST | /api/v1.0/dashboards/{dashboardId}/charts/{chartId}/duplicate |
| Dashboard ๋ณต์ | DB0011 | Dashboard ๋ณต์ | ํน์ Dashboard๋ฅผ ๋ณต์ ํ๋ค. | POST | /api/v1.0/dashboards/{dashboardId}/duplicate |
API ์ค๋ช
- Dashboard ์ ์ฒด List๋ฅผ ์กฐํํฉ๋๋ค.
URI
GET /api/v1.0/dashboards
์์ฒญ ์์
GET /api/v1.0/dashboards
Header:
{
"searchParam": "dashboard"
}์๋ต ์์
{
"dashboards": [
{
"dashboardId": "dashboard_123",
"title": "๋งค์ถ ๋ถ์",
"description": "๋งค์ถ๊ณผ ์ฌ์ฉ์ ๋ถ์์ ์ํ ๋์๋ณด๋"
}
]
}ํ์ ํ๋ผ๋ฏธํฐ
| ํ๋ผ๋ฏธํฐ๋ช | ์ค๋ช | ํ์ | ํ์ | ์์ |
|---|---|---|---|---|
searchParam |
๋์๋ณด๋ ๊ฒ์์ด | String | No | "dashboard" |
์๋ต ํ๋ผ๋ฏธํฐ
| ํ๋ผ๋ฏธํฐ๋ช | ์ค๋ช | ํ์ | ํ์ | ์์ |
|---|---|---|---|---|
dashboardId |
๋์๋ณด๋ ID | String | Yes | "dashboard_123" |
title |
๋์๋ณด๋ ์ ๋ชฉ | String | Yes | "๋งค์ถ ๋ถ์" |
description |
๋์๋ณด๋ ์ค๋ช | String | Yes | "๋งค์ถ๊ณผ ์ฌ์ฉ์ ๋ถ์์ ์ํ ๋์๋ณด๋" |
API ์ค๋ช
- Dashboard๋ฅผ ์์ฑํฉ๋๋ค.
URI
POST /api/v1.0/dashboards
์์ฒญ ์์
POST /api/v1.0/dashboards
Header:
{
"title": "๋ชจ๋ํฐ๋ง ๋์๋ณด๋",
"description": "๋งค์ถ๊ณผ ์ฌ์ฉ์ ๋ถ์์ ์ํ ๋์๋ณด๋"
}์๋ต ์์
{
"dashboardId": "dashboard_124",
"title": "๋ชจ๋ํฐ๋ง ๋์๋ณด๋",
"description": "๋งค์ถ๊ณผ ์ฌ์ฉ์ ๋ถ์์ ์ํ ๋์๋ณด๋"
}ํ์ ํ๋ผ๋ฏธํฐ
| ํ๋ผ๋ฏธํฐ๋ช | ์ค๋ช | ํ์ | ํ์ | ์์ |
|---|---|---|---|---|
title |
๋์๋ณด๋ ์ ๋ชฉ | String | Yes | "๋ชจ๋ํฐ๋ง ๋์๋ณด๋" |
description |
๋์๋ณด๋ ์ค๋ช | String | No | "๋งค์ถ๊ณผ ์ฌ์ฉ์ ๋ถ์์ ์ํ ๋์๋ณด๋" |
API ์ค๋ช
- Dashboard๋ฅผ ์์ ํฉ๋๋ค.
URI
PUT /api/v1.0/dashboards/{dashboardId}
์์ฒญ ์์
PUT /api/v1.0/dashboards/dashboard_001
Header:
{
"title": "์
๋ฐ์ดํธ๋ ๋์๋ณด๋",
"description": "์๋ก์ด ์ค๋ช
"
}์๋ต ์์
{
"dashboardId": "dashboard_124",
"title": "์
๋ฐ์ดํธ๋ ๋์๋ณด๋",
"description": "๋งค์ถ๊ณผ ์ฌ์ฉ์ ๋ถ์์ ์ํ ๋์๋ณด๋ ์
๋ฐ์ดํธ"
}ํ์ ํ๋ผ๋ฏธํฐ
| ํ๋ผ๋ฏธํฐ๋ช | ์ค๋ช | ํ์ | ํ์ | ์์ |
|---|---|---|---|---|
dashboardId |
๋์๋ณด๋ ID (Path Parameter) | String | Yes | "dashboard_001" |
title |
๋์๋ณด๋ ์ ๋ชฉ | String | Yes | "์ ๋ฐ์ดํธ๋ ๋์๋ณด๋" |
description |
๋์๋ณด๋ ์ค๋ช | String | No | "์๋ก์ด ์ค๋ช " |
API ์ค๋ช
- Dashboard๋ฅผ ์ญ์ ํฉ๋๋ค.
URI
DELETE /api/v1.0/dashboards/{dashboardId}
์์ฒญ ์์
DELETE /api/v1.0/dashboards/dashboard_001์๋ต ์์
{
"message": "Dashboard deleted successfully"
}ํ์ ํ๋ผ๋ฏธํฐ
| ํ๋ผ๋ฏธํฐ๋ช | ์ค๋ช | ํ์ | ํ์ | ์์ |
|---|---|---|---|---|
dashboardId |
๋์๋ณด๋ ID (Path Parameter) | String | Yes | "dashboard_001" |
API ์ค๋ช
- Dashboard์ ์ ์ฒด Chart List๋ฅผ ์กฐํํฉ๋๋ค.
URI
GET /api/v1.0/dashboards/{dashboardId}/charts
์์ฒญ ์์
GET /api/v1.0/dashboards/dashboard_001/charts์๋ต ์์
{
"chartData": [
{
"chartId": "chart_001",
"title": "๋งค์ถ ๋ถ์",
"dataSourceType": "API",
"dataSourceConfig": {
"apiUrl": "https://api.example.com/users",
"query": "SELECT date, revenue FROM sales WHERE date >= CURDATE() - INTERVAL 7 DAY"
},
"datasets": [
{
"name": "Dataset 1",
"data": [
{ "label": "Jan", "value": 50 },
{ "label": "Feb", "value": 75 }
],
"color": [
"rgba(255, 99, 132, 0.5)",
"rgba(255, 159, 64, 0.5)"
]
}
],
"options": {
"chartType": "pie",
"showLegend": true,
"legendPosition": "top",
"titleText": "Sales Data",
"titleColor": "#00ff00"
}
}
]
}ํ์ ํ๋ผ๋ฏธํฐ
| ํ๋ผ๋ฏธํฐ๋ช | ์ค๋ช | ํ์ | ํ์ | ์์ |
|---|---|---|---|---|
dashboardId |
๋์๋ณด๋ ID (Path Parameter) | String | Yes | "dashboard_001" |
API ์ค๋ช
- Chart๋ฅผ ์์ธ ์กฐํํฉ๋๋ค.
URI
GET /api/v1.0/charts/{chartId}
์์ฒญ ์์
GET /api/v1.0/charts/chart_001์๋ต ์์
{
"chartId": "chart_002",
"title": "์ฌ์ฉ์ ์ฆ๊ฐ์จ",
"dataSourceType": "API",
"dataSourceConfig": {
"apiUrl": "https://api.example.com/users"
},
"datasets": [
{
"name": "๊ฐ์
์ ์",
"data": [
{ "label": "2024-02-01", "value": 100 },
{ "label": "2024-02-02", "value": 120 }
]
}
]
}ํ์ ํ๋ผ๋ฏธํฐ
| ํ๋ผ๋ฏธํฐ๋ช | ์ค๋ช | ํ์ | ํ์ | ์์ |
|---|---|---|---|---|
chartId |
์ฐจํธ ID (Path Parameter) | String | Yes | "chart_001" |
API ์ค๋ช
- Chart ์์ธ๋ฅผ ์์ ํฉ๋๋ค.
URI
PUT /api/v1.0/charts/{chartId}
์์ฒญ ์์
PUT /api/v1.0/charts/chart_001
Header:
{
"title": "์
๋ฐ์ดํธ๋ ์ฐจํธ",
"dataSourceType": "API",
"dataSourceConfig": {
"apiUrl": "https://api.example.com/newdata"
}
}์๋ต ์์
{
"chartId": "chart_001",
"title": "์
๋ฐ์ดํธ๋ ์ฐจํธ"
}ํ์ ํ๋ผ๋ฏธํฐ
| ํ๋ผ๋ฏธํฐ๋ช | ์ค๋ช | ํ์ | ํ์ | ์์ |
|---|---|---|---|---|
chartId |
์ฐจํธ ID (Path Parameter) | String | Yes | "chart_001" |
title |
์ฐจํธ ์ ๋ชฉ | String | Yes | "์ ๋ฐ์ดํธ๋ ์ฐจํธ" |
API ์ค๋ช
- Dashboard์ Chart๋ฅผ ์์ฑํฉ๋๋ค.
URI
POST /api/v1.0/dashboards/{dashboardId}/charts
์์ฒญ ์์
POST /api/v1.0/dashboards/dashboard_001/charts
Header:
{
"title": "์๋ก์ด ์ฐจํธ",
"dataSourceType": "SQL",
"dataSourceConfig": {
"query": "SELECT * FROM sales"
}
}์๋ต ์์
{
"message": "Chart created successfully"
}ํ์ ํ๋ผ๋ฏธํฐ
| ํ๋ผ๋ฏธํฐ๋ช | ์ค๋ช | ํ์ | ํ์ | ์์ |
|---|---|---|---|---|
title |
์ฐจํธ ์ ๋ชฉ | String | Yes | "์๋ก์ด ์ฐจํธ" |
dataSourceType |
๋ฐ์ดํฐ ์์ค ํ์ (API, SQL ๋ฑ) | String | Yes | "SQL" |
API ์ค๋ช
- Chart๋ฅผ ์ญ์ ํฉ๋๋ค.
URI
DELETE /api/v1.0/charts/{chartId}
์์ฒญ ์์
DELETE /api/v1.0/charts/chart_001์๋ต ์์
{
"message": "Chart deleted successfully"
}ํ์ ํ๋ผ๋ฏธํฐ
| ํ๋ผ๋ฏธํฐ๋ช | ์ค๋ช | ํ์ | ํ์ | ์์ |
|---|---|---|---|---|
chartId |
์ฐจํธ ID (Path Parameter) | String | Yes | "chart_001" |
API ์ค๋ช
- ํน์ Dashboard์ Chart๋ฅผ ๋ณต์ ํฉ๋๋ค.
URI
POST /api/v1.0/dashboards/{dashboardId}/charts/{chartId}/duplicate
์์ฒญ ์์
POST /api/v1.0/dashboards/dashboard_001/charts/chart_001/duplicate์๋ต ์์
{
"chartId": "chart_010",
"title": "๋งค์ถ ๋ถ์_copy"
}ํ์ ํ๋ผ๋ฏธํฐ
| ํ๋ผ๋ฏธํฐ๋ช | ์ค๋ช | ํ์ | ํ์ | ์์ |
|---|---|---|---|---|
chartId |
์ฐจํธ ID (Path Parameter) | String | Yes | "chart_001" |
API ์ค๋ช
- Dashboard๋ฅผ ๋ณต์ ํฉ๋๋ค.
URI
POST /api/v1.0/dashboards/{dashboardId}/duplicate
์์ฒญ ์์
POST /api/v1.0/dashboards/dashboard_001/duplicate์๋ต ์์
{
"dashboardId": "dashboard_010",
"title": "๋งค์ถ ๋ถ์_copy",
"description": "๋งค์ถ๊ณผ ์ฌ์ฉ์ ๋ถ์์ ์ํ ๋์๋ณด๋_copy"
}ํ์ ํ๋ผ๋ฏธํฐ
| ํ๋ผ๋ฏธํฐ๋ช | ์ค๋ช | ํ์ | ํ์ | ์์ |
|---|---|---|---|---|
dashboardId |
๋์๋ณด๋ ID (Path Parameter) | String | Yes | "dashboard_001" |
โ opion ์ด ๋๋ฌด ๋ง์์ ๋ช
์ธ์์ ๋ชจ๋ ์ ๋ฆฌํ์ง ์์์ต๋๋ค.
{
datasets: [
{
name: "Dataset 1",
data: [
{ label: "Jan", value: 50 },
{ label: "Feb", value: 75 },
{ label: "Mar", value: 100 },
{ label: "Apr", value: 125 },
{ label: "May", value: 150 },
],
color: [
"rgba(255, 99, 132, 0.5)",
"rgba(255, 159, 64, 0.5)",
"rgba(255, 205, 86, 0.5)",
"rgba(75, 192, 192, 0.5)",
"rgba(54, 162, 235, 0.5)",
],
},
],
options: {
chartType: "pie",
showLegend: true,
legendPosition: "top",
legendColor: "#ffffff",
showTitle: true,
titleText: "Sales Data",
titleColor: "#00ff00",
showTooltip: true,
tooltipBgColor: "rgba(0,0,0,0.8)",
tooltipMode: "index",
layoutPadding: { top: 10, bottom: 20 },
aspectRatio: 2,
xAxisColor: "#ffffff",
yAxisColor: "#ffffff",
xGridDisplay: true,
yGridColor: "rgba(255, 255, 255, 0.2)",
ySuggestedMin: 0,
ySuggestedMax: 200,
interactionMode: "index",
interactionIntersect: false,
hoverMode: "nearest",
animationDuration: 1000,
animationEasing: "easeOutBounce",
},
};