使用 CloudConnect 提取报告结果
Extract report results with CloudConnect
我想在 CloudConnect 进程中提取原始报告结果。
到目前为止,我已经设法从原始报告 API 端点获得响应 - https://secure.gooddata.com/gdc/app/projects/{project_id}/execute/raw/
此响应包含文件的 URI,如果我将该 URI 放入浏览器,文件就会上传。
我曾尝试将此 URI 传递给以下读者,但均未成功:
- CSV Reader 产生以下错误:
------------------- Error details ------------------
Component [CSV Reader:CSV_READER] finished with status ERROR.
Parsing error: Unexpected end of file in record 1, field 1 ("date"),
metadata "outOfStock";
value: Raw record data is not available, please turn on verbose mode.
- 文件下载 - 我不知道如何通过端口将 URI 传递给 "URL to Downlaod" 参数。
- HTTP 连接器 我又没看到如何从端口传递 URI。
有什么方法可以做到这一点?
编辑
如果我按照@Filip 的建议使用 HTTP 连接器,我会收到以下错误:
Error details:
Component [HTTP connector:HTTP_CONNECTOR] finished with status ERROR. hostname in
certificate didn't match: xxx.com != secure.gooddata.com OR secure.gooddata.com
我试过将 header 设置为 X-GDC-CHECK-DOMAIN: false
但没有效果。
HTTP 连接器 是合适的组件。将 URL 属性 留空并使用组件的 属性 称为“输入映射”,在图形编辑器中,您可以在其中分配输入边缘字段到 URL 字段。
来自 GoodData 支持的解决方案:
HTTP connector can be also used, but it is very complex, because
logging in to GoodData has to be created. REST connector has it built
in.
If you want to run the example graph, you have to be logged in in
CloudConnect with a user who has access to the project from where you
would like to export the report. You also have to change URL to
the one of white-labeled account in both REST connector components and change project
and report definition in the first REST connector.
因此有效的图表如下所示:
以下是您需要为每个元素设置的主要字段:
- 获取结果 URI - 为 POST 请求设置参数:
Request URL = https://secure.gooddata.com/gdc/app/projects/${GDC_PROJECT_ID}/execute/raw/
Request Body =
{
"report_req": {
"reportDefinition": "gdc/md/${GDC_PROJECT_ID}/obj/${OBJECT_ID}"
}
}
从响应中获取 URI - 只需将 uri 值映射到相应字段:
<Mapping cloverField="uri" xpath="uri"/>
加载结果 - 确保它连接到具有两个字段的元数据,一个用于响应数据,另一个通过 uri
.
加载结果 - 您将需要排除 uri
字段以处理数据:
Exclude Fields = uri
我想在 CloudConnect 进程中提取原始报告结果。
到目前为止,我已经设法从原始报告 API 端点获得响应 - https://secure.gooddata.com/gdc/app/projects/{project_id}/execute/raw/
此响应包含文件的 URI,如果我将该 URI 放入浏览器,文件就会上传。
我曾尝试将此 URI 传递给以下读者,但均未成功:
- CSV Reader 产生以下错误:
------------------- Error details ------------------
Component [CSV Reader:CSV_READER] finished with status ERROR.
Parsing error: Unexpected end of file in record 1, field 1 ("date"), metadata "outOfStock"; value: Raw record data is not available, please turn on verbose mode.
- 文件下载 - 我不知道如何通过端口将 URI 传递给 "URL to Downlaod" 参数。
- HTTP 连接器 我又没看到如何从端口传递 URI。
有什么方法可以做到这一点?
编辑
如果我按照@Filip 的建议使用 HTTP 连接器,我会收到以下错误:
Error details:
Component [HTTP connector:HTTP_CONNECTOR] finished with status ERROR. hostname in certificate didn't match: xxx.com != secure.gooddata.com OR secure.gooddata.com
我试过将 header 设置为 X-GDC-CHECK-DOMAIN: false
但没有效果。
HTTP 连接器 是合适的组件。将 URL 属性 留空并使用组件的 属性 称为“输入映射”,在图形编辑器中,您可以在其中分配输入边缘字段到 URL 字段。
来自 GoodData 支持的解决方案:
HTTP connector can be also used, but it is very complex, because logging in to GoodData has to be created. REST connector has it built in.
If you want to run the example graph, you have to be logged in in CloudConnect with a user who has access to the project from where you would like to export the report. You also have to change URL to the one of white-labeled account in both REST connector components and change project and report definition in the first REST connector.
因此有效的图表如下所示:
以下是您需要为每个元素设置的主要字段:
- 获取结果 URI - 为 POST 请求设置参数:
Request URL = https://secure.gooddata.com/gdc/app/projects/${GDC_PROJECT_ID}/execute/raw/
Request Body =
{
"report_req": {
"reportDefinition": "gdc/md/${GDC_PROJECT_ID}/obj/${OBJECT_ID}"
}
}
从响应中获取 URI - 只需将 uri 值映射到相应字段:
<Mapping cloverField="uri" xpath="uri"/>
加载结果 - 确保它连接到具有两个字段的元数据,一个用于响应数据,另一个通过
uri
.加载结果 - 您将需要排除
uri
字段以处理数据:
Exclude Fields = uri