Skip to content

Commit e305396

Browse files
committed
chore: policy entities
1 parent 26280d9 commit e305396

1 file changed

Lines changed: 116 additions & 0 deletions

File tree

openapi.yaml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18090,6 +18090,88 @@ paths:
1809018090
'500':
1809118091
description: Server error
1809218092

18093+
/policies/usage-limits/{policyUsageLimitsId}/entities:
18094+
get:
18095+
tags:
18096+
- Usage Limits Policies
18097+
summary: List Usage Limits Policy Entities
18098+
description: List entities tracked by a usage limits policy with their current usage.
18099+
operationId: listUsageLimitsPolicyEntities
18100+
security:
18101+
- Portkey-Key: []
18102+
parameters:
18103+
- $ref: '#/components/parameters/PolicyUsageLimitsId'
18104+
- name: status
18105+
in: query
18106+
description: Filter by entity usage status
18107+
required: false
18108+
schema:
18109+
type: string
18110+
enum: [active, exhausted]
18111+
- name: search
18112+
in: query
18113+
description: Filter entities by value key
18114+
required: false
18115+
schema:
18116+
type: string
18117+
- name: page_size
18118+
in: query
18119+
description: Number of items per page
18120+
required: false
18121+
schema:
18122+
type: integer
18123+
minimum: 1
18124+
maximum: 100
18125+
- $ref: '#/components/parameters/CurrentPage'
18126+
responses:
18127+
'200':
18128+
description: List of entities for the policy
18129+
content:
18130+
application/json:
18131+
schema:
18132+
$ref: '#/components/schemas/UsageLimitsPolicyEntityListResponse'
18133+
'400':
18134+
description: Bad request
18135+
'401':
18136+
description: Unauthorized
18137+
'403':
18138+
description: Forbidden
18139+
'404':
18140+
description: Policy not found
18141+
'500':
18142+
description: Server error
18143+
18144+
/policies/usage-limits/{policyUsageLimitsId}/entities/{entityId}/reset:
18145+
put:
18146+
tags:
18147+
- Usage Limits Policies
18148+
summary: Reset Usage Limits Policy Entity
18149+
description: Reset the current usage for a specific entity in a usage limits policy.
18150+
operationId: resetUsageLimitsPolicyEntity
18151+
security:
18152+
- Portkey-Key: []
18153+
parameters:
18154+
- $ref: '#/components/parameters/PolicyUsageLimitsId'
18155+
- $ref: '#/components/parameters/UsageLimitsPolicyEntityId'
18156+
responses:
18157+
'200':
18158+
description: Entity usage reset successfully
18159+
content:
18160+
application/json:
18161+
schema:
18162+
type: object
18163+
example: {}
18164+
'400':
18165+
description: Bad request
18166+
'401':
18167+
description: Unauthorized
18168+
'403':
18169+
description: Forbidden
18170+
'404':
18171+
description: Policy or entity not found
18172+
'500':
18173+
description: Server error
18174+
1809318175
/policies/rate-limits:
1809418176
post:
1809518177
tags:
@@ -20400,6 +20482,13 @@ components:
2040020482
schema:
2040120483
type: string
2040220484
format: uuid
20485+
UsageLimitsPolicyEntityId:
20486+
name: entityId
20487+
in: path
20488+
required: true
20489+
description: Usage limits policy entity ID
20490+
schema:
20491+
type: string
2040320492
RateLimitsPolicyId:
2040420493
name: rateLimitsPolicyId
2040520494
in: path
@@ -34566,6 +34655,33 @@ components:
3456634655
type: string
3456734656
example: policy_usage_limits
3456834657

34658+
UsageLimitsPolicyEntity:
34659+
type: object
34660+
properties:
34661+
id:
34662+
type: string
34663+
description: Entity ID
34664+
value_key:
34665+
type: string
34666+
description: The value key identifying the entity (e.g. metadata._user:username)
34667+
current_usage:
34668+
type: number
34669+
description: Current usage value for this entity
34670+
34671+
UsageLimitsPolicyEntityListResponse:
34672+
type: object
34673+
properties:
34674+
object:
34675+
type: string
34676+
example: list
34677+
data:
34678+
type: array
34679+
items:
34680+
$ref: '#/components/schemas/UsageLimitsPolicyEntity'
34681+
total:
34682+
type: integer
34683+
description: Total number of entities
34684+
3456934685
RateLimitsPolicyListResponse:
3457034686
type: object
3457134687
properties:

0 commit comments

Comments
 (0)