Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

apigee-go-gen creating custom template with updating apiproxy.yaml under oas3

Hi @lalevee@ssvaidyanathan 

We are trying to create a custom template to include  multiple route rules using system.region.name variables (conditions) & also include corresponding targetservers in apiprpoxy.yaml under oas3 in apigee-go-gen but not successful. Does apigee-go-gen follow the apigeex apiproxy.xml indent or what tool could help create the yaml with correct indent?

RouteRule:
.name: east
Conditions:
- Condition: "system.region.name == 'east'"
TargetEndpoint: west
- RouteRule:
.name: west
Conditions:
- Condition: "system.region.name == 'west'"
TargetEndpoint: west
- RouteRule:
.name: default
TargetEndpoint: east
Conditions: []
TargetEndpoints:
- TargetEndpoint:
.name: west
HTTPTargetConnection:
LoadBalancer:
- Algorithm: RoundRobin
- Server:
.name: api-region1
- Server:
.name: api-region2
IsFallback: true
- MaxFailures: 10
- ServerUnhealthyResponse:
- ResponseCode: 502
- ResponseCode: 503
- ResponseCode: 504
- HealthMonitor:
IsEnabled: true
IntervalInSec: 35
HTTPMonitor:
Request:
ConnectTimeoutInSec: 10
SocketReadTimeoutInSec: 30
Port: 443
Verb: GET
Path: /livecheck
SuccessResponse:
ResponseCode: 200
- TargetEndpoint:
.name: east
HTTPTargetConnection:
LoadBalancer:
- Algorithm: RoundRobin
- Server:
.name: api-region2
- Server:
.name: api-region1
IsFallback: true
- MaxFailures: 10
- ServerUnhealthyResponse:
- ResponseCode: 502
- ResponseCode: 503
- ResponseCode: 504
- HealthMonitor:
IsEnabled: true
IntervalInSec: 35
HTTPMonitor:
Request:
ConnectTimeoutInSec: 10
SocketReadTimeoutInSec: 30
Port: 443
Verb: GET
Path: /livecheck
SuccessResponse:
ResponseCode: 200
 
 
Error:
Error: unknown node "Request" found at "Root.ProxyEndpoints.0.ProxyEndpoint(name: PreFlow)"
Error: unknown node "IsFallback" found at "Root.TargetEndpoints.0.TargetEndpoint(name: west).HTTPTargetConnection.LoadBalancer"
1 12 446
12 REPLIES 12

@raghunathapalle - why dont you use the xml code needed to configure the routeRules you need in a sample proxy and then use the apiproxy-to-yaml command or xml-to-yaml command to generate the yaml templates for you?

Also - your yaml code is difficult to read without the indentation. You can use the "Insert code" option here to post code snippets

CC @miguelmendoza 

@raghunathapalle can you update the original post, and edit the YAML as a code block. It's hard to see the indentation. 

Screenshot 2024-11-11 at 8.25.00 AM.png

 

Hi @miguelmendoza - see 403 forbidden when we try to add it as a code block in the browser edit. Not sure if there is blocked at security at google end or my org. Is there a secure way to pass it on ?

Feel free to open a GitHub issue here.

Hopefully you can add code snippet there with the issue. Also please provide the version you are using

thanks @ssvaidyanathan @miguelmendoza ; our google solution engineer helped open an github issue for it already few mins back. 

https://github.com/apigee/apigee-go-gen/issues/25

 

thanks for your help on this.

I see that - can you add more info to it?

Like the version you are using, the command you are running.. What is the steps you are following with the yaml code

@raghunathapalle,
I've published a fix for the issue (https://github.com/apigee/apigee-go-gen/pull/26). The following elements were missing for validation:

  • RetryEnabled
  • MaxFailures
  • ServerUnhealthyResponse


Can you try like this? (Are you getting 403?)
2024-11-11 10.39.27.gif

yes I tried the same & still see 403 frobidden. tried multiple times but still getting same error.

I see. Is there any error message with the 403? If you can, post a screenshot. I will try to follow up with the community moderators, to see if that can be fixed. (If it's an issue with the community site).

623DF6CD-C5AF-4AA8-9AB0-7409802AD130.jpeg

 

above is the screenshot of the error.

@raghunathapalle,

While we are troubleshooting your issue, I have reached out via PM for additional information. 

Thank you,

Michelle | Community Manager