Unable to Create KVM in Apigee X using apigee-config-maven-plugin

Hi ,

I am trying leverage the apigee-config-maven-plugin to create KVM in Apigee X and add values to it.

Here is the snippet.

{
    "version": "1.0",
    "envConfig": {
        "dev": {
            "targetServers": [
                {
                    "name": "server1",
                    "host": "124.124.124.124",
                    "isEnabled": true,
                    "port": 80
                }
            ],
            "kvms": [
                {
                    "name": "POC",
                    "encrypted": true,
                    "entry": [
                        {
                            "name": "dev-tar",
                            "value": "123.123.123.123"
                        }
                    ]
                }
            ]        
        }      
    },
    "orgConfig": {    
             "org config":"org config"
    }  
}
 
I tried to run this using maven plugin to create KVM entry and getting error as  below
 
{
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unknown name \"entry\" at 'key_value_map': Cannot find field.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "key_value_map",
"description": "Invalid JSON payload received. Unknown name \"entry\" at 'key_value_map': Cannot find field."
}
]
}
]
}
}
 
When I added KVM "POC" manually in the Apigee X environment and ran the same config using maven plugin then its skipping this config setup altogether. 
 
Env KVM "POC" exists. Skipping.
195Retrieving config from /builds/<file_path>/edge.json
196No API scoped KVM config found.
 
what am I missing here ? Is using this plugin valid way to setup KVM values ?
 
 
 
 
 
 
Solved Solved
0 2 817
1 ACCEPTED SOLUTION

Hi Samirj,

Modifying KVM entries via the Apigee API is not supported in Apigee X.

See docs: https://cloud.google.com/apigee/docs/api-platform/get-started/compare-apigee-products#summary-featur...

You can only update the entries in the KVM by using KVM policies. You have a few options to work around this situation.

  1. Use this kvm-admin-v1 proxy to set entries.
  2. Use this apigee-api-facade-v1 proxy and with the maven config plugin v2.x.
  3. Create a separate proxy with a KeyValueMapOperations policy using IntitialEntries.

For option 3, once you deploy the proxy you will have access to the entries. You can even un-deploy the proxy and the entries will persist. For example:

<KeyValueMapOperations async="false" continueOnError="false" enabled="true" name="KV-kvm-test-v1" mapIdentifier="kvm-test-v1">
    <InitialEntries>
        <Entry>
            <Key>
                <Parameter>kvm-1-key-1</Parameter>
            </Key>
            <Value>kvm-1-key-1-value-11</Value>
        </Entry>
    </InitialEntries>
    <Scope>environment</Scope>
</KeyValueMapOperations>

Hope that helps!

View solution in original post

2 REPLIES 2

Hi Samirj,

Modifying KVM entries via the Apigee API is not supported in Apigee X.

See docs: https://cloud.google.com/apigee/docs/api-platform/get-started/compare-apigee-products#summary-featur...

You can only update the entries in the KVM by using KVM policies. You have a few options to work around this situation.

  1. Use this kvm-admin-v1 proxy to set entries.
  2. Use this apigee-api-facade-v1 proxy and with the maven config plugin v2.x.
  3. Create a separate proxy with a KeyValueMapOperations policy using IntitialEntries.

For option 3, once you deploy the proxy you will have access to the entries. You can even un-deploy the proxy and the entries will persist. For example:

<KeyValueMapOperations async="false" continueOnError="false" enabled="true" name="KV-kvm-test-v1" mapIdentifier="kvm-test-v1">
    <InitialEntries>
        <Entry>
            <Key>
                <Parameter>kvm-1-key-1</Parameter>
            </Key>
            <Value>kvm-1-key-1-value-11</Value>
        </Entry>
    </InitialEntries>
    <Scope>environment</Scope>
</KeyValueMapOperations>

Hope that helps!

Thank you @kurtkanaskie