sysrepo
1.4.168
YANG datastore
|
Functions | |
const char * | sr_get_repo_path (void) |
Get the common path prefix for all sysrepo files. More... | |
int | sr_install_module (sr_conn_ctx_t *conn, const char *schema_path, const char *search_dirs, const char **features, int feat_count) |
Install a new schema (module) into sysrepo. Deferred until there are no connections! More... | |
int | sr_install_module_data (sr_conn_ctx_t *conn, const char *module_name, const char *data, const char *data_path, LYD_FORMAT format) |
Set newly installed module startup and running data. It is necessary in case empty data are not valid for the particular schema (module). More... | |
int | sr_remove_module (sr_conn_ctx_t *conn, const char *module_name) |
Remove an installed module from sysrepo. Deferred until there are no connections! More... | |
int | sr_update_module (sr_conn_ctx_t *conn, const char *schema_path, const char *search_dirs) |
Update an installed schema (module) to a new revision. Deferred until there are no connections! More... | |
int | sr_cancel_update_module (sr_conn_ctx_t *conn, const char *module_name) |
Cancel scheduled update of a module. More... | |
int | sr_set_module_replay_support (sr_conn_ctx_t *conn, const char *module_name, int replay_support) |
Change module replay support. More... | |
int | sr_set_module_access (sr_conn_ctx_t *conn, const char *module_name, const char *owner, const char *group, mode_t perm) |
Change module filesystem permissions. More... | |
int | sr_get_module_access (sr_conn_ctx_t *conn, const char *module_name, char **owner, char **group, mode_t *perm) |
Learn about module filesystem permissions. More... | |
int | sr_enable_module_feature (sr_conn_ctx_t *conn, const char *module_name, const char *feature_name) |
Enable a module feature. Deferred until there are no connections! More... | |
int | sr_disable_module_feature (sr_conn_ctx_t *conn, const char *module_name, const char *feature_name) |
Disable a module feature. Deferred until there are no connections! More... | |
int | sr_get_module_info (sr_conn_ctx_t *conn, struct lyd_node **sysrepo_data) |
Get internal sysrepo data tree, which holds information about installed modules. These data are from the sysrepo module found in modules/sysrepo.yang . More... | |
const char* sr_get_repo_path | ( | void | ) |
Get the common path prefix for all sysrepo files.
int sr_install_module | ( | sr_conn_ctx_t * | conn, |
const char * | schema_path, | ||
const char * | search_dirs, | ||
const char ** | features, | ||
int | feat_count | ||
) |
Install a new schema (module) into sysrepo. Deferred until there are no connections!
[in] | conn | Connection to use. |
[in] | schema_path | Path to the new schema. Can have either YANG or YIN extension/format. |
[in] | search_dirs | Optional search directories for import schemas, supports the format <dir>[:<dir>]* . |
[in] | features | Array of enabled features. |
[in] | feat_count | Number of enabled features. |
int sr_install_module_data | ( | sr_conn_ctx_t * | conn, |
const char * | module_name, | ||
const char * | data, | ||
const char * | data_path, | ||
LYD_FORMAT | format | ||
) |
Set newly installed module startup and running data. It is necessary in case empty data are not valid for the particular schema (module).
[in] | conn | Connection to use. |
[in] | module_name | Name of the module to set startup data. |
[in] | data | Data to set. Must be NULL if data_path is set. |
[in] | data_path | Data file with the data to set. Must be NULL if data is set. |
[in] | format | Format of the data/file. |
int sr_remove_module | ( | sr_conn_ctx_t * | conn, |
const char * | module_name | ||
) |
Remove an installed module from sysrepo. Deferred until there are no connections!
Required WRITE access.
[in] | conn | Connection to use. |
[in] | module_name | Name of the module to remove. |
int sr_update_module | ( | sr_conn_ctx_t * | conn, |
const char * | schema_path, | ||
const char * | search_dirs | ||
) |
Update an installed schema (module) to a new revision. Deferred until there are no connections!
Required WRITE access.
[in] | conn | Connection to use. |
[in] | schema_path | Path to the updated schema. Can have either YANG or YIN extension/format. |
[in] | search_dirs | Optional search directories for import schemas, supports the format <dir>[:<dir>]* . |
int sr_cancel_update_module | ( | sr_conn_ctx_t * | conn, |
const char * | module_name | ||
) |
Cancel scheduled update of a module.
Required WRITE access.
[in] | conn | Connection to use. |
[in] | module_name | Name of the module whose update to cancel. |
int sr_set_module_replay_support | ( | sr_conn_ctx_t * | conn, |
const char * | module_name, | ||
int | replay_support | ||
) |
Change module replay support.
[in] | conn | Connection to use. |
[in] | module_name | Name of the module to change. NULL to change all the modules. |
[in] | replay_support | 0 to disabled, non-zero to enable. |
int sr_set_module_access | ( | sr_conn_ctx_t * | conn, |
const char * | module_name, | ||
const char * | owner, | ||
const char * | group, | ||
mode_t | perm | ||
) |
Change module filesystem permissions.
Required WRITE access.
[in] | conn | Connection to use. |
[in] | module_name | Name of the module to change. |
[in] | owner | If set, new owner of the module. |
[in] | group | If set, new group of the module. |
[in] | perm | If set, new permissions of the module. |
int sr_get_module_access | ( | sr_conn_ctx_t * | conn, |
const char * | module_name, | ||
char ** | owner, | ||
char ** | group, | ||
mode_t * | perm | ||
) |
Learn about module filesystem permissions.
Required READ access.
[in] | conn | Connection to use. |
[in] | module_name | Name of the module to use. |
[in,out] | owner | If set, read the owner of the module. |
[in,out] | group | If set, read the group of the module. |
[in,out] | perm | If set, read the permissions of the module. |
int sr_enable_module_feature | ( | sr_conn_ctx_t * | conn, |
const char * | module_name, | ||
const char * | feature_name | ||
) |
Enable a module feature. Deferred until there are no connections!
Note that no recursive if-feature checks are performed meaning the feature may still be effectively disabled in case some of its if-features are disabled. This can be checked using sysrepoctl -l
.
Required WRITE access.
[in] | conn | Connection to use. |
[in] | module_name | Name of the module to change. |
[in] | feature_name | Name of the feature to enable. |
int sr_disable_module_feature | ( | sr_conn_ctx_t * | conn, |
const char * | module_name, | ||
const char * | feature_name | ||
) |
Disable a module feature. Deferred until there are no connections!
Note that this may effectively also disable any dependant features. This can be checked using sysrepoctl -l
.
Required WRITE access.
[in] | conn | Connection to use. |
[in] | module_name | Name of the module to change. |
[in] | feature_name | Name of the feature to disable. |
int sr_get_module_info | ( | sr_conn_ctx_t * | conn, |
struct lyd_node ** | sysrepo_data | ||
) |
Get internal sysrepo data tree, which holds information about installed modules. These data are from the sysrepo module found in modules/sysrepo.yang
.
[in] | conn | Connection to use. |
[out] | sysrepo_data | Sysrepo internal data tree. |