Set the target success.codes property from a variable

We would like to set the HttpTargetConnection success.codes property via a variable. It looks like it is not currently supported according to the documentation here: https://docs.apigee.com/api-platform/reference/endpoint-properties-reference

I wanted to check if it has been requested before and if there was already an open enhancement request for it. I'm also assuming that there is no work around for setting the value.

0 7 492
7 REPLIES 7

A great question! At the moment property values can only be set as values. I also cannot think of a way to work around it. If you could share more information on the requirement, why success.code property of an API proxy Target Endpoint needs to be handled dynamically, we could discuss this with the Apigee Engineering team and propose an enhancement. Thanks!

Our requirement is as follows.

In our Apigee environment when we proxy internal vs external APIs we have a different list of status codes that we set. If the requests are going to internal endpoints then we always treat 1xx,2xx,3xx,400,401,403,404,500 as success so that we can pass these error responses from the target endpoint untouched. If we are calling a target endpoint that is external to our company then we configure a different list of success codes depending on what they external API supports for error codes.

We had wanted to set the list of success codes dynamically within our shared flows that we call prior to calling the target endpoint. These shared flows have logic for determining which HTTP status codes to treat as success.

One idea: Use two targets. InternalTarget uses any status code as success. ExternalTarget uses the default.

Thanks for the suggestion. In our case that's not exactly what we want. Let me further explain.

We have created a template API proxy that we use when creating our proxies. This template has the <HTTPTargetConnection/> values templated using variables. Within our shared flow library we have a number of shared flows that set the HTTPTargetConnection variables based on the type of proxy that is being configured. The only property that we are not able to set via a variable are those set via the <Properties/> tags.

I see. Well, I don't have a good solution for you then.

Any way that we could get it added as an enhancement request?

I wanted to check back on this.

Are there any plans to support variables in the HttpTargetConnection success.codes property?