From 93e0724fffcd3d13134b0cd8f97d624e654b286b Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 15 Aug 2014 21:51:32 +0530 Subject: server: Use the /api/ prefix for the REST API --- REST-API | 14 +++++++------- TESTING | 2 +- src/main.c | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/REST-API b/REST-API index ec1c2ca..9fe6dcf 100644 --- a/REST-API +++ b/REST-API @@ -15,25 +15,25 @@ Adding Tokens: -------------- > Adding a token for an HTTP stream - POST http://[host]:8000/add-token?type=http&sessionid=[sessionid] + POST http://[host]:8000/api/add-token?type=http&sessionid=[sessionid] > Adding a token for an RTP-UDP stream on host:port - POST http://[host]:8000/add-token?type=rtp-udp&sessionid=[sessionid]&udp-clients=[host]:[port] + POST http://[host]:8000/api/add-token?type=rtp-udp&sessionid=[sessionid]&udp-clients=[host]:[port] > Adding a token for an HTTP stream and RTP-UDP streams on host1:port1,host2:port2 - POST http://[host]:8000/add-token?type=http,rtp-udp&sessionid=[sessionid]&udp-clients=[host1]:[port1],[host2]:[port2] + POST http://[host]:8000/api/add-token?type=http,rtp-udp&sessionid=[sessionid]&udp-clients=[host1]:[port1],[host2]:[port2] Revoking Tokens: ---------------- > Revoking a token - DELETE http://[host]:8000/revoke-token?sessionid=[sessionid] + DELETE http://[host]:8000/api/revoke-token?sessionid=[sessionid] Listing Tokens: ---------------- > Listing all tokens - GET http://[host]:8000/list-tokens + GET http://[host]:8000/api/list-tokens This will return a JSON array of dicts with the "sessionid", "host", and "port" for each token. @@ -43,7 +43,7 @@ Listing and Aborting Running Streams: ===================================== > Listing all streams - GET http://[host]:8000/list-streams + GET http://[host]:8000/api/list-streams > Aborting a running stream - DELETE http://[host]:8000/abort-stream?sessionid=[sessionid] + DELETE http://[host]:8000/api/abort-stream?sessionid=[sessionid] diff --git a/TESTING b/TESTING index fcc0fcf..38f635f 100644 --- a/TESTING +++ b/TESTING @@ -11,7 +11,7 @@ PUT stream: ----------- $ gst-launch-1.0 -e videotestsrc is-live=TRUE ! videoscale ! \ video/x-raw, height=120, width=160 ! timeoverlay font-desc="80px" ! tee name=t \ - t. ! queue ! videoconvert ! theoraenc ! oggmux ! souphttpclientsink location="http://localhost:8000/somepath" \ + t. ! queue ! videoconvert ! theoraenc ! oggmux ! souphttpclientsink location="http://localhost:8000/somepath?type=http" \ t. ! queue ! videoconvert ! xvimagesink GET stream: diff --git a/src/main.c b/src/main.c index 416e9cd..e3b4ad0 100644 --- a/src/main.c +++ b/src/main.c @@ -31,11 +31,11 @@ #include "debug/local-play.h" #endif -#define STP_REST_LIST_STREAMS "/list-streams" -#define STP_REST_ABORT_STREAM "/abort-stream" -#define STP_REST_ADD_TOKEN "/add-token" -#define STP_REST_REVOKE_TOKEN "/revoke-token" -#define STP_REST_LIST_TOKENS "/list-tokens" +#define STP_REST_LIST_STREAMS "/api/list-streams" +#define STP_REST_ABORT_STREAM "/api/abort-stream" +#define STP_REST_ADD_TOKEN "/api/add-token" +#define STP_REST_REVOKE_TOKEN "/api/revoke-token" +#define STP_REST_LIST_TOKENS "/api/list-tokens" typedef struct _STPHashTables STPHashTables; -- cgit v0.11.2-2-gd1dd