Reply
New Contributor
Posts: 5
Registered: ‎09-09-2015
Accepted Solution

adding resource pool using Cloudera Manager REST api

Hi

 

Is there a way to add resource pool using the REST api?

 

I'm standing up a cluster using cloudera director and want to run a post script to configure, including resource pool weighting.

 

I can't find any documentation for this in the API docs, is this possible?

Thanks,

Owen

Posts: 1,770
Kudos: 389
Solutions: 285
Registered: ‎07-31-2013

Re: adding resource pool using Cloudera Manager REST api

You can edit this via API just as you would with the Pools API, by using JSON edits to the existing property the UI itself writes into.

See https://www.cloudera.com/content/cloudera/en/documentation/core/latest/topics/cm_props_cdh540_yarn_m... specifically the entry with name "Fair Scheduler Allocations" and description "JSON representation of all the configurations that the Fair Scheduler can take on across all schedules. Typically edited using the Pools configuration UI.". Use http://cloudera.github.io/cm_api/apidocs/v10/path__clusters_-clusterName-_services_-serviceName-_con... to update this like any other config.

Subsequently, call http://cloudera.github.io/cm_api/apidocs/v10/path__clusters_-clusterName-_commands_poolsRefresh.html... to update the pool configs (if you use Dynamic Resource Pools).
Highlighted
New Contributor
Posts: 2
Registered: ‎02-02-2019

Re: adding resource pool using Cloudera Manager REST api

[ Edited ]

Thank you for answering the question. I am able to get a response back. But how can I HTTP PUT the below object to create a new resource pool? Would you happen to have a CURL example?

 

{ 'minSharePreemptionTimeout': None, 'name': 'username', 'schedulingPolicy': 'fair', 'fairSharePreemptionTimeout': None, 'queues': [], 'aclAdministerApps': None, 'fairSharePreemptionThreshold': None, 'allowPreemptionFrom': None, 'aclSubmitApps': 'scrubbed', 'schedulablePropertiesList': [ { 'maxAMShare': None, 'weight': 1.0, 'impalaDefaultQueryMemLimit': None, 'maxRunningApps': None, 'impalaQueueTimeout': None, 'maxChildResources': None, 'impalaMaxQueuedQueries': None, 'impalaMaxRunningQueries': None, 'scheduleName': 'default', 'maxResources': {'vcores': 60, 'memory': 131072}, 'impalaDefaultQueryOptions': None, 'impalaMaxMemory': None, 'minResources': {'vcores': 25, 'memory': 32768} } ], 'type': None }

 

When I insert this into the response and PUT it back to the endpoint, I get a 200 status code. However the resource pool is not actually created nor visible in Web UI.

Announcements