Skip to content

Commit fe1c894

Browse files
authored
Status code 415 is not documented (#203) (#250)
* Status code 415 is not documented (#203) Adds documention of HTTP status code 415. * Status code 415 added to table of codes
1 parent 60a53e4 commit fe1c894

File tree

1 file changed

+45
-51
lines changed

1 file changed

+45
-51
lines changed

wiki/markdown/statusCodes.md

Lines changed: 45 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@ The response generated will have internal status codes for each and every event
33

44
Status codes are generated according to the below tables.
55

6-
## Internal status codes
6+
## Status codes
77

8-
Below is the status codes:
8+
Status codes returned by `/versions` and `/producer/msg` operations.
9+
Note, that status codes of operation `/generateAndPublish` are listed [below](#status-codes-related-to-failures-in-eiffel-remrem-generate-service).
910

10-
| Status code | Result | Message | Comment |
11-
|-------------|-------------------------------|-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
12-
| 200 | SUCCESS | Event sent successfully | Is returned if the request is completed successfully. |
11+
| Status code | Result | Message | Comment |
12+
|-------------|-------------------------------|-------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
13+
| 200 | SUCCESS | Event sent successfully | Is returned if the request is completed successfully. |
1314
| 207 | Multi-Status | | Is returned if we have a mix of internal status codes. Eg: publish of few events was successful and few events was a failure. In case of multiple events in the body JSON, if a event is given internal status code of 400 or 500 rest events will not be published and will be given a internal status code of 503, which will result in overall HTTP response code of 207. |
14-
| 400 | Bad Request | Invalid event content, client need to fix problem in event before submitting again. | Is returned if the request body JSON is malformed. Eg: unable to parse the body JSON. |
15-
| 404 | RabbitMQ properties not found | RabbitMQ properties not configured for the protocol <protocol> | Is returned if RabbitMQ message broker properties are not found for the protocol used by event. |
16-
| 500 | Internal Server Error | RabbitMQ is down. Please try later | Is returned if RabbitMQ is down. |
17-
| | | Could not prepare Routing key to publish message. | Is returned if could not prepare routing key to publish the eiffel event. |
18-
| 503 | Service Unavailable | Please check previous event and try again later | Is returned if there is a failure in publishing previous event with status code 400, 404 or 500.
19-
| 504 | Gateway Timeout | Time out waiting for ACK | Is returned if event is not confirmed within waitForConfirmsTimeout. |
15+
| 400 | Bad Request | Invalid event content, client need to fix problem in event before submitting again. | Is returned if the request body JSON is malformed. Eg: unable to parse the body JSON. |
16+
| 404 | RabbitMQ properties not found | RabbitMQ properties not configured for the protocol <protocol> | Is returned if RabbitMQ message broker properties are not found for the protocol used by event. |
17+
| 415 | Unsupported Media Type | Content type `<content-type>` not supported | Indicates that the server refuses to accept the request because the payload format is in an unsupported format. |
18+
| 500 | Internal Server Error | RabbitMQ is down. Please try later | Is returned if RabbitMQ is down. |
19+
| | | Could not prepare Routing key to publish message. | Is returned if could not prepare routing key to publish the eiffel event. |
20+
| 503 | Service Unavailable | Please check previous event and try again later | Is returned if there is a failure in publishing previous event with status code 400, 404 or 500. |
2021

2122
### Status codes explanation
2223

@@ -89,68 +90,43 @@ RabbitMQ properties not configured in tomcat/conf/config.properties file for the
8990
]
9091
```
9192

92-
**500 Internal Server Error**
93+
**415 Unsupported Media Type**
9394

94-
Cannot prepare routing key.
95+
Server refuses to accept the request because the payload format is in an unsupported format.
9596

9697
```
97-
[
98-
{
99-
"status_code": 500,
100-
"result": "Internal Server Error",
101-
"message": "Could not prepare Routing key to publish message"
102-
}
103-
]
98+
{
99+
"timestamp": "Sep 9, 2022 2:56:07 PM",
100+
"status": 415,
101+
"error": "Unsupported Media Type",
102+
"message": "Content type \u0027unsupported;charset\u003dUTF-8\u0027 not supported",
103+
"path": "/publish/producer/msg"
104+
}
104105
```
105106

106-
Event is failed to send because of internal server error.
107+
**500 Internal Server Error**
107108

108-
```
109-
[
110-
{
111-
"id": "9cdd0f68-df85-44b0-88bd-fc4163ac90a0",
112-
"status_code": 500,
113-
"result": "Internal Server Error",
114-
"message": "RabbitMQ is down. Please try later"
115-
}
116-
]
117-
```
118-
When previous Event is failed to send because of Gateway Timeout.
109+
Cannot prepare routing key.
119110

120111
```
121112
[
122113
{
123-
"id": "9cdd0f68-df85-44b0-88bd-fc4163ac90a0",
124114
"status_code": 500,
125115
"result": "Internal Server Error",
126-
"message": "Channel was closed for Rabbitmq connection <hostaddress>"
116+
"message": "Could not prepare Routing key to publish message"
127117
}
128118
]
129119
```
130120

131-
When message is nack-ed i.e broker could not take care of it for some reason.
121+
Event is failed to send because of internal server error.
132122

133123
```
134124
[
135125
{
136126
"id": "9cdd0f68-df85-44b0-88bd-fc4163ac90a0",
137127
"status_code": 500,
138128
"result": "Internal Server Error",
139-
"message": "Message is nacked"
140-
}
141-
]
142-
```
143-
144-
**504 Gateway Timeout**
145-
146-
Event is not confirmed by RabbitMq within specified waitForConfirmsTimeout.
147-
148-
```
149-
[
150-
{
151-
"status_code": 504,
152-
"result": "Gateway Timeout",
153-
"message": "Time out waiting for ACK"
129+
"message": "RabbitMQ is down. Please try later"
154130
}
155131
]
156132
```
@@ -209,6 +185,7 @@ These response can be generated only when `/generateAndPublish` endpoint is used
209185
| 400 | Bad Request | Malformed JSON or incorrect type of event | Is returned if the request body JSON is malformed or entered incorrect type of event. |
210186
| 401 | Unauthorized | Unauthorized. Please, check if LDAP for REMReM Generate Service is disabled | Is returned if LDAP for REMReM Generate Service is enabled and REMReM Generate Publish have not access to it. |
211187
| 406 | Not Acceptable | No event id found with ERLookup properties | Is returned if no event id fetched from configured event repository in REMReM generate. |
188+
| 415 | Unsupported Media Type| Content type `<content-type>` not supported | Indicates that the server refuses to accept the request because the payload format is in an unsupported format. |
212189
| 417 | Expectation Failed | Multiple event ids found with ERLookup properties | Is returned if multiple event ids fetched from configured event repository in REMReM generate. |
213190
| 422 | Unprocessable Entity | Link specific lookup options could not be fulfilled | Is returned if Link specific lookup options could not be matched with failIfMultipleFound and failIfNoneFound. |
214191
| 500 | Internal Server Error | Internal server error in Generate Service | Is returned if REMReM Generate Service is not started or in case of others internal errors in REMReM Generate Service. |
@@ -258,7 +235,23 @@ The Lookup properties with no event id fetched from configured event repository
258235
]
259236
```
260237

238+
**415 Unsupported Media Type**
239+
240+
Server refuses to accept the request because the payload format is in an unsupported format.
241+
242+
```
243+
{
244+
"timestamp": "Sep 9, 2022 2:56:07 PM",
245+
"status": 415,
246+
"error": "Unsupported Media Type",
247+
"message": "Content type \u0027unsupported;charset\u003dUTF-8\u0027 not supported",
248+
"path": "/publish/producer/msg"
249+
}
250+
```
251+
252+
261253
**417 Expectation Failed**
254+
262255
The Lookup properties with multiple event ids fetched from configured event repository in generate , REMReM fails to generate.
263256

264257
```
@@ -272,6 +265,7 @@ The Lookup properties with multiple event ids fetched from configured event repo
272265
```
273266

274267
**422 Unprocessable Entity**
268+
275269
The link specific lookup options could not be matched with failIfMultipleFound and failIfNoneFound in generate , REMReM fails to generate.
276270

277271
```
@@ -310,4 +304,4 @@ There is no such message protocol loaded..
310304
"message": "No protocol service has been found registered"
311305
}
312306
]
313-
```
307+
```

0 commit comments

Comments
 (0)