Unable to perform the updates to KVM in apigee cloud

Hi, we are try to update the KVMs in apigee cloud using management api and getting below error. 

searched for addEntry/updateEntry API documentation as per error message but couldn't find anything.

https://api.enterprise.apigee.com/v1/o/{orgname}/environments/{env}/keyvaluemaps/{kvm name}

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

Tried to perform the update kvm using maven plugin  as well and getting same error. deleting and recreate is not an option.

for cloud, are there any solutions to update an existing environment kvm's  entry values ( either new entry or update to an entry ) other than deleting & recreating it?

Solved Solved
0 8 584
1 ACCEPTED SOLUTION

From your endpoint (api.enterprise.apigee.com) I understand you're using Apigee EDGE cloud.  I searched and found this.

Basically 

 

POST https://api.enterprise.apigee.com/v1/organizations/{org_name}/keyvaluemaps/{map_name}/entries/{entry_name} \
-H "Authorization: Bearer $TOKEN" \ 
-H "content-type:application/json" \ 
-d '{  "name": "keyname",  "value": "keyvalue"} '

 

 

View solution in original post

8 REPLIES 8

From your endpoint (api.enterprise.apigee.com) I understand you're using Apigee EDGE cloud.  I searched and found this.

Basically 

 

POST https://api.enterprise.apigee.com/v1/organizations/{org_name}/keyvaluemaps/{map_name}/entries/{entry_name} \
-H "Authorization: Bearer $TOKEN" \ 
-H "content-type:application/json" \ 
-d '{  "name": "keyname",  "value": "keyvalue"} '

 

 

Thank you @dchiesa1 . This helps. do we have corresponding maven plugin to edit the entries of kvm? currently we are using the array of KVM object and using the extension as below in pom xml file. 

                    <execution>
                        <id>create-config-kvm</id>
                        <phase>install</phase>                        
                        <goals>
                            <goal>keyvaluemaps</goal>
                        </goals>
                    </execution>

OK this started as a question of "What are the KVM APIs for updating KVMs?"  I answered that.  And now you have another question, I think it is about maven. 

Some questions

  • are you using the Apigee maven config plugin?  if so can you show the configuration and explain specifically what you are trying to do?
  • What are the results you expect to see? 
  • What are the results you actually see?  (and how are they different from what you expect?)

 

@dchiesa1  Here are the details you requested for. 

are you using the Apigee maven config plugin? -- Yes.  project structure is similar to the one provided in below link & also similar kvms.json under edge/<<env>>. https://github.com/apigee/apigee-config-maven-plugin/tree/master/samples/EdgeConfig

kvms json :

[
    {
        "entry": [
            {
                "name": "COMPANY",
                "value": "example.com"
            },
            {
                "name": "PREFIX",
                "value": "EXMPL"
            }
        ],
        "name": "backend_account_config"
    }
]

What are the results you expect to see? & What are the results you actually see?  

When we run the maven command for kvms update command, we expect the kvm entries to be updated with new entry addition or updates to existing entries. This works fine for on-premise. Since apigee cloud is not allowing it, looking for an option on how to change kvms config file to make it work for cloud as well. 

@soujanyaedunuri - Which version of the plugin are you using ? Also can you share the mvn command you are running. Lastly can you share the pom file you are using. Please make sure you remove all sensitive info before sharing

@soujanyaedunuri - any response?

@dchiesa1  @ssvaidyanathan  Sorry for the delayed response. we are using pom xml similar to https://github.com/apigee/apigee-config-maven-plugin/blob/master/samples/EdgeConfig/shared-pom.xml

Also, noticed that this maven plugin is working even for apigee cloud environment for KVMs. it is invoking below API for updates for apigee cloud.  

https://api.enterprise.apigee.com/v1/organizations/{org_name}/keyvaluemaps/{map_name}/entries/{entry_name}

For apigee on-premise, it is invoking below api for updates. https://host/o/{org}/environments/{env}/keyvaluemaps/{mapname}

This clarified the issue i was working on. Thank you both for the responses. 

Great!  Thanks for the confirmation.