【问题标题】:How to change query parameter value of tRestClient如何更改 tRestClient 的查询参数值
【发布时间】:2020-08-20 06:11:09
【问题描述】:

我是 talend 的新手。我从过去 2 天开始就在做这件事,但做不到。我想将 api 数据消耗到我的数据库中。我有这个 api =>
http://api.dss.adapt-odisha.com/aagro?url=https://mausam.imd.gov.in/api/nowcast_district_api.php

它给了我所有地区的数据。我可以使用所有地区数据,但我的要求是,我想加载少数地区的数据,我的 url 只支持一个地区 id 作为查询参数=>

 http://api.dss.adapt-odisha.com/aagro?url=https://mausam.imd.gov.in/api/nowcast_district_api.php?id=204

像这样

http://api.dss.adapt-odisha.com/aagro?url=https://mausam.imd.gov.in/api/nowcast_district_api.php?id=215

这些 url 仅显示我在查询参数中传递的那个地区的数据。我可以使用所有地区数据,但我只想存储这些地区的数据。我怎样才能实现它?
到目前为止我已经尝试过了:

【问题讨论】:

    标签: etl talend talend-mdm


    【解决方案1】:

    你快到了!你需要做的是建立一个你想要得到的地区列表(这里我放了一个固定值的 tFixedFlow,但你可以有一个文件、一个数据库查询等)。

    将此传递给 tFlowToIterate,这将允许您遍历地区列表:列表中的每个地区都会有一个 API 调用。 配置 2d tFixedFlow 以从 tFlowToIterate 检索当前区: 像这样调整 tRestClientUrl:

    "http://api.dss.adapt-odisha.com/aagro?url=https://mausam.imd.gov.in/api/nowcast_district_api.php?id="+row2.district
    

    【讨论】:

    • 在第一个 tFixedFlowInput 中如何放置地区列表?
    猜你喜欢
    • 2022-11-21
    • 1970-01-01
    • 1970-01-01
    • 2023-02-09
    • 1970-01-01
    • 1970-01-01
    • 2019-05-14
    • 2018-04-08
    • 2020-08-21
    相关资源
    最近更新 更多