How to store KVM data in apigee X UI

I am not able to store KVM data in apigee X from environment configuration. There is only option for putting the name of KVM, not getting the option for storing Key and value.

Help me with information to store the data from UI.

1 Like

https://www.googlecloudcommunity.com/gc/Apigee/Caches-and-KVM-access-is-missing-in-ApigeeX/td-p/168892

Hi, @ayan8902
from your screenshot, I could guess, that you are using Apigee X or Hybrid.
Edge allows you to put KVM values directly from the UI.

However, X & Hybrid are not allowing you to do the same from their UI.
Try to use KVM policy’s Put & specify your value as below.

  • Save policy as e.g. “KVM-save-values”
  • Once you will add policy into the Flow, deploy proxy & Flow with “KVM-save-values” executed, it will save values into KVM.
  • Do not forget to delete the policy from the Flow & check that values are saved by using another KVM policy with Get.
    Below is my Edge evaluation to illustrate my reply. It will work with X & Hybrid too.

thanks, regards, Yermek

“KeyValueMapOperations”: Put Value into the KVM:

<Put override="false">
        <Key>
            <Parameter>private.KeyName</Parameter>
        </Key>
        <Value>Your secret text</Value>
    </Put>

“KeyValueMapOperations”: Get Value from the KVM:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<KeyValueMapOperations continueOnError="false" enabled="true" name="KVM-Name" mapIdentifier="KVM-id">
    <DisplayName>KVM-Name</DisplayName>
    <Properties/>
    <ExclusiveCache>false</ExclusiveCache>
    <ExpiryTimeInSecs>86400</ExpiryTimeInSecs>
    <Get assignTo="private.KeyName" index="1">
        <Key>
            <Parameter>private.KeyName</Parameter>
        </Key>
    </Get>
    <Scope>environment</Scope>
</KeyValueMapOperations>

@optimism the put request in the proxy is not working.

There is also this reference implementation. It works nicely, uses your correct administrative credentials. It’s like a substitute for the missing KVM admin API.

1 Like

@ayan8902 Are you using unencrypted KVM? If so, please remove “private.”:

<Put override="false">
        <Key>
            <Parameter>KeyName</Parameter>
        </Key>
        <Value>Your secret text</Value>
    </Put>

make sure that KVM name, KVM id, key name all are the same you should put & get using the same.

could you share your code?