Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: The Cloudera Community will undergo maintenance on Saturday, August 17 at 12:00am PDT. See more info here.

Getting the cluster directory structure via CM API in Python

Highlighted

Getting the cluster directory structure via CM API in Python

New Contributor

Hi there:

 

I am using CDH 5.14 and CM API V19. 

 

I would like to know if there is a way to get the HDFS directory structure (should include the folder paths, their size and the users who have permissions to that folder) using any Cloudera Manager API. I have been through all the APIs on their site but failed to get the desired information. 

 

I have been told that the FSImage can be accessed from the command line on an edge node to the cluster and that parsing that information would give the desired metrics. But I would prefer to use the CM APIs for it.

 

Any help is greatly appreciated.

 

 

1 REPLY 1

Re: Getting the cluster directory structure via CM API in Python

Super Guru

@HadoopNewbieUSA,

 

There is no Cloudera Manager API to view the HDFS directory Structure.

 

I don't know how you would assess which users have access to a particular directory either, as users are managed outside of the cluster and the cluster does not know what users exist.  I think you would have to iterate over a list of users, maybe with doAs to see if they can access directories and files.