-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#IOPLT-228] - Remove routing to AKS beta cluster (#722)
- Loading branch information
Showing
3 changed files
with
42 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 34 additions & 33 deletions
67
src/domains/payments-common/api/payments_updater/v1/_base_policy.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,50 @@ | ||
<policies> | ||
<inbound> | ||
<base /> | ||
<choose> | ||
<set-backend-service base-url="https://weuprod01.payments.internal.io.pagopa.it/api/v1/payment" /> | ||
<!-- <choose> | ||
<when condition="@(context.Request.Headers.GetValueOrDefault("environment", "false").Equals("beta"))"> | ||
<set-backend-service base-url="https://weubeta.payments.internal.io.pagopa.it/api/v1/payment" /> | ||
</when> | ||
<when condition="@(context.Request.Headers.GetValueOrDefault("environment", "false").Equals("weu-prod01"))"> | ||
<set-backend-service base-url="https://weuprod01.payments.internal.io.pagopa.it/api/v1/payment" /> | ||
</when> | ||
<otherwise> | ||
<!-- https://docs.microsoft.com/en-us/dotnet/api/system.random.next?view=net-6.0#system-random-next(system-int32-system-int32) --> | ||
# https://docs.microsoft.com/en-us/dotnet/api/system.random.next?view=net-6.0#system-random-next(system-int32-system-int32) | ||
<set-variable name="urlWeight" value="@{ | ||
Random rnd = new Random(); | ||
int urlWeight = rnd.Next(1, 1001); | ||
return urlWeight;}" /> | ||
<choose> | ||
<when condition="@(context.Variables.GetValueOrDefault | ||
<int>("urlWeight") | ||
<= 1)"> | ||
<set-backend-service base-url="https://weubeta.payments.internal.io.pagopa.it/api/v1/payment" /> | ||
</when> | ||
<when condition="@(context.Variables.GetValueOrDefault | ||
<int>("urlWeight") > 1)"> | ||
<set-backend-service base-url="https://weuprod01.payments.internal.io.pagopa.it/api/v1/payment" /> | ||
</when> | ||
<otherwise> | ||
<return-response> | ||
<set-status code="500" reason="InternalServerError" /> | ||
<set-header name="Microsoft-Azure-Api-Management-Correlation-Id" exists-action="override"> | ||
<value>@{return Guid.NewGuid().ToString();}</value> | ||
</set-header> | ||
<set-body>A gateway-related error occurred while processing the request.</set-body> | ||
</return-response> | ||
</otherwise> | ||
</choose> | ||
</otherwise> | ||
</choose> | ||
</inbound> | ||
<outbound> | ||
<base /> | ||
</outbound> | ||
<backend> | ||
<base /> | ||
</backend> | ||
<on-error> | ||
<base /> | ||
</on-error> | ||
</policies> | ||
<int>("urlWeight") | ||
<= 1)"> | ||
<set-backend-service base-url="https://weubeta.payments.internal.io.pagopa.it/api/v1/payment" /> | ||
</when> | ||
<when condition="@(context.Variables.GetValueOrDefault | ||
<int>("urlWeight") > 1)"> | ||
<set-backend-service base-url="https://weuprod01.payments.internal.io.pagopa.it/api/v1/payment" /> | ||
</when> | ||
<otherwise> | ||
<return-response> | ||
<set-status code="500" reason="InternalServerError" /> | ||
<set-header name="Microsoft-Azure-Api-Management-Correlation-Id" exists-action="override"> | ||
<value>@{return Guid.NewGuid().ToString();}</value> | ||
</set-header> | ||
<set-body>A gateway-related error occurred while processing the request.</set-body> | ||
</return-response> | ||
</otherwise> | ||
</choose> | ||
</otherwise> | ||
</choose> --> | ||
</inbound> | ||
<outbound> | ||
<base /> | ||
</outbound> | ||
<backend> | ||
<base /> | ||
</backend> | ||
<on-error> | ||
<base /> | ||
</on-error> | ||
</policies> |