Retrieve and Update KVM Value

Not applicable

Hi, I'm able to retrieve all the KVM Maps available in my test org and looks like the following kvm (

mapIdentifier="DataCenter") is there in default kvmap. But I would like to update value for the datacenterserver variable and for this I' not seeing this variable only in kvmap in retrieval. Is KVM work in test orgs? If yes, How can I directly retrieve the data of DataCenter KVM map? I have tried using the below once, but not working for the mapIdentifier names. Please advice. Thanks!

http://docs.apigee.com/management/apis/get/organizations/%7Borg_name%7D/keyvaluemaps/%7Bmap_name%7D

Existing KVM:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<KeyValueMapOperations async="false" continueOnError="false" enabled="true" name="DataCenterGet" mapIdentifier="DataCenter">
<DisplayName>DataCenterGet</DisplayName>
<FaultRules/>
<Properties/>
<ExclusiveCache>false</ExclusiveCache>
<ExpiryTimeInSecs>-1</ExpiryTimeInSecs>
<Get assignTo="datacenterserver" index="1">
<Key>
<Parameter ref="request.header.X-OUID"/>
</Key>
</Get>
<Scope>environment</Scope>
</KeyValueMapOperations>

0 4 1,845
4 REPLIES 4

Hi Swapna,

Make sure the apiproxy from where you are accessing the KVM is deployed to the same environment where the KVM is created, since the Scope element of the KVM is <Environment> as per your snippet above.

Also, to update the KVM entry, you can use the <Put> operation as described here:

http://docs.apigee.com/api-services/reference/key-value-map-operations-policy

adas
Participant V

@Swapna In your keyvaluemap policy I see that you have set the <Scope> as environment, which means its not an org level kvm, its an environment level kvm. Now depending on which environment you had deployed this proxy, you should be able to call it via the management api using:

curl -v https://api.enterprise.apigee.com/v1/o/{org}/e/{env}/keyvaluemaps/{mapname}

I think you already know how to update the kvm, otherwise just follow the public api docs for kvm.

Thanks @arghya das and @hmiranda@apigee.com.

Can weretrieve the custom attributes based on environment and apps? I have tried the below one but it's not working.

/v1/o/{org}/e/{env}/companies/Epsilon/apps/Epsilon-SHarLS/attributes/DCServerDown

Thanks in Advance.

@arghya das Irgnore this. Got it. it's a context level.