Difference between revisions of "Zaqar/specs/api/v1/responsecodes"
< Zaqar | specs/api/v1
(→Get Queue Stats) |
m (Malini moved page Marconi/specs/api/v1/responsecodes to Zaqar/specs/api/v1/responsecodes: Project Rename) |
||
(71 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | * In | + | * In case of error, the response body will have a message appropriate to the scenario |
− | * Any http operation , other than the specified will return a | + | * Any http operation , other than the specified will return a 405 (?) |
=== '''Create Queue ''' === | === '''Create Queue ''' === | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! | + | ! Scenario !! HTTP Response Code |
|- | |- | ||
− | | | + | |Success (Created) || 201 |
|- | |- | ||
− | | | + | |Success (Already exists) || 204 |
+ | |- | ||
+ | | Queue has a long name (>64 bytes)|| 400 | ||
|- | |- | ||
| Request header has missing fields || 400 | | Request header has missing fields || 400 | ||
|- | |- | ||
| Request header has invalid auth token || 401 | | Request header has invalid auth token || 401 | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
Line 31: | Line 22: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! | + | ! Scenario!! HTTP Response Code !! Notes |
+ | |- | ||
+ | | Success || 200 || | ||
|- | |- | ||
| Request a non existing queue || 404 || | | Request a non existing queue || 404 || | ||
Line 41: | Line 34: | ||
| Request with zero value for limit || 400 || | | Request with zero value for limit || 400 || | ||
|- | |- | ||
− | | Request with non existing value of marker || 204 | + | | Request with non existing value of marker || 200 or 204 || A marker always "exists" in the sense that we can always perform a range comparison with it. In other words, if you pass 'g' for the marker, Marconi will return all queue's whose names sort after 'g', lexicographically. If you pass a marker that sorts after all existing queues, you will receive "204 No Content" in response. |
|- | |- | ||
| Request with non boolean value for metadata || 400 || lowercase true/false? | | Request with non boolean value for metadata || 400 || lowercase true/false? | ||
Line 55: | Line 48: | ||
=== '''Set Queue Metadata ''' === | === '''Set Queue Metadata ''' === | ||
− | + | {| class="wikitable" | |
+ | |- | ||
+ | | Success || 204 | ||
+ | |- | ||
+ | | Request Body is Empty || 400 | ||
+ | |- | ||
+ | | Request header has Accept != "application/json" || 406 | ||
+ | |- | ||
+ | | Request body is >64KB || 400 | ||
+ | |- | ||
+ | | Request body has malformed JSON || 400 | ||
+ | |- | ||
+ | | Request with non JSON body|| 400 | ||
+ | |- | ||
+ | | Request with UTF-16 char JSON body|| | ||
+ | |} | ||
=== '''Get Queue Metadata ''' === | === '''Get Queue Metadata ''' === | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! | + | ! Scenario!! HTTP Response Code |
+ | |- | ||
+ | | Success || 200 | ||
+ | |- | ||
+ | | No metadata exists for the queue || 200 | ||
|- | |- | ||
| Request metadata for a non existing queue || 404 | | Request metadata for a non existing queue || 404 | ||
Line 66: | Line 78: | ||
| Header has Accept != "application/json" || 406 | | Header has Accept != "application/json" || 406 | ||
|- | |- | ||
− | Header has missing fields || 400 | + | | Header has missing fields || 400 |
|- | |- | ||
| Header has invalid auth token|| 401 | | Header has invalid auth token|| 401 | ||
Line 77: | Line 89: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! | + | ! Scenario!! HTTP Response Code |
+ | |- | ||
+ | | Success || 200 | ||
|- | |- | ||
| Request stats for a non existing queue || 404 | | Request stats for a non existing queue || 404 | ||
Line 94: | Line 108: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! | + | ! Scenario!! HTTP Response Code |
+ | |- | ||
+ | | Success || 204 | ||
|- | |- | ||
| Delete a non existing queue || 204 <ref name="ref1"/> | | Delete a non existing queue || 204 <ref name="ref1"/> | ||
|- | |- | ||
− | Header has Accept != "application/json" || 406 | + | | Header has Accept != "application/json" || 406 |
|- | |- | ||
− | Header has missing fields || 400 | + | | Header has missing fields || 400 |
|- | |- | ||
− | Header has invalid auth token|| 401 | + | | Header has invalid auth token|| 401 |
|- | |- | ||
− | URL has invalid params ||200 | + | | URL has invalid params ||200 |
|- | |- | ||
|} | |} | ||
Line 111: | Line 127: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! | + | ! Scenario!! HTTP Response Code |
+ | |- | ||
+ | | Success (query matched 1 or more messages) ||200 | ||
+ | |- | ||
+ | | Success (query has no match) ||204 | ||
|- | |- | ||
| Request message from a non existing queue || 404 | | Request message from a non existing queue || 404 | ||
Line 117: | Line 137: | ||
| Request message with invalid param (something other than marker,limit,echo) || 200 | | Request message with invalid param (something other than marker,limit,echo) || 200 | ||
|- | |- | ||
− | | Request message with limit >100 || | + | | Request message with limit >100 || 400 |
|- | |- | ||
| Request message with limit <= 0 || 400 | | Request message with limit <= 0 || 400 | ||
|- | |- | ||
− | | Request message with non existing marker || | + | | Request message with non existing marker || 204 |
|- | |- | ||
| Request message with non boolean value for echo || 400 | | Request message with non boolean value for echo || 400 | ||
|- | |- | ||
− | Header has Accept != "application/json" || 406 | + | | Header has Accept != "application/json" || 406 |
|- | |- | ||
− | Header has missing fields || 400 | + | | Header has missing fields || 400 |
|- | |- | ||
− | Header has invalid auth token|| 401 | + | | Header has invalid auth token|| 401 |
|- | |- | ||
|} | |} | ||
− | === '''Get | + | === '''Get a Specific Message''' === |
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! | + | ! Scenario!! HTTP Response Code |
|- | |- | ||
− | | | + | | Success (query matched the messages) ||200 |
|- | |- | ||
− | | Request | + | | Request message from a non existing queue || 404 |
|- | |- | ||
− | | Request message | + | | Request a non existing message || 404 |
|- | |- | ||
− | | Request message | + | | Request an expired message || 404 |
|- | |- | ||
− | | | + | | Header has Accept != "application/json" || 406 |
|- | |- | ||
− | Header has | + | | Header has missing fields || 400 |
|- | |- | ||
− | Header has | + | | Header has invalid auth token|| 401 |
|- | |- | ||
− | + | | URL has invalid params ||200 | |
|- | |- | ||
|} | |} | ||
− | === '''Get a | + | === '''Get a Set of Messages By ID''' === |
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! | + | ! Scenario!! HTTP Response Code |
|- | |- | ||
− | | | + | | Success ||200 |
|- | |- | ||
− | | | + | | Partial Success|| |
|- | |- | ||
− | | Request | + | | Request non existing messages || 404 |
|- | |- | ||
− | + | | Request expired messages || 404 | |
|- | |- | ||
− | Header has | + | | Header has Accept != "application/json" || 406 |
|- | |- | ||
− | Header has | + | | Header has missing fields || 400 |
|- | |- | ||
− | URL has invalid params ||200 | + | | Header has invalid auth token|| 401 |
+ | |- | ||
+ | | URL has invalid params ||200 | ||
|- | |- | ||
|} | |} | ||
− | |||
=== '''Post Message(s)''' === | === '''Post Message(s)''' === | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! | + | ! Scenario!! HTTP Response Code |
+ | |- | ||
+ | | Success || 201 | ||
+ | |- | ||
+ | | Post multiple messages in a single request , all of them fails || 503 | ||
+ | |- | ||
+ | | Post multiple messages in a single request , few of them succeed || 201 (with "partial": true) <ref name="postmsg">[https://wiki.openstack.org/wiki/Marconi/specs/api/v1#Post_Message.28s.29 postmessage api wiki]</ref> | ||
|- | |- | ||
| Post message to a non existing queue || 404 | | Post message to a non existing queue || 404 | ||
|- | |- | ||
− | | Post > 100 messages with a single request || | + | | Post > 100 messages with a single request || 400 |
|- | |- | ||
− | |Post with request body > 4KB || | + | |Post with request body > 4KB || 400 |
|- | |- | ||
|Post with invalid JSON request body || 400 | |Post with invalid JSON request body || 400 | ||
|- | |- | ||
− | |Post with non-JSON request body || | + | |Post with non-JSON request body || 400 |
+ | |- | ||
+ | |Post with non-JSON message || 400 | ||
|- | |- | ||
− | |Post with TTL < 60 || | + | |Post with TTL < 60 || 400 |
|- | |- | ||
− | |Post with TTL > 1209600 || | + | |Post with TTL > 1209600 || 400 |
|- | |- | ||
− | |Post with non int value of TTL || | + | |Post with non int value of TTL || 400 |
|- | |- | ||
− | |Post with negative value of TTL || | + | |Post with negative value of TTL || 400 |
|- | |- | ||
|Post without TTL in request body|| 400 | |Post without TTL in request body|| 400 | ||
|- | |- | ||
− | |Post without body in request body|| 400 | + | |Post without "body" in request body|| 400 |
|- | |- | ||
|Post with no request body|| 400 | |Post with no request body|| 400 | ||
|- | |- | ||
− | + | |Post with messages encapsulated in multiple arrays|| 400 | |
|- | |- | ||
− | Header has | + | | Header has Accept != "application/json" || 406 |
|- | |- | ||
− | Header has invalid auth token|| 401 | + | | Header has missing fields || 400 |
+ | |- | ||
+ | | Header has invalid auth token|| 401 | ||
|- | |- | ||
− | URL has invalid params ||200 | + | | URL has invalid params ||200 |
|- | |- | ||
|} | |} | ||
Line 219: | Line 250: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! | + | ! Scenario!! HTTP Response Code |
+ | |- | ||
+ | | Success || 204 | ||
|- | |- | ||
| Delete message from a non existing queue || 204 | | Delete message from a non existing queue || 204 | ||
Line 225: | Line 258: | ||
| Delete a non existing message || 204 | | Delete a non existing message || 204 | ||
|- | |- | ||
− | | Delete with | + | | Delete with expired claim_id || 403 |
|- | |- | ||
− | | Delete with non existing claim_id || | + | | Delete with non existing claim_id || 403 |
|- | |- | ||
− | + | | Delete claimed message without providing a claim_id || 403 | |
|- | |- | ||
− | Header has | + | | Header has Accept != "application/json" || 406 |
|- | |- | ||
− | Header has | + | | Header has missing fields || 400 |
|- | |- | ||
− | URL has invalid params ||200 | + | | Header has invalid auth token|| 401 |
+ | |- | ||
+ | | URL has invalid params ||200 | ||
|- | |- | ||
|} | |} | ||
+ | |||
=== '''Claim Messages''' === | === '''Claim Messages''' === | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! | + | ! Scenario!! HTTP Response Code |
|- | |- | ||
− | | | + | | Success || 200 |
|- | |- | ||
− | | Claim message with invalid value for limit (nonint, <=0 | + | | Success (empty queue with no messages to claim) || 204 |
+ | |- | ||
+ | | Claim message from a non existing queue || 204 | ||
+ | |- | ||
+ | | Claim message with invalid value for limit (nonint, <=0) || 400 | ||
+ | |- | ||
+ | | Claim message with limit >100) || 400 | ||
|- | |- | ||
| Claim message with no request body || 400 | | Claim message with no request body || 400 | ||
|- | |- | ||
− | | Claim message with no TTL field || | + | | Claim message with no TTL field || 400 |
|- | |- | ||
− | | Claim message with invalid TTL value (non int, <=0) || | + | | Claim message with invalid TTL value (non int, <=0) || 400 |
|- | |- | ||
− | | Claim message with invalid JSON || | + | | Claim message with invalid JSON || 400 |
|- | |- | ||
− | | Claim message with non JSON request body || | + | | Claim message with non JSON request body || 400 |
|- | |- | ||
| Claim message with invalid auth token || 401 | | Claim message with invalid auth token || 401 | ||
Line 261: | Line 303: | ||
| Claim message with missing header fields || 400 | | Claim message with missing header fields || 400 | ||
|- | |- | ||
− | Header has Accept != "application/json" || 406 | + | | Header has Accept != "application/json" || 406 |
|- | |- | ||
|} | |} | ||
Line 268: | Line 310: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! | + | ! Scenario!! HTTP Response Code |
+ | |- | ||
+ | | Success || 200 | ||
+ | |- | ||
+ | | Query Expired Claim || 404 | ||
|- | |- | ||
| Query Claim from a non existing queue || 404 | | Query Claim from a non existing queue || 404 | ||
Line 276: | Line 322: | ||
| Query Claim with missing header fields || 400 | | Query Claim with missing header fields || 400 | ||
|- | |- | ||
− | | Query Claim with invalid URL params || | + | | Query Claim with invalid URL params || 200 |
|- | |- | ||
− | | Query Claim with non existing claim_id || | + | | Query Claim with non existing claim_id || 404 |
|- | |- | ||
− | Header has Accept != "application/json" || 406 | + | | Header has Accept != "application/json" || 406 |
|- | |- | ||
|} | |} | ||
+ | |||
=== '''Update Claim''' === | === '''Update Claim''' === | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! | + | ! Scenario!! HTTP Response Code |
+ | |- | ||
+ | | Success || 204 | ||
+ | |- | ||
+ | | Update Expired Claim || 404 | ||
|- | |- | ||
| Update Claim on a non existing queue || 404 | | Update Claim on a non existing queue || 404 | ||
Line 311: | Line 362: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! | + | ! Scenario!! HTTP Response Code |
+ | |- | ||
+ | | Success || 204 | ||
+ | |- | ||
+ | | Release Expired Claim || 204 | ||
|- | |- | ||
| Release Claim from a non existing queue || 404 | | Release Claim from a non existing queue || 404 | ||
Line 323: | Line 378: | ||
| Release Claim with missing header fields || 400 | | Release Claim with missing header fields || 400 | ||
|- | |- | ||
− | Header has Accept != "application/json" || 406 | + | | Header has Accept != "application/json" || 406 |
|- | |- | ||
|} | |} | ||
Line 329: | Line 384: | ||
<references> | <references> | ||
<ref name="ref1">DELETE is an idempotent operation.</ref> | <ref name="ref1">DELETE is an idempotent operation.</ref> | ||
− | |||
− | |||
− | |||
− | |||
</references> | </references> |
Latest revision as of 18:42, 7 August 2014
- In case of error, the response body will have a message appropriate to the scenario
- Any http operation , other than the specified will return a 405 (?)
Contents
Create Queue
Scenario | HTTP Response Code |
---|---|
Success (Created) | 201 |
Success (Already exists) | 204 |
Queue has a long name (>64 bytes) | 400 |
Request header has missing fields | 400 |
Request header has invalid auth token | 401 |
List Queues
Scenario | HTTP Response Code | Notes |
---|---|---|
Success | 200 | |
Request a non existing queue | 404 | |
URL has invalid param (something other than limit,marker,metadata) | 200 | Extra params are ignored. |
Request with negative value for limit | 400 | |
Request with zero value for limit | 400 | |
Request with non existing value of marker | 200 or 204 | A marker always "exists" in the sense that we can always perform a range comparison with it. In other words, if you pass 'g' for the marker, Marconi will return all queue's whose names sort after 'g', lexicographically. If you pass a marker that sorts after all existing queues, you will receive "204 No Content" in response. |
Request with non boolean value for metadata | 400 | lowercase true/false? |
Header has Accept != "application/json" | 406 | |
Header has missing fields | 400 | |
Header has invalid auth token | 401 |
Set Queue Metadata
Success | 204 |
Request Body is Empty | 400 |
Request header has Accept != "application/json" | 406 |
Request body is >64KB | 400 |
Request body has malformed JSON | 400 |
Request with non JSON body | 400 |
Request with UTF-16 char JSON body |
Get Queue Metadata
Scenario | HTTP Response Code |
---|---|
Success | 200 |
No metadata exists for the queue | 200 |
Request metadata for a non existing queue | 404 |
Header has Accept != "application/json" | 406 |
Header has missing fields | 400 |
Header has invalid auth token | 401 |
URL has invalid params | 200 |
Get Queue Stats
Scenario | HTTP Response Code |
---|---|
Success | 200 |
Request stats for a non existing queue | 404 |
Header has Accept != "application/json" | 406 |
Header has missing fields | 400 |
Header has invalid auth token | 401 |
URL has invalid params | 200 |
Delete Queue
Scenario | HTTP Response Code |
---|---|
Success | 204 |
Delete a non existing queue | 204 [1] |
Header has Accept != "application/json" | 406 |
Header has missing fields | 400 |
Header has invalid auth token | 401 |
URL has invalid params | 200 |
Get Messages
Scenario | HTTP Response Code |
---|---|
Success (query matched 1 or more messages) | 200 |
Success (query has no match) | 204 |
Request message from a non existing queue | 404 |
Request message with invalid param (something other than marker,limit,echo) | 200 |
Request message with limit >100 | 400 |
Request message with limit <= 0 | 400 |
Request message with non existing marker | 204 |
Request message with non boolean value for echo | 400 |
Header has Accept != "application/json" | 406 |
Header has missing fields | 400 |
Header has invalid auth token | 401 |
Get a Specific Message
Scenario | HTTP Response Code |
---|---|
Success (query matched the messages) | 200 |
Request message from a non existing queue | 404 |
Request a non existing message | 404 |
Request an expired message | 404 |
Header has Accept != "application/json" | 406 |
Header has missing fields | 400 |
Header has invalid auth token | 401 |
URL has invalid params | 200 |
Get a Set of Messages By ID
Scenario | HTTP Response Code |
---|---|
Success | 200 |
Partial Success | |
Request non existing messages | 404 |
Request expired messages | 404 |
Header has Accept != "application/json" | 406 |
Header has missing fields | 400 |
Header has invalid auth token | 401 |
URL has invalid params | 200 |
Post Message(s)
Scenario | HTTP Response Code |
---|---|
Success | 201 |
Post multiple messages in a single request , all of them fails | 503 |
Post multiple messages in a single request , few of them succeed | 201 (with "partial": true) [2] |
Post message to a non existing queue | 404 |
Post > 100 messages with a single request | 400 |
Post with request body > 4KB | 400 |
Post with invalid JSON request body | 400 |
Post with non-JSON request body | 400 |
Post with non-JSON message | 400 |
Post with TTL < 60 | 400 |
Post with TTL > 1209600 | 400 |
Post with non int value of TTL | 400 |
Post with negative value of TTL | 400 |
Post without TTL in request body | 400 |
Post without "body" in request body | 400 |
Post with no request body | 400 |
Post with messages encapsulated in multiple arrays | 400 |
Header has Accept != "application/json" | 406 |
Header has missing fields | 400 |
Header has invalid auth token | 401 |
URL has invalid params | 200 |
Delete Messages
Scenario | HTTP Response Code |
---|---|
Success | 204 |
Delete message from a non existing queue | 204 |
Delete a non existing message | 204 |
Delete with expired claim_id | 403 |
Delete with non existing claim_id | 403 |
Delete claimed message without providing a claim_id | 403 |
Header has Accept != "application/json" | 406 |
Header has missing fields | 400 |
Header has invalid auth token | 401 |
URL has invalid params | 200 |
Claim Messages
Scenario | HTTP Response Code |
---|---|
Success | 200 |
Success (empty queue with no messages to claim) | 204 |
Claim message from a non existing queue | 204 |
Claim message with invalid value for limit (nonint, <=0) | 400 |
Claim message with limit >100) | 400 |
Claim message with no request body | 400 |
Claim message with no TTL field | 400 |
Claim message with invalid TTL value (non int, <=0) | 400 |
Claim message with invalid JSON | 400 |
Claim message with non JSON request body | 400 |
Claim message with invalid auth token | 401 |
Claim message with missing header fields | 400 |
Header has Accept != "application/json" | 406 |
Query Claim
Scenario | HTTP Response Code |
---|---|
Success | 200 |
Query Expired Claim | 404 |
Query Claim from a non existing queue | 404 |
Query Claim with invalid auth token | 401 |
Query Claim with missing header fields | 400 |
Query Claim with invalid URL params | 200 |
Query Claim with non existing claim_id | 404 |
Header has Accept != "application/json" | 406 |
Update Claim
Scenario | HTTP Response Code |
---|---|
Success | 204 |
Update Expired Claim | 404 |
Update Claim on a non existing queue | 404 |
Update a non existing claim | 404 |
Update claim with invalid URL params | 200 |
Update claim with content-type != application/json-patch | 406 |
Update claim with no request body | 400 |
Update claim with invalid JSON in request body | 400 |
Update claim with non JSON request body | 400 |
Update Claim with invalid auth token | 401 |
Update Claim with missing header fields | 400 |
Release Claim
Scenario | HTTP Response Code |
---|---|
Success | 204 |
Release Expired Claim | 204 |
Release Claim from a non existing queue | 404 |
Release a non existing claim | 204 |
Release claim with invalid URL params | 200 |
Release Claim with invalid auth token | 401 |
Release Claim with missing header fields | 400 |
Header has Accept != "application/json" | 406 |
- ↑ DELETE is an idempotent operation.
- ↑ postmessage api wiki