Update the complete dashboard chart order¶
PATCH /data-dashboards/{dashboard_id}/chart-order uses exactly one nonempty X-Workspace-ID to select the workspace. Only chart_ids is needed in the body, but the handler uses ordinary single JSON decoding. Unlike drill-through, it does not reject unknown fields or a second JSON value. Keep these validation levels distinct.
Request parameters¶
{"chart_ids":["chart-b","chart-a"]}
Fields |
Type |
Constraints |
|---|---|---|
chart_ids |
array (array of strings) |
Must be explicitly provided and non-null. Complete ordering of all nondeleted chart IDs, not a partial move list |
The service requires nonempty IDs without surrounding whitespace. In a same-tenant transaction, the DAO locks the active dashboard and all nondeleted charts and requires matching counts, no duplicates, and no foreign IDs. pending/deleting charts reject sorting with409/ErrDataDashboardOperationActive. Existing layout_config fields are retained; only order becomes the zero-based index. Unchanged layouts are not updated. This neither recreates charts nor changes SQL.
Successful response¶
Success uses a code/msg/data envelope and echoes order in data.chart_ids. An explicit [] for an empty dashboard may pass validation, but copying the empty slice may produce null in the response. Do not infer chart deletion from the echo. Omitted/null input and invalid arrangements map to 400/ErrParamInvalid; missing objects to 404/ErrDataDashboardNotFound; permission/dependency errors follow dashboard mappings. Responses provide no concurrency version. Reread details before submission to avoid stale ordering.
Current Go SDK and CLI omit an explicit empty array into {}, while Python preserves []. See SDK differences. This does not mean the entire sorting capability is missing from all three clients.