I am not able to retrieve a value from Key value map through the get operation. I know I am doing something silly. Please help.
Here are the steps I have taken:
1. Setup the KeyValue map with the enterprise APIs:
POST: https://api.enterprise.apigee.com/v1/o/myorg/keyvaluemaps { "name": "basic-credentials", "entry": [ { "name":"username", "value": "user-TJFZ84" },{ "name":"password", "value": "password5f947b2" } ] }
2. Using the keyvaluemapoperation to retrieve the value:
<KeyValueMapOperations async="false" continueOnError="false" enabled="true" name="kvm_get_boomi_credentials" mapIdentifier="basic-credentials"> <DisplayName>kvm_get_boomi_credentials</DisplayName> <ExpiryTimeInSecs>-1</ExpiryTimeInSecs> <Get assignTo="apiUsername" index="1"> <Key> <Parameter>username</Parameter> </Key> </Get> <Get assignTo="apiPassword" index="1"> <Key> <Parameter>password</Parameter> </Key> </Get> <Scope>environment</Scope> </KeyValueMapOperations>
Step #2 above is not working. When I make a call to this API, and trace it, step 2 is successful, but the "apiUsername" and "apiPassword" fields appear blank.
Also, in the next step (basic authentication policy), when I am trying to use "apiUsername" or "apiPassword", it throws an error:
{"fault":{"detail":{"errorcode":"steps.basicauthentication.UnresolvedVariable"},"faultstring":"Unresolved variable : apiUsername"}}
Please help.
I realized that the KeyValueMapOperations is not able to get access to the map "basic-credentials". It does not fail, but simply sets the values of the variables to null.
The question now is why isn't KeyValueMapOperations not able to access the kvm I am setting through the enterprise API call in step #1? Am I missing out on anything.
Regards,
Ritwik
Hi @Ritwik, In step 1, you have created the key value map in organization scope. Hence, in step 2 while retrieving it, it is necessary to set scope to organization i.e. <Scope>organization</Scope>
User | Count |
---|---|
5 | |
2 | |
2 | |
1 | |
1 |