Multiple KVMs

Is it possible to have multiple KVMs in one proxy?

I have created a proxy with one default KVM. I need to add multiple KVMs where outbound key and password changes and inbound key and value remains same.

0 3 268
3 REPLIES 3

@Anuj Shiva,

You can access any number of KVMs in a single API proxy. For each kvm, you will need to use a separate policy with the mapidentifier attribute set appropriately.

I need to add multiple KVMs where outbound key and password changes and inbound key and value remains same

This statement is not clear. Can you elaborate what you are trying to do.

A Key-Value-Map is a LIST of mappings from one thing (the key) to another (the value).

For example

key value
A Apple
B Banana
partner_ids A123456,B456789
A123456 abc.def.xyz
B456789 foo.bar.baz

Key-Value-Maps can be managed at the: organization, environment, API Proxy, or proxy revision . Only KVMs managed at the environment level are shown in the Apigee Edge Administrative UI at this time.

If you have a large number of values, you can use distinct, named KVMs attached at any of the scopes I mentioned (org, env, proxy, revision) to organize the values. But if you've got just a handful of values, then it probably makes sense to just have a single KVM, called something generic like "Settings".

Many people want a single "value" to be used for all requests, and then a second value that may be different depending on the client_id, or the day of week, or ... something else. That's no problem with KVMs.

To get the "fixed" or non-varying value, perform a KVM Get with a static key.

To get the "varying" value, then use a parameterized key in the KVM Get. One of the key parameters should be the client_id, the day of week, or another variable representing whatever data you would like to "key" off of.

In the example data table above, you can see that some of the "keys" are also stored as values. Imagine a flow in which the partner_id is validated against the list, and then depending on which partner_id was sent in, a different value for a backend hostname was used.

KVMs are very flexible.

I this doesn't answer your question, please clarify what you are asking. this part is not clear:

I need to add multiple KVMs where outbound key and password changes and inbound key and value remains same.

Maybe offer an example.

Not applicable

You can have any number of KVMs used in one proxy according to your requirement. Outbound keys and values change, what I understand is ur kvm key and value will change according to your requirement. In that case using kvm policy first you need to delete the existing key-value pairs and then add the key and values with reference. Another way is to update your kvm using managemnet api call as a service callout inside the proxy.