如何使用API​​GEE中的Assign Message策略构建Target Url?

时间:2017-09-11 10:59:52

标签: apigee

我希望在代理流根据提供的条件到达目标端点时在运行时构造或修改目标URL,我不想硬编码它想要从kvm获取它但是当我尝试从kvm获取它不起作用。

1 个答案:

答案 0 :(得分:0)

  1. 创建一个KVM并将其加密。
  2. 使用KVM策略从KVM获取加密值。

    <KeyValueMapOperations async="false" continueOnError="false" enabled="true" name="Key-Value-Map-Operations-dark-sky" mapIdentifier="encrpt"> <DisplayName>Key Value Map Operations</DisplayName> <Properties/> <ExclusiveCache>false</ExclusiveCache> <ExpiryTimeInSecs>300</ExpiryTimeInSecs> <Get assignTo="private.targetURL" index="1"> <Key> <Parameter>KVM-key</Parameter> </Key> </Get> <Scope>environment</Scope> </KeyValueMapOperations>

*仅当使用加密值时才应使用私有。 foo是键,而mapIdentifier应该是您创建的KVM。

您可以在目标端点的路径中直接使用private.targetURL。

<HTTPTargetConnection>
    <LoadBalancer>
        <Server name="targetapi"/>
    </LoadBalancer>
    <Path>/forecast/{private.targetURL}/</Path>
</HTTPTargetConnection>
相关问题