Add <commit> RPC for M-plane
This commit is contained in:
@@ -91,3 +91,27 @@ bool validate_config_mplane(ru_session_t *ru_session)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool commit_config_mplane(ru_session_t *ru_session)
|
||||
{
|
||||
int timeout = CLI_RPC_REPLY_TIMEOUT;
|
||||
struct nc_rpc *rpc;
|
||||
NC_WD_MODE wd = NC_WD_ALL;
|
||||
NC_PARAMTYPE param = NC_PARAMTYPE_CONST;
|
||||
int confirmed = 0;
|
||||
int32_t confirm_timeout = 0;
|
||||
char *persist = NULL, *persist_id = NULL;
|
||||
|
||||
MP_LOG_I("RPC request to RU \"%s\" = <commit> candidate datastore.\n", ru_session->ru_ip_add);
|
||||
rpc = nc_rpc_commit(confirmed, confirm_timeout, persist, persist_id, param);
|
||||
AssertError(rpc != NULL, return false, "[MPLANE] <commit> RPC creation failed.\n");
|
||||
|
||||
bool success = rpc_send_recv((struct nc_session *)ru_session->session, rpc, wd, timeout, NULL);
|
||||
AssertError(success, return false, "[MPLANE] Failed to commit candidate datastore.\n");
|
||||
|
||||
MP_LOG_I("Successfully commited CU-planes configuration into running datastore for RU \"%s\".\n", ru_session->ru_ip_add);
|
||||
|
||||
nc_rpc_free(rpc);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -29,4 +29,6 @@ bool edit_config_mplane(ru_session_t *ru_session, const char *buffer, const open
|
||||
|
||||
bool validate_config_mplane(ru_session_t *ru_session);
|
||||
|
||||
bool commit_config_mplane(ru_session_t *ru_session);
|
||||
|
||||
#endif /* CONFIGURE_MPLANE_H */
|
||||
|
||||
@@ -181,6 +181,9 @@ bool manage_ru(ru_session_t *ru_session, const openair0_config_t *oai, const siz
|
||||
|
||||
success = validate_config_mplane(ru_session);
|
||||
AssertError(success, return false, "[MPLANE] Unable to validate the RU configuration.\n");
|
||||
|
||||
success = commit_config_mplane(ru_session);
|
||||
AssertError(success, return false, "[MPLANE] Unable to commit the RU configuration.\n");
|
||||
}
|
||||
|
||||
free(operational_ds);
|
||||
|
||||
Reference in New Issue
Block a user