From 0bdf3516fc8f75e05b8be7ef868e2bdb877480a3 Mon Sep 17 00:00:00 2001 From: Maansi Prerna Date: Fri, 12 Jan 2024 15:22:34 +0530 Subject: [PATCH 1/3] adding example policies for tpm and circuit breaker --- examples/Rate limit by TPM.xml | 45 ++++++++++++++++++++++++++++++++++ examples/circuitbreaker.xml | 41 +++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 examples/Rate limit by TPM.xml create mode 100644 examples/circuitbreaker.xml diff --git a/examples/Rate limit by TPM.xml b/examples/Rate limit by TPM.xml new file mode 100644 index 0000000..ee569eb --- /dev/null +++ b/examples/Rate limit by TPM.xml @@ -0,0 +1,45 @@ + + + + + + + + + ())" remaining-calls-header-name="remainingTPM" total-calls-header-name="totalTPM" /> + + + + + + + + ())" remaining-calls-header-name="remainingTPM" total-calls-header-name="totalTPM" /> + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/circuitbreaker.xml b/examples/circuitbreaker.xml new file mode 100644 index 0000000..10d237c --- /dev/null +++ b/examples/circuitbreaker.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + @((string)context.Variables["circuitBreakerTimeoutSeconds"]) + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 95e229eb503f0730761883e1c61a067c21f69850 Mon Sep 17 00:00:00 2001 From: Maansi Prerna Date: Fri, 12 Jan 2024 15:44:55 +0530 Subject: [PATCH 2/3] removing rpm policies --- examples/Rate limit by TPM.xml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/examples/Rate limit by TPM.xml b/examples/Rate limit by TPM.xml index ee569eb..d5ba1dc 100644 --- a/examples/Rate limit by TPM.xml +++ b/examples/Rate limit by TPM.xml @@ -13,28 +13,13 @@ Clients recieve 429 as the response status code. --> ())" remaining-calls-header-name="remainingTPM" total-calls-header-name="totalTPM" /> - - - - ())" remaining-calls-header-name="remainingTPM" total-calls-header-name="totalTPM" /> - - - - - - From c676228aa9a3bec2fba02009e9932651c22fad34 Mon Sep 17 00:00:00 2001 From: Maansi Prerna Date: Mon, 15 Jan 2024 16:54:16 +0530 Subject: [PATCH 3/3] adding link in the readme and removing circuitbreaker --- examples/README.md | 1 + examples/circuitbreaker.xml | 41 ------------------------------------- 2 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 examples/circuitbreaker.xml diff --git a/examples/README.md b/examples/README.md index d8f614e..4ec4460 100644 --- a/examples/README.md +++ b/examples/README.md @@ -51,3 +51,4 @@ Overview | Extract multiple values from xml documents | Uses an intermediate json object to provide easy access to extracted values from an xml document. | | Return a blob URL signed with a user delegation SAS token | Demonstrates how to check if a blob exists and then return the URL of the blob signed with a User Delegation SAS token leveraging Managed Identity. | | OAuth Reverse Proxy | Demonstrates how to implement an OAuth Reverse Proxy to provide OIDC authentication in-front of a Web Application behind Azure API Management. | +| Rate limit by TPM (Tokens per minute) | Demonstrates how to implement a TPM based rate limiting policy in Azure API Management. | diff --git a/examples/circuitbreaker.xml b/examples/circuitbreaker.xml deleted file mode 100644 index 10d237c..0000000 --- a/examples/circuitbreaker.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - @((string)context.Variables["circuitBreakerTimeoutSeconds"]) - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file