From 254d07b15b6f6a741c1293cf9d26a2a235e795ed Mon Sep 17 00:00:00 2001 From: Matt Jordan Date: Wed, 8 Jul 2015 16:39:35 -0500 Subject: ARI: Add support for push configuration of dynamic object This patch adds support for push configuration of dynamic, i.e., sorcery, objects in Asterisk. It adds three new REST API calls to the 'asterisk' resource: * GET /asterisk/{configClass}/{objectType}/{id}: retrieve the current object given its ID. This returns back a list of ConfigTuples, which define the fields and their present values that make up the object. * PUT /asterisk/{configClass}/{objectType}/{id}: create or update an object. A body may be passed with the request that contains fields to populate in the object. The same format as what is retrieved using the GET operation is used for the body, save that we specify that the list of fields to update are contained in the "fields" attribute. * DELETE /asterisk/{configClass}/{objectType}/{id}: remove a dynamic object from its backing storage. Note that the success/failure of these operations is somewhat configuration dependent, i.e., you must be using a sorcery wizard that supports the operation in question. If a sorcery wizard does not support the create or delete mechanisms, then the REST API call will fail with a 403 forbidden. ASTERISK-25238 #close Change-Id: I28cd5c7bf6f67f8e9e437ff097f8fd171d30ff5c --- res/ari/ari_model_validators.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'res/ari/ari_model_validators.h') diff --git a/res/ari/ari_model_validators.h b/res/ari/ari_model_validators.h index 41b91791d..e122ded34 100644 --- a/res/ari/ari_model_validators.h +++ b/res/ari/ari_model_validators.h @@ -206,6 +206,24 @@ int ast_ari_validate_config_info(struct ast_json *json); */ ari_validator ast_ari_validate_config_info_fn(void); +/*! + * \brief Validator for ConfigTuple. + * + * A key/value pair that makes up part of a configuration object. + * + * \param json JSON object to validate. + * \returns True (non-zero) if valid. + * \returns False (zero) if invalid. + */ +int ast_ari_validate_config_tuple(struct ast_json *json); + +/*! + * \brief Function pointer to ast_ari_validate_config_tuple(). + * + * See \ref ast_ari_model_validators.h for more details. + */ +ari_validator ast_ari_validate_config_tuple_fn(void); + /*! * \brief Validator for Module. * @@ -1262,6 +1280,9 @@ ari_validator ast_ari_validate_application_fn(void); * - max_open_files: int * - name: string (required) * - setid: SetId (required) + * ConfigTuple + * - attribute: string (required) + * - value: string (required) * Module * - description: string (required) * - name: string (required) -- cgit v1.2.3