[asterisk-commits] kharwell: branch 12 r402560 - in /branches/12: res/ res/ari/ rest-api/ rest-a...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Nov 8 11:39:45 CST 2013


Author: kharwell
Date: Fri Nov  8 11:39:43 2013
New Revision: 402560

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=402560
Log:
ARI playback: Rename ARI Playback to Playbacks

Before playback was the only non plural resource.  It has been renamed to
playbacks for consistency.

(closes issue ASTERISK-22737)
Reported by: Paul Belanger

Added:
    branches/12/res/ari/resource_playbacks.c
      - copied, changed from r402546, branches/12/res/ari/resource_playback.c
    branches/12/res/ari/resource_playbacks.h
      - copied, changed from r402546, branches/12/res/ari/resource_playback.h
    branches/12/res/res_ari_playbacks.c
      - copied, changed from r402546, branches/12/res/res_ari_playback.c
    branches/12/rest-api/api-docs/playbacks.json
      - copied, changed from r402546, branches/12/rest-api/api-docs/playback.json
Removed:
    branches/12/res/ari/resource_playback.c
    branches/12/res/ari/resource_playback.h
    branches/12/res/res_ari_playback.c
    branches/12/rest-api/api-docs/playback.json
Modified:
    branches/12/res/ari.make
    branches/12/rest-api/resources.json

Modified: branches/12/res/ari.make
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/ari.make?view=diff&rev=402560&r1=402559&r2=402560
==============================================================================
--- branches/12/res/ari.make (original)
+++ branches/12/res/ari.make Fri Nov  8 11:39:43 2013
@@ -41,9 +41,9 @@
 
 ari/resource_sounds.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ari_sounds)
 
-res_ari_playback.so: ari/resource_playback.o
+res_ari_playbacks.so: ari/resource_playbacks.o
 
-ari/resource_playback.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ari_playback)
+ari/resource_playbacks.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ari_playbacks)
 
 res_ari_events.so: ari/resource_events.o
 

Copied: branches/12/res/ari/resource_playbacks.c (from r402546, branches/12/res/ari/resource_playback.c)
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/ari/resource_playbacks.c?view=diff&rev=402560&p1=branches/12/res/ari/resource_playback.c&r1=402546&p2=branches/12/res/ari/resource_playbacks.c&r2=402560
==============================================================================
--- branches/12/res/ari/resource_playback.c (original)
+++ branches/12/res/ari/resource_playbacks.c Fri Nov  8 11:39:43 2013
@@ -18,7 +18,7 @@
 
 /*! \file
  *
- * \brief /api-docs/playback.{format} implementation- Playback control resources
+ * \brief /api-docs/playbacks.{format} implementation- Playback control resources
  *
  * \author David M. Lee, II <dlee at digium.com>
  */
@@ -28,10 +28,10 @@
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 #include "asterisk/stasis_app_playback.h"
-#include "resource_playback.h"
+#include "resource_playbacks.h"
 
-void ast_ari_playback_get(struct ast_variable *headers,
-	struct ast_ari_playback_get_args *args,
+void ast_ari_playbacks_get(struct ast_variable *headers,
+	struct ast_ari_playbacks_get_args *args,
 	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_app_playback *, playback, NULL, ao2_cleanup);
@@ -53,8 +53,8 @@
 
 	ast_ari_response_ok(response, ast_json_ref(json));
 }
-void ast_ari_playback_stop(struct ast_variable *headers,
-	struct ast_ari_playback_stop_args *args,
+void ast_ari_playbacks_stop(struct ast_variable *headers,
+	struct ast_ari_playbacks_stop_args *args,
 	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_app_playback *, playback, NULL, ao2_cleanup);
@@ -84,8 +84,8 @@
 		return;
 	}
 }
-void ast_ari_playback_control(struct ast_variable *headers,
-	struct ast_ari_playback_control_args *args,
+void ast_ari_playbacks_control(struct ast_variable *headers,
+	struct ast_ari_playbacks_control_args *args,
 	struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_app_playback *, playback, NULL, ao2_cleanup);

Copied: branches/12/res/ari/resource_playbacks.h (from r402546, branches/12/res/ari/resource_playback.h)
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/ari/resource_playbacks.h?view=diff&rev=402560&p1=branches/12/res/ari/resource_playback.h&r1=402546&p2=branches/12/res/ari/resource_playbacks.h&r2=402560
==============================================================================
--- branches/12/res/ari/resource_playback.h (original)
+++ branches/12/res/ari/resource_playbacks.h Fri Nov  8 11:39:43 2013
@@ -40,7 +40,7 @@
 #include "asterisk/ari.h"
 
 /*! \brief Argument struct for ast_ari_playback_get() */
-struct ast_ari_playback_get_args {
+struct ast_ari_playbacks_get_args {
 	/*! \brief Playback's id */
 	const char *playback_id;
 };
@@ -51,9 +51,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_playback_get(struct ast_variable *headers, struct ast_ari_playback_get_args *args, struct ast_ari_response *response);
+void ast_ari_playbacks_get(struct ast_variable *headers, struct ast_ari_playbacks_get_args *args, struct ast_ari_response *response);
 /*! \brief Argument struct for ast_ari_playback_stop() */
-struct ast_ari_playback_stop_args {
+struct ast_ari_playbacks_stop_args {
 	/*! \brief Playback's id */
 	const char *playback_id;
 };
@@ -64,9 +64,9 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_playback_stop(struct ast_variable *headers, struct ast_ari_playback_stop_args *args, struct ast_ari_response *response);
+void ast_ari_playbacks_stop(struct ast_variable *headers, struct ast_ari_playbacks_stop_args *args, struct ast_ari_response *response);
 /*! \brief Argument struct for ast_ari_playback_control() */
-struct ast_ari_playback_control_args {
+struct ast_ari_playbacks_control_args {
 	/*! \brief Playback's id */
 	const char *playback_id;
 	/*! \brief Operation to perform on the playback. */
@@ -79,6 +79,6 @@
  * \param args Swagger parameters
  * \param[out] response HTTP response
  */
-void ast_ari_playback_control(struct ast_variable *headers, struct ast_ari_playback_control_args *args, struct ast_ari_response *response);
+void ast_ari_playbacks_control(struct ast_variable *headers, struct ast_ari_playbacks_control_args *args, struct ast_ari_response *response);
 
 #endif /* _ASTERISK_RESOURCE_PLAYBACK_H */

Copied: branches/12/res/res_ari_playbacks.c (from r402546, branches/12/res/res_ari_playback.c)
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_ari_playbacks.c?view=diff&rev=402560&p1=branches/12/res/res_ari_playback.c&r1=402546&p2=branches/12/res/res_ari_playbacks.c&r2=402560
==============================================================================
--- branches/12/res/res_ari_playback.c (original)
+++ branches/12/res/res_ari_playbacks.c Fri Nov  8 11:39:43 2013
@@ -44,7 +44,7 @@
 #include "asterisk/app.h"
 #include "asterisk/module.h"
 #include "asterisk/stasis_app.h"
-#include "ari/resource_playback.h"
+#include "ari/resource_playbacks.h"
 #if defined(AST_DEVMODE)
 #include "ari/ari_model_validators.h"
 #endif
@@ -52,17 +52,17 @@
 #define MAX_VALS 128
 
 /*!
- * \brief Parameter parsing callback for /playback/{playbackId}.
+ * \brief Parameter parsing callback for /playbacks/{playbackId}.
  * \param get_params GET parameters in the HTTP request.
  * \param path_vars Path variables extracted from the request.
  * \param headers HTTP headers.
  * \param[out] response Response to the HTTP request.
  */
-static void ast_ari_playback_get_cb(
+static void ast_ari_playbacks_get_cb(
 	struct ast_variable *get_params, struct ast_variable *path_vars,
 	struct ast_variable *headers, struct ast_ari_response *response)
 {
-	struct ast_ari_playback_get_args args = {};
+	struct ast_ari_playbacks_get_args args = {};
 	struct ast_variable *i;
 #if defined(AST_DEVMODE)
 	int is_valid;
@@ -75,7 +75,7 @@
 		} else
 		{}
 	}
-	ast_ari_playback_get(headers, &args, response);
+	ast_ari_playbacks_get(headers, &args, response);
 #if defined(AST_DEVMODE)
 	code = response->response_code;
 
@@ -93,13 +93,13 @@
 			is_valid = ast_ari_validate_playback(
 				response->message);
 		} else {
-			ast_log(LOG_ERROR, "Invalid error response %d for /playback/{playbackId}\n", code);
+			ast_log(LOG_ERROR, "Invalid error response %d for /playbacks/{playbackId}\n", code);
 			is_valid = 0;
 		}
 	}
 
 	if (!is_valid) {
-		ast_log(LOG_ERROR, "Response validation failed for /playback/{playbackId}\n");
+		ast_log(LOG_ERROR, "Response validation failed for /playbacks/{playbackId}\n");
 		ast_ari_response_error(response, 500,
 			"Internal Server Error", "Response validation failed");
 	}
@@ -109,17 +109,17 @@
 	return;
 }
 /*!
- * \brief Parameter parsing callback for /playback/{playbackId}.
+ * \brief Parameter parsing callback for /playbacks/{playbackId}.
  * \param get_params GET parameters in the HTTP request.
  * \param path_vars Path variables extracted from the request.
  * \param headers HTTP headers.
  * \param[out] response Response to the HTTP request.
  */
-static void ast_ari_playback_stop_cb(
+static void ast_ari_playbacks_stop_cb(
 	struct ast_variable *get_params, struct ast_variable *path_vars,
 	struct ast_variable *headers, struct ast_ari_response *response)
 {
-	struct ast_ari_playback_stop_args args = {};
+	struct ast_ari_playbacks_stop_args args = {};
 	struct ast_variable *i;
 #if defined(AST_DEVMODE)
 	int is_valid;
@@ -132,7 +132,7 @@
 		} else
 		{}
 	}
-	ast_ari_playback_stop(headers, &args, response);
+	ast_ari_playbacks_stop(headers, &args, response);
 #if defined(AST_DEVMODE)
 	code = response->response_code;
 
@@ -150,13 +150,13 @@
 			is_valid = ast_ari_validate_void(
 				response->message);
 		} else {
-			ast_log(LOG_ERROR, "Invalid error response %d for /playback/{playbackId}\n", code);
+			ast_log(LOG_ERROR, "Invalid error response %d for /playbacks/{playbackId}\n", code);
 			is_valid = 0;
 		}
 	}
 
 	if (!is_valid) {
-		ast_log(LOG_ERROR, "Response validation failed for /playback/{playbackId}\n");
+		ast_log(LOG_ERROR, "Response validation failed for /playbacks/{playbackId}\n");
 		ast_ari_response_error(response, 500,
 			"Internal Server Error", "Response validation failed");
 	}
@@ -166,17 +166,17 @@
 	return;
 }
 /*!
- * \brief Parameter parsing callback for /playback/{playbackId}/control.
+ * \brief Parameter parsing callback for /playbacks/{playbackId}/control.
  * \param get_params GET parameters in the HTTP request.
  * \param path_vars Path variables extracted from the request.
  * \param headers HTTP headers.
  * \param[out] response Response to the HTTP request.
  */
-static void ast_ari_playback_control_cb(
+static void ast_ari_playbacks_control_cb(
 	struct ast_variable *get_params, struct ast_variable *path_vars,
 	struct ast_variable *headers, struct ast_ari_response *response)
 {
-	struct ast_ari_playback_control_args args = {};
+	struct ast_ari_playbacks_control_args args = {};
 	struct ast_variable *i;
 #if defined(AST_DEVMODE)
 	int is_valid;
@@ -195,7 +195,7 @@
 		} else
 		{}
 	}
-	ast_ari_playback_control(headers, &args, response);
+	ast_ari_playbacks_control(headers, &args, response);
 #if defined(AST_DEVMODE)
 	code = response->response_code;
 
@@ -215,13 +215,13 @@
 			is_valid = ast_ari_validate_void(
 				response->message);
 		} else {
-			ast_log(LOG_ERROR, "Invalid error response %d for /playback/{playbackId}/control\n", code);
+			ast_log(LOG_ERROR, "Invalid error response %d for /playbacks/{playbackId}/control\n", code);
 			is_valid = 0;
 		}
 	}
 
 	if (!is_valid) {
-		ast_log(LOG_ERROR, "Response validation failed for /playback/{playbackId}/control\n");
+		ast_log(LOG_ERROR, "Response validation failed for /playbacks/{playbackId}/control\n");
 		ast_ari_response_error(response, 500,
 			"Internal Server Error", "Response validation failed");
 	}
@@ -231,46 +231,46 @@
 	return;
 }
 
-/*! \brief REST handler for /api-docs/playback.{format} */
-static struct stasis_rest_handlers playback_playbackId_control = {
+/*! \brief REST handler for /api-docs/playbacks.{format} */
+static struct stasis_rest_handlers playbacks_playbackId_control = {
 	.path_segment = "control",
 	.callbacks = {
-		[AST_HTTP_POST] = ast_ari_playback_control_cb,
+		[AST_HTTP_POST] = ast_ari_playbacks_control_cb,
 	},
 	.num_children = 0,
 	.children = {  }
 };
-/*! \brief REST handler for /api-docs/playback.{format} */
-static struct stasis_rest_handlers playback_playbackId = {
+/*! \brief REST handler for /api-docs/playbacks.{format} */
+static struct stasis_rest_handlers playbacks_playbackId = {
 	.path_segment = "playbackId",
 	.is_wildcard = 1,
 	.callbacks = {
-		[AST_HTTP_GET] = ast_ari_playback_get_cb,
-		[AST_HTTP_DELETE] = ast_ari_playback_stop_cb,
+		[AST_HTTP_GET] = ast_ari_playbacks_get_cb,
+		[AST_HTTP_DELETE] = ast_ari_playbacks_stop_cb,
 	},
 	.num_children = 1,
-	.children = { &playback_playbackId_control, }
+	.children = { &playbacks_playbackId_control, }
 };
-/*! \brief REST handler for /api-docs/playback.{format} */
-static struct stasis_rest_handlers playback = {
-	.path_segment = "playback",
+/*! \brief REST handler for /api-docs/playbacks.{format} */
+static struct stasis_rest_handlers playbacks = {
+	.path_segment = "playbacks",
 	.callbacks = {
 	},
 	.num_children = 1,
-	.children = { &playback_playbackId, }
+	.children = { &playbacks_playbackId, }
 };
 
 static int load_module(void)
 {
 	int res = 0;
 	stasis_app_ref();
-	res |= ast_ari_add_handler(&playback);
+	res |= ast_ari_add_handler(&playbacks);
 	return res;
 }
 
 static int unload_module(void)
 {
-	ast_ari_remove_handler(&playback);
+	ast_ari_remove_handler(&playbacks);
 	stasis_app_unref();
 	return 0;
 }

Copied: branches/12/rest-api/api-docs/playbacks.json (from r402546, branches/12/rest-api/api-docs/playback.json)
URL: http://svnview.digium.com/svn/asterisk/branches/12/rest-api/api-docs/playbacks.json?view=diff&rev=402560&p1=branches/12/rest-api/api-docs/playback.json&r1=402546&p2=branches/12/rest-api/api-docs/playbacks.json&r2=402560
==============================================================================
--- branches/12/rest-api/api-docs/playback.json (original)
+++ branches/12/rest-api/api-docs/playbacks.json Fri Nov  8 11:39:43 2013
@@ -5,10 +5,10 @@
 	"apiVersion": "0.0.1",
 	"swaggerVersion": "1.1",
 	"basePath": "http://localhost:8088/stasis",
-	"resourcePath": "/api-docs/playback.{format}",
+	"resourcePath": "/api-docs/playbacks.{format}",
 	"apis": [
 		{
-			"path": "/playback/{playbackId}",
+			"path": "/playbacks/{playbackId}",
 			"description": "Control object for a playback operation.",
 			"operations": [
 				{
@@ -58,7 +58,7 @@
 			]
 		},
 		{
-			"path": "/playback/{playbackId}/control",
+			"path": "/playbacks/{playbackId}/control",
 			"description": "Control object for a playback operation.",
 			"operations": [
 				{

Modified: branches/12/rest-api/resources.json
URL: http://svnview.digium.com/svn/asterisk/branches/12/rest-api/resources.json?view=diff&rev=402560&r1=402559&r2=402560
==============================================================================
--- branches/12/rest-api/resources.json (original)
+++ branches/12/rest-api/resources.json Fri Nov  8 11:39:43 2013
@@ -31,7 +31,7 @@
 			"description": "Sound resources"
 		},
 		{
-			"path": "/api-docs/playback.{format}",
+			"path": "/api-docs/playbacks.{format}",
 			"description": "Playback control resources"
 		},
 		{




More information about the asterisk-commits mailing list