[asterisk-commits] dlee: branch dlee/stasis-cache-split r395703 - in /team/dlee/stasis-cache-spl...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 29 14:43:21 CDT 2013


Author: dlee
Date: Mon Jul 29 14:43:16 2013
New Revision: 395703

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=395703
Log:
Merge of revisions 395603 from http://svn.asterisk.org/svn/asterisk/trunk

........
Rename everything Stasis-HTTP to ARI

This renames all files and API calls from several variants of
Stasis-HTTP to ARI including:
* Stasis-HTTP -> ARI
* STASIS_HTTP -> ARI
* stasis_http -> ari (ast_ari for global symbols, file names as well)
* stasis http -> ARI

Review: https://reviewboard.asterisk.org/r/2706/
(closes issue ASTERISK-22136)

Added:
    team/dlee/stasis-cache-split/include/asterisk/ari.h
      - copied unchanged from r395603, trunk/include/asterisk/ari.h
    team/dlee/stasis-cache-split/res/ari/
      - copied from r395603, trunk/res/ari/
    team/dlee/stasis-cache-split/res/ari.make
      - copied unchanged from r395603, trunk/res/ari.make
    team/dlee/stasis-cache-split/res/res_ari.c
      - copied unchanged from r395603, trunk/res/res_ari.c
    team/dlee/stasis-cache-split/res/res_ari.exports.in
      - copied unchanged from r395603, trunk/res/res_ari.exports.in
    team/dlee/stasis-cache-split/res/res_ari_asterisk.c
      - copied unchanged from r395603, trunk/res/res_ari_asterisk.c
    team/dlee/stasis-cache-split/res/res_ari_bridges.c
      - copied unchanged from r395603, trunk/res/res_ari_bridges.c
    team/dlee/stasis-cache-split/res/res_ari_channels.c
      - copied unchanged from r395603, trunk/res/res_ari_channels.c
    team/dlee/stasis-cache-split/res/res_ari_endpoints.c
      - copied unchanged from r395603, trunk/res/res_ari_endpoints.c
    team/dlee/stasis-cache-split/res/res_ari_events.c
      - copied unchanged from r395603, trunk/res/res_ari_events.c
    team/dlee/stasis-cache-split/res/res_ari_playback.c
      - copied unchanged from r395603, trunk/res/res_ari_playback.c
    team/dlee/stasis-cache-split/res/res_ari_recordings.c
      - copied unchanged from r395603, trunk/res/res_ari_recordings.c
    team/dlee/stasis-cache-split/res/res_ari_sounds.c
      - copied unchanged from r395603, trunk/res/res_ari_sounds.c
    team/dlee/stasis-cache-split/rest-api-templates/ari.make.mustache
      - copied unchanged from r395603, trunk/rest-api-templates/ari.make.mustache
    team/dlee/stasis-cache-split/rest-api-templates/ari_resource.c.mustache
      - copied unchanged from r395603, trunk/rest-api-templates/ari_resource.c.mustache
    team/dlee/stasis-cache-split/rest-api-templates/ari_resource.h.mustache
      - copied unchanged from r395603, trunk/rest-api-templates/ari_resource.h.mustache
    team/dlee/stasis-cache-split/rest-api-templates/res_ari_resource.c.mustache
      - copied unchanged from r395603, trunk/rest-api-templates/res_ari_resource.c.mustache
    team/dlee/stasis-cache-split/tests/test_ari.c
      - copied unchanged from r395603, trunk/tests/test_ari.c
Removed:
    team/dlee/stasis-cache-split/include/asterisk/stasis_http.h
    team/dlee/stasis-cache-split/res/res_stasis_http.c
    team/dlee/stasis-cache-split/res/res_stasis_http.exports.in
    team/dlee/stasis-cache-split/res/res_stasis_http_asterisk.c
    team/dlee/stasis-cache-split/res/res_stasis_http_bridges.c
    team/dlee/stasis-cache-split/res/res_stasis_http_channels.c
    team/dlee/stasis-cache-split/res/res_stasis_http_endpoints.c
    team/dlee/stasis-cache-split/res/res_stasis_http_events.c
    team/dlee/stasis-cache-split/res/res_stasis_http_playback.c
    team/dlee/stasis-cache-split/res/res_stasis_http_recordings.c
    team/dlee/stasis-cache-split/res/res_stasis_http_sounds.c
    team/dlee/stasis-cache-split/res/stasis_http/
    team/dlee/stasis-cache-split/res/stasis_http.make
    team/dlee/stasis-cache-split/rest-api-templates/res_stasis_http_resource.c.mustache
    team/dlee/stasis-cache-split/rest-api-templates/stasis_http.make.mustache
    team/dlee/stasis-cache-split/rest-api-templates/stasis_http_resource.c.mustache
    team/dlee/stasis-cache-split/rest-api-templates/stasis_http_resource.h.mustache
    team/dlee/stasis-cache-split/tests/test_stasis_http.c
Modified:
    team/dlee/stasis-cache-split/   (props changed)
    team/dlee/stasis-cache-split/configs/ari.conf.sample
    team/dlee/stasis-cache-split/main/stasis_config.c
    team/dlee/stasis-cache-split/res/Makefile
    team/dlee/stasis-cache-split/res/ari/resource_bridges.c
    team/dlee/stasis-cache-split/res/ari/resource_channels.c
    team/dlee/stasis-cache-split/res/ari/resource_endpoints.c
    team/dlee/stasis-cache-split/res/res_ari_model.c
    team/dlee/stasis-cache-split/res/res_ari_model.exports.in
    team/dlee/stasis-cache-split/res/res_statsd.c
    team/dlee/stasis-cache-split/rest-api-templates/ari_model_validators.c.mustache
    team/dlee/stasis-cache-split/rest-api-templates/ari_model_validators.h.mustache
    team/dlee/stasis-cache-split/rest-api-templates/make_ari_stubs.py
    team/dlee/stasis-cache-split/rest-api-templates/rest_handler.mustache
    team/dlee/stasis-cache-split/tests/test_ari_model.c

Propchange: team/dlee/stasis-cache-split/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Jul 29 14:43:16 2013
@@ -1,1 +1,1 @@
-/trunk:1-395588
+/trunk:1-395603

Modified: team/dlee/stasis-cache-split/configs/ari.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/configs/ari.conf.sample?view=diff&rev=395703&r1=395702&r2=395703
==============================================================================
--- team/dlee/stasis-cache-split/configs/ari.conf.sample (original)
+++ team/dlee/stasis-cache-split/configs/ari.conf.sample Mon Jul 29 14:43:16 2013
@@ -1,6 +1,6 @@
 [general]
-enabled = yes		; When set to no, stasis-http support is disabled.
-;pretty = no		; When set to yes, responses from stasis-http are
+enabled = yes		; When set to no, ARI support is disabled.
+;pretty = no		; When set to yes, responses from ARI are
 ;			; formatted to be human readable.
 ;allowed_origins =	; Comma separated list of allowed origins, for
 ;			; Cross-Origin Resource Sharing. May be set to * to

Modified: team/dlee/stasis-cache-split/main/stasis_config.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/main/stasis_config.c?view=diff&rev=395703&r1=395702&r2=395703
==============================================================================
--- team/dlee/stasis-cache-split/main/stasis_config.c (original)
+++ team/dlee/stasis-cache-split/main/stasis_config.c Mon Jul 29 14:43:16 2013
@@ -70,7 +70,7 @@
 	struct stasis_threadpool_conf *threadpool;
 };
 
-/*! \brief Mapping of the stasis http conf struct's globals to the
+/*! \brief Mapping of the stasis conf struct's globals to the
  *         threadpool context in the config file. */
 static struct aco_type threadpool_option = {
         .type = ACO_GLOBAL,

Modified: team/dlee/stasis-cache-split/res/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/res/Makefile?view=diff&rev=395703&r1=395702&r2=395703
==============================================================================
--- team/dlee/stasis-cache-split/res/Makefile (original)
+++ team/dlee/stasis-cache-split/res/Makefile Mon Jul 29 14:43:16 2013
@@ -73,18 +73,18 @@
 ael/pval.o: ael/pval.c
 
 clean::
-	rm -f snmp/*.[oi] ael/*.[oi] ais/*.[oi] stasis_http/*.[oi]
+	rm -f snmp/*.[oi] ael/*.[oi] ais/*.[oi] ari/*.[oi]
 	rm -f res_sip/*.[oi] stasis/*.[oi]
 	rm -f parking/*.o parking/*.i
 
 $(if $(filter res_parking,$(EMBEDDED_MODS)),modules.link,res_parking.so): $(subst .c,.o,$(wildcard parking/*.c))
 $(subst .c,.o,$(wildcard parking/*.c)): _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_parking)
 
-res_stasis_http.so: stasis_http/cli.o stasis_http/config.o stasis_http/ari_websockets.o
-stasis_http/cli.o stasis_http/config.o stasis_http/ari_websockets.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_stasis_http)
+res_ari.so: ari/cli.o ari/config.o ari/ari_websockets.o
+ari/cli.o ari/config.o ari/ari_websockets.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ari)
 
-res_ari_model.so: stasis_http/ari_model_validators.o
-stasis_http/ari_model_validators.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ari_model)
+res_ari_model.so: ari/ari_model_validators.o
+ari/ari_model_validators.o: _ASTCFLAGS+=$(call MOD_ASTCFLAGS,res_ari_model)
 
-# Dependencies for res_stasis_http_*.so are generated, so they're in this file
-include stasis_http.make
+# Dependencies for res_ari_*.so are generated, so they're in this file
+include ari.make

Modified: team/dlee/stasis-cache-split/res/ari/resource_bridges.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/res/ari/resource_bridges.c?view=diff&rev=395703&r1=395603&r2=395703
==============================================================================
--- team/dlee/stasis-cache-split/res/ari/resource_bridges.c (original)
+++ team/dlee/stasis-cache-split/res/ari/resource_bridges.c Mon Jul 29 14:43:16 2013
@@ -448,22 +448,28 @@
 
 void ast_ari_get_bridges(struct ast_variable *headers, struct ast_get_bridges_args *args, struct ast_ari_response *response)
 {
-	RAII_VAR(struct stasis_caching_topic *, caching_topic, NULL, ao2_cleanup);
+	RAII_VAR(struct stasis_cache *, cache, NULL, ao2_cleanup);
 	RAII_VAR(struct ao2_container *, snapshots, NULL, ao2_cleanup);
 	RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
 	struct ao2_iterator i;
 	void *obj;
 
+<<<<<<< HEAD:res/stasis_http/resource_bridges.c
+	cache = ast_bridge_cache();
+	if (!cache) {
+		stasis_http_response_error(
+=======
 	caching_topic = ast_bridge_topic_all_cached();
 	if (!caching_topic) {
 		ast_ari_response_error(
+>>>>>>> stasis-rename:res/ari/resource_bridges.c
 			response, 500, "Internal Server Error",
 			"Message bus not initialized");
 		return;
 	}
-	ao2_ref(caching_topic, +1);
-
-	snapshots = stasis_cache_dump(caching_topic, ast_bridge_snapshot_type());
+	ao2_ref(cache, +1);
+
+	snapshots = stasis_cache_dump(cache, ast_bridge_snapshot_type());
 	if (!snapshots) {
 		ast_ari_response_alloc_failed(response);
 		return;

Modified: team/dlee/stasis-cache-split/res/ari/resource_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/res/ari/resource_channels.c?view=diff&rev=395703&r1=395603&r2=395703
==============================================================================
--- team/dlee/stasis-cache-split/res/ari/resource_channels.c (original)
+++ team/dlee/stasis-cache-split/res/ari/resource_channels.c Mon Jul 29 14:43:16 2013
@@ -466,18 +466,24 @@
 			     struct ast_ari_response *response)
 {
 	RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
-	struct stasis_caching_topic *caching_topic;
+	struct stasis_cache *cache;
 	struct ast_channel_snapshot *snapshot;
 
+<<<<<<< HEAD:res/stasis_http/resource_channels.c
+	cache = ast_channel_cache();
+	if (!cache) {
+		stasis_http_response_error(
+=======
 	caching_topic = ast_channel_topic_all_cached();
 	if (!caching_topic) {
 		ast_ari_response_error(
+>>>>>>> stasis-rename:res/ari/resource_channels.c
 			response, 500, "Internal Server Error",
 			"Message bus not initialized");
 		return;
 	}
 
-	msg = stasis_cache_get(caching_topic, ast_channel_snapshot_type(),
+	msg = stasis_cache_get(cache, ast_channel_snapshot_type(),
 			       args->channel_id);
 	if (!msg) {
 		ast_ari_response_error(
@@ -516,22 +522,28 @@
 			      struct ast_get_channels_args *args,
 			      struct ast_ari_response *response)
 {
-	RAII_VAR(struct stasis_caching_topic *, caching_topic, NULL, ao2_cleanup);
+	RAII_VAR(struct stasis_cache *, cache, NULL, ao2_cleanup);
 	RAII_VAR(struct ao2_container *, snapshots, NULL, ao2_cleanup);
 	RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
 	struct ao2_iterator i;
 	void *obj;
 
+<<<<<<< HEAD:res/stasis_http/resource_channels.c
+	cache = ast_channel_cache();
+	if (!cache) {
+		stasis_http_response_error(
+=======
 	caching_topic = ast_channel_topic_all_cached();
 	if (!caching_topic) {
 		ast_ari_response_error(
+>>>>>>> stasis-rename:res/ari/resource_channels.c
 			response, 500, "Internal Server Error",
 			"Message bus not initialized");
 		return;
 	}
-	ao2_ref(caching_topic, +1);
-
-	snapshots = stasis_cache_dump(caching_topic, ast_channel_snapshot_type());
+	ao2_ref(cache, +1);
+
+	snapshots = stasis_cache_dump(cache, ast_channel_snapshot_type());
 	if (!snapshots) {
 		ast_ari_response_alloc_failed(response);
 		return;

Modified: team/dlee/stasis-cache-split/res/ari/resource_endpoints.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/res/ari/resource_endpoints.c?view=diff&rev=395703&r1=395603&r2=395703
==============================================================================
--- team/dlee/stasis-cache-split/res/ari/resource_endpoints.c (original)
+++ team/dlee/stasis-cache-split/res/ari/resource_endpoints.c Mon Jul 29 14:43:16 2013
@@ -37,22 +37,28 @@
 	struct ast_get_endpoints_args *args,
 	struct ast_ari_response *response)
 {
-	RAII_VAR(struct stasis_caching_topic *, caching_topic, NULL, ao2_cleanup);
+	RAII_VAR(struct stasis_cache *, cache, NULL, ao2_cleanup);
 	RAII_VAR(struct ao2_container *, snapshots, NULL, ao2_cleanup);
 	RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
 	struct ao2_iterator i;
 	void *obj;
 
+<<<<<<< HEAD:res/stasis_http/resource_endpoints.c
+	cache = ast_endpoint_cache();
+	if (!cache) {
+		stasis_http_response_error(
+=======
 	caching_topic = ast_endpoint_topic_all_cached();
 	if (!caching_topic) {
 		ast_ari_response_error(
+>>>>>>> stasis-rename:res/ari/resource_endpoints.c
 			response, 500, "Internal Server Error",
 			"Message bus not initialized");
 		return;
 	}
-	ao2_ref(caching_topic, +1);
+	ao2_ref(cache, +1);
 
-	snapshots = stasis_cache_dump(caching_topic, ast_endpoint_snapshot_type());
+	snapshots = stasis_cache_dump(cache, ast_endpoint_snapshot_type());
 	if (!snapshots) {
 		ast_ari_response_alloc_failed(response);
 		return;
@@ -83,7 +89,7 @@
 	struct ast_get_endpoints_by_tech_args *args,
 	struct ast_ari_response *response)
 {
-	RAII_VAR(struct stasis_caching_topic *, caching_topic, NULL, ao2_cleanup);
+	RAII_VAR(struct stasis_cache *, cache, NULL, ao2_cleanup);
 	RAII_VAR(struct ao2_container *, snapshots, NULL, ao2_cleanup);
 	RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
 	struct ao2_iterator i;
@@ -91,16 +97,22 @@
 
 	/* TODO - if tech isn't a recognized type of endpoint, it should 404 */
 
+<<<<<<< HEAD:res/stasis_http/resource_endpoints.c
+	cache = ast_endpoint_cache();
+	if (!cache) {
+		stasis_http_response_error(
+=======
 	caching_topic = ast_endpoint_topic_all_cached();
 	if (!caching_topic) {
 		ast_ari_response_error(
+>>>>>>> stasis-rename:res/ari/resource_endpoints.c
 			response, 500, "Internal Server Error",
 			"Message bus not initialized");
 		return;
 	}
-	ao2_ref(caching_topic, +1);
+	ao2_ref(cache, +1);
 
-	snapshots = stasis_cache_dump(caching_topic, ast_endpoint_snapshot_type());
+	snapshots = stasis_cache_dump(cache, ast_endpoint_snapshot_type());
 	if (!snapshots) {
 		ast_ari_response_alloc_failed(response);
 		return;

Modified: team/dlee/stasis-cache-split/res/res_ari_model.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/res/res_ari_model.c?view=diff&rev=395703&r1=395702&r2=395703
==============================================================================
--- team/dlee/stasis-cache-split/res/res_ari_model.c (original)
+++ team/dlee/stasis-cache-split/res/res_ari_model.c Mon Jul 29 14:43:16 2013
@@ -31,7 +31,7 @@
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
-#include "stasis_http/ari_model_validators.h"
+#include "ari/ari_model_validators.h"
 #include "asterisk/logger.h"
 #include "asterisk/module.h"
 #include "asterisk/utils.h"
@@ -90,18 +90,18 @@
 	return 1;
 }
 
-int ari_validate_void(struct ast_json *json)
+int ast_ari_validate_void(struct ast_json *json)
 {
 	return check_type(json, AST_JSON_NULL);
 }
 
-int ari_validate_byte(struct ast_json *json)
+int ast_ari_validate_byte(struct ast_json *json)
 {
 	/* Java bytes are signed, which accounts for great fun for all */
 	return check_range(-128, 255, json);
 }
 
-int ari_validate_boolean(struct ast_json *json)
+int ast_ari_validate_boolean(struct ast_json *json)
 {
 	enum ast_json_type actual = ast_json_typeof(json);
 	switch (actual) {
@@ -115,34 +115,34 @@
 	}
 }
 
-int ari_validate_int(struct ast_json *json)
+int ast_ari_validate_int(struct ast_json *json)
 {
 	/* Swagger int's are 32-bit */
 	return check_range(-2147483648LL, 2147483647LL, json);
 }
 
-int ari_validate_long(struct ast_json *json)
+int ast_ari_validate_long(struct ast_json *json)
 {
 	/* All integral values are valid longs. No need for range check. */
 	return check_type(json, AST_JSON_INTEGER);
 }
 
-int ari_validate_float(struct ast_json *json)
+int ast_ari_validate_float(struct ast_json *json)
 {
 	return check_type(json, AST_JSON_REAL);
 }
 
-int ari_validate_double(struct ast_json *json)
+int ast_ari_validate_double(struct ast_json *json)
 {
 	return check_type(json, AST_JSON_REAL);
 }
 
-int ari_validate_string(struct ast_json *json)
+int ast_ari_validate_string(struct ast_json *json)
 {
 	return check_type(json, AST_JSON_STRING);
 }
 
-int ari_validate_date(struct ast_json *json)
+int ast_ari_validate_date(struct ast_json *json)
 {
 	/* Dates are ISO-8601 strings */
 	const char *str;
@@ -158,7 +158,7 @@
 	return 1;
 }
 
-int ari_validate_list(struct ast_json *json, int (*fn)(struct ast_json *))
+int ast_ari_validate_list(struct ast_json *json, int (*fn)(struct ast_json *))
 {
 	int res = 1;
 	size_t i;

Modified: team/dlee/stasis-cache-split/res/res_ari_model.exports.in
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/res/res_ari_model.exports.in?view=diff&rev=395703&r1=395702&r2=395703
==============================================================================
--- team/dlee/stasis-cache-split/res/res_ari_model.exports.in (original)
+++ team/dlee/stasis-cache-split/res/res_ari_model.exports.in Mon Jul 29 14:43:16 2013
@@ -1,6 +1,6 @@
 {
 	global:
-		LINKER_SYMBOL_PREFIXari_*;
+		LINKER_SYMBOL_PREFIXast_ari_*;
 	local:
 		*;
 };

Modified: team/dlee/stasis-cache-split/res/res_statsd.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/res/res_statsd.c?view=diff&rev=395703&r1=395702&r2=395703
==============================================================================
--- team/dlee/stasis-cache-split/res/res_statsd.c (original)
+++ team/dlee/stasis-cache-split/res/res_statsd.c Mon Jul 29 14:43:16 2013
@@ -34,7 +34,7 @@
 			<configObject name="global">
 				<synopsis>Global configuration settings</synopsis>
 				<configOption name="enabled">
-					<synopsis>Enable/disable the stasis-http module</synopsis>
+					<synopsis>Enable/disable the statsd module</synopsis>
 				</configOption>
 				<configOption name="server">
 					<synopsis>Address of the statsd server</synopsis>
@@ -161,7 +161,7 @@
 		sample_rate);
 }
 
-/*! \brief Mapping of the stasis http conf struct's globals to the
+/*! \brief Mapping of the statsd conf struct's globals to the
  *         general context in the config file. */
 static struct aco_type global_option = {
 	.type = ACO_GLOBAL,
@@ -173,7 +173,7 @@
 
 static struct aco_type *global_options[] = ACO_TYPES(&global_option);
 
-/*! \brief Disposes of the stasis http conf object */
+/*! \brief Disposes of the statsd conf object */
 static void conf_destructor(void *obj)
 {
     struct conf *cfg = obj;

Modified: team/dlee/stasis-cache-split/rest-api-templates/ari_model_validators.c.mustache
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/rest-api-templates/ari_model_validators.c.mustache?view=diff&rev=395703&r1=395702&r2=395703
==============================================================================
--- team/dlee/stasis-cache-split/rest-api-templates/ari_model_validators.c.mustache (original)
+++ team/dlee/stasis-cache-split/rest-api-templates/ari_model_validators.c.mustache Mon Jul 29 14:43:16 2013
@@ -36,7 +36,7 @@
 {{#api_declaration}}
 {{#models}}
 
-int ari_validate_{{c_id}}(struct ast_json *json)
+int ast_ari_validate_{{c_id}}(struct ast_json *json)
 {
 	int res = 1;
 	struct ast_json_iter *iter;
@@ -59,7 +59,7 @@
 	} else
 {{#subtypes}}
 	if (strcmp("{{id}}", discriminator) == 0) {
-		return ari_validate_{{c_id}}(json);
+		return ast_ari_validate_{{c_id}}(json);
 	} else
 {{/subtypes}}
 	{
@@ -78,12 +78,12 @@
 {{/required}}
 {{#type}}
 {{#is_list}}
-			prop_is_valid = ari_validate_list(
+			prop_is_valid = ast_ari_validate_list(
 				ast_json_object_iter_value(iter),
-				ari_validate_{{c_singular_name}});
+				ast_ari_validate_{{c_singular_name}});
 {{/is_list}}
 {{^is_list}}
-			prop_is_valid = ari_validate_{{c_name}}(
+			prop_is_valid = ast_ari_validate_{{c_name}}(
 				ast_json_object_iter_value(iter));
 {{/is_list}}
 {{/type}}
@@ -113,9 +113,9 @@
 	return res;
 }
 
-ari_validator ari_validate_{{c_id}}_fn(void)
+ari_validator ast_ari_validate_{{c_id}}_fn(void)
 {
-	return ari_validate_{{c_id}};
+	return ast_ari_validate_{{c_id}};
 }
 {{/models}}
 {{/api_declaration}}

Modified: team/dlee/stasis-cache-split/rest-api-templates/ari_model_validators.h.mustache
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/rest-api-templates/ari_model_validators.h.mustache?view=diff&rev=395703&r1=395702&r2=395703
==============================================================================
--- team/dlee/stasis-cache-split/rest-api-templates/ari_model_validators.h.mustache (original)
+++ team/dlee/stasis-cache-split/rest-api-templates/ari_model_validators.h.mustache Mon Jul 29 14:43:16 2013
@@ -19,7 +19,7 @@
  * \brief Generated file - Build validators for ARI model objects.
  *
  * In addition to the normal validation functions one would normally expect,
- * each validator has a ari_validate_{id}_fn() companion function that returns
+ * each validator has a ast_ari_validate_{id}_fn() companion function that returns
  * the validator's function pointer.
  *
  * The reason for this seamingly useless indirection is the way function
@@ -50,7 +50,7 @@
  * \returns True (non-zero) if valid.
  * \returns False (zero) if invalid.
  */
-int ari_validate_void(struct ast_json *json);
+int ast_ari_validate_void(struct ast_json *json);
 
 /*!
  * \brief Validator for native Swagger byte.
@@ -59,7 +59,7 @@
  * \returns True (non-zero) if valid.
  * \returns False (zero) if invalid.
  */
-int ari_validate_byte(struct ast_json *json);
+int ast_ari_validate_byte(struct ast_json *json);
 
 /*!
  * \brief Validator for native Swagger boolean.
@@ -68,7 +68,7 @@
  * \returns True (non-zero) if valid.
  * \returns False (zero) if invalid.
  */
-int ari_validate_boolean(struct ast_json *json);
+int ast_ari_validate_boolean(struct ast_json *json);
 
 /*!
  * \brief Validator for native Swagger int.
@@ -77,7 +77,7 @@
  * \returns True (non-zero) if valid.
  * \returns False (zero) if invalid.
  */
-int ari_validate_int(struct ast_json *json);
+int ast_ari_validate_int(struct ast_json *json);
 
 /*!
  * \brief Validator for native Swagger long.
@@ -86,7 +86,7 @@
  * \returns True (non-zero) if valid.
  * \returns False (zero) if invalid.
  */
-int ari_validate_long(struct ast_json *json);
+int ast_ari_validate_long(struct ast_json *json);
 
 /*!
  * \brief Validator for native Swagger float.
@@ -95,7 +95,7 @@
  * \returns True (non-zero) if valid.
  * \returns False (zero) if invalid.
  */
-int ari_validate_float(struct ast_json *json);
+int ast_ari_validate_float(struct ast_json *json);
 
 /*!
  * \brief Validator for native Swagger double.
@@ -104,7 +104,7 @@
  * \returns True (non-zero) if valid.
  * \returns False (zero) if invalid.
  */
-int ari_validate_double(struct ast_json *json);
+int ast_ari_validate_double(struct ast_json *json);
 
 /*!
  * \brief Validator for native Swagger string.
@@ -113,7 +113,7 @@
  * \returns True (non-zero) if valid.
  * \returns False (zero) if invalid.
  */
-int ari_validate_string(struct ast_json *json);
+int ast_ari_validate_string(struct ast_json *json);
 
 /*!
  * \brief Validator for native Swagger date.
@@ -122,7 +122,7 @@
  * \returns True (non-zero) if valid.
  * \returns False (zero) if invalid.
  */
-int ari_validate_date(struct ast_json *json);
+int ast_ari_validate_date(struct ast_json *json);
 
 /*!
  * \brief Validator for a Swagger List[]/JSON array.
@@ -132,7 +132,7 @@
  * \returns True (non-zero) if valid.
  * \returns False (zero) if invalid.
  */
-int ari_validate_list(struct ast_json *json, int (*fn)(struct ast_json *));
+int ast_ari_validate_list(struct ast_json *json, int (*fn)(struct ast_json *));
 
 /*! @} */
 
@@ -153,14 +153,14 @@
  * \returns True (non-zero) if valid.
  * \returns False (zero) if invalid.
  */
-int ari_validate_{{c_id}}(struct ast_json *json);
+int ast_ari_validate_{{c_id}}(struct ast_json *json);
 
 /*!
- * \brief Function pointer to ari_validate_{{c_id}}().
+ * \brief Function pointer to ast_ari_validate_{{c_id}}().
  *
- * See \ref ari_model_validators.h for more details.
+ * See \ref ast_ari_model_validators.h for more details.
  */
-ari_validator ari_validate_{{c_id}}_fn(void);
+ari_validator ast_ari_validate_{{c_id}}_fn(void);
 {{/models}}
 {{/api_declaration}}
 {{/apis}}

Modified: team/dlee/stasis-cache-split/rest-api-templates/make_ari_stubs.py
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/rest-api-templates/make_ari_stubs.py?view=diff&rev=395703&r1=395702&r2=395703
==============================================================================
--- team/dlee/stasis-cache-split/rest-api-templates/make_ari_stubs.py (original)
+++ team/dlee/stasis-cache-split/rest-api-templates/make_ari_stubs.py Mon Jul 29 14:43:16 2013
@@ -44,22 +44,22 @@
 API_TRANSFORMS = [
     Transform(rel('api.wiki.mustache'),
               'doc/rest-api/%s {{name_title}} REST API.wiki' % WIKI_PREFIX),
-    Transform(rel('res_stasis_http_resource.c.mustache'),
-              'res/res_stasis_http_{{name}}.c'),
-    Transform(rel('stasis_http_resource.h.mustache'),
-              'res/stasis_http/resource_{{name}}.h'),
-    Transform(rel('stasis_http_resource.c.mustache'),
-              'res/stasis_http/resource_{{name}}.c', overwrite=False),
+    Transform(rel('res_ari_resource.c.mustache'),
+              'res/res_ari_{{name}}.c'),
+    Transform(rel('ari_resource.h.mustache'),
+              'res/ari/resource_{{name}}.h'),
+    Transform(rel('ari_resource.c.mustache'),
+              'res/ari/resource_{{name}}.c', overwrite=False),
 ]
 
 RESOURCES_TRANSFORMS = [
     Transform(rel('models.wiki.mustache'),
               'doc/rest-api/%s REST Data Models.wiki' % WIKI_PREFIX),
-    Transform(rel('stasis_http.make.mustache'), 'res/stasis_http.make'),
+    Transform(rel('ari.make.mustache'), 'res/ari.make'),
     Transform(rel('ari_model_validators.h.mustache'),
-              'res/stasis_http/ari_model_validators.h'),
+              'res/ari/ari_model_validators.h'),
     Transform(rel('ari_model_validators.c.mustache'),
-              'res/stasis_http/ari_model_validators.c'),
+              'res/ari/ari_model_validators.c'),
 ]
 
 

Modified: team/dlee/stasis-cache-split/rest-api-templates/rest_handler.mustache
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/rest-api-templates/rest_handler.mustache?view=diff&rev=395703&r1=395702&r2=395703
==============================================================================
--- team/dlee/stasis-cache-split/rest-api-templates/rest_handler.mustache (original)
+++ team/dlee/stasis-cache-split/rest-api-templates/rest_handler.mustache Mon Jul 29 14:43:16 2013
@@ -17,7 +17,7 @@
 }}
 {{!
  * Recursive partial template to render a rest_handler. Used in
- * res_stasis_http_resource.c.mustache.
+ * res_ari_resource.c.mustache.
 }}
 {{#children}}
 {{> rest_handler}}
@@ -31,7 +31,7 @@
 	.callbacks = {
 {{#operations}}
 {{#is_req}}
-		[{{c_http_method}}] = stasis_http_{{c_nickname}}_cb,
+		[{{c_http_method}}] = ast_ari_{{c_nickname}}_cb,
 {{/is_req}}
 {{/operations}}
 	},

Modified: team/dlee/stasis-cache-split/tests/test_ari_model.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/stasis-cache-split/tests/test_ari_model.c?view=diff&rev=395703&r1=395702&r2=395703
==============================================================================
--- team/dlee/stasis-cache-split/tests/test_ari_model.c (original)
+++ team/dlee/stasis-cache-split/tests/test_ari_model.c Mon Jul 29 14:43:16 2013
@@ -36,7 +36,7 @@
 #include "asterisk/utils.h"
 #include "asterisk/module.h"
 #include "asterisk/test.h"
-#include "../res/stasis_http/ari_model_validators.h"
+#include "../res/ari/ari_model_validators.h"
 
 AST_TEST_DEFINE(validate_byte)
 {
@@ -58,34 +58,34 @@
 
 	uut = ast_json_integer_create(-128);
 	ast_test_validate(test, NULL != uut);
-	ast_test_validate(test, ari_validate_byte(uut));
+	ast_test_validate(test, ast_ari_validate_byte(uut));
 
 	res = ast_json_integer_set(uut, 0);
 	ast_test_validate(test, 0 == res);
-	ast_test_validate(test, ari_validate_byte(uut));
+	ast_test_validate(test, ast_ari_validate_byte(uut));
 
 	res = ast_json_integer_set(uut, 255);
 	ast_test_validate(test, 0 == res);
-	ast_test_validate(test, ari_validate_byte(uut));
+	ast_test_validate(test, ast_ari_validate_byte(uut));
 
 	res = ast_json_integer_set(uut, -129);
 	ast_test_validate(test, 0 == res);
-	ast_test_validate(test, !ari_validate_byte(uut));
+	ast_test_validate(test, !ast_ari_validate_byte(uut));
 
 	res = ast_json_integer_set(uut, 256);
 	ast_test_validate(test, 0 == res);
-	ast_test_validate(test, !ari_validate_byte(uut));
+	ast_test_validate(test, !ast_ari_validate_byte(uut));
 
 	str = ast_json_string_create("not a byte");
 	ast_test_validate(test, NULL != str);
-	ast_test_validate(test, !ari_validate_byte(str));
+	ast_test_validate(test, !ast_ari_validate_byte(str));
 
 	/* Even if the string has an integral value */
 	res = ast_json_string_set(str, "0");
 	ast_test_validate(test, 0 == res);
-	ast_test_validate(test, !ari_validate_byte(str));
-
-	ast_test_validate(test, !ari_validate_byte(ast_json_null()));
+	ast_test_validate(test, !ast_ari_validate_byte(str));
+
+	ast_test_validate(test, !ast_ari_validate_byte(ast_json_null()));
 
 	return AST_TEST_PASS;
 }
@@ -107,24 +107,24 @@
 		break;
 	}
 
-	ast_test_validate(test, ari_validate_boolean(ast_json_true()));
-	ast_test_validate(test, ari_validate_boolean(ast_json_false()));
+	ast_test_validate(test, ast_ari_validate_boolean(ast_json_true()));
+	ast_test_validate(test, ast_ari_validate_boolean(ast_json_false()));
 
 	str = ast_json_string_create("not a bool");
 	ast_test_validate(test, NULL != str);
-	ast_test_validate(test, !ari_validate_boolean(str));
+	ast_test_validate(test, !ast_ari_validate_boolean(str));
 
 	/* Even if the string has a boolean value */
 	res = ast_json_string_set(str, "true");
 	ast_test_validate(test, 0 == res);
-	ast_test_validate(test, !ari_validate_boolean(str));
+	ast_test_validate(test, !ast_ari_validate_boolean(str));
 
 	/* Even if the string has a boolean text in it */
 	res = ast_json_string_set(str, "true");
 	ast_test_validate(test, 0 == res);
-	ast_test_validate(test, !ari_validate_boolean(str));
-
-	ast_test_validate(test, !ari_validate_boolean(ast_json_null()));
+	ast_test_validate(test, !ast_ari_validate_boolean(str));
+
+	ast_test_validate(test, !ast_ari_validate_boolean(ast_json_null()));
 
 	return AST_TEST_PASS;
 }
@@ -149,34 +149,34 @@
 
 	uut = ast_json_integer_create(-2147483648LL);
 	ast_test_validate(test, NULL != uut);
-	ast_test_validate(test, ari_validate_int(uut));
+	ast_test_validate(test, ast_ari_validate_int(uut));
 
 	res = ast_json_integer_set(uut, 0);
 	ast_test_validate(test, 0 == res);
-	ast_test_validate(test, ari_validate_int(uut));
+	ast_test_validate(test, ast_ari_validate_int(uut));
 
 	res = ast_json_integer_set(uut, 2147483647LL);
 	ast_test_validate(test, 0 == res);
-	ast_test_validate(test, ari_validate_int(uut));
+	ast_test_validate(test, ast_ari_validate_int(uut));
 
 	res = ast_json_integer_set(uut, -2147483649LL);
 	ast_test_validate(test, 0 == res);
-	ast_test_validate(test, !ari_validate_int(uut));
+	ast_test_validate(test, !ast_ari_validate_int(uut));
 
 	res = ast_json_integer_set(uut, 2147483648LL);
 	ast_test_validate(test, 0 == res);
-	ast_test_validate(test, !ari_validate_int(uut));
+	ast_test_validate(test, !ast_ari_validate_int(uut));
 
 	str = ast_json_string_create("not a int");
 	ast_test_validate(test, NULL != str);
-	ast_test_validate(test, !ari_validate_int(str));
+	ast_test_validate(test, !ast_ari_validate_int(str));
 
 	/* Even if the string has an integral value */
 	res = ast_json_string_set(str, "0");
 	ast_test_validate(test, 0 == res);
-	ast_test_validate(test, !ari_validate_int(str));
-
-	ast_test_validate(test, !ari_validate_int(ast_json_null()));
+	ast_test_validate(test, !ast_ari_validate_int(str));
+
+	ast_test_validate(test, !ast_ari_validate_int(ast_json_null()));
 
 	return AST_TEST_PASS;
 }
@@ -201,18 +201,18 @@
 
 	uut = ast_json_integer_create(0);
 	ast_test_validate(test, NULL != uut);
-	ast_test_validate(test, ari_validate_long(uut));
+	ast_test_validate(test, ast_ari_validate_long(uut));
 
 	str = ast_json_string_create("not a long");
 	ast_test_validate(test, NULL != str);
-	ast_test_validate(test, !ari_validate_long(str));
+	ast_test_validate(test, !ast_ari_validate_long(str));
 
 	/* Even if the string has an integral value */
 	res = ast_json_string_set(str, "0");
 	ast_test_validate(test, 0 == res);
-	ast_test_validate(test, !ari_validate_long(str));
-
-	ast_test_validate(test, !ari_validate_long(ast_json_null()));
+	ast_test_validate(test, !ast_ari_validate_long(str));
+
+	ast_test_validate(test, !ast_ari_validate_long(ast_json_null()));
 
 	return AST_TEST_PASS;
 }
@@ -237,13 +237,13 @@
 
 	uut = ast_json_string_create("text");
 	ast_test_validate(test, NULL != uut);
-	ast_test_validate(test, ari_validate_string(uut));
+	ast_test_validate(test, ast_ari_validate_string(uut));
 
 	res = ast_json_string_set(uut, "");
 	ast_test_validate(test, 0 == res);
-	ast_test_validate(test, ari_validate_string(uut));
-
-	ast_test_validate(test, !ari_validate_string(ast_json_null()));
+	ast_test_validate(test, ast_ari_validate_string(uut));
+
+	ast_test_validate(test, !ast_ari_validate_string(ast_json_null()));
 
 	return AST_TEST_PASS;
 }
@@ -341,7 +341,7 @@
 	for (i = 0; i < ARRAY_LEN(valid_dates); ++i) {
 		res = ast_json_string_set(uut, valid_dates[i]);
 		ast_test_validate(test, 0 == res);
-		if (!ari_validate_date(uut)) {
+		if (!ast_ari_validate_date(uut)) {
 			ast_test_status_update(test,
 				"Expected '%s' to be a valid date\n",
 				valid_dates[i]);
@@ -352,7 +352,7 @@
 	for (i = 0; i < ARRAY_LEN(invalid_dates); ++i) {
 		res = ast_json_string_set(uut, invalid_dates[i]);
 		ast_test_validate(test, 0 == res);
-		if (ari_validate_date(uut)) {
+		if (ast_ari_validate_date(uut)) {
 			ast_test_status_update(test,
 				"Expected '%s' to be an invalid date\n",
 				invalid_dates[i]);
@@ -360,7 +360,7 @@
 		}
 	}
 
-	ast_test_validate(test, !ari_validate_string(ast_json_null()));
+	ast_test_validate(test, !ast_ari_validate_string(ast_json_null()));
 
 	return test_res;
 }
@@ -385,21 +385,21 @@
 
 	uut = ast_json_array_create();
 	ast_test_validate(test, NULL != uut);
-	ast_test_validate(test, ari_validate_list(uut, ari_validate_string));
-	ast_test_validate(test, ari_validate_list(uut, ari_validate_int));
+	ast_test_validate(test, ast_ari_validate_list(uut, ast_ari_validate_string));
+	ast_test_validate(test, ast_ari_validate_list(uut, ast_ari_validate_int));
 
 	res = ast_json_array_append(uut, ast_json_string_create(""));
 	ast_test_validate(test, 0 == res);
-	ast_test_validate(test, ari_validate_list(uut, ari_validate_string));
-	ast_test_validate(test, !ari_validate_list(uut, ari_validate_int));
+	ast_test_validate(test, ast_ari_validate_list(uut, ast_ari_validate_string));
+	ast_test_validate(test, !ast_ari_validate_list(uut, ast_ari_validate_int));
 
 	res = ast_json_array_append(uut, ast_json_integer_create(0));
 	ast_test_validate(test, 0 == res);
-	ast_test_validate(test, !ari_validate_list(uut, ari_validate_string));
-	ast_test_validate(test, !ari_validate_list(uut, ari_validate_int));
+	ast_test_validate(test, !ast_ari_validate_list(uut, ast_ari_validate_string));
+	ast_test_validate(test, !ast_ari_validate_list(uut, ast_ari_validate_int));
 
 	ast_test_validate(test,
-		!ari_validate_list(ast_json_null(), ari_validate_string));
+		!ast_ari_validate_list(ast_json_null(), ast_ari_validate_string));
 
 	return AST_TEST_PASS;
 }




More information about the asterisk-commits mailing list