yumapro  21.10T-10
YumaPro SDK
db_api.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3  * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
4  *
5  * Unless required by applicable law or agreed to in writing,
6  * software distributed under the License is distributed on an
7  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8  * KIND, either express or implied. See the License for the
9  * specific language governing permissions and limitations
10  * under the License.
11  */
12 #ifndef _H_db_api
13 #define _H_db_api
14 
15 /* FILE: db_api.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
28 /*********************************************************************
29 * *
30 * C H A N G E H I S T O R Y *
31 * *
32 *********************************************************************
33 
34 date init comment
35 ----------------------------------------------------------------------
36 18-nov-14 abb Begun
37 */
38 
39 #include <xmlstring.h>
40 
41 #ifndef _H_rpc
42 #include "rpc.h"
43 #endif
44 
45 #ifndef _H_val
46 #include "val.h"
47 #endif
48 
49 #ifndef _H_yang_patch
50 #include "yang_patch.h"
51 #endif
52 
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 
79 /********************************************************************
80 * *
81 * C O N S T A N T S *
82 * *
83 *********************************************************************/
84 
86 #define DB_API (const xmlChar *)"db-api"
87 
89 #define DB_API_MOD (const xmlChar *)"yumaworks-db-api"
90 
92 #define DB_API_OBJ (const xmlChar *)"db-api"
93 
95 #define DB_API_REQ_OK(ST) (ST >= DB_API_ST_READY)
96 
97 
98 /********************************************************************
99 * *
100 * T Y P E S *
101 * *
102 *********************************************************************/
103 
104 
105 /********************************************************************
106 * *
107 * F U N C T I O N S *
108 * *
109 *********************************************************************/
110 
111 
119 extern status_t
121 
122 
132 extern status_t
133  db_api_register_service_ex (boolean with_db_lock);
134 
135 
142 extern boolean
143  db_api_service_ready (void);
144 
145 
188 extern status_t
189  db_api_send_edit (const xmlChar *edit_target,
190  const xmlChar *edit_operation,
191  const xmlChar *edit_xml_value);
192 
193 
222 extern status_t
223  db_api_send_edit_ex (const xmlChar *edit_target,
224  const xmlChar *edit_operation,
225  const xmlChar *edit_xml_value,
226  const xmlChar *patch_id_str,
227  boolean system_edit);
228 
229 
294 extern status_t
295  db_api_send_edit_full (const xmlChar *edit_target,
296  const xmlChar *edit_operation,
297  const xmlChar *edit_xml_value,
298  const xmlChar *patch_id_str,
299  boolean system_edit,
300  const xmlChar *insert_point,
301  const xmlChar *insert_where);
302 
303 
369 extern status_t
370  db_api_send_edit_full2 (const xmlChar *edit_target,
371  const xmlChar *edit_operation,
372  const xmlChar *edit_xml_value,
373  const xmlChar *patch_id_str,
374  boolean system_edit,
375  const xmlChar *insert_point,
376  const xmlChar *insert_where,
377  boolean skip_sil);
378 
379 
392 extern status_t
393  db_api_check_edit (void);
394 
395 
413 extern status_t
414  db_api_check_edit_ex (const xmlChar **errstr);
415 
416 
417 
427 extern status_t
428  db_api_send_getconfig (const xmlChar *filespec,
429  boolean withdef);
430 
431 
445 extern status_t
446  db_api_send_getfilter (const xmlChar *filespec,
447  boolean withdef,
448  boolean get_config,
449  const xmlChar *xpath_filter);
450 
451 
474 extern status_t
475  db_api_start_patch (const xmlChar *patch_id_str,
476  boolean system_edit,
477  yang_patch_cb_t **retcb);
478 
479 
480 
508 extern status_t
509  db_api_start_patch2 (const xmlChar *patch_id_str,
510  boolean system_edit,
511  boolean skip_sil,
512  const xmlChar *comment,
513  yang_patch_cb_t **retcb);
514 
515 
536 extern status_t
538  const xmlChar *edit_id_str,
539  const xmlChar *edit_target,
540  const xmlChar *edit_operation,
541  const xmlChar *edit_xml_value,
542  const xmlChar *insert_point,
543  const xmlChar *insert_where);
544 
545 
554 extern status_t
556 
557 
563 extern void
565 
566 
574 extern status_t
576 
577 
586 extern status_t
587  db_api_send_enter_maintmode_ex (boolean read_ok,
588  boolean operation_ok);
589 
590 
596 extern status_t
598 
599 
606 extern status_t
607  db_api_send_set_loglevel (const char *dlevel);
608 
609 
615 extern status_t
617 
618 
624 extern status_t
626 
627 
642 extern status_t
643  db_api_send_subrpc_request (const xmlChar *user_id,
644  const xmlChar *rpc_modname,
645  const xmlChar *rpc_name,
646  const xmlChar *in_filespec,
647  const xmlChar *out_filespec);
648 
649 
650 
651 
652 
660 extern status_t
662 
663 
664 
668 #ifdef __cplusplus
669 } /* end extern 'C' */
670 #endif
671 
672 #endif /* _H_db_api */
status_t db_api_send_enter_maintmode_ex(boolean read_ok, boolean operation_ok)
Create a <enter-maintmode> request and send it to the main server.
Definition: db_api.c:3223
status_t db_api_send_exit_maintmode(void)
Create a <exit-maintmode> request and send it to the main server.
Definition: db_api.c:3243
status_t db_api_send_edit_full2(const xmlChar *edit_target, const xmlChar *edit_operation, const xmlChar *edit_xml_value, const xmlChar *patch_id_str, boolean system_edit, const xmlChar *insert_point, const xmlChar *insert_where, boolean skip_sil)
Create a YANG Patch edit request and send it to the DB-API service on the main server.
Definition: db_api.c:2391
status_t db_api_request_local_db_lock(void)
API to request that the local system has the Db-Edit-Lock.
Definition: db_api.c:3282
status_t db_api_add_edit(yang_patch_cb_t *pcb, const xmlChar *edit_id_str, const xmlChar *edit_target, const xmlChar *edit_operation, const xmlChar *edit_xml_value, const xmlChar *insert_point, const xmlChar *insert_where)
Create an edit request and add to YANG Patch in progress.
Definition: db_api.c:2775
status_t db_api_register_service(void)
Register the DB-API service with the YControl layer.
Definition: db_api.c:2070
status_t db_api_send_enter_maintmode(void)
Create a <enter-maintmode> request and send it to the main server.
Definition: db_api.c:3201
status_t db_api_send_edit_full(const xmlChar *edit_target, const xmlChar *edit_operation, const xmlChar *edit_xml_value, const xmlChar *patch_id_str, boolean system_edit, const xmlChar *insert_point, const xmlChar *insert_where)
Create a YANG Patch edit request and send it to the DB-API service on the main server.
Definition: db_api.c:2309
status_t db_api_start_patch(const xmlChar *patch_id_str, boolean system_edit, yang_patch_cb_t **retcb)
Start a YANG Patch request that can have multiple edits.
Definition: db_api.c:2634
status_t db_api_register_service_ex(boolean with_db_lock)
Register the DB-API service with the YControl layer.
Definition: db_api.c:2084
status_t db_api_send_patch(yang_patch_cb_t *pcb)
Send a previously created patch request.
Definition: db_api.c:3012
status_t db_api_check_edit_ex(const xmlChar **errstr)
Check on the status of an edit in progress.
Definition: db_api.c:2883
Value Node Basic Support.
boolean db_api_service_ready(void)
Check if the DB-API service is done initializing, and is now ready to send requests to the server...
Definition: db_api.c:2130
One YANG Patch Request.
Definition: yang_patch.h:155
status_t db_api_release_local_db_lock(void)
API to release the local system Db-Edit-Lock.
Definition: db_api.c:3334
YANG Patch Media Type.
status_t db_api_send_ypha_request(val_value_t *msgval)
Create a <yp-ha-mode> request and send it to the main server.
Definition: db_api.c:3457
status_t db_api_send_edit_ex(const xmlChar *edit_target, const xmlChar *edit_operation, const xmlChar *edit_xml_value, const xmlChar *patch_id_str, boolean system_edit)
Create a YANG Patch edit request and send it to the DB-API service on the main server.
Definition: db_api.c:2233
one value to match one type
Definition: val.h:870
status_t db_api_check_edit(void)
Check on the status of an edit in progress.
Definition: db_api.c:2853
status_t db_api_send_edit(const xmlChar *edit_target, const xmlChar *edit_operation, const xmlChar *edit_xml_value)
Create a YANG Patch edit request and send it to the DB-API service on the main server.
Definition: db_api.c:2174
status_t db_api_send_getconfig(const xmlChar *filespec, boolean withdef)
Create a <getconfig> request and send it to the main server.
Definition: db_api.c:2935
status_t db_api_send_subrpc_request(const xmlChar *user_id, const xmlChar *rpc_modname, const xmlChar *rpc_name, const xmlChar *in_filespec, const xmlChar *out_filespec)
Create a <subrpc-request> request and send it to the main server.
Definition: db_api.c:3396
status_t
global error return code
Definition: status_enum.h:186
NETCONF protocol remote procedure call common definitions.
status_t db_api_send_set_loglevel(const char *dlevel)
Create a <set-log-level> request and send it to the main server.
Definition: db_api.c:3262
void db_api_free_patch(yang_patch_cb_t *pcb)
Free a patch control block.
Definition: db_api.c:3182
status_t db_api_send_getfilter(const xmlChar *filespec, boolean withdef, boolean get_config, const xmlChar *xpath_filter)
Retrieve data from the server with complete parameters.
Definition: db_api.c:2961
status_t db_api_start_patch2(const xmlChar *patch_id_str, boolean system_edit, boolean skip_sil, const xmlChar *comment, yang_patch_cb_t **retcb)
Start a YANG Patch request that can have multiple edits with complete parameters (YPW-1826) ...
Definition: db_api.c:2670