I'm currently creating resource pools through the web UI as per https://www.cloudera.com/documentation/enterprise/5-6-x/topics/cm_mc_resource_pools.html#concept_xkk_l1d_wr__section_utc_gbl_vl
Since I have a large number of resource pools to create I want to do this using some script.
Is there any way this can be done through cloudera manager REST api?
It is possible to GET the yarn configuration through cloudera manager api. As specified by http://cloudera.github.io/cm_api/apidocs/v14/path__clusters_-clusterName-services-serviceName-_config.html, e.g. https://cm-web-url:7183/api/v14/clusters/cluster1/services/yarn/config, if you're using yarn fair-scheduler, then look for field yarn_fs_scheduled_allocations. After editing you can PUT the configuration back.
I also asked Cloudera support and the official answer was that there is no fine-grained REST API for this.
This is as of CDH 5.9.0.