gpt4 book ai didi

api - 一个 Apigee Api 代理,每个环境具有不同的目标端点

转载 作者:行者123 更新时间:2023-12-04 16:01:49 24 4
gpt4 key购买 nike

我是 Apigee 新手。

我们在主机名中有我们的环境,例如:

something.int.other.thing.co.uk
something.test.other.thing.co.uk
something.stage.other.thing.co.uk
something.prod.other.thing.co.uk

我希望能够将它们映射到 apigee api 代理本身的 4 个环境,分别是 int、test、stage、prod

我目前为他们准备了一个 Rest 资源,例如:/resource

基本上,我希望 apigee api 代理具有一个 rest 资源,以映射到 4 个不同的目标端点,具体取决于环境。

到目前为止,我已经尝试通过 UI 执行此操作,但未能成功。

我一直在浏览文档,到目前为止我已经找到了这些:

  • 据此应该可以:“API 代理可以包含零个或多个 TargetEndpoints。” (目标端点部分)

http://apigee.com/docs/api-services/content/api-proxy-configuration-reference

  • 根据这些,您可以对代理端点进行路由规则,但我还没有能够将它实现到目标端点:

Create a New Endpoint on an existing API Proxy with "No Target Endpoint"

One API proxy calling two different target endpoints

我也尝试按照此思路为 TargetEndpoint 做一些事情,我在其中测试了环境名称,但没有成功:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TargetEndpoint name="default">
<Description/>
<Flows/>
<PreFlow name="PreFlow">
<Request/>
<Response/>
</PreFlow>
<HTTPTargetConnection>
<URL>something.int.other.thing.co.uk</URL>
</HTTPTargetConnection>
<RouteRule name="int">
<Condition>environment.name == "int"</Condition>
<TargetEndpoint>something.int.other.thing.co.uk</TargetEndpoint>
</RouteRule>
<RouteRule name="test">
<Condition>environment.name == "test"</Condition>
<TargetEndpoint>something.test.other.thing.co.uk/</TargetEndpoint>
</RouteRule>
<RouteRule name="stage">
<Condition>environment.name == "stage"</Condition>
<TargetEndpoint>something.stage.other.thing.co.uk/</TargetEndpoint>
</RouteRule>
<RouteRule name="prod">
<Condition>environment.name == "prod"</Condition>
<TargetEndpoint>something.prod.other.thing.co.uk</TargetEndpoint>
</RouteRule>
<PostFlow name="PostFlow">
<Request/>
<Response/>
</PostFlow>
</TargetEndpoint>

这可能吗?

你能告诉我怎么做吗?

我们正在迁移到 Apigee,我们有一个严格的截止日期,因此我们将不胜感激!

谢谢!

最佳答案

Apigee 支持 Target Servers 的概念- 从代理中抽象出后端主机并提供​​负载平衡。相同的目标服务器可以配置为指向每个环境的不同主机(这个概念已经内置到 Apigee 中)。

看看,这应该有帮助。

斯里坎特

关于api - 一个 Apigee Api 代理,每个环境具有不同的目标端点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22933346/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com