Created 09-30-2015 04:01 AM
/var/lib/ambari-server/resources/scripts/configs.sh is a great way to automate config changes, but seems it only supports the 'Default' config group. Is there a clean way to make changes to other config groups via API?
Created 09-30-2015 04:46 AM
Yes you can use APIs. Sample:
A PUT call at http://ambari.host:8080/api/v1/clusters/c1/config_groups/2
with payload:
[{"ConfigGroup":{"id":2,"cluster_name":"c1","group_name":"A config group","tag":"HDFS","description":"A config group","hosts":[{"host_name":"host1"}],"service_config_version_note":"change","desired_configs":[{"type":"hdfs-site","tag":"version1443587493807","properties":{"dfs.replication":"2","dfs.datanode.du.reserved":"1073741822"}}]}}]
will modify the config group. A POST to http://ambari.host:8080/api/v1/clusters/c1/config_groups would have created a new config group.
Created 09-30-2015 04:46 AM
Yes you can use APIs. Sample:
A PUT call at http://ambari.host:8080/api/v1/clusters/c1/config_groups/2
with payload:
[{"ConfigGroup":{"id":2,"cluster_name":"c1","group_name":"A config group","tag":"HDFS","description":"A config group","hosts":[{"host_name":"host1"}],"service_config_version_note":"change","desired_configs":[{"type":"hdfs-site","tag":"version1443587493807","properties":{"dfs.replication":"2","dfs.datanode.du.reserved":"1073741822"}}]}}]
will modify the config group. A POST to http://ambari.host:8080/api/v1/clusters/c1/config_groups would have created a new config group.
Created 09-30-2015 05:04 AM
Thanks @smohanty@hortonworks.com. Is it correct to say that we need to pass in previously configured properties as well as new properties together to the POST? (to avoid removal of existing properties)
Created 08-20-2022 02:13 PM
hi smohanty
can you show me example for - how to config the dfs.replication by using full example ( as with curl ) ?
you mentioned the - version1443587493807 , according to what I need to set this "version number"?
Created 06-07-2017 11:17 AM
how do add new host on existing config_groups through ambari api
Created 08-21-2022 10:31 PM
@mike_bronson7, as this is an older post, you would have a better chance of receiving a resolution by starting a new thread. This will also be an opportunity to provide details specific to your environment that could aid others in assisting you with a more accurate answer to your question. You can link this thread as a reference in your new post.
Regards,
Vidya Sargur,