Reply
Expert Contributor
Posts: 263
Registered: ‎01-25-2017

Yarn history Rest API shows different results

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.

Posts: 1,566
Kudos: 287
Solutions: 240
Registered: ‎07-31-2013

Re: Yarn history Rest API shows different results

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.
Backline Customer Operations Engineer
Expert Contributor
Posts: 263
Registered: ‎01-25-2017

Re: Yarn history Rest API shows different results

[ Edited ]

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

 

Highlighted
Posts: 1,566
Kudos: 287
Solutions: 240
Registered: ‎07-31-2013

Re: Yarn history Rest API shows different results

[ Edited ]

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'
Backline Customer Operations Engineer
Announcements