运行 Look

版本 3.1.23.6

一探究竟

运行指定样式的查询,并以请求的格式返回结果。

支持的格式:

result_format 说明
json 纯 json
json_detail 行数据以及描述查询的字段、数据透视表、表计算和其他方面的元数据
csv 以英文逗号分隔的值,带有标题
txt 使用标头制表符分隔值
html 简单 HTML
MD 简单 Markdown
XX MS Excel 电子表格
sql 返回生成的 SQL,而不是运行查询
png 查询可视化图表的 PNG 图片
jpg 查询可视化的 JPG 图片

请求

获取 /looks/{look_id}/run/{result_format}
数据类型
说明
请求
HTTP 请求
路径
HTTP 路径
展开 HTTPPath 定义...
Look_id
整数
样式 ID
result_format
字符串
结果格式
查询
HTTPQuery
展开 HTTPQuery 定义...
限制
整数
行数上限(可能会覆盖已保存查询中的上限)。
apply_formatting
布尔值
为每个模型应用模型指定的格式。
apply_vis
布尔值
将可视化选项应用于结果。
缓存
布尔值
从缓存中获取结果(如果有)。
图片宽度
整数
图片格式的呈现宽度。
图片高度
整数
图片格式的呈现高度。
generate_drill_links
布尔值
生成深入链接(仅适用于“json_detail”格式)。
force_production
布尔值
强制使用生产模型,即使用户处于开发模式。请注意,此标记为 false 并不保证将使用开发模型。
仅缓存
布尔值
从缓存中检索任何结果,即使结果已过期。
路径前缀
字符串
用于细目链接(网址编码)的前缀。
重新构建_pdts
布尔值
重新构建查询中使用的 PDTS。
server_table_calcs
布尔值
对查询结果执行表计算

响应

200:查看

数据类型
说明
(字符串)
字符串

400:错误请求

数据类型
说明
(对象)
消息
字符串
错误详情
文档网址
字符串
文档链接

404:未找到

数据类型
说明
(对象)
消息
字符串
错误详情
文档网址
字符串
文档链接

422:验证错误

数据类型
说明
(对象)
消息
字符串
错误详情
展开 ValidationErrorDetail 定义...
字段
字符串
出错的字段
代码
字符串
错误代码
消息
字符串
错误信息消息
文档网址
字符串
文档链接
文档网址
字符串
文档链接

429:请求数过多

数据类型
说明
(对象)
消息
字符串
错误详情
文档网址
字符串
文档链接

示例

Python

https://github.com/looker-open-source/sdk-codegen/blob/main/examples/python/lookersdk-flask/app/looker.py
https://github.com/looker-open-source/sdk-codegen/blob/main/examples/python/lookersdk-flask/app/looker.py
https://github.com/looker-open-source/sdk-codegen/blob/main/python/tests/integration/test_methods.py
https://github.com/looker-open-source/sdk-codegen/blob/main/python/tests/integration/test_methods.py
https://github.com/looker-open-source/sdk-codegen/blob/main/python/tests/integration/test_methods.py

Ruby

https://github.com/looker-open-source/sdk-codegen/blob/main/examples/ruby/dev_vs_prod.rb
https://github.com/looker-open-source/sdk-codegen/blob/main/examples/ruby/dev_vs_prod.rb
https://github.com/looker-open-source/sdk-codegen/blob/main/examples/ruby/dev_vs_prod.rb
https://github.com/looker-open-source/sdk-codegen/blob/main/examples/ruby/dev_vs_prod.rb
https://github.com/looker-open-source/sdk-codegen/blob/main/examples/ruby/rerun_failed_email_schedules.rb

TypeScript

https://github.com/looker-open-source/sdk-codegen/blob/main/packages/sdk-codegen/src/kotlin.gen.spec.ts
https://github.com/looker-open-source/sdk-codegen/blob/main/packages/sdk-codegen/src/python.gen.spec.ts
https://github.com/looker-open-source/sdk-codegen/blob/main/packages/sdk-codegen/src/typescript.gen.spec.ts
https://github.com/looker-open-source/sdk-codegen/blob/main/packages/sdk-codegen/src/typescript.gen.spec.ts