Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How command line use to have number of yarn job with api ambari

avatar
Rising Star

Hello,

I want to use commands lines to know number of yarn jobs in a cluster HDP.

can i do that with ambari api rest?

Thanks

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Baruch AMOUSSOU DJANGBAN

Are you looking out for following kind of information's to get via Ambari APIs (Which we see in the Ambari YARN Summary Page) ?

.Submitted Apps:

http://erie1.example.com:8080/api/v1/clusters/ErieCluster/host_components?HostRoles/component_name=R...

. Pending Apps

http://erie1.example.com:8080/api/v1/clusters/ErieCluster/host_components?HostRoles/component_name=R...

.Running Apps

http://erie1.example.com:8080/api/v1/clusters/ErieCluster/host_components?HostRoles/component_name=R...

Here "erie1.example.com" is ambari server hostname.

Similarly you can get the Completed/Killed/Failed application informations.

.

View solution in original post

5 REPLIES 5

avatar
Master Mentor

@Baruch AMOUSSOU DJANGBAN

Are you looking out for following kind of information's to get via Ambari APIs (Which we see in the Ambari YARN Summary Page) ?

.Submitted Apps:

http://erie1.example.com:8080/api/v1/clusters/ErieCluster/host_components?HostRoles/component_name=R...

. Pending Apps

http://erie1.example.com:8080/api/v1/clusters/ErieCluster/host_components?HostRoles/component_name=R...

.Running Apps

http://erie1.example.com:8080/api/v1/clusters/ErieCluster/host_components?HostRoles/component_name=R...

Here "erie1.example.com" is ambari server hostname.

Similarly you can get the Completed/Killed/Failed application informations.

.

avatar
Rising Star

@Jay SenSharma

Thanks for your answer! can you have a link for all documentation where i can find all and more information to use ambari api?

avatar
Master Mentor

@Baruch AMOUSSOU DJANGBAN

Following link gives a good idea about various Ambari Rest API uris:

https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/index.md

avatar
Rising Star

avatar
Master Mentor

@Baruch AMOUSSOU DJANGBAN

Apart from Ambari API, If you are open for other API options then you might want to take a look at the Resource Manager Rest APIs as well:

https://hadoop.apache.org/docs/r2.7.2/hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html

Example:

http://erie2.example.com:8088/ws/v1/cluster/metrics