首页 > 解决方案 > 我的 Pentaho 服务器中的 Kettle api 请求返回 404

问题描述

我是使用 pentaho 服务器来调用localhost:8080/pentaho/home.

事实是,当我想请求激活我存储在该位置的转换(ktr)时,呼叫服务返回错误 404。

简单的例子不起作用:localhost:8080/kettle/status/?xml=Y.

我从 nodejs 调用 api rest,因为它放在 pentaho 文档中

function launchTrans(req, res) {
    let options = {
        url: `http://localhost:8080/kettle/status/?xml=Y`,
        method: 'GET',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
            'Access-Control-Allow-Credentials': 'true',
            'Cookie': globalString
        },
    };

    request(options, (error, response, body) => {
        if (!error && response.statusCode == 200) {
            res.status(200).send(response);
        } else {
            console.log("There was an error " + error);
            res.status(500).send(response);
        }
    });
}

标签: node.jsapipentaho

解决方案


http://localhost:8080/pentaho/kettle/status/?xml=yURL不应该是http://localhost:8080/kettle/status/?xml=y. 您的 URL 格式不完全正确。您使用的格式适用于旧的 PDI 独立服务器。在报告和 PDI 合并到一个服务器的新合并服务器中,您需要包含 URL 的“pentaho”部分。


推荐阅读