Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error behaviour when session cannot be created due to "time cap" limitation #257

Open
jlurien opened this issue Jan 23, 2024 · 1 comment · May be fixed by #297
Open

Error behaviour when session cannot be created due to "time cap" limitation #257

jlurien opened this issue Jan 23, 2024 · 1 comment · May be fixed by #297
Assignees
Labels
enhancement New feature or request QoD v0.11.0 Within scope for v0.11.0

Comments

@jlurien
Copy link
Collaborator

jlurien commented Jan 23, 2024

Problem description

Use case would be that QoD is productized as number of N QoD minutes or sessions per period and after reaching that limit a new QoD session, or a session duration extension, is requested. What would be the right error to be answered? As an enhancement this can be added as example to document the expected behaviour.

Possible evolution
Add an explicit example to /paths/sessions/POST/responses/"429"/content/"application/json"/examples:

In the guidelines there is a Service Exception documented as:

Error Code Description
TOO_MANY_REQUESTS Either out of resource quota or reaching rate limiting.
SessionsTimeCapExceeded:
  summary: The requested duration exceeds the overall sessions time cap for this device in certain period of time or contract duration.
  value:
    status: 429
    code: TOO_MANY_REQUESTS
    message: The requested session exceeds the allocated quota for this device: Sessions time cap limit exceeded

Alternative solution
An alternative code may be created especifically for QUOTA_REACHED.

Additional context

Initially opened as discussion: #231

@jlurien
Copy link
Collaborator Author

jlurien commented May 29, 2024

I have decided to use status 429 but with a new specific code QUOTA_EXCEEDED for this error scenario, as the default one, TOO_MANY_REQUESTS, is misleading.

403 would be acceptable as well.

@jlurien jlurien linked a pull request May 29, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request QoD v0.11.0 Within scope for v0.11.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants