libdsdb3  3.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups
dbog_dsdb.h
Go to the documentation of this file.
1 /*******************************************************************************
2 *
3 * COPYRIGHT (C) 2010 Battelle Memorial Institute. All Rights Reserved.
4 *
5 ********************************************************************************
6 *
7 * Author:
8 * name: Brian Ermold
9 * phone: (509) 375-2277
10 * email: brian.ermold@pnl.gov
11 *
12 ********************************************************************************
13 *
14 * REPOSITORY INFORMATION:
15 * $Revision: 48761 $
16 * $Author: ermold $
17 * $Date: 2013-10-28 20:35:44 +0000 (Mon, 28 Oct 2013) $
18 *
19 *******************************************************************************/
20 
21 /** @file dbog_dsdb.h
22  * Header file for DSDB object group functions.
23  */
24 
25 #ifndef _DBOG_DSDB_H_
26 #define _DBOG_DSDB_H_ 1
27 
28 #include "dbconn.h"
29 
30 /*@{*/
31 /** @privatesection */
32 
33 /*******************************************************************************
34 * Facilities
35 */
36 
37 DBStatus dsdbog_get_facility_location(
38  DBConn *dbconn,
39  const char *site,
40  const char *facility,
41  DBResult **result);
42 
43 #define FacLat(dbres) dbres->data[0]
44 #define FacLon(dbres) dbres->data[1]
45 #define FacAlt(dbres) dbres->data[2]
46 #define FacLoc(dbres) dbres->data[3]
47 
48 DBStatus dsdbog_get_site_description(
49  DBConn *dbconn,
50  const char *site,
51  DBResult **result);
52 
53 #define SiteName(dbres) dbres->data[0]
54 #define SiteDesc(dbres) dbres->data[1]
55 
56 /*******************************************************************************
57 * Process Procedures
58 */
59 
60 /* Process Config Values */
61 
62 
63 DBStatus dsdbog_define_process_config_key(
64  DBConn *dbconn,
65  const char *key,
66  int *result);
67 
68 DBStatus dsdbog_delete_process_config_key(
69  DBConn *dbconn,
70  const char *key,
71  int *result);
72 
73 DBStatus dsdbog_delete_process_config_value(
74  DBConn *dbconn,
75  const char *proc_type,
76  const char *proc_name,
77  const char *site,
78  const char *facility,
79  const char *key,
80  int *result);
81 
82 DBStatus dsdbog_get_process_config_values(
83  DBConn *dbconn,
84  const char *proc_type,
85  const char *proc_name,
86  const char *site,
87  const char *facility,
88  const char *key,
89  DBResult **result);
90 
91 #define ProcConfType(dbres,row) DB_RESULT(dbres,row,0)
92 #define ProcConfName(dbres,row) DB_RESULT(dbres,row,1)
93 #define ProcConfSite(dbres,row) DB_RESULT(dbres,row,2)
94 #define ProcConfFac(dbres,row) DB_RESULT(dbres,row,3)
95 #define ProcConfKey(dbres,row) DB_RESULT(dbres,row,4)
96 #define ProcConfValue(dbres,row) DB_RESULT(dbres,row,5)
97 
98 DBStatus dsdbog_update_process_config_value(
99  DBConn *dbconn,
100  const char *proc_type,
101  const char *proc_name,
102  const char *site,
103  const char *facility,
104  const char *key,
105  const char *value,
106  int *result);
107 
108 /* Process Families */
109 
110 
111 DBStatus dsdbog_inquire_process_families(
112  DBConn *dbconn,
113  const char *category,
114  const char *class,
115  const char *site,
116  const char *facility,
117  DBResult **result);
118 
119 #define ProcFamCat(dbres,row) DB_RESULT(dbres,row,0)
120 #define ProcFamClass(dbres,row) DB_RESULT(dbres,row,1)
121 #define ProcFamSite(dbres,row) DB_RESULT(dbres,row,2)
122 #define ProcFamFac(dbres,row) DB_RESULT(dbres,row,3)
123 #define ProcFamLoc(dbres,row) DB_RESULT(dbres,row,4)
124 #define ProcFamLat(dbres,row) DB_RESULT(dbres,row,5)
125 #define ProcFamLon(dbres,row) DB_RESULT(dbres,row,6)
126 #define ProcFamAlt(dbres,row) DB_RESULT(dbres,row,7)
127 
128 
129 /* Family Processes */
130 
131 
132 DBStatus dsdbog_get_family_process(
133  DBConn *dbconn,
134  const char *site,
135  const char *facility,
136  const char *proc_type,
137  const char *proc_name,
138  DBResult **result);
139 
140 DBStatus dsdbog_inquire_family_processes(
141  DBConn *dbconn,
142  const char *category,
143  const char *class,
144  const char *site,
145  const char *facility,
146  const char *proc_type,
147  const char *proc_name,
148  DBResult **result);
149 
150 #define FamProcCat(dbres,row) DB_RESULT(dbres,row,0)
151 #define FamProcClass(dbres,row) DB_RESULT(dbres,row,1)
152 #define FamProcSite(dbres,row) DB_RESULT(dbres,row,2)
153 #define FamProcFac(dbres,row) DB_RESULT(dbres,row,3)
154 #define FamProcType(dbres,row) DB_RESULT(dbres,row,4)
155 #define FamProcName(dbres,row) DB_RESULT(dbres,row,5)
156 
157 DBStatus dsdbog_get_family_process_location(
158  DBConn *dbconn,
159  const char *site,
160  const char *facility,
161  const char *proc_type,
162  const char *proc_name,
163  DBResult **result);
164 
165 #define FamProcLat(dbres) dbres->data[0]
166 #define FamProcLon(dbres) dbres->data[1]
167 #define FamProcAlt(dbres) dbres->data[2]
168 #define FamProcLoc(dbres) dbres->data[3]
169 
170 
171 /* Family Process States */
172 
173 
174 DBStatus dsdbog_delete_family_process_state(
175  DBConn *dbconn,
176  const char *site,
177  const char *facility,
178  const char *proc_type,
179  const char *proc_name,
180  int *result);
181 
182 DBStatus dsdbog_get_family_process_state(
183  DBConn *dbconn,
184  const char *site,
185  const char *facility,
186  const char *proc_type,
187  const char *proc_name,
188  DBResult **result);
189 
190 DBStatus dsdbog_inquire_family_process_states(
191  DBConn *dbconn,
192  const char *category,
193  const char *class,
194  const char *site,
195  const char *facility,
196  const char *proc_type,
197  const char *proc_name,
198  DBResult **result);
199 
200 #define StateCat(dbres,row) DB_RESULT(dbres,row,0)
201 #define StateClass(dbres,row) DB_RESULT(dbres,row,1)
202 #define StateSite(dbres,row) DB_RESULT(dbres,row,2)
203 #define StateFac(dbres,row) DB_RESULT(dbres,row,3)
204 #define StateProcType(dbres,row) DB_RESULT(dbres,row,4)
205 #define StateProcName(dbres,row) DB_RESULT(dbres,row,5)
206 #define StateName(dbres,row) DB_RESULT(dbres,row,6)
207 #define StateEnabled(dbres,row) DB_RESULT(dbres,row,7)
208 #define StateText(dbres,row) DB_RESULT(dbres,row,8)
209 #define StateTime(dbres,row) DB_RESULT(dbres,row,9)
210 
211 DBStatus dsdbog_is_family_process_enabled(
212  DBConn *dbconn,
213  const char *site,
214  const char *facility,
215  const char *proc_type,
216  const char *proc_name,
217  int *result);
218 
219 DBStatus dsdbog_update_family_process_state(
220  DBConn *dbconn,
221  const char *site,
222  const char *facility,
223  const char *proc_type,
224  const char *proc_name,
225  const char *state,
226  const char *description,
227  time_t state_time,
228  int *result);
229 
230 
231 /* Family Process Statuses */
232 
233 
234 DBStatus dsdbog_delete_family_process_status(
235  DBConn *dbconn,
236  const char *site,
237  const char *facility,
238  const char *proc_type,
239  const char *proc_name,
240  int *result);
241 
242 DBStatus dsdbog_get_family_process_status(
243  DBConn *dbconn,
244  const char *site,
245  const char *facility,
246  const char *proc_type,
247  const char *proc_name,
248  DBResult **result);
249 
250 DBStatus dsdbog_inquire_family_process_statuses(
251  DBConn *dbconn,
252  const char *category,
253  const char *class,
254  const char *site,
255  const char *facility,
256  const char *proc_type,
257  const char *proc_name,
258  DBResult **result);
259 
260 #define StatusCat(dbres,row) DB_RESULT(dbres,row,0)
261 #define StatusClass(dbres,row) DB_RESULT(dbres,row,1)
262 #define StatusSite(dbres,row) DB_RESULT(dbres,row,2)
263 #define StatusFac(dbres,row) DB_RESULT(dbres,row,3)
264 #define StatusProcType(dbres,row) DB_RESULT(dbres,row,4)
265 #define StatusProcName(dbres,row) DB_RESULT(dbres,row,5)
266 #define StatusName(dbres,row) DB_RESULT(dbres,row,6)
267 #define StatusSuccessful(dbres,row) DB_RESULT(dbres,row,7)
268 #define StatusText(dbres,row) DB_RESULT(dbres,row,8)
269 #define StatusLastStarted(dbres,row) DB_RESULT(dbres,row,9)
270 #define StatusLastCompleted(dbres,row) DB_RESULT(dbres,row,10)
271 #define StatusLastSuccessful(dbres,row) DB_RESULT(dbres,row,11)
272 
273 DBStatus dsdbog_update_family_process_started(
274  DBConn *dbconn,
275  const char *site,
276  const char *facility,
277  const char *proc_type,
278  const char *proc_name,
279  time_t started_time,
280  int *result);
281 
282 DBStatus dsdbog_update_family_process_completed(
283  DBConn *dbconn,
284  const char *site,
285  const char *facility,
286  const char *proc_type,
287  const char *proc_name,
288  time_t completed_time,
289  int *result);
290 
291 DBStatus dsdbog_update_family_process_status(
292  DBConn *dbconn,
293  const char *site,
294  const char *facility,
295  const char *proc_type,
296  const char *proc_name,
297  const char *status,
298  const char *description,
299  time_t completed_time,
300  int *result);
301 
302 
303 /* Process Input Datastream Classes */
304 
305 
306 DBStatus dsdbog_get_process_input_ds_classes(
307  DBConn *dbconn,
308  const char *proc_type,
309  const char *proc_name,
310  DBResult **result);
311 
312 DBStatus dsdbog_inquire_process_input_ds_classes(
313  DBConn *dbconn,
314  const char *proc_type,
315  const char *proc_name,
316  const char *dsc_name,
317  const char *dsc_level,
318  DBResult **result);
319 
320 #define InDscProcType(dbres,row) DB_RESULT(dbres,row,0)
321 #define InDscProcName(dbres,row) DB_RESULT(dbres,row,1)
322 #define InDscName(dbres,row) DB_RESULT(dbres,row,2)
323 #define InDscLevel(dbres,row) DB_RESULT(dbres,row,3)
324 
325 
326 /* Process Output Datastream Classes */
327 
328 
329 DBStatus dsdbog_get_process_output_ds_classes(
330  DBConn *dbconn,
331  const char *proc_type,
332  const char *proc_name,
333  DBResult **result);
334 
335 DBStatus dsdbog_inquire_process_output_ds_classes(
336  DBConn *dbconn,
337  const char *proc_type,
338  const char *proc_name,
339  const char *dsc_name,
340  const char *dsc_level,
341  DBResult **result);
342 
343 #define OutDscProcType(dbres,row) DB_RESULT(dbres,row,0)
344 #define OutDscProcName(dbres,row) DB_RESULT(dbres,row,1)
345 #define OutDscName(dbres,row) DB_RESULT(dbres,row,2)
346 #define OutDscLevel(dbres,row) DB_RESULT(dbres,row,3)
347 
348 
349 /* Process Output Datastreams */
350 
351 
352 DBStatus dsdbog_delete_process_output_datastream(
353  DBConn *dbconn,
354  const char *proc_type,
355  const char *proc_name,
356  const char *dsc_name,
357  const char *dsc_level,
358  const char *site,
359  const char *facility,
360  int *result);
361 
362 DBStatus dsdbog_get_process_output_datastream(
363  DBConn *dbconn,
364  const char *proc_type,
365  const char *proc_name,
366  const char *dsc_name,
367  const char *dsc_level,
368  const char *site,
369  const char *facility,
370  DBResult **result);
371 
372 DBStatus dsdbog_inquire_process_output_datastreams(
373  DBConn *dbconn,
374  const char *proc_type,
375  const char *proc_name,
376  const char *dsc_name,
377  const char *dsc_level,
378  const char *site,
379  const char *facility,
380  DBResult **result);
381 
382 #define OutDsProcType(dbres,row) DB_RESULT(dbres,row,0)
383 #define OutDsProcName(dbres,row) DB_RESULT(dbres,row,1)
384 #define OutDsClassName(dbres,row) DB_RESULT(dbres,row,2)
385 #define OutDsClassLevel(dbres,row) DB_RESULT(dbres,row,3)
386 #define OutDsSite(dbres,row) DB_RESULT(dbres,row,4)
387 #define OutDsFac(dbres,row) DB_RESULT(dbres,row,5)
388 #define OutDsFirstTime(dbres,row) DB_RESULT(dbres,row,6)
389 #define OutDsLastTime(dbres,row) DB_RESULT(dbres,row,7)
390 
391 DBStatus dsdbog_update_process_output_datastream(
392  DBConn *dbconn,
393  const char *proc_type,
394  const char *proc_name,
395  const char *dsc_name,
396  const char *dsc_level,
397  const char *site,
398  const char *facility,
399  const timeval_t *first_time,
400  const timeval_t *last_time,
401  int *result);
402 
403 /* Datastream Config Values */
404 
405 
406 DBStatus dsdbog_define_datastream_config_key(
407  DBConn *dbconn,
408  const char *key,
409  int *result);
410 
411 DBStatus dsdbog_delete_datastream_config_key(
412  DBConn *dbconn,
413  const char *key,
414  int *result);
415 
416 DBStatus dsdbog_delete_datastream_config_value(
417  DBConn *dbconn,
418  const char *dsc_type,
419  const char *dsc_name,
420  const char *site,
421  const char *facility,
422  const char *key,
423  int *result);
424 
425 DBStatus dsdbog_get_datastream_config_values(
426  DBConn *dbconn,
427  const char *dsc_type,
428  const char *dsc_name,
429  const char *site,
430  const char *facility,
431  const char *key,
432  DBResult **result);
433 
434 #define DSConfName(dbres,row) DB_RESULT(dbres,row,0)
435 #define DSConfLevel(dbres,row) DB_RESULT(dbres,row,1)
436 #define DSConfSite(dbres,row) DB_RESULT(dbres,row,2)
437 #define DSConfFac(dbres,row) DB_RESULT(dbres,row,3)
438 #define DSConfKey(dbres,row) DB_RESULT(dbres,row,4)
439 #define DSConfValue(dbres,row) DB_RESULT(dbres,row,5)
440 
441 DBStatus dsdbog_update_datastream_config_value(
442  DBConn *dbconn,
443  const char *dsc_type,
444  const char *dsc_name,
445  const char *site,
446  const char *facility,
447  const char *key,
448  const char *value,
449  int *result);
450 
451 /*@}*/
452 
453 #endif /* _DBOG_DSDB_H_ */