diff options
author | David M. Lee <dlee@digium.com> | 2013-08-02 14:46:21 +0000 |
---|---|---|
committer | David M. Lee <dlee@digium.com> | 2013-08-02 14:46:21 +0000 |
commit | 5114e4fc0ba896c91344c1c766740e8f7c661813 (patch) | |
tree | 9a2c49a909bc217232ef657b976f90293f6de7b3 /res/ari/ari_model_validators.h | |
parent | 537ecebd2dc27120144498598f32dec97db6808d (diff) |
ARI - GET /ari/asterisk/info
This patch adds basic system information access to ARI.
The results are roughly what you get from 'core show settings', with a
few minor differences.
* Data is structured, with 'build', 'system', 'config' and 'status'
sub-objects.
* Each sub-object is selectable, using the ?only= parameter. A comma
separated list can be provided to select multiple sections.
* A few config options are numeric, for which 0 means 'unlimited'.
Instead of having a special interpretation of those fields, they
are simply omitted if they're 0.
* The information is limited to what might be useful to building
external applications.
(closes issue ASTERISK-21575)
Review: https://reviewboard.asterisk.org/r/2702/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/ari/ari_model_validators.h')
-rw-r--r-- | res/ari/ari_model_validators.h | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/res/ari/ari_model_validators.h b/res/ari/ari_model_validators.h index c5e74d21a..e8ef8e210 100644 --- a/res/ari/ari_model_validators.h +++ b/res/ari/ari_model_validators.h @@ -162,6 +162,96 @@ int ast_ari_validate_asterisk_info(struct ast_json *json); ari_validator ast_ari_validate_asterisk_info_fn(void); /*! + * \brief Validator for BuildInfo. + * + * Info about how Asterisk was built + * + * \param json JSON object to validate. + * \returns True (non-zero) if valid. + * \returns False (zero) if invalid. + */ +int ast_ari_validate_build_info(struct ast_json *json); + +/*! + * \brief Function pointer to ast_ari_validate_build_info(). + * + * See \ref ast_ari_model_validators.h for more details. + */ +ari_validator ast_ari_validate_build_info_fn(void); + +/*! + * \brief Validator for ConfigInfo. + * + * Info about Asterisk configuration + * + * \param json JSON object to validate. + * \returns True (non-zero) if valid. + * \returns False (zero) if invalid. + */ +int ast_ari_validate_config_info(struct ast_json *json); + +/*! + * \brief Function pointer to ast_ari_validate_config_info(). + * + * See \ref ast_ari_model_validators.h for more details. + */ +ari_validator ast_ari_validate_config_info_fn(void); + +/*! + * \brief Validator for SetId. + * + * Effective user/group id + * + * \param json JSON object to validate. + * \returns True (non-zero) if valid. + * \returns False (zero) if invalid. + */ +int ast_ari_validate_set_id(struct ast_json *json); + +/*! + * \brief Function pointer to ast_ari_validate_set_id(). + * + * See \ref ast_ari_model_validators.h for more details. + */ +ari_validator ast_ari_validate_set_id_fn(void); + +/*! + * \brief Validator for StatusInfo. + * + * Info about Asterisk status + * + * \param json JSON object to validate. + * \returns True (non-zero) if valid. + * \returns False (zero) if invalid. + */ +int ast_ari_validate_status_info(struct ast_json *json); + +/*! + * \brief Function pointer to ast_ari_validate_status_info(). + * + * See \ref ast_ari_model_validators.h for more details. + */ +ari_validator ast_ari_validate_status_info_fn(void); + +/*! + * \brief Validator for SystemInfo. + * + * Info about Asterisk + * + * \param json JSON object to validate. + * \returns True (non-zero) if valid. + * \returns False (zero) if invalid. + */ +int ast_ari_validate_system_info(struct ast_json *json); + +/*! + * \brief Function pointer to ast_ari_validate_system_info(). + * + * See \ref ast_ari_model_validators.h for more details. + */ +ari_validator ast_ari_validate_system_info_fn(void); + +/*! * \brief Validator for Variable. * * The value of a channel variable @@ -785,6 +875,33 @@ ari_validator ast_ari_validate_stasis_start_fn(void); * JSON models * * AsteriskInfo + * - build: BuildInfo + * - config: ConfigInfo + * - status: StatusInfo + * - system: SystemInfo + * BuildInfo + * - date: string (required) + * - kernel: string (required) + * - machine: string (required) + * - options: string (required) + * - os: string (required) + * - user: string (required) + * ConfigInfo + * - default_language: string (required) + * - max_channels: int + * - max_load: double + * - max_open_files: int + * - name: string (required) + * - setid: SetId (required) + * SetId + * - group: string (required) + * - user: string (required) + * StatusInfo + * - last_reload_time: Date (required) + * - startup_time: Date (required) + * SystemInfo + * - entity_id: string (required) + * - version: string (required) * Variable * - value: string (required) * Endpoint |