Support Questions
Find answers, ask questions, and share your expertise

Update Yarn Scheduler Queues through Rest API

Highlighted

Update Yarn Scheduler Queues through Rest API

Explorer

I am trying to update the yarn scheduler queues through rest api and it does not seem to be working as I expect. I followed the example at the post: https://community.hortonworks.com/questions/33578/api-to-manage-yarn-capacity-queue.html but I keep getting the error 415 Unsupported Media Type.

Here is the command I am using:

curl -kv -u admin:admin -H "Content-Type: application/json" -H "X-Requested-By:ambari" -X PUT -d@yarn_queues.json https://<FQDN>:<PORT>/api/v1/views/CAPACITY-SCHEDULER/versions/1.0.0/instances/AUTO_CS_INSTANCE/reso...
3 REPLIES 3
Highlighted

Re: Update Yarn Scheduler Queues through Rest API

@Theyaa Matti

Try using /var/lib/ambari-server/resources/scripts/configs.sh to update queue mapping(yarn.scheduler.capacity.queue-mappings) programmatically.

Highlighted

Re: Update Yarn Scheduler Queues through Rest API

Explorer

Do you have an example please? I would appreciate it.

Highlighted

Re: Update Yarn Scheduler Queues through Rest API

Super Guru
@Theyaa Matti

Adding few more details to Sindhu's answer.

Here is an usage:

[root@danielrepro ~]# /var/lib/ambari-server/resources/scripts/configs.sh --help


WARNING: THIS SCRIPT IS DEPRECATED AND DOESN’T SUPPORT NEW FEATURES. PLEASE USE configs.py


Usage: configs.sh [-u userId] [-p password] [-port port] [-s] <ACTION> <AMBARI_HOST> <CLUSTER_NAME> <CONFIG_TYPE> [CONFIG_FILENAME | CONFIG_KEY [CONFIG_VALUE]]


       [-u userId]: Optional user ID to use for authentication. Default is 'admin'.
       [-p password]: Optional password to use for authentication. Default is 'admin'.
       [-port port]: Optional port number for Ambari server. Default is '8080'. Provide empty string to not use port.
       [-s]: Optional support of SSL. Default is 'false'. Provide empty string to not use SSL.
       <ACTION>: One of 'get', 'set', 'delete'. 'Set' adds/updates as necessary.
       <AMBARI_HOST>: Server external host name
       <CLUSTER_NAME>: Name given to cluster. Ex: 'c1'
       <CONFIG_TYPE>: One of the various configuration types in Ambari. Ex:global, core-site, hdfs-site, mapred-queue-acls, etc.
       [CONFIG_FILENAME]: File where entire configurations are saved to, or read from. Only applicable to 'get' and 'set' actions
       [CONFIG_KEY]: Key that has to be set or deleted. Not necessary for 'get' action.
       [CONFIG_VALUE]: Optional value to be set. Not necessary for 'get' or 'delete' actions.

Here are few examples:

/var/lib/ambari-server/resources/scripts/configs.sh -u admin -p admin set `hostname` Sandbox hdfs-site dfs.ha.fencing.methods "abc\nbcd"

.

/var/lib/ambari-server/resources/scripts/configs.sh
-u admin -p <password> set localhost dev1 ooze-env oozie_hostname
xxxxx.

.

./configs.sh  -u admin -p admin -port 8443 -s delete
`hostname -f` burger ams-ssl-client ssl.client.truststore.password