Access KVM Programmatically

Not applicable

Hi,

I have gone through another discussion(https://community.apigee.com/questions/19816/accessing-kvm-from-node-js.html) reg. this subject but didnt' yield any helpful response.

So, Here I am posting another one as per suggestion.

I would like to access the list of KVM (Keys and values) programmatically based on some regular expression.

Example KVM Key: APIName_APIVersion

Example VVM Value: <a json object with API details>

The requirement is to retrieve all the KVM Values based on API Name.

Any help will be appreciated.

thanks.

0 4 830
4 REPLIES 4

Hi @Ravi Shah,

In the question you have mentioned the KVM value is a son object with API details. As per KVM doc values is of type "string".

@Ravi Shah - if you are interested in reading configuration information for all versions of a single API, why not create a KVM per APIName with APIVersion as entries within that map? Then you can simply read that whole KVM that corresponds to your APIName in one go and assign individual version details to flow variables.

Hi @oseymen@apigee.com,

There are multiple reasons for not going for APIName based keys.

1. My automation program needs to update the KVM after each version change. I prefer inserting a new one to keep it simple, independent and less prone to errors.

2. I am also planning to search multiple APINames as passed in the parameters which will not be possible then.

If we have regex based key / value lookup or programmatic KVM access, it possibly works.

I wonder why apigee doesn't have programmatic access to KVM when they have it for cache and Vault.

If it is intentional, I am curious to know the rationale behind it.

Hi @Ravi Shah,

Your option 1 is still valid with "KVM per APIName" approach - you would be inserting a new entry in an APIName KVM for the new version. So your automation program logic is still same.

I guess APIName searching will need to be done some other way: perhaps either using management API to list all maps which you can cache and then regex in your automation program OR using another KVM map to list apinames independently.

Perhaps it would be more useful if you could tell us what you are trying to achieve so we could recommend other solutions. The previous thread that you have mentioned already confirmed that there is no programmatic access to KVM. I don't know the rationale behind it.