Adding multiple entries in KVM in APIGEE SAAS

Hi All,

I am using APIGEE SAAS.I have a requirement to add multiple entries in single KVM(value will be same for all entries, keys are different) Is there any way to do this without adding each entry manually ,as the no of entries is huge.

Thanks in advance.

Solved Solved
0 18 716
1 ACCEPTED SOLUTION

Not applicable

You can use management api call to add or update one KVM at once for multiple entries.

ref: https://apidocs.apigee.com/management/apis/post/organizations/%7Borg_name%7D/apis/%7Bapi_name%7D/key...

View solution in original post

18 REPLIES 18

Not applicable

You can use management api call to add or update one KVM at once for multiple entries.

ref: https://apidocs.apigee.com/management/apis/post/organizations/%7Borg_name%7D/apis/%7Bapi_name%7D/key...

Thank you Priyadarshi.Can we also do it using javascript policy and adding in KVM using KVM put operation

KVM PUT operation will not allow you to enter n number of entries. It's difficult to put in KVM policy.

Javascript policy you can use and call the same management api call in the doc. But that is not a good practice.

You can use the management api call directly in rest clients.

Hi Priyadarshi,

what does api_name mean here

https://api.enterprise.apigee.com/v1/organizations/<org_name>/apis/{api_name}/keyvaluemaps

Also where do we specify environment name

This is the url for api proxy scope kvm.

It loooks you are looking for environment level KVM. For the environment level below is the url.

https://api.enterprise.apigee.com/v1/o/{orgname}/e/{envname}/keyvaluemaps

Can you post the URL 🙂

Thanks Priyadarshi.I beleive this is for creating new KVM.I am looking for adding multiple entries in existing KVM.

{ "code": "keyvaluemap.service.keyvaluemap_already_exist", "message": "KeyValueMap {kvm name} already exists", "contexts": [] }

you can use PUT over the kvm and add the new entries to the old body. So, the /{kvm-name} will be appended in url.

Getting method not allowed

Hi, this works for me. please paste your curl request for the same.

curl --location --request PUT 'https://api.enterprise.apigee.com/v1/organizations/{org name}/environments/qa/keyvaluemaps' \ --header 'Authorization: Bearer {token} \ --header 'Content-Type: application/json' \ --data-raw '{"name" :{kvm name}, "encrypted":"true" "entry" :[ {"name":"a","value":"true"}, {"name":"b","value":"true"}, ] } '

This is just an example,i need to add multiple entries

https://api.enterprise.apigee.com/v1/organizations/{org name}/environments/qa/keyvaluemaps/{kvm_name}

the url should look as above.

{ "code": "keyvaluemap.service.KeyValueMapUpdateOperationNotSupported", "message": "Update of KeyValueMap is not supported; use addEntry/updateEntry api to add entries to a KeyValueMap", "contexts": [] }

do you have enough permission?

I used this just last month.

Not sure what the issue is,i was able to add single entry using managment api

Apigee vendor confirmed the functionality is available to private cloud only.

We can add only one entry at a time in public cloud.

but I used before a month for multiple. give a try then to POST and having multiple entrie.