Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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