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

Adding multiple entries to KVM using Management API

Not applicable

As per the available documentation, we can use the 'Create an entry in an organization-scoped KVM (CPS)' API to add an additional entry into an existing KVM. This involves sending the entry as a JSON/XML payload.

{"name":"aaa",
"value": "AAA"}

I was wondering if there was any way to add multiple entries using a single management API call. I tried using an array of JSON objects

[{"name":"aaa","value": "AAA"},{"name":"bbb","value": "BBB"}]

but this doesn't work. Any suggestions?

0 1 424
1 REPLY 1

If your organization does not have CPS enabled, it should work. But your payload needs to be

{
  "name" : "mapName",
  "entry" : [ 
  {
    "name" : "aaa",
    "value" : "AAA"
  }, 
  {
    "name" : "bbb",
    "value" : "BBB"
  }, 
  {
    "name" : "ccc",
    "value" : "CCC"
  }
 ]
}

If your organization has CPS enabled, then there doesn't seem to be a documented way to perform a multi element insert/update.

Reference: https://apidocs.apigee.com/management/apis/post/organizations/%7Borg_name%7D/keyvaluemaps/%7Bmap_nam...