fix: controller discovery now called by PUT

This commit is contained in:
Tobias Reisinger 2020-09-06 13:19:10 +02:00
parent 4b39631765
commit b38c3d61d8
4 changed files with 5 additions and 5 deletions

View file

@ -4,7 +4,7 @@
#include <router.h> #include <router.h>
void void
api_v1_controllers_discover_POST(struct mg_connection *nc, struct http_message *hm, endpoint_args_t *args, endpoint_response_t *response); api_v1_controllers_discover_PUT(struct mg_connection *nc, struct http_message *hm, endpoint_args_t *args, endpoint_response_t *response);
void void
api_v1_controllers_GET(struct mg_connection *nc, struct http_message *hm, endpoint_args_t *args, endpoint_response_t *response); api_v1_controllers_GET(struct mg_connection *nc, struct http_message *hm, endpoint_args_t *args, endpoint_response_t *response);

View file

@ -105,7 +105,7 @@ send_udp_broadcast(const char *addr, uint16_t port, void *message, size_t length
} }
void void
api_v1_controllers_discover_POST(struct mg_connection *nc, struct http_message *hm, endpoint_args_t *args, endpoint_response_t *response) api_v1_controllers_discover_PUT(struct mg_connection *nc, struct http_message *hm, endpoint_args_t *args, endpoint_response_t *response)
{ {
(void)nc; (void)nc;
(void)hm; (void)hm;

View file

@ -72,7 +72,7 @@ router_init()
router_register_endpoint("/api/v1/schedules/{str}", HTTP_METHOD_DELETE, api_v1_schedules_STR_DELETE); router_register_endpoint("/api/v1/schedules/{str}", HTTP_METHOD_DELETE, api_v1_schedules_STR_DELETE);
router_register_endpoint("/api/v1/schedules/tag/{str}", HTTP_METHOD_GET, api_v1_schedules_tag_STR_GET); router_register_endpoint("/api/v1/schedules/tag/{str}", HTTP_METHOD_GET, api_v1_schedules_tag_STR_GET);
router_register_endpoint("/api/v1/controllers/discover/", HTTP_METHOD_POST, api_v1_controllers_discover_POST); router_register_endpoint("/api/v1/controllers/discover/", HTTP_METHOD_PUT, api_v1_controllers_discover_PUT);
router_register_endpoint("/api/v1/controllers/", HTTP_METHOD_GET, api_v1_controllers_GET); router_register_endpoint("/api/v1/controllers/", HTTP_METHOD_GET, api_v1_controllers_GET);
router_register_endpoint("/api/v1/controllers/{str}", HTTP_METHOD_GET, api_v1_controllers_STR_GET); router_register_endpoint("/api/v1/controllers/{str}", HTTP_METHOD_GET, api_v1_controllers_STR_GET);
router_register_endpoint("/api/v1/controllers/{str}", HTTP_METHOD_PUT, api_v1_controllers_STR_PUT); router_register_endpoint("/api/v1/controllers/{str}", HTTP_METHOD_PUT, api_v1_controllers_STR_PUT);

View file

@ -3,7 +3,7 @@ test_name: Test basic controller functions
stages: stages:
- name: "[controllers_basic] discover controllers" - name: "[controllers_basic] discover controllers"
request: request:
method: POST method: PUT
url: "http://localhost:5000/api/v1/controllers/discover/" url: "http://localhost:5000/api/v1/controllers/discover/"
response: response:
status_code: 200 status_code: 200
@ -86,7 +86,7 @@ stages:
- name: "[controllers_basic] discover controllers again" - name: "[controllers_basic] discover controllers again"
request: request:
method: POST method: PUT
url: "http://localhost:5000/api/v1/controllers/discover/" url: "http://localhost:5000/api/v1/controllers/discover/"
response: response:
status_code: 200 status_code: 200