Is it possible to store IP Address blocks in CIDR notation as a value in the KVM?

Hi ,

One of our consumer want to whitelist IP for their docker service cluster: Sample ip which they want to Configure is 10.XX.XX.XXX/XX

Will it work in Apigee Edge if we put this in KVM in below manner.

<Entry>
  <Key>
    <Parameter>kvm.whitelistIp</Parameter>
  </Key>
 <Value>10.XX.XX.XXX/XX</Value>
</Entry>
0 2 234
2 REPLIES 2

@Dino @Anil Sagar @ Google @Anil Sagar Could you help here

I'm not sure! Have you tried it? Experiencing problems?

There is some restriction on the content of the KVM value. I'm not sure if you can store CIDR notation. I'm certain you cannot store full URLs - maybe the problem is with the slashes.

This is a hassle, but the way I work around it is to encode the value, or similar, before storing it. And then decode after retrieve.

You can use the static functions available in the Message Template to do base64 decoding.

eg

Retrieve the base64-encoded value from KVM in a KeyValueMapOperations/Get,

<KeyValueMapOperations name='KVM-Get-1' mapIdentifier='nameOfMap'>
  <Scope>environment</Scope>
  <ExpiryTimeInSecs>300</ExpiryTimeInSecs>
  <Get assignTo='retrieved_value'>
    <Key>
      <Parameter>kvm.whitelistIp</Parameter>
    </Key>
  </Get>
</KeyValueMapOperations>


then decode

<AssignMessage name='AM-Decode'>
  <AssignVariable>
    <Name>decoded</Name>
    <Template>{decodeBase64(retrieved_value)}</Template>
  </AssignVariable>
</AssignMessage>