Is there any method to copy the KVM values from environment to another without the use of Key Value Map Operation policy ?
Hi @praveen p I am just curious here. I have never used nodeJS to a handle my edge env(proxy, prodcut or KVMs) Where do I start for this. Any infor would be very helpful .
Answer by seshi · Apr 09, 2015 at 06:58 AM
#1 Use GET KVM map data using GET call - http://apigee.com/docs/management/apis/get/organizations/%7Borg_name%7D/environments/%7Benv_name%7D/keyvaluemaps/%7Bmap_name%7D
#2 PUT to update KVM - http://apigee.com/docs/management/apis/put/organizations/%7Borg_name%7D/environments/%7Benv_name%7D/keyvaluemaps/%7Bmap_name%7D
#3 POST to create KVM map - http://apigee.com/docs/management/apis/post/organizations/%7Borg_name%7D/environments/%7Benv_name%7D/keyvaluemaps
use Payload from GET call #1 to create or update another KVM map.
Answer by sudheendras
·
Apr 09, 2015 at 07:05 AM
Hi @praveen p - I don't know your complete use case.. but if you want to use key-value-map across environments, you can configure the KVM with "Organization" scope (and avoid copying).
Checkout KVM policy related documents here for more details on scope.
Answer by pbhogill · Apr 10, 2015 at 05:11 AM
@praveen p can you describe your use case a little more? As @sudheendra1 explains you can use the Management APIs to move values between KVMs or use Org level KVMs if more appropriate. You can also use node.js to programatically move values between KVMs. You will have to end up using the Management APIs from your node code however.
Slightly unrelated, if you are looking to move entries from one cache to the other without using a PopulateCache policy, you can also use the apigee-access node module to get from one cache & put into another one.
Hope this helps!
@Prithpal Bhogill - To move the KVM from one environement to another through come command like codes or through some plugin feature. (Not through Apigee Edge UI - Using KVM policy)
Answer by Den Nis · Jul 17, 2015 at 12:28 PM
Hi Diego,
Thanks for fixing the sdk, I got it working both the import and export codes, I'm currently trying to merge the import and export and noticed that the implementation in the import kvm's is a bit different in export.
What I'm trying to achieve now is to export KVMs from test env then import to prod for now, (but main goal is to transfer those also to another org with specific env). Is it possible to change the env config from test to prod when importing the KVMs?
The challenge I am facing right now is that once the --env is set to test (via console) then gruntfile executes, export will run pointing to test after that I am not able to change the target to 'prod' to import those KVMs in prod env.
Thanks!
denz
Answer by Den Nis · Jul 20, 2015 at 05:22 AM
Thanks Diego for your quick response. that is what I'm trying to do last week but since I'm new to grunt I did not make it to work. I'll check on the code you created and see what I can do to improve.
Answer by SnehaNiyogi · Sep 14, 2017 at 09:08 PM
Hi. I was trying to use the grunt plugin to copy KVM from one env to another as mentioned above. But I always get
grunt-apigee-kvm@0.1.0 requires a peer of grunt@~0.4.5 but none was installed error.
I am following the exact steps as mentioned in
Why KVM can store oauth token? 1 Answer
What's the use case of KVM Scope @ Policy level ? 1 Answer
Unreliable KVM return values 1 Answer