diff options
author | neodarz <neodarz@neodarz.net> | 2019-09-11 17:07:53 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2019-09-11 17:07:53 +0200 |
commit | e7446855b668d84be6f516ffe94e71fb88f3cc56 (patch) | |
tree | 334a213338076c5c0b3c6dd8afe3c4aac7f3eed5 /api | |
parent | cafab1abb5912100b2e1ddccb753ccb5d7c9972f (diff) | |
download | umosapicpp-e7446855b668d84be6f516ffe94e71fb88f3cc56.tar.xz umosapicpp-e7446855b668d84be6f516ffe94e71fb88f3cc56.zip |
Add doc about 200 and 500 error on some endpoints
Diffstat (limited to '')
-rw-r--r-- | api/umosapi.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/api/umosapi.cpp b/api/umosapi.cpp index ee2705d..1bdd077 100644 --- a/api/umosapi.cpp +++ b/api/umosapi.cpp @@ -276,6 +276,8 @@ void UmosapiService::Api::createResource() { UmosapiService::Api::set_path("/v2/ready"); UmosapiService::Api::set_method_handler("GET", is_ready); UmosapiService::Api::produce("application/json"); + UmosapiService::Api::response("200", "All is fine"); + UmosapiService::Api::response("500", "Backend is dead"); UmosapiService::Api::publish(); UmosapiService::Api::set_path("/v2/{mcollection: .*}"); @@ -283,12 +285,14 @@ void UmosapiService::Api::createResource() { UmosapiService::Api::produce("application/json"); UmosapiService::Api::parameter("mcollection", "Name of the collection where the uobject are located"); UmosapiService::Api::response("200", "All is fine", "UObject", "array"); + UmosapiService::Api::response("500", "Backend is dead"); UmosapiService::Api::set_error_handler(&resource_error_handler); UmosapiService::Api::set_method_handler("POST", addUObject); UmosapiService::Api::consume("application/json"); UmosapiService::Api::parameter("mcollection", "Name of the collection where the uobject are located"); UmosapiService::Api::parameter("body", "UObject to add", "UObjectSended"); UmosapiService::Api::response("200", "All is fine", "UObject"); + UmosapiService::Api::response("500", "Backend is dead"); UmosapiService::Api::set_error_handler(&resource_error_handler); UmosapiService::Api::publish(); @@ -298,6 +302,7 @@ void UmosapiService::Api::createResource() { UmosapiService::Api::parameter("mcollection", "Name of the collection where the uobject are located" ); UmosapiService::Api::parameter("oid", "MongoDB oid of the uobject"); UmosapiService::Api::response("200", "All is fine", "UObject"); + UmosapiService::Api::response("500", "Backend is dead"); UmosapiService::Api::set_error_handler(&resource_error_handler); UmosapiService::Api::publish(); @@ -308,6 +313,7 @@ void UmosapiService::Api::createResource() { UmosapiService::Api::parameter("key", "Key of uobject to search, ex: kill or total.kill"); UmosapiService::Api::parameter("value", "Value of uobject to search, ex: 42"); UmosapiService::Api::response("200", "All is fine", "UObject"); + UmosapiService::Api::response("500", "Backend is dead"); UmosapiService::Api::set_error_handler(&resource_error_handler); UmosapiService::Api::publish(); |