Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Yarn history Rest API shows different results

Yarn history Rest API shows different results

Super Collaborator

Hi,

 

I'm trying to pull details of the failed applications using the yarn history Rest API,

 

when i access it using the browser the data shown correct while running curl froma linux machine to the same url it's ignoring the other parmeters i pass other than 

 

example: http://ropr-mhc102:8088/ws/v1/cluster/apps?finishedTimeBegin=1504676752636&finishedTimeEnd=1504680352637&finalStatus=FAILED

 

while running from linux machine like this: curl http://ropr-mhc102:8088/ws/v1/cluster/apps?finishedTimeBegin=1504676752636&finishedTimeEnd=1504680352637&finalStatus=FAILED

 

the first one is showing the failed applications only while the other is not taking the finalStatus parmeter in condieration.

3 REPLIES 3

Re: Yarn history Rest API shows different results

Master Guru
If you haven't tried it yet, apply single quotes around the URL passed to
curl. An unquoted ampersand is interpreted as a command terminator symbol
(and fork instruction) by your shell.

Re: Yarn history Rest API shows different results

Super Collaborator

Hi @Harsh J I already tried the single quotes before and i assume you meant the ` instead of ' around the url.

 

but when saving the ouput of `curl -s url` to result and echo the result i got different out from the UI and the command line.

 

Here my full command that i'm running:

 

result=`curl -s http://caprod.int.liveperson.net:8088/ws/v1/cluster/apps?finishedTimeBegin=1504676752636&finishedTim...`

 

echo $result

 

while running http://caprod.int.liveperson.net:8088/ws/v1/cluster/apps?finishedTimeBegin=1504676752636&finishedTim... from the UI is returing me correct output

 

Re: Yarn history Rest API shows different results

Master Guru

No, I specifically mean single (') or double (") quotes. The backticks (`) are to perform command substitution, which you can use to store outputs into a variable, but the chief problem is that the ampersands must not go outside of a string literal (a quote) for it to be a proper part of the URL itself.

 

curl 'http://ropr-mhc102:8088/ws/v1/cluster/apps?finishedTimeBegin=1504676752636&finishedTimeEnd=1504680352637&finalStatus=FAILED'