irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

libirods_rule_engine_plugin-irods_rule_language.cpp
Go to the documentation of this file.
1 // =-=-=-=-=-=-=-
2 // irods includes
3 #include "msParam.h"
4 #include "reGlobalsExtern.hpp"
5 #include "generalAdmin.h"
6 #include "miscServerFunct.hpp"
7 #include "execMyRule.h"
8 
9 // =-=-=-=-=-=-=-
11 #include "irods_file_object.hpp"
17 #include "irods_stacktrace.hpp"
18 #include "irods_re_plugin.hpp"
23 #include "irods_ms_plugin.hpp"
24 
25 // =-=-=-=-=-=-=-
26 // stl includes
27 #include <iostream>
28 #include <sstream>
29 #include <vector>
30 #include <string>
31 
32 // =-=-=-=-=-=-=-
33 // boost includes
34 #include <boost/lexical_cast.hpp>
35 #include <boost/function.hpp>
36 #include <boost/any.hpp>
37 
38 #include "configuration.hpp"
39 #include "rules.hpp"
40 #include "reFuncDefs.hpp"
41 #include "region.h"
42 
43 #include "msiHelper.hpp"
44 
45 // =-=-=-=-=-=-=-
46 // from reGlobals.hpp
55 int reTestFlag = 0;
64 
65 const std::string STATIC_PEP_RULE_REGEX = "ac[^ ]*";
66 const std::string DYNAMIC_PEP_RULE_REGEX = "[^ ]*pep_[^ ]*_(pre|post)";
67 const std::string MICROSERVICE_RULE_REGEX = "msi[^ ]*";
68 static std::string local_instance_name;
69 
70 int initRuleEngine( const char*, rsComm_t*, const char*, const char*, const char *);
71 
72 static std::string get_string_array_from_array( const boost::any& _array ) {
73  std::string str_array;
74  try {
75  for( const auto& el : boost::any_cast<const std::vector<boost::any>&>( _array ) ) {
76  try {
77  str_array += boost::any_cast< const std::string& >(el);
78  }
79  catch ( const boost::bad_any_cast& ) {
80  rodsLog(LOG_ERROR, "%s - failed to cast rule base file name entry to string", __PRETTY_FUNCTION__);
81  continue;
82  }
83  str_array += ",";
84 
85  } // for itr
86  str_array = str_array.substr( 0, str_array.size() - 1 );
87  return str_array;
88  } catch( const boost::bad_any_cast& ) {
89  THROW(INVALID_ANY_CAST, "failed to any_cast to vector");
90  }
91 
92 } // get_string_array_from_array
93 
95  const boost::any& _array,
96  const std::string& _instance_name ) {
97  try {
98  const auto& arr = boost::any_cast<const std::vector<boost::any>&>( _array );
99  for ( const auto& elem : arr ) {
100  try {
101  const auto& tmp = boost::any_cast<const std::string&>(elem);
103  } catch ( boost::bad_any_cast& ) {
104  rodsLog(
105  LOG_ERROR,
106  "%s - failed to cast regex to string",
107  __FUNCTION__);
108  continue;
109  }
110  }
111  } catch ( const boost::bad_any_cast& ) {
112  std::stringstream msg;
113  msg << "[" << _instance_name << "] failed to any_cast a std::vector<boost::any>&";
114  THROW(INVALID_ANY_CAST, msg.str());
115  }
116 } // register_regexes_from_array
117 
121 
122  table[ "msiGetStdoutInExecCmdOut" ] = new irods::ms_table_entry( "msiGetStdoutInExecCmdOut", 2, std::function<int(msParam_t*,msParam_t*,ruleExecInfo_t*)>( msiGetStdoutInExecCmdOut ) );
123  table[ "msiGetStderrInExecCmdOut" ] = new irods::ms_table_entry( "msiGetStderrInExecCmdOut", 2, std::function<int(msParam_t*,msParam_t*,ruleExecInfo_t*)>( msiGetStderrInExecCmdOut ) );
124  table[ "msiAddKeyValToMspStr" ] = new irods::ms_table_entry( "msiAddKeyValToMspStr", 3, std::function<int(msParam_t*,msParam_t*,msParam_t*,ruleExecInfo_t*)>( msiAddKeyValToMspStr ) );
125  table[ "msiWriteRodsLog" ] = new irods::ms_table_entry( "msiWriteRodsLog", 2, std::function<int(msParam_t*,msParam_t*,ruleExecInfo_t*)>( msiWriteRodsLog ) );
126  table[ "msiSplitPath" ] = new irods::ms_table_entry( "msiSplitPath", 3, std::function<int(msParam_t*,msParam_t*,msParam_t*,ruleExecInfo_t*)>( msiSplitPath ) );
127  table[ "msiSplitPathByKey" ] = new irods::ms_table_entry( "msiSplitPathByKey", 4, std::function<int(msParam_t*,msParam_t*,msParam_t*,msParam_t*,ruleExecInfo_t*)>( msiSplitPathByKey ) );
128  table[ "msiGetSessionVarValue" ] = new irods::ms_table_entry( "msiGetSessionVarValue", 2, std::function<int(msParam_t*,msParam_t*,ruleExecInfo_t*)>( msiGetSessionVarValue ) );
129  table[ "msiStrlen" ] = new irods::ms_table_entry( "msiStrlen", 2, std::function<int(msParam_t*,msParam_t*,ruleExecInfo_t*)>( msiStrlen ) );
130  table[ "msiStrCat" ] = new irods::ms_table_entry( "msiStrCat", 2, std::function<int(msParam_t*,msParam_t*,ruleExecInfo_t*)>( msiStrCat ) );
131  table[ "msiStrchop" ] = new irods::ms_table_entry( "msiStrchop", 2, std::function<int(msParam_t*,msParam_t*,ruleExecInfo_t*)>( msiStrchop ) );
132  table[ "msiSubstr" ] = new irods::ms_table_entry( "msiSubstr", 4, std::function<int(msParam_t*,msParam_t*,msParam_t*,msParam_t*,ruleExecInfo_t*)>( msiSubstr ) );
133  table[ "msiExit" ] = new irods::ms_table_entry( "msiExit", 2, std::function<int(msParam_t*,msParam_t*,ruleExecInfo_t*)>( msiExit ) );
134 
135 }
136 
137 extern Cache ruleEngineConfig;
138 
139 irods::error start(irods::default_re_ctx&,const std::string& _instance_name ) {
140  local_instance_name = _instance_name;
141 
142  try {
143  const auto& re_plugin_arr = boost::any_cast<const std::vector<boost::any>&>(irods::get_server_property<const std::unordered_map<std::string, boost::any>&>(irods::CFG_PLUGIN_CONFIGURATION_KW).at(irods::PLUGIN_TYPE_RULE_ENGINE));
144  for( const auto& el : re_plugin_arr ) {
145  const auto& plugin_config = boost::any_cast<const std::unordered_map<std::string, boost::any>&>(el);
146  const auto& inst_name = boost::any_cast<const std::string&>(plugin_config.at(irods::CFG_INSTANCE_NAME_KW));
147  if( inst_name == _instance_name) {
148  const auto& shmem_value = boost::any_cast<const std::string&>( plugin_config.at(irods::CFG_SHARED_MEMORY_INSTANCE_KW) );
149  const auto& plugin_spec_cfg = boost::any_cast<const std::unordered_map<std::string, boost::any>&>( plugin_config.at(irods::CFG_PLUGIN_SPECIFIC_CONFIGURATION_KW) );
150  std::string core_re = get_string_array_from_array(plugin_spec_cfg.at(irods::CFG_RE_RULEBASE_SET_KW));
151  std::string core_fnm = get_string_array_from_array(plugin_spec_cfg.at(irods::CFG_RE_FUNCTION_NAME_MAPPING_SET_KW));
152  std::string core_dvm = get_string_array_from_array(plugin_spec_cfg.at(irods::CFG_RE_DATA_VARIABLE_MAPPING_SET_KW));
153  int status = initRuleEngine(
154  shmem_value.c_str(),
155  nullptr,
156  core_re.c_str(),
157  core_dvm.c_str(),
158  core_fnm.c_str() );
159  if( status < 0 ) {
160  return ERROR(
161  status,
162  "failed to initialize native rule engine" );
163  }
164  // index locally defined microservices
166 
167  if (plugin_spec_cfg.count(irods::CFG_RE_PEP_REGEX_SET_KW) > 0) {
169  plugin_spec_cfg.at(irods::CFG_RE_PEP_REGEX_SET_KW),
170  _instance_name );
171  } else {
175  rodsLog(
176  LOG_DEBUG,
177  "No regexes found in server config - using default regexes: [%s], [%s], [%s]",
178  STATIC_PEP_RULE_REGEX.c_str(),
179  DYNAMIC_PEP_RULE_REGEX.c_str(),
180  MICROSERVICE_RULE_REGEX.c_str() );
181  }
182 
183  return SUCCESS();
184  }
185  }
186  } catch (const irods::exception& e) {
187  return irods::error(e);
188  } catch (const boost::bad_any_cast& e) {
189  return ERROR(INVALID_ANY_CAST, e.what());
190  } catch (const std::out_of_range& e) {
191  return ERROR(KEY_NOT_FOUND, e.what());
192  }
193 
194  std::stringstream msg;
195  msg << "failed to find configuration for re-irods plugin ["
196  << _instance_name << "]";
197  rodsLog( LOG_ERROR, "%s", msg.str().c_str() );
198  return ERROR(
200  msg.str() );
201 
202 }
203 
204 int finalizeRuleEngine();
205 irods::error stop(irods::default_re_ctx& _u, const std::string& _instance_name) {
206  (void) _u;
208  return SUCCESS();
209 }
210 
211 irods::error rule_exists(irods::default_re_ctx&, const std::string& _rn, bool& _ret) {
213  rodsLog(
214  LOG_DEBUG,
215  "rule engine xre has not initialized, skip rule [%s]",
216  _rn.c_str()
217  );
218  _ret = false;
219  return SUCCESS();
220  }
221  _ret = lookupFromEnv(ruleEngineConfig.extFuncDescIndex, const_cast<char*>(_rn.c_str())) != NULL;
222  rodsLog(
223  LOG_DEBUG,
224  "looking up rule name %s, found = %d",
225  _rn.c_str(),
226  _ret );
227 
228  return SUCCESS();
229 }
230 
231 irods::error list_rules( irods::default_re_ctx&, std::vector<std::string>& rule_vec ) {
232  for ( int i = 0; i < ruleEngineConfig.coreRuleSet->len; ++i ) {
233  rule_vec.push_back( ruleEngineConfig.coreRuleSet->rules[i]->node->subtrees[0]->text );
234  }
235  return SUCCESS();
236 }
237 
238 irods::error exec_rule(irods::default_re_ctx&, const std::string& _rn, std::list<boost::any>& _ps, irods::callback _eff_hdlr) {
240  rodsLog(
241  LOG_DEBUG,
242  "rule engine xre has not initialized, skip rule [%s]",
243  _rn.c_str());
244  return SUCCESS();
245  }
246 
247  rodsLog(
248  LOG_DEBUG,
249  "applying rule %s, params %ld",
250  _rn.c_str(),
251  _ps.size());
252 
253  ruleExecInfo_t* rei;
254  irods::error err;
255  if(!(err = _eff_hdlr("unsafe_ms_ctx", &rei)).ok()) {
256  return err;
257  }
258 
259  struct all_resources{
260  all_resources() {
261  memset(&msParamArray, 0, sizeof(msParamArray_t));
262 
263  }
264  ~all_resources() {
265  clearMsParamArray(&msParamArray, 1);
266  }
267  msParamArray_t msParamArray;
268 
269  } ar;
270 
271  std::stringstream expr;
272  expr << _rn << "(";
273  int i = 0;
274 
275  for ( auto itr = begin(_ps);itr!=end(_ps);++itr ) {
276  char arg[10];
277  snprintf(arg, 10, "*ARG%d", i);
278  if(i!=0) expr << ",";
279  expr << arg;
280 
281  // serialize to the map then bind to a ms param
284 
285  if(!ret.ok()) {
286  rodsLog(LOG_ERROR, "unsupported argument for calling re rules from the rule language");
287  addMsParam(&(ar.msParamArray), arg, STR_MS_T, (void *) "<unconvertible>", NULL);
288  }
289  else {
290  if( 0 == param.size() ) {
291  rodsLog( LOG_DEBUG, "empty serialized map for parameter %s", arg );
292  addMsParam(&(ar.msParamArray), arg, STR_MS_T, (void *) "<unconvertible>", NULL);
293  }
294  else if( 1 == param.size() ) {
295  // only one key-value in them map, bind it as a string
296  addMsParam(&(ar.msParamArray), arg, STR_MS_T, (void *) param.begin()->second.c_str(), NULL);
297  }
298  else {
299  keyValPair_t* kvp = (keyValPair_t*)malloc(sizeof(keyValPair_t));
300  memset( kvp, 0, sizeof( keyValPair_t ) );
301  for( auto i : param ) {
302  addKeyVal( kvp, i.first.c_str(), i.second.c_str() );
303  }
304  addMsParam(&(ar.msParamArray), arg, KeyValPair_MS_T, kvp, NULL );
305  }
306  }
307 
308  i++;
309  }
310  expr << ")";
311 
312  int ret = applyRuleUpdateParams(const_cast<char *>(expr.str().c_str()), &(ar.msParamArray), rei, 0);
313  i = 0;
314  for ( auto itr = begin(_ps);itr!=end(_ps);++itr ) {
315  char arg[10];
316  snprintf(arg, 10, "*ARG%d", i);
317  if(itr->type() == typeid(std::string)) {
318  } else if(itr->type() == typeid(std::string*)) {
319  msParam_t *msParam = getMsParamByLabel(&(ar.msParamArray), arg);
320  if(msParam != NULL) {
321  *boost::any_cast<std::string*>(*itr) = reinterpret_cast<char *>(msParam->inOutStruct);
322  } else {
323  rodsLog(LOG_ERROR, "no output parameter");
324  }
325 
326  } else {
327  rodsLog(LOG_DEBUG, "only string arguments are supported for returning from xre rules to the calling rule");
328  }
329  i++;
330  }
331 
332  rodsLog(
333  LOG_DEBUG,
334  "rule engine return %d", ret);
335 
336  // clear client-side errors for dynamic PEPs as we expect failures
337  // from the pre-PEPs to control access to operations
338  if( _rn.substr(0,4) == "pep_" ) {
339  if( rei && rei->rsComm ) {
340  freeRErrorContent( &rei->rsComm->rError );
341  }
342  }
343 
344  if (ret < 0) {
345  std::stringstream msg;
346  msg << "applyRuleUpdateParams failed for rule " << _rn;
347  rodsLog(LOG_DEBUG, "%s", msg.str().c_str() );
348  return ERROR(ret, msg.str());
349  }
350 
351  return CODE(ret);
352 }
353 
356  const std::string& _rt,
357  msParamArray_t* _ms_params,
358  const std::string& _out_desc,
359  irods::callback _eff_hdlr) {
360 
362  rodsLog(
363  LOG_DEBUG,
364  "rule engine xre has not initialized, skip rule [%s]",
365  _rt.c_str());
366  return SUCCESS();
367  }
368 
369  ruleExecInfo_t * rei;
370  irods::error err;
371  if(!(err = _eff_hdlr("unsafe_ms_ctx", &rei)).ok()) {
372  return err;
373  }
374 
375  rodsLog(
376  LOG_DEBUG,
377  "applying rule %s, params %ld",
378  _rt.c_str(),
379  _ms_params->len);
380 
381  const int status = execMyRule(
382  (char*)_rt.c_str(),
383  _ms_params,
384  _out_desc.c_str(),
385  rei );
386 
387  if (status < 0) {
388  std::stringstream msg;
389  msg << "execMyRule failed for rule " << _rt;
390  rodsLog(LOG_DEBUG, "%s", msg.str().c_str() );
391  return ERROR(status, msg.str());
392  }
393 
394  return SUCCESS();
395 }
396 
399  const std::string& _rt,
400  msParamArray_t* _ms_params,
401  irods::callback _eff_hdlr) {
402 
404  rodsLog(
405  LOG_DEBUG,
406  "rule engine xre has not initialized, skip rule [%s]",
407  _rt.c_str());
408  return SUCCESS();
409  }
410 
411  ruleExecInfo_t * rei;
412  irods::error err;
413  if(!(err = _eff_hdlr("unsafe_ms_ctx", &rei)).ok()) {
414  return err;
415  }
416 
417  rodsLog(
418  LOG_DEBUG,
419  "applying rule %s, params %ld",
420  _rt.c_str(),
421  _ms_params->len);
422 
423  std::string rule_text = "{" + _rt + "}";
424 
425  char res[MAX_COND_LEN];
427  (char*)rule_text.c_str(),
428  _ms_params,
429  rei,
430  NO_SAVE_REI,
431  res );
432 
433  if (status < 0) {
434  std::stringstream msg;
435  msg << "computeExpression failed for input " << _rt;
436  rodsLog(LOG_DEBUG, "%s", msg.str().c_str() );
437  return ERROR(status, msg.str());
438  }
439 
440  return SUCCESS();
441 }
442 
443 
444 extern "C"
446  const std::string& _context ) {
448  re->add_operation( "start",
449  std::function<irods::error(irods::default_re_ctx&,const std::string&)>( start ) );
450 
451  re->add_operation( "stop",
452  std::function<irods::error(irods::default_re_ctx&,const std::string&)>( stop ) );
453 
454  re->add_operation( "rule_exists",
455  std::function<irods::error(irods::default_re_ctx&, const std::string&, bool&)>( rule_exists ) );
456 
457  re->add_operation( "list_rules",
458  std::function<irods::error(irods::default_re_ctx&,std::vector<std::string>&)>( list_rules ) );
459 
460  re->add_operation( "exec_rule",
461  std::function<irods::error(irods::default_re_ctx&,const std::string&,std::list<boost::any>&,irods::callback)>( exec_rule ) );
462 
463  re->add_operation( "exec_rule_text",
464  std::function<irods::error(irods::default_re_ctx&,const std::string&,msParamArray_t*,const std::string&,irods::callback)>( exec_rule_text ) );
465 
466  re->add_operation( "exec_rule_expression",
468 
469  return re;
470 
471 }
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
ruleSet::rules
RuleDesc * rules[50000]
Definition: restructs.hpp:284
msiSplitPathByKey
int msiSplitPathByKey(msParam_t *inpPath, msParam_t *inpKey, msParam_t *outParentColl, msParam_t *outChildName, ruleExecInfo_t *rei)
Definition: msiHelper.cpp:838
exec_rule_expression
irods::error exec_rule_expression(irods::default_re_ctx &, const std::string &_rt, msParamArray_t *_ms_params, irods::callback _eff_hdlr)
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:397
NULL
#define NULL
Definition: rodsDef.h:70
msiStrCat
int msiStrCat(msParam_t *targParam, msParam_t *srcParam, ruleExecInfo_t *rei)
Definition: msiHelper.cpp:801
irods_physical_object.hpp
rsComm_t
Definition: rcConnect.h:145
coreRuleFuncMapDef
rulefmapdef_t coreRuleFuncMapDef
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:49
addKeyVal
int addKeyVal(keyValPair_t *condInput, const char *keyWord, const char *value)
Definition: rcMisc.cpp:789
irods::re_serialization::serialized_parameter_t
std::map< std::string, std::string > serialized_parameter_t
Definition: irods_re_serialization.hpp:21
irods::CFG_RE_PEP_REGEX_SET_KW
const std::string CFG_RE_PEP_REGEX_SET_KW("regexes_for_supported_peps")
irods::lookup_table
Definition: irods_lookup_table.hpp:24
GlobalREDebugFlag
int GlobalREDebugFlag
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:58
lookupFromEnv
const void * lookupFromEnv(Env *env, const char *key)
Definition: utils.cpp:813
irods_ms_plugin.hpp
RuleExistsHelper::Instance
static RuleExistsHelper * Instance()
Definition: irods_re_ruleexistshelper.cpp:6
irods_server_properties.hpp
msiSplitPath
int msiSplitPath(msParam_t *inpPath, msParam_t *outParentColl, msParam_t *outChildName, ruleExecInfo_t *rei)
Definition: msiHelper.cpp:281
THROW
#define THROW(_code, _msg)
Definition: irods_exception.hpp:68
GlobalAllRuleExecFlag
int GlobalAllRuleExecFlag
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:57
Cache
Definition: configuration.hpp:34
getMsParamByLabel
msParam_t * getMsParamByLabel(msParamArray_t *msParamArray, const char *label)
Definition: msParam.cpp:376
msParam.h
reDebugStackCurrPtr
int reDebugStackCurrPtr
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:63
msiGetStdoutInExecCmdOut
int msiGetStdoutInExecCmdOut(msParam_t *inpExecCmdOut, msParam_t *outStr, ruleExecInfo_t *rei)
Definition: msiHelper.cpp:45
irods_file_object.hpp
irods_stacktrace.hpp
list_rules
irods::error list_rules(irods::default_re_ctx &, std::vector< std::string > &rule_vec)
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:231
ruleEngineConfig
Cache ruleEngineConfig
Definition: configuration.cpp:68
irods_collection_object.hpp
NO_SAVE_REI
#define NO_SAVE_REI
Definition: rodsDef.h:103
coreMsrvcStruct
msrvcStruct_t coreMsrvcStruct
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:53
appRuleStrct
ruleStruct_t appRuleStrct
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:50
irods_re_serialization.hpp
generalAdmin.h
configuration.hpp
reDebugStack
Definition: reGlobalsExtern.hpp:86
irods::CFG_PLUGIN_CONFIGURATION_KW
const std::string CFG_PLUGIN_CONFIGURATION_KW("plugin_configuration")
get_microservice_table
irods::ms_table & get_microservice_table()
Definition: reAction.cpp:5
ruleSet::len
int len
Definition: restructs.hpp:283
msiExit
int msiExit(msParam_t *inpParam1, msParam_t *inpParam2, ruleExecInfo_t *rei)
Definition: msiHelper.cpp:754
MICROSERVICE_RULE_REGEX
const std::string MICROSERVICE_RULE_REGEX
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:67
irods::PLUGIN_TYPE_RULE_ENGINE
const std::string PLUGIN_TYPE_RULE_ENGINE("rule_engines")
irods::CFG_RE_RULEBASE_SET_KW
const std::string CFG_RE_RULEBASE_SET_KW("re_rulebase_set")
reTestFlag
int reTestFlag
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:55
execMyRule.h
Cache::coreRuleSet
RuleSet * coreRuleSet
Definition: configuration.hpp:53
reGlobalsExtern.hpp
irods::pluggable_rule_engine
Definition: irods_re_plugin.hpp:169
irods_re_ruleexistshelper.hpp
reLoopBackFlag
int reLoopBackFlag
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:56
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
irods_resource_redirect.hpp
SYS_INVALID_INPUT_PARAM
@ SYS_INVALID_INPUT_PARAM
Definition: rodsErrorTable.h:195
region.h
STR_MS_T
#define STR_MS_T
Definition: msParam.h:21
UNINITIALIZED
@ UNINITIALIZED
Definition: configuration.hpp:26
irods_re_plugin.hpp
RuleExecInfo::rsComm
rsComm_t * rsComm
Definition: irods_re_structs.hpp:22
irods::experimental::filesystem::client::end
auto end(const collection_iterator &) noexcept -> const collection_iterator
Definition: collection_iterator.hpp:88
irods::CFG_RE_FUNCTION_NAME_MAPPING_SET_KW
const std::string CFG_RE_FUNCTION_NAME_MAPPING_SET_KW("re_function_name_mapping_set")
node::text
char * text
Definition: restructs.hpp:252
irods_resource_plugin.hpp
SUCCESS
#define SUCCESS()
Definition: irods_error.hpp:121
irods_string_tokenize.hpp
irods::experimental::filesystem::client::begin
auto begin(collection_iterator _iter) noexcept -> collection_iterator
Definition: collection_iterator.hpp:83
clearMsParamArray
int clearMsParamArray(msParamArray_t *msParamArray, int freeStruct)
Definition: msParam.cpp:447
rsComm_t::rError
rError_t rError
Definition: rcConnect.h:158
msiGetSessionVarValue
int msiGetSessionVarValue(msParam_t *inpVar, msParam_t *outputMode, ruleExecInfo_t *rei)
Definition: msiHelper.cpp:359
node::subtrees
struct node ** subtrees
Definition: restructs.hpp:254
LOG_DEBUG
#define LOG_DEBUG
Definition: rodsLog.h:23
REDEBUG_STACK_SIZE_FULL
#define REDEBUG_STACK_SIZE_FULL
Definition: reDefines.h:51
exec_rule_text
irods::error exec_rule_text(irods::default_re_ctx &, const std::string &_rt, msParamArray_t *_ms_params, const std::string &_out_desc, irods::callback _eff_hdlr)
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:354
initialize_microservice_table
void initialize_microservice_table()
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:119
REDEBUG_STACK_SIZE_CURR
#define REDEBUG_STACK_SIZE_CURR
Definition: reDefines.h:52
Cache::ruleEngineStatus
RuleEngineStatus ruleEngineStatus
Definition: configuration.hpp:47
rules.hpp
coreRuleStrct
ruleStruct_t coreRuleStrct
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:47
STATIC_PEP_RULE_REGEX
const std::string STATIC_PEP_RULE_REGEX
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:65
rulevardef_t
Definition: reGlobalsExtern.hpp:102
computeExpression
int computeExpression(char *expr, msParamArray_t *msParamArray, ruleExecInfo_t *rei, int reiSaveFlag, char *res)
Definition: nre.reLib1.cpp:73
start
irods::error start(irods::default_re_ctx &, const std::string &_instance_name)
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:139
msiGetStderrInExecCmdOut
int msiGetStderrInExecCmdOut(msParam_t *inpExecCmdOut, msParam_t *outStr, ruleExecInfo_t *rei)
Definition: msiHelper.cpp:93
terminate_irods_processes.e
e
Definition: terminate_irods_processes.py:19
irods::CFG_INSTANCE_NAME_KW
const std::string CFG_INSTANCE_NAME_KW("instance_name")
INVALID_ANY_CAST
@ INVALID_ANY_CAST
Definition: rodsErrorTable.h:771
KEY_NOT_FOUND
@ KEY_NOT_FOUND
Definition: rodsErrorTable.h:749
irods::callback
Definition: irods_re_plugin.hpp:133
irods::pluggable_rule_engine::add_operation
error add_operation(const std::string &_op, std::function< error(types_t...)> _f)
Definition: irods_re_plugin.hpp:176
irods::default_re_ctx
unit default_re_ctx
Definition: irods_re_plugin.hpp:739
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
MsParam
Definition: msParam.h:76
msiAddKeyValToMspStr
int msiAddKeyValToMspStr(msParam_t *keyStr, msParam_t *valStr, msParam_t *msKeyValStr, ruleExecInfo_t *rei)
Definition: msiHelper.cpp:231
RuleExistsHelper::registerRuleRegex
void registerRuleRegex(const std::string &_regex)
Definition: irods_re_ruleexistshelper.cpp:14
execMyRule
int execMyRule(char *ruleDef, msParamArray_t *inMsParamArray, const char *outParamsDesc, ruleExecInfo_t *rei)
Definition: nre.reLib1.cpp:239
reDebugStackCurr
struct reDebugStack reDebugStackCurr[1000]
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:61
ERROR
#define ERROR(code_, message_)
Definition: irods_error.hpp:117
irods::re_serialization::serialize_parameter
error serialize_parameter(boost::any _in_param, serialized_parameter_t &_out_param)
Definition: irods_re_serialization.cpp:1006
appRuleFuncMapDef
rulefmapdef_t appRuleFuncMapDef
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:52
irods::error
Definition: irods_error.hpp:23
rule_exists
irods::error rule_exists(irods::default_re_ctx &, const std::string &_rn, bool &_ret)
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:211
register_regexes_from_array
void register_regexes_from_array(const boost::any &_array, const std::string &_instance_name)
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:94
applyRuleUpdateParams
int applyRuleUpdateParams(char *inAction, msParamArray_t *inMsParamArray, ruleExecInfo_t *rei, int reiSaveFlag)
Definition: nre.reLib1.cpp:119
miscServerFunct.hpp
MsParamArray::len
int len
Definition: msParam.h:85
irods::ms_table_entry
Definition: irods_ms_plugin.hpp:28
GlobalREAuditFlag
int GlobalREAuditFlag
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:59
irods_hierarchy_parser.hpp
local_instance_name
static std::string local_instance_name
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:68
initRuleEngine
int initRuleEngine(const char *, rsComm_t *, const char *, const char *, const char *)
Definition: rsRe.cpp:17
msiHelper.hpp
KeyValPair_MS_T
#define KeyValPair_MS_T
Definition: msParam.h:37
finalizeRuleEngine
int finalizeRuleEngine()
Definition: nre.reLib1.cpp:1511
appRuleVarDef
rulevardef_t appRuleVarDef
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:51
msiStrchop
int msiStrchop(msParam_t *stringIn, msParam_t *stringOut, ruleExecInfo_t *rei)
Definition: msiHelper.cpp:549
error
int error
Definition: filesystem.cpp:101
RuleDesc::node
Node * node
Definition: restructs.hpp:275
RuleExecInfo
Definition: irods_re_structs.hpp:18
MAX_COND_LEN
#define MAX_COND_LEN
Definition: reDefines.h:17
Cache::extFuncDescIndex
Env * extFuncDescIndex
Definition: configuration.hpp:59
reDebugStackFullPtr
int reDebugStackFullPtr
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:62
rulefmapdef_t
Definition: reGlobalsExtern.hpp:112
irods::CFG_SHARED_MEMORY_INSTANCE_KW
const std::string CFG_SHARED_MEMORY_INSTANCE_KW("shared_memory_instance")
irods::exception
Definition: irods_exception.hpp:15
irods_configuration_parser.hpp
get_string_array_from_array
static std::string get_string_array_from_array(const boost::any &_array)
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:72
stop
irods::error stop(irods::default_re_ctx &_u, const std::string &_instance_name)
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:205
irods::CFG_RE_DATA_VARIABLE_MAPPING_SET_KW
const std::string CFG_RE_DATA_VARIABLE_MAPPING_SET_KW("re_data_variable_mapping_set")
msrvcStruct_t
Definition: reGlobalsExtern.hpp:121
ruleStruct_t
Definition: reGlobalsExtern.hpp:91
MsParam::inOutStruct
void * inOutStruct
Definition: msParam.h:80
msiSubstr
int msiSubstr(msParam_t *stringIn, msParam_t *offset, msParam_t *length, msParam_t *stringOut, ruleExecInfo_t *rei)
Definition: msiHelper.cpp:628
addMsParam
int addMsParam(msParamArray_t *msParamArray, const char *label, const char *packInstruct, void *inOutStruct, bytesBuf_t *inpOutBuf)
Definition: msParam.cpp:17
coreRuleVarDef
rulevardef_t coreRuleVarDef
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:48
MsParamArray
Definition: msParam.h:84
exec_rule
irods::error exec_rule(irods::default_re_ctx &, const std::string &_rn, std::list< boost::any > &_ps, irods::callback _eff_hdlr)
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:238
msiStrlen
int msiStrlen(msParam_t *stringIn, msParam_t *lengthOut, ruleExecInfo_t *rei)
Definition: msiHelper.cpp:479
KeyValPair
Definition: objInfo.h:120
irods::CFG_PLUGIN_SPECIFIC_CONFIGURATION_KW
const std::string CFG_PLUGIN_SPECIFIC_CONFIGURATION_KW("plugin_specific_configuration")
reFuncDefs.hpp
CODE
#define CODE(code_)
Definition: irods_error.hpp:120
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
msiWriteRodsLog
int msiWriteRodsLog(msParam_t *inpParam1, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: msiHelper.cpp:157
plugin_factory
irods::pluggable_rule_engine< irods::default_re_ctx > * plugin_factory(const std::string &_inst_name, const std::string &_context)
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:445
freeRErrorContent
int freeRErrorContent(rError_t *myError)
Definition: rcMisc.cpp:182
DYNAMIC_PEP_RULE_REGEX
const std::string DYNAMIC_PEP_RULE_REGEX
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:66
reDebugStackFull
char * reDebugStackFull[2000]
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:60
appMsrvcStruct
msrvcStruct_t appMsrvcStruct
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:54