datalens

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

DataLens

DataLens

DataLens is a business intelligence and data visualization system: it connects to databases, models the data into datasets, and renders charts and dashboards on top of them. It is offered as a managed service in Yandex Cloud, deployed on-premise, and run internally at Yandex.
This file orients and routes. It does not teach any one interface — pick the interface below and follow the skill that owns it.
DataLens 是商业智能和数据可视化系统:它连接数据库,将数据建模为 dataset,并在其上渲染 chart 和 dashboard。它以 Yandex Cloud 托管服务的形式提供,也可进行 on-premise 部署,或在 Yandex 内部运行。
本文件用于提供背景并引导选择。它不会讲解任何单一接口——请从下方选择接口,并遵循负责该接口的 skill。

Data flow

数据流

database → connection → source → dataset → chart → dashboard
  • connection — credentials and driver for one database.
  • source — a table or a SQL query exposed by that connection.
  • dataset — the modelling layer: fields, calculated fields, joins, parameters, row-level security.
  • chart — one visualization. Wizard charts sit on a dataset; QL charts skip the dataset and query a connection directly; editor charts are custom JavaScript.
  • dashboard — tabs, widgets, selectors, and layout over charts.
Build left to right and reference by id. Deleting upstream breaks everything downstream.
database → connection → source → dataset → chart → dashboard
  • connection(连接) — 一个数据库的凭据和 driver。
  • source(数据源) — connection 暴露的一张表或一个 SQL 查询。
  • dataset(数据集) — 建模层:字段、计算字段、join、参数和 row-level security(行级安全)。
  • chart(图表) — 单个可视化。Wizard chart 基于 dataset;QL chart 跳过 dataset,直接查询 connection;editor chart 是自定义 JavaScript。
  • dashboard(仪表板) — 由位于 chart 之上的标签页、组件、选择器和布局组成。
按从左到右的顺序构建,并通过 id 引用。删除上游对象会破坏所有下游对象。

Object IDs and URLs

对象 ID 与 URL

DataLens URLs for objects with an explicit type can use either of these forms:
  • /<object_type>/<object_id>-<readable_slug>
    — pass only the object ID before the readable suffix to the API.
  • /<object_type>/<object_id>
    — when the readable suffix is absent, the entire final path segment is the object ID.
Dashboard links have an additional short form:
https://datalens.ru/<dashboard_id>
. When the URL is identified as a dashboard link, the only path segment is the dashboard ID; there is no object type segment. For example,
https://datalens.ru/bgquq1234567
refers to dashboard ID
bgquq1234567
.
For an explicitly typed object,
https://datalens.ru/connections/r6wa2j1ww5cad-demo
refers to the connection ID
r6wa2j1ww5cad
;
demo
is a human-readable URL suffix. If the URL is
https://datalens.ru/connections/r6wa2j1ww5cad
, use the same complete segment as the ID. The same rule applies to connections, datasets, and charts. Do not apply the root-level short form to those object types.
Treat object IDs as opaque values. Prefer the value from
Copy ID
or the API response's
id
field when available. If a URL is ambiguous or does not match these forms, do not guess the ID. Do not confuse an object ID with a display name, readable URL suffix, or a field UUID.
对于显式指定类型的对象,DataLens URL 可以采用以下两种形式:
  • /<object_type>/<object_id>-<readable_slug>
    — 向 API 传递时,仅使用可读后缀之前的 object ID。
  • /<object_type>/<object_id>
    — 当不存在可读后缀时,最后一个完整路径段就是 object ID。
Dashboard 链接还有一种简短形式:
https://datalens.ru/<dashboard_id>
。当某个 URL 被识别为 dashboard 链接时,唯一的路径段就是 dashboard ID,不存在 object type 段。例如,
https://datalens.ru/bgquq1234567
指向 dashboard ID
bgquq1234567
。
对于显式指定类型的对象,
https://datalens.ru/connections/r6wa2j1ww5cad-demo
指向 connection ID
r6wa2j1ww5cad
;
demo
是便于阅读的 URL 后缀。如果 URL 是
https://datalens.ru/connections/r6wa2j1ww5cad
,请将同一个完整路径段用作 ID。相同规则适用于 connection、dataset 和 chart。不要对这些对象类型使用根级别的简短形式。
将 object ID 视为不透明值。如果可用,优先使用
Copy ID
中的值或 API 响应中的
id
字段。如果 URL 有歧义或不符合这些形式,不要猜测 ID。不要将 object ID 与显示名称、可读 URL 后缀或字段 UUID 混淆。

Object model

对象模型

Where entries are filed — a separate axis from the flow above. Connections, datasets, charts, and dashboards are all entries, and entries live in a container tree. Two schemes exist, and which one is available differs per installation:
newer    collection
           ├── collection …            nested, arbitrarily deep
           └── workbook
                 └── entries           connection, dataset, chart, dashboard

older    folder tree, path-addressed   e.g. Users/someone/reports
           └── entries                 held directly, no workbook in between
The workbook is the unit of grouping and permissions in the newer scheme; the folder path plays that role in the older one. Never assume which is available — an installation may offer one, the other, or both, so establish it the way the interface skill tells you rather than writing path-based logic against a workbook-only deployment.
条目的归档位置——这是与上述数据流相互独立的一个维度。Connection、dataset、chart 和 dashboard 都是 entry(条目),并且 entry 存放在容器树中。存在两种方案,而可用方案因部署形态而异:
newer    collection
           ├── collection …            nested, arbitrarily deep
           └── workbook
                 └── entries           connection, dataset, chart, dashboard

older    folder tree, path-addressed   e.g. Users/someone/reports
           └── entries                 held directly, no workbook in between
在较新的方案中,workbook 是分组和权限的单位;在较旧的方案中,文件夹路径承担这一角色。绝不要臆测哪种方案可用——某个部署可能只提供其中一种、另一种,或两者都提供;应按照接口 skill 的说明加以确认,而不要针对仅支持 workbook 的部署编写基于 path 的逻辑。

Installations

部署形态

Never assume which one is in play — hosts, auth, and the available connectors and chart types all differ. Establish it before writing anything that talks to an API.
InstallationUIAPI hostAuth
Yandex Cloud
datalens.ru
api.datalens.tech
yc
CLI IAM token, plus an organization id
On-premiseask the userask the userdeployment-specific; commonly an OAuth token in the environment
Yandex Team (internal)
datalens.yandex-team.ru
api.datalens.yandex.net
internal
Yandex Cloud is the managed service. On-premise covers both the open-source self-host (
docker compose
, UI on
:8080
) and the commercial enterprise build. Yandex Team is the internal Yandex installation — see Installation-specific detail below before answering anything specific to it.
Tool-specific skills detect the installation for you — the SDK, for instance, ships a preflight that reports it. Do not hand-roll detection.
绝不要假定当前使用的是哪一种——主机、身份验证、可用 connector 和 chart 类型都会因部署而异。在编写任何与 API 通信的内容之前,先确定当前部署形态。
部署形态UIAPI 主机身份验证
Yandex Cloud
datalens.ru
api.datalens.tech
yc
CLI IAM token,以及 organization id
on-premise询问用户询问用户取决于具体部署;通常使用环境变量中的 OAuth token
Yandex Team(内部)
datalens.yandex-team.ru
api.datalens.yandex.net
内部认证
Yandex Cloud 是托管服务。on-premise 包括开源自托管版本(
docker compose
,UI 端口为
:8080
)和商业企业版。Yandex Team 是 Yandex 的内部部署——在回答任何与它相关的具体问题前,请参阅下文的特定部署细节。
面向具体工具的 skill 会替你检测部署形态——例如 SDK 附带 preflight,可报告相关信息。不要自行实现检测逻辑。

Choosing an interface

选择接口

Want toUseSkill
Manage entities from Python — create, update, inspect, export, clonePython SDK (
datalens-sdk
on PyPI)
datalens-sdk
Let an agent call the DataLens API directly through toolsMCP server (
@datalens-tech/mcp
)
— see its README
Anything else programmaticthe public HTTP API— see below
Explore, click around, look at a rendered chartthe web UI— human work, not agent work
SDK vs MCP. The SDK is the default for anything scripted, repeatable, or committed to a repository — it is typed, it has a documented object model, and the work survives as code. The MCP server suits interactive one-offs inside an agent session: it fetches the API's OpenAPI spec at startup and exposes a three-tool gateway (
list_commands
→
describe_commands
→
invoke_command
) instead of hundreds of tools. Do not mix them for one task.
The HTTP API, when neither fits. The SDK and the MCP server are both built on it, so reach for it directly only where they fall short. It is an HTTP API in an RPC style rather than a REST one: you call named commands with JSON payloads, not resources. It is also self-describing — fetch the OpenAPI spec from
/json/
on the installation's API host (Installations above;
https://api.datalens.tech/json/
on the cloud) and work from the spec rather than guessing command names or payload shapes. On the cloud the organization id is required, sent as an
x-dl-org-id
header.
用途使用Skill
从 Python 管理实体——创建、更新、检查、导出、克隆Python SDK(PyPI 上的
datalens-sdk
)
datalens-sdk
让 Agent 通过工具直接调用 DataLens APIMCP server(
@datalens-tech/mcp
)
— 请参阅其 README
其他所有以编程方式完成的任务公共 HTTP API— 见下文
浏览、点击操作并查看渲染后的 chartweb UI— 人工操作,而非 Agent 工作
SDK 与 MCP。 对于所有需要编写脚本、重复执行或提交到 repository 的任务,SDK 是默认选择——它具有类型定义、具备有文档的对象模型,且工作成果能够以代码形式留存。MCP server 适合在 Agent 会话中执行交互式的一次性任务:它在启动时获取 API 的 OpenAPI spec,并暴露一个三工具 gateway(
list_commands
→
describe_commands
→
invoke_command
),而不是数百个工具。不要在同一任务中混用两者。
二者都不适合时使用 HTTP API。 SDK 和 MCP server 都构建于 HTTP API 之上,因此只有在二者无法满足需求时才直接使用它。它采用 RPC 风格而非 REST 风格:调用带有 JSON payload 的具名 command,而不是操作 resource。它还具备自描述能力——从当前部署的 API 主机上的
/json/
获取 OpenAPI spec(见上文部署形态;cloud 环境为
https://api.datalens.tech/json/
),并依据 spec 工作,而不是猜测 command 名称或 payload 结构。在 cloud 环境中必须提供 organization id,并通过
x-dl-org-id
header 发送。

Installation-specific detail

特定部署细节

Two installations withhold something you need, and in both cases the answer is to ask rather than to fill the gap yourself.
Yandex Team is extended by a skill distributed separately,
datalens-yateam
. If it is present in the available skills list and the environment targets that installation, invoke it: it adds and overrides installation-specific detail from this file, and it wins where the two disagree. If the task concerns Yandex Team and the skill is not in the list, stop and ask the user to install it, following the instructions at https://datalens.yandex-team.ru/get-skills. Do not reconstruct its content in the meantime — say which part of the answer is installation-dependent and leave it there.
On-premise publishes no endpoints, and the API does not necessarily sit on the UI's host. Stop and ask the user for both — the DataLens endpoint and the DataLens API endpoint — before writing anything that talks to either. Do not derive one from the other, do not fall back to a cloud default, and do not carry on with a placeholder.
有两种部署不会提供你所需的信息;在这两种情况下,答案都是询问用户,而不是自行填补缺失信息。
Yandex Team 由一个单独分发的 skill
datalens-yateam
扩展。如果该 skill 出现在可用 skill 列表中,且当前环境以该部署为目标,请调用它:该 skill 会添加并覆盖本文件中的部署特定细节;如果本文件与该 skill 存在冲突,以该 skill 为准。如果任务涉及 Yandex Team,但列表中没有该 skill,请停止并请用户按照 https://datalens.yandex-team.ru/get-skills 中的说明安装。在此期间不要自行重建其内容——只需说明答案中哪一部分取决于部署,然后止步于此。
on-premise 不公开任何 endpoint,而且 API 不一定与 UI 位于同一主机。在编写任何会与二者之一通信的内容之前,请停止并向用户询问 DataLens endpoint 和 DataLens API endpoint。不要根据其中一个推导另一个,不要回退到 cloud 默认值,也不要使用 placeholder 继续执行。

Out of scope

范围外

State the boundary and stop rather than improvising an adjacent solution:
  • What a metric means for the business, or whether a number looks right.
  • Screenshotting or driving the web UI.
  • Embedding DataLens in another product, or iframes.
  • SQL and analysis that does not touch DataLens entities.
明确说明边界并停止,而不是临时拼凑一个相邻方案:
  • 指标对业务而言意味着什么,或某个数值看起来是否正确。
  • 对 web UI 截图或操作 web UI。
  • 将 DataLens 嵌入其他产品,或使用 iframe。
  • 不涉及 DataLens 实体的 SQL 和分析。