Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Posting Multiple KVM Entries using JSON Object

@dchiesa1 

@anilsagar 

We are using management API Call to Post entries to KVM

https://apigee.googleapis.com/v1/organizations/org/environments/EnvName/keyvaluemaps/KVMName/entries

This does allow to Post one Entry 

{
"name": "Test",
"value": "Test"
}

How do we post multiple entries using JSON objects at once?

When I try posting multiple entries I am getting a 403 from Management API call.

Example:

{"name":"setting1", "value":"Test1"},
{"name":"setting2", "value":"Test2"},
{"name":"setting3", "value":"Test3"}

2 6 396
6 REPLIES 6

Ya, I understand your question.

The documentation for this interface is here: 

https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments.keyval...

It describes methods that allow you to Create, Read, Update, and Delete an entry, and another method to List all the entries. 

There is no MultiCreate or MultiUpdate. 

So the way to do what you want is: 

  • make three calls for your three distinct entries, OR
  • collapse your three entries into one entry, and parse the items from that entry at runtime in the API Proxy. 

 

 

 

Or use apigeecli.

$ apigeecli kvms entries
Manage Key Value Map Entries

Usage:
  apigeecli kvms entries [command]

Available Commands:
  create      Create a KV Map entry
  delete      Delete a KVM Map entry
  export      Export KV Map entries
  get         Get a KV Map entry
  import      Import a file containing KVM Entries
  list        List KV Map entries
  update      Update a KV Map entry

 

ya; that's a nice, handy wrapper.

BTW in case anyone reading might wonder - the apigeecli just loops through the "Create one entry" API call, N times, one for each entry in the file you pass.  It's not using some undocumented "Bulk import" API.  

Hi @sanugu,

Thanks so much for reaching out to the Apigee forum! If any of the solutions provided worked for you, it would be great if you could mark one as the accepted solution. This will help others in the community who might face a similar situation in the future 🙂

@AlexET The solutions provided above does not fit our use case. 

We are sorry to hear that the previous solutions didn't meet your expectations. We value your participation and encourage you to keep engaging with the forum!

Thanks for being part of our community.