Created 05-27-2018 03:08 PM
we want to post the new config to ambari
but we need uniq tag number that not exist in ambari
how to generate new tag number by API or other approach , so we can put it after "tag" ? as - 237432322
curl -u admin:admin -H "X-Requested-By: ambari" -X PUT -d '[ { "Clusters": { "desired_config": [ { "type": "kafka-env", "tag": "237432322", "properties": {
Created 05-27-2018 05:19 PM
You can use the current epoch timestamp as tag.
configs.py internally uses the same.
In python: "version"+str(int(time.time() * 1000000)) tag will be something like : "version1527441356254688"
Created 05-27-2018 05:19 PM
You can use the current epoch timestamp as tag.
configs.py internally uses the same.
In python: "version"+str(int(time.time() * 1000000)) tag will be something like : "version1527441356254688"
Created 05-27-2018 05:30 PM
can you please give real example ?
Created 05-27-2018 05:50 PM
curl -u admin:admin -H 'X-Requested-By:admin' -X PUT 'http://localhost:8080/api/v1/clusters/cc' -d '{ "Clusters": { "desired_config": { "type": "core-site", "tag": "version1527441356254688", "properties": { "security.admin.operations.protocol.acl" : "hadoop", "security.client.datanode.protocol.acl" : "*", "security.client.protocol.acl" : "*", "security.datanode.protocol.acl" : "*", "security.inter.datanode.protocol.acl" : "*", "security.inter.tracker.protocol.acl" : "*", "security.job.client.protocol.acl" : "*", "security.job.task.protocol.acl" : "*", "security.namenode.protocol.acl" : "*", "security.refresh.policy.protocol.acl" : "hadoop", "security.refresh.usertogroups.mappings.protocol.acl" : "hadoop" } } } }'
Created 05-28-2018 07:22 AM
( I accept your anser but we have aproblem ) , regarding the - version"+str(int(time.time() * 1000000)) , what in case its return number that already exists as version ( in spite this is very very rare ? )
Created 05-28-2018 09:04 AM
@Michael Bronson, It is highly unlikely that you will get the same version number when using epoch timestamp, The number changes every millisecond. So each time you execute "version"+str(int(time.time() * 1000000)) you will get a new unique number.