Skip to content

Commit

Permalink
Tweaking Resource Docs for Rate Limiting related endpoints. Added api…
Browse files Browse the repository at this point in the history
…TagRateLimits
  • Loading branch information
simonredfern committed Sep 20, 2023
1 parent e6a057e commit 58c3a79
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions obp-api/src/main/scala/code/api/util/ApiTag.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ object ApiTag {
val apiTagMethodRouting = ResourceDocTag("Method-Routing")
val apiTagWebUiProps = ResourceDocTag("WebUi-Props")
val apiTagEndpointMapping = ResourceDocTag("Endpoint-Mapping")
val apiTagRateLimits = ResourceDocTag("Rate-Limits")

val apiTagApiCollection = ResourceDocTag("Api-Collection")

Expand Down
11 changes: 8 additions & 3 deletions obp-api/src/main/scala/code/api/v3_1_0/APIMethods310.scala
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,11 @@ trait APIMethods310 {
nameOf(callsLimit),
"PUT",
"/management/consumers/CONSUMER_ID/consumer/call-limits",
"Set Calls Limit for a Consumer",
"Set Rate Limiting (call limits) per Consumer",
s"""
|Set the API call limits for a Consumer:
|Set the API rate limiting (call limits) per Consumer:
|
|Call limits can be set:
|
|Per Second
|Per Minute
Expand Down Expand Up @@ -1221,14 +1223,17 @@ trait APIMethods310 {
|Is rate limiting enabled and active?
|What backend is used to keep track of the API calls (e.g. REDIS).
|
|Note: Rate limiting can be set at the Consumer level and also for anonymous calls.
|
|See the consumer rate limits / call limits endpoints.
|
|${authenticationRequiredMessage(true)}
|
""".stripMargin,
EmptyBody,
rateLimitingInfoV310,
List(UnknownError),
List(apiTagApi))
List(apiTagApi, apiTagRateLimits))


lazy val getRateLimitingInfo: OBPEndpoint = {
Expand Down
8 changes: 5 additions & 3 deletions obp-api/src/main/scala/code/api/v4_0_0/APIMethods400.scala
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,11 @@ trait APIMethods400 {
nameOf(callsLimit),
"PUT",
"/management/consumers/CONSUMER_ID/consumer/call-limits",
"Set Calls Limit for a Consumer",
"Set Rate Limits / Call Limits per Consumer",
s"""
|Set the API call limits for a Consumer:
|Set the API rate limits / call limits for a Consumer:
|
|Rate limiting can be set:
|
|Per Second
|Per Minute
Expand All @@ -216,7 +218,7 @@ trait APIMethods400 {
UpdateConsumerError,
UnknownError
),
List(apiTagConsumer),
List(apiTagConsumer, apiTagRateLimits),
Some(List(canSetCallLimits)))

lazy val callsLimit : OBPEndpoint = {
Expand Down

0 comments on commit 58c3a79

Please sign in to comment.