I am trying to retrieve the list of jobs and transformations using the carte API REST. However I am not able. From code, when executing http://...../kettle/status
I get a 200 code, but If I try to access http://...../kettle/jobs
I get an error.
我正在尝试使用Carte API REST检索作业和转换的列表。然而,我不能。在代码中,当执行http://...../kettle/status时,我得到一个200代码,但如果我试图访问http://...../kettle/jobs,我会得到一个错误。
If I execute the following command:
如果我执行以下命令:
wget http://cluster:cluster@localhost:8080/kettle/status
WGET http://cluster:cluster@localhost:8080/kettle/status
I get the following response:
我得到的回应如下:
--2023-05-25 13:38:50-- http://cluster:*password*@localhost:8080/kettle/status
Resolviendo localhost (localhost)... 127.0.0.1, ::1
Conectando con localhost (localhost)[127.0.0.1]:8080... conectado.
Petición HTTP enviada, esperando respuesta... 401 Unauthorized
Reutilizando la conexión con localhost:8080.
Petición HTTP enviada, esperando respuesta... 302 Found
Localización: http://localhost:8080/kettle/status/ [siguiendo]
--2023-05-25 13:38:50-- http://localhost:8080/kettle/status/ Reutilizando la conexión con localhost:8080.
Can you guess where the problem is?
Thanks in advance
你能猜出问题出在哪里吗?提前谢谢你
更多回答
优秀答案推荐
Replying to the below questions:
回答以下问题:
I am trying to retrieve the list of jobs and transformations using the carte API REST. However I am not able. From code, when executing http://...../kettle/status I get a 200 code, but If I try to access http://...../kettle/jobs I get an error.
In order to retrieve the status of the Jobs and Transformations from Pentaho Carte, you need to use /kettle/jobStatus/
and /kettle/transStatus/
REST endpoints to correctly fetch the results. The Pentaho documents provides the necessary details on the same.
为了从Pentaho Carte中检索作业和转换的状态,您需要使用/kettle/jobStatus/and/kettle/TransStatus/rest端点来正确获取结果。五角大楼的文件提供了同样的必要细节。
In both of the above situations you are required to pass the Job / Transformation name or object id's in order to fetch the details.
在上述两种情况下,您都需要传递作业/转换名称或对象ID才能获取详细信息。
If I execute the following command:
wget http://cluster:cluster@localhost:8080/kettle/status
I get the following response:
Assuming the username and password are correct for the carte server, it seems the logs generated are the default behaviour of WGET. WGET generates a lot of diagnostics information that may seem like getting redirected to the stdout whereas the errors are pushed to stderr. WGET also interprets the response headers as part of diagnostic information. So, it’ll be sending the header information to stderr. In order to solve this, you can use the arg, -q
(quiet) to suppress the diagnostic information. Blog here for ref. For example:
假设点菜服务器的用户名和密码是正确的,则生成的日志似乎是WGET的默认行为。WGET生成许多诊断信息,这些信息似乎被重定向到标准输出,而错误则被推送到标准错误。WGET还将响应头解释为诊断信息的一部分。因此,它将把头信息发送到stderr。为了解决这个问题,您可以使用arg,-q(安静)来抑制诊断信息。博客在这里供参考。例如:
wget -q 'http://localhost:8085/kettle/status/?xml=Y' --user cluster --password cluster --output-document kettle_status
The above command redirects the output to a file kettle_status
. xml=Y
generates and XML output of the Carte REST API response.
上面的命令将输出重定向到文件kettle_status。Xml=Y生成Carte rest API响应的XML输出。
Alternatively, you can use CURL to get the kettle status in an XML format.
或者,您可以使用cURL以XML格式获取水壶状态。
curl -u "cluster:cluster" -X GET 'http://localhost:8084/kettle/status/?xml=Y'
更多回答
我是一名优秀的程序员,十分优秀!