Can we fetch the values of a KVM without the KEY reference?

rovyas
Participant I

I have a VALUE parameter, (say role_name) and based on this value, I want to find the Clients (KEY) associated with it.. If this is not possible to do, could you suggest an alternative method which helps..

1 3 329
3 REPLIES 3

It is a KVM pair. So I dont think you can pull up without key reference. From above I understand role name can be key and client can be reference. May be you can elaborate on use case to think of alternative way.

@rovyas ,

You can use Management APIs to solve your issue. You can make an API call to retrieve all key value pairs in key value map & then use a script to find out key from value.

API Call Details :

Method : GET

EndPoint : https://api.enterprise.apigee.com/v1/organizations/{YOURORGNAME}/environments/{ENVIRONMENTNAME}/keyv...

Headers : Authoriation : Basic {BASE64ENCODDE OF APIGEE ORG ADMIN CREDS}

Auth : Base 64 encode of Apigee credentials using Authorization Heder, Check Apigee Docs to know how to make management API calls

Response will have key-value map pairs, you can parse response & find out corresponding key for given value.

You can use service callout to make a managment api call to fetch all key value pair for a KVM. Response object can then be parsed inside a java script to fetch value