Skip to content

Commit

Permalink
Merge pull request camaraproject#306 from maxl2287/feature/update-htt…
Browse files Browse the repository at this point in the history
…p-status-codes

Add HTTP-429 for quality-on-demand
  • Loading branch information
hdamker authored Jul 18, 2024
2 parents 546e4f8 + 84d2f1a commit 552f9de
Showing 1 changed file with 62 additions and 22 deletions.
84 changes: 62 additions & 22 deletions code/API_definitions/quality-on-demand.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,18 +248,9 @@ paths:
"403":
$ref: "#/components/responses/Generic403"
"409":
description: Conflict
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
example:
status: 409
code: CONFLICT
message: "Another session is created for the same device"
$ref: "#/components/responses/SessionInConflict409"
"429":
$ref: "#/components/responses/Generic429"
"500":
$ref: "#/components/responses/Generic500"
"501":
Expand Down Expand Up @@ -313,6 +304,8 @@ paths:
$ref: "#/components/responses/Generic403"
"404":
$ref: "#/components/responses/SessionNotFound404"
"429":
$ref: "#/components/responses/Generic429"
"500":
$ref: "#/components/responses/Generic500"
"503":
Expand Down Expand Up @@ -359,6 +352,8 @@ paths:
$ref: "#/components/responses/Generic403"
"404":
$ref: "#/components/responses/SessionNotFound404"
"429":
$ref: "#/components/responses/Generic429"
"500":
$ref: "#/components/responses/Generic500"
"503":
Expand Down Expand Up @@ -437,6 +432,8 @@ paths:
$ref: "#/components/responses/Generic403"
"404":
$ref: "#/components/responses/SessionNotFound404"
"429":
$ref: "#/components/responses/Generic429"
"500":
$ref: "#/components/responses/Generic500"
"503":
Expand Down Expand Up @@ -929,6 +926,43 @@ components:
code: NOT_FOUND
message: "Session Id does not exist"

SessionInConflict409:
description: Conflict
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
example:
status: 409
code: CONFLICT
message: Conflict with an existing session for the same device.

Generic429:
description: Too Many Requests
headers:
x-correlator:
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
examples:
GENERIC_429_QUOTA_EXCEEDED:
description: Request is rejected due to exceeding a business quota limit
value:
status: 429
code: QUOTA_EXCEEDED
message: Either out of resource quota or reaching rate limiting.
GENERIC_429_TOO_MANY_REQUESTS:
description: API Server request limit is overpassed
value:
status: 429
code: TOO_MANY_REQUESTS
message: Either out of resource quota or reaching rate limiting.

Generic500:
description: Internal server error
headers:
Expand All @@ -952,24 +986,30 @@ components:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
example:
status: 501
code: NOT_IMPLEMENTED
message: "Service not implemented for the specified user device"
examples:
GENERIC_501_NOT_IMPLEMENTED:
description: Service not implemented. The use of this code should be avoided as far as possible to get the objective to reach aligned implementations
value:
status: 501
code: NOT_IMPLEMENTED
message: This functionality is not implemented yet.

Generic503:
description: Service unavailable
description: Service Unavailable
headers:
x-correlator:
$ref: '#/components/headers/x-correlator'
$ref: "#/components/headers/x-correlator"
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorInfo"
example:
status: 503
code: UNAVAILABLE
message: "Service unavailable"
examples:
GENERIC_503_UNAVAILABLE:
description: Service is not available. Temporary situation usually related to maintenance process in the server side
value:
status: 503
code: UNAVAILABLE
message: Service Unavailable.

examples:
SESSION_AVAILABLE_EXAMPLE:
Expand Down

0 comments on commit 552f9de

Please sign in to comment.