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)  

irods_resource_backport.cpp
Go to the documentation of this file.
1 // =-=-=-=-=-=-=-
2 #include "rcMisc.h"
6 #include "irods_stacktrace.hpp"
7 #include <boost/lexical_cast.hpp>
8 #include <boost/algorithm/string.hpp>
9 
10 namespace irods {
11 
12 // =-=-=-=-=-=-=-
13 // helper function to query properties from a resource plugin
14 // and load them into a keyValPair_t
16  error err;
17  std::string prop_name;
18  // =-=-=-=-=-=-=-
19  // get the resource property - host
20 // prop_name = RESOURCE_HOST;
21 // rodsServerHost_t* host = 0;
22 // err = _resc->get_property< rodsServerHost_t* >( prop_name, host );
23 // if ( !err.ok() ) {
24 // std::stringstream msg;
25 // msg << "failed to get property [";
26 // msg << prop_name;
27 // msg << "]";
28 // return ERROR( UNMATCHED_KEY_OR_INDEX, msg.str() );
29 // }
30 
31  // =-=-=-=-=-=-=-
32  // get the resource property - id
33  prop_name = RESOURCE_ID;
34  rodsLong_t id = 0;
35  err = _resc->get_property< rodsLong_t >( prop_name, id );
36  if ( !err.ok() ) {
37  std::stringstream msg;
38  msg << "failed to get property [";
39  msg << prop_name;
40  msg << "]";
41  return ERROR( UNMATCHED_KEY_OR_INDEX, msg.str() );
42  }
43 
44  // =-=-=-=-=-=-=-
45  // get the resource property - freespace
46  prop_name = RESOURCE_FREESPACE;
47  std::string freespace;
48  err = _resc->get_property< std::string >( prop_name, freespace );
49  if ( !err.ok() ) {
50  std::stringstream msg;
51  msg << "failed to get property [";
52  msg << prop_name;
53  msg << "]";
54  return ERROR( UNMATCHED_KEY_OR_INDEX, msg.str() );
55  }
56 
57  // =-=-=-=-=-=-=-
58  // get the resource property - quota
59  prop_name = RESOURCE_QUOTA;
60  long quota = 0;
61  err = _resc->get_property< long >( prop_name, quota );
62  if ( !err.ok() ) {
63  std::stringstream msg;
64  msg << "failed to get property [";
65  msg << prop_name;
66  msg << "]";
67  return ERROR( UNMATCHED_KEY_OR_INDEX, msg.str() );
68  }
69 
70  // =-=-=-=-=-=-=-
71  // get the resource property - zone
72  prop_name = RESOURCE_ZONE;
73  std::string zone;
74  err = _resc->get_property< std::string >( prop_name, zone );
75  if ( !err.ok() ) {
76  std::stringstream msg;
77  msg << "failed to get property [";
78  msg << prop_name;
79  msg << "]";
80  return ERROR( UNMATCHED_KEY_OR_INDEX, msg.str() );
81  }
82 
83  // =-=-=-=-=-=-=-
84  // get the resource property - name
85  prop_name = RESOURCE_NAME;
86  std::string name;
87  err = _resc->get_property< std::string >( prop_name, name );
88  if ( !err.ok() ) {
89  std::stringstream msg;
90  msg << "failed to get property [";
91  msg << prop_name;
92  msg << "]";
93  return ERROR( UNMATCHED_KEY_OR_INDEX, msg.str() );
94  }
95 
96  // =-=-=-=-=-=-=-
97  // get the resource property - location
98  prop_name = RESOURCE_LOCATION;
99  std::string location;
100  err = _resc->get_property< std::string >( prop_name, location );
101  if ( !err.ok() ) {
102  std::stringstream msg;
103  msg << "failed to get property [";
104  msg << prop_name;
105  msg << "]";
106  return ERROR( UNMATCHED_KEY_OR_INDEX, msg.str() );
107  }
108 
109  // =-=-=-=-=-=-=-
110  // get the resource property - type
111  prop_name = RESOURCE_TYPE;
112  std::string type;
113  err = _resc->get_property< std::string >( prop_name, type );
114  if ( !err.ok() ) {
115  std::stringstream msg;
116  msg << "failed to get property [";
117  msg << prop_name;
118  msg << "]";
119  return ERROR( UNMATCHED_KEY_OR_INDEX, msg.str() );
120  }
121 
122  // =-=-=-=-=-=-=-
123  // get the resource property - class
124  prop_name = RESOURCE_CLASS;
125  std::string rclass;
126  err = _resc->get_property< std::string >( prop_name, rclass );
127  if ( !err.ok() ) {
128  std::stringstream msg;
129  msg << "failed to get property";
130  msg << prop_name;
131  msg << "]";
132  return ERROR( UNMATCHED_KEY_OR_INDEX, msg.str() );
133  }
134 
135  // =-=-=-=-=-=-=-
136  // get the resource property - path
137  prop_name = RESOURCE_PATH;
138  std::string path;
139  err = _resc->get_property< std::string >( prop_name, path );
140  if ( !err.ok() ) {
141  std::stringstream msg;
142  msg << "failed to get property";
143  msg << prop_name;
144  msg << "]";
145  return ERROR( UNMATCHED_KEY_OR_INDEX, msg.str() );
146  }
147 
148  // =-=-=-=-=-=-=-
149  // get the resource property - info
150  prop_name = RESOURCE_INFO;
151  std::string info;
152  err = _resc->get_property< std::string >( prop_name, info );
153  if ( !err.ok() ) {
154  std::stringstream msg;
155  msg << "failed to get property";
156  msg << prop_name;
157  msg << "]";
158  return ERROR( UNMATCHED_KEY_OR_INDEX, msg.str() );
159  }
160 
161  // =-=-=-=-=-=-=-
162  // get the resource property - comments
163  prop_name = RESOURCE_COMMENTS;
164  std::string comments;
165  err = _resc->get_property< std::string >( prop_name, comments );
166  if ( !err.ok() ) {
167  std::stringstream msg;
168  msg << "failed to get property";
169  msg << prop_name;
170  msg << "]";
171  return ERROR( UNMATCHED_KEY_OR_INDEX, msg.str() );
172  }
173 
174  // =-=-=-=-=-=-=-
175  // get the resource property - create
176  prop_name = RESOURCE_CREATE_TS;
177  std::string create;
178  err = _resc->get_property< std::string >( prop_name, create );
179  if ( !err.ok() ) {
180  std::stringstream msg;
181  msg << "failed to get property [";
182  msg << prop_name;
183  msg << "]";
184  return ERROR( UNMATCHED_KEY_OR_INDEX, msg.str() );
185  }
186 
187  // =-=-=-=-=-=-=-
188  // get the resource property - modify
189  prop_name = RESOURCE_MODIFY_TS;
190  std::string modify;
191  err = _resc->get_property< std::string >( prop_name, modify );
192  if ( !err.ok() ) {
193  std::stringstream msg;
194  msg << "failed to get property [";
195  msg << prop_name;
196  msg << "]";
197  return ERROR( UNMATCHED_KEY_OR_INDEX, msg.str() );
198  }
199 
200  // =-=-=-=-=-=-=-
201  // get the resource property - status
202  prop_name = RESOURCE_STATUS;
203  int status = 0;
204  err = _resc->get_property< int >( prop_name, status );
205  if ( !err.ok() ) {
206  std::stringstream msg;
207  msg << "failed to get property [";
208  msg << prop_name;
209  msg << "]";
210  return ERROR( UNMATCHED_KEY_OR_INDEX, msg.str() );
211  }
212 
213  addKeyVal(_kvp, RESC_ID_KW, boost::lexical_cast<std::string>(id).c_str());
214  addKeyVal(_kvp, QUOTA_LIMIT_KW, boost::lexical_cast<std::string>(quota).c_str());
215  addKeyVal(_kvp, RESC_STATUS_KW, boost::lexical_cast<std::string>(status).c_str());
216 
217  addKeyVal(_kvp, FREE_SPACE_KW, freespace.c_str());
218  addKeyVal(_kvp, RESC_ZONE_KW, zone.c_str());
219  addKeyVal(_kvp, RESC_NAME_KW, name.c_str());
220  addKeyVal(_kvp, RESC_LOC_KW, location.c_str());
221  addKeyVal(_kvp, RESC_TYPE_KW, type.c_str());
222  addKeyVal(_kvp, RESC_CLASS_KW, rclass.c_str());
223  addKeyVal(_kvp, RESC_VAULT_PATH_KW, path.c_str());
224  addKeyVal(_kvp, RESC_INFO_KW, info.c_str());
225  addKeyVal(_kvp, RESC_COMMENTS_KW, comments.c_str());
226  addKeyVal(_kvp, RESC_CREATE_KW, create.c_str());
227  addKeyVal(_kvp, RESC_MODIFY_KW, modify.c_str());
228 
229  return SUCCESS();
230 
231  } // resource_to_kvp
232 
234  error is_hier_live( const std::string& _resc_hier ) {
235  error res;
237 
238  res = parser.set_string( _resc_hier );
239  if ( !res.ok() ) {
240  std::stringstream msg;
241  msg << __FUNCTION__;
242  msg << " - Failed to parse hierarchy string \"" << _resc_hier << "\"";
243  return PASSMSG( msg.str(), res );
244  }
245 
247  for ( ; res.ok() && it != parser.end(); ++it ) {
248  rodsLong_t resc_id;
249  res = resc_mgr.hier_to_leaf_id(*it,resc_id);
250  if(!res.ok()){
251  return PASS(res);
252  }
253  res = is_resc_live( resc_id );
254  if(!res.ok()){
255  return PASS(res);
256  }
257  }
258 
259  return res;
260  }
261 
264  // Try to get resource status
265  int status = 0;
266  error resc_err = get_resource_property< int >( _resc_id, RESOURCE_STATUS, status );
267 
268  if ( resc_err.ok() ) {
269  if ( status == INT_RESC_STATUS_DOWN ) {
270  std::stringstream msg;
271  msg << "Resource [";
272  msg << _resc_id;
273  msg << "] is down";
274 
275  return ERROR( SYS_RESC_IS_DOWN, msg.str() );
276  }
277  }
278  else {
279  std::stringstream msg;
280  msg << "Failed to get status for resource [";
281  msg << _resc_id;
282  msg << "]";
283 
284  return PASSMSG( msg.str(), resc_err );
285  }
286 
287  return resc_err;
288 
289  } // is_resc_live
290 
291 
292 // =-=-=-=-=-=-=-
293 // given a list of resource names from a rule, make some decisions
294 // about which resource should be set to default and used. store
295 // that information in the rescGrpInfo structure
296 // NOTE :: this is a reimplementation of setDefaultResc in resource.c but
297 // :: with the composite resource spin
299  const std::string& _resc_list,
300  const std::string& _option,
301  keyValPair_t* _cond_input,
302  std::string& _resc_name ) {
303  // =-=-=-=-=-=-=
304  // quick error check
305  if ( _resc_list.empty() && NULL == _cond_input ) {
306  return ERROR( USER_NO_RESC_INPUT_ERR, "no user input" );
307  }
308 
309  // =-=-=-=-=-=-=-
310  // resource name passed in via conditional input
311  std::string cond_input_resc;
312 
313  // =-=-=-=-=-=-=-
314  // if the resource list is not "null" and the forced flag is set
315  // then zero out the conditional input as it is to be ignored
316  if ( "null" != _resc_list &&
317  "forced" == _option &&
319  _cond_input = NULL;
320  }
321  else if ( _cond_input ) {
322  char* name = NULL;
323  if ( ( name = getValByKey( _cond_input, BACKUP_RESC_NAME_KW ) ) == NULL &&
324  ( name = getValByKey( _cond_input, DEST_RESC_NAME_KW ) ) == NULL &&
325  ( name = getValByKey( _cond_input, DEF_RESC_NAME_KW ) ) == NULL &&
326  ( name = getValByKey( _cond_input, RESC_NAME_KW ) ) == NULL ) {
327  // =-=-=-=-=-=-=-
328  // no conditional input resource
329  }
330  else {
331  cond_input_resc = name;
332  boost::trim(cond_input_resc);
333  }
334 
335  } // else if
336 
337  // =-=-=-=-=-=-=-
338  // split the list into a vector of strings using a % delimiter
339  std::vector< std::string > resources;
340  string_tokenize( _resc_list, "%", resources );
341 
342  // =-=-=-=-=-=-=-
343  // pick a good resource which is available out of the list,
344  // NOTE :: the legacy code picks a random one first then scans
345  // :: for a valid one if the random resource is down. i just
346  // :: scan for one. i don't think this would break anything...
347  std::string default_resc_name;
348 
349  std::vector< std::string >::iterator itr = resources.begin();
350  for ( ; itr != resources.end(); ++itr ) {
351  error resc_err = is_hier_live( *itr );
352  if ( resc_err.ok() ) {
353  // live resource found
354  default_resc_name = *itr;
355  }
356  else {
357  irods::log( resc_err );
358  }
359 
360  } // for itr
361 
362  // =-=-=-=-=-=-=-
363  // determine that we might need a 'preferred' resource
364  if ( "preferred" == _option && !cond_input_resc.empty() ) {
365  // =-=-=-=-=-=-=-
366  // determine if the resource is live
367  error resc_err = is_hier_live( cond_input_resc );
368  if ( resc_err.ok() ) {
369  // =-=-=-=-=-=-=-
370  // we found a live one, we're good to go
371  _resc_name = cond_input_resc;
372  return SUCCESS();
373  }
374 
375  }
376  else if ( "forced" == _option && _comm->clientUser.authInfo.authFlag < LOCAL_PRIV_USER_AUTH ) {
377  // stick with the default found above, its forced.
378  _resc_name = default_resc_name;
379  return SUCCESS();
380 
381  }
382  else {
383  // =-=-=-=-=-=-=-
384  // try the conditional input string, if not go back to the default resource
385  error resc_err = is_hier_live( cond_input_resc );
386  if ( resc_err.ok() ) {
387  // =-=-=-=-=-=-=-
388  // we found a live one, go!
389  _resc_name = cond_input_resc;
390  return SUCCESS();
391 
392  }
393  else {
394  // =-=-=-=-=-=-=-
395  // otherwise go back to the old, default we had before
396  error resc_err = is_hier_live( default_resc_name );
397  if ( resc_err.ok() ) {
398  _resc_name = default_resc_name;
399  return SUCCESS();
400 
401  }
402  else {
403  std::stringstream msg;
404  msg << "set_default_resource - failed to find default resource for list [";
405  msg << _resc_list;
406  msg << "] and option [";
407  msg << _option;
408  msg << "]";
409  return PASSMSG( msg.str(), resc_err );
410  }
411 
412  } // else
413 
414  } // else
415 
416 
417  // =-=-=-=-=-=-=-
418  // should not reach here
419  std::stringstream msg;
420  msg << "should not reach here for list [";
421  msg << _resc_list;
422  msg << "] and option [";
423  msg << _option;
424  msg << "]";
425  return ERROR( CAT_NO_ROWS_FOUND, msg.str() );
426 
427  } // set_default_resource
428 
429 // =-=-=-=-=-=-=-
430 // function which determines resource name based on
431 // keyval pair and a given string
433  const std::string& _resc_name,
434  keyValPair_t* _cond_input,
435  std::string& _out ) {
436  if ( _resc_name.empty() ) {
437  char* name = 0;
438  name = getValByKey( _cond_input, BACKUP_RESC_NAME_KW );
439  if ( name ) {
440  _out = std::string( name );
441  return SUCCESS();
442  }
443 
444  name = getValByKey( _cond_input, DEST_RESC_NAME_KW );
445  if ( name ) {
446  _out = std::string( name );
447  return SUCCESS();
448  }
449 
450  name = getValByKey( _cond_input, DEF_RESC_NAME_KW );
451  if ( name ) {
452  _out = std::string( name );
453  return SUCCESS();
454  }
455 
456  return ERROR( INT_RESC_STATUS_DOWN, "failed to resolve resource name" );
457 
458  }
459  else {
460  _out = _resc_name;
461  return SUCCESS();
462  }
463 
464  } // resolve_resource_name
465 
466 // =-=-=-=-=-=-=-
467 // helper function - get the status property of a resource given a
468 // match to the incoming pointer
470  // =-=-=-=-=-=-=-
471  // idiot check pointer
472  if ( !_info ) {
473  return ERROR( SYS_INVALID_INPUT_PARAM, "null pointer" );
474  }
475 
476  // =-=-=-=-=-=-=-
477  // find a matching resource
478  resource_ptr resc;
480  if ( !err.ok() ) {
481  return PASSMSG( "failed to resolve resource", err );
482  }
483 
484  // =-=-=-=-=-=-=-
485  // get the status property of the resource
486  int status = -1;
487  err = resc->get_property< int >( RESOURCE_STATUS, status );
488  if ( !err.ok() ) {
489  return PASSMSG( "failed to get resource property", err );
490  }
491 
492  return CODE( status );
493 
494  } // get_host_status_by_host_info
495 
496 
497 // =-=-=-=-=-=-=-
498 // helper function to save on typing - get properties kvp
499 // for leaf resource given a resource hierarchy
500  error get_resc_properties_as_kvp(const std::string& _resc_hier, keyValPair_t* _kvp) {
501  // =-=-=-=-=-=-=-
502  // check hierarchy string
503  if ( _resc_hier.empty() ) {
504  return ERROR( SYS_INVALID_INPUT_PARAM, "resource hierarchy string is empty" );
505  }
506 
507  // =-=-=-=-=-=-=-
508  // extract the last resource in the hierarchy
509  std::string resc_name;
510  hierarchy_parser parse;
511  parse.set_string( _resc_hier );
512  parse.last_resc( resc_name );
513 
514  resource_ptr resc;
515  error res_err = resc_mgr.resolve( resc_name, resc );
516  if ( res_err.ok() ) {
517  // =-=-=-=-=-=-=-
518  // check to see if the resource is active, if not fail
519  int status = 0;
520  resc->get_property< int >( RESOURCE_STATUS, status );
521  if ( status == INT_RESC_STATUS_DOWN ) {
522  return ERROR( SYS_RESC_IS_DOWN, "The Resource is Down" );
523  }
524 
525  error info_err = resource_to_kvp(resc, _kvp);
526  if ( info_err.ok() ) {
527  return SUCCESS();
528 
529  }
530  else {
531  return PASS( info_err );
532 
533  }
534 
535  }
536  else {
537  return PASS( res_err );
538 
539  }
540 
541  } // get_resc_properties_as_kvp
542 
543 
544 #if 0 // #1472
545 // =-=-=-=-=-=-=-
546 // helper function to save on typing - get legacy data struct
547 // for resource group given a resource name
548  error get_resc_grp_info( std::string _name, rescGrpInfo_t& _info ) {
549  if ( _name.empty() ) {
550  return ERROR( SYS_INVALID_INPUT_PARAM, "empty key" );
551  }
552 
553  resource_ptr resc;
554  error res_err = resc_mgr.resolve( _name, resc );
555  if ( res_err.ok() ) {
556  // =-=-=-=-=-=-=-
557  // check to see if the resource is active, if not fail
558  int status = 0;
559  get_resource_property< int >( _name, RESOURCE_STATUS, status );
560  if ( status == INT_RESC_STATUS_DOWN ) {
561  return ERROR( SYS_RESC_IS_DOWN, "The Resource is Down" );
562  }
563 
564  error info_err = resource_to_resc_grp_info( _info, resc );
565  if ( info_err.ok() ) {
566  return SUCCESS();
567  }
568  else {
569  return PASS( info_err );
570  }
571 
572  }
573  else {
574  return PASS( res_err );
575  }
576 
577 
578  } // get_resc_grp_info
579 #endif
580 
582  const std::string& _hier_str, // hier string
583  int& _local_flag, // local flag
584  rodsServerHost_t*& _server_host ) { // server host
585 
586  // =-=-=-=-=-=-=-
587  // check hier string
588  if ( _hier_str.empty() ) {
589  return ERROR( SYS_INVALID_INPUT_PARAM, "hier string is empty" );
590  }
591 
592  // =-=-=-=-=-=-=-
593  // extract the last resource in the hierarchy
594  rodsLong_t resc_id;
595  error ret = resc_mgr.hier_to_leaf_id(_hier_str,resc_id);
596  if(!ret.ok()) {
597  return PASS(ret);
598  }
599 
600  // =-=-=-=-=-=-=-
601  // get the rods server host info for the child resc
603  ret = get_resource_property< rodsServerHost_t* >( resc_id, RESOURCE_HOST, host );
604  if ( !ret.ok() ) {
605  std::stringstream msg;
606  msg << "get_host_for_hier_string - failed to get host property for [";
607  msg << _hier_str;
608  msg << "]";
609  return PASSMSG( msg.str(), ret );
610  }
611 
612  // Check for null host.
613  if ( host == NULL ) {
614  std::stringstream msg;
615  msg << __FUNCTION__;
616  msg << " - Host from hierarchy string: \"";
617  msg << _hier_str;
618  msg << "\" is NULL";
619  return ERROR( INVALID_LOCATION, msg.str() );
620  }
621 
622  // =-=-=-=-=-=-=-
623  // set the outgoing variables
624  _server_host = host;
625  _local_flag = host->localFlag;
626 
627  return SUCCESS();
628 
629  } // get_host_for_hier_string
630 
631 // =-=-=-=-=-=-=-
632 // function which returns the host name for a given hier string
634  const std::string& _hier,
635  std::string& _loc ) {
636  rodsLong_t resc_id = 0;
637  irods::error ret = resc_mgr.hier_to_leaf_id(_hier,resc_id);
638  if( !ret.ok() ) {
639  return PASS(ret);
640  }
641 
642  std::string location;
643  ret = get_resource_property< std::string >( resc_id, RESOURCE_LOCATION, location );
644  if ( !ret.ok() ) {
645  location = "";
646  return PASSMSG( "get_loc_for_hier_string - failed in get_resource_property", ret );
647  }
648 
649  // =-=-=-=-=-=-=-
650  // set out variable and return
651  _loc = location;
652 
653  return SUCCESS();
654 
655  } // get_loc_for_hier_string
656 
659  const std::string& _hier,
660  std::string& _rtn_vault_path ) {
661  rodsLong_t resc_id = 0;
662  irods::error ret = resc_mgr.hier_to_leaf_id(_hier,resc_id);
663  if( !ret.ok() ) {
664  return PASS(ret);
665  }
666 
667  ret = get_resource_property<std::string>( resc_id, RESOURCE_PATH, _rtn_vault_path );
668  if ( !ret.ok() ) {
669  return PASS(ret);
670  }
671 
672  return SUCCESS();
673  }
674 
675 
678  const std::string& _hier,
679  std::string& _resc_type ) {
680  rodsLong_t resc_id = 0;
681  irods::error ret = resc_mgr.hier_to_leaf_id(_hier,resc_id);
682  if( !ret.ok() ) {
683  return PASS(ret);
684  }
685 
686  ret = get_resource_property<std::string>( resc_id, RESOURCE_TYPE, _resc_type );
687  if ( !ret.ok() ) {
688  return PASS(ret);
689  }
690 
691  return SUCCESS();
692  }
693 
694 
695 }; // namespace irods
getValByKey
char * getValByKey(const keyValPair_t *condInput, const char *keyWord)
Definition: rcMisc.cpp:675
QUOTA_LIMIT_KW
#define QUOTA_LIMIT_KW
Definition: rodsKeyWdDef.h:153
RESC_NAME_KW
#define RESC_NAME_KW
Definition: rodsKeyWdDef.h:19
NULL
#define NULL
Definition: rodsDef.h:70
irods::RESOURCE_CLASS
const std::string RESOURCE_CLASS("resource_property_class")
RESC_STATUS_KW
#define RESC_STATUS_KW
Definition: rodsKeyWdDef.h:147
irods::RESOURCE_LOCATION
const std::string RESOURCE_LOCATION("resource_property_location")
rsComm_t
Definition: rcConnect.h:145
irods::RESOURCE_COMMENTS
const std::string RESOURCE_COMMENTS("resource_property_comments")
addKeyVal
int addKeyVal(keyValPair_t *condInput, const char *keyWord, const char *value)
Definition: rcMisc.cpp:789
irods::RESOURCE_NAME
const std::string RESOURCE_NAME("resource_property_name")
irods::get_vault_path_for_hier_string
error get_vault_path_for_hier_string(const std::string &_hier_string, std::string &_rtn_vault_path)
Definition: irods_resource_backport.cpp:658
UNMATCHED_KEY_OR_INDEX
@ UNMATCHED_KEY_OR_INDEX
Definition: rodsErrorTable.h:244
irods_stacktrace.hpp
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
resc_mgr
irods::resource_manager resc_mgr
Definition: irods_resource_manager.cpp:31
irods::resource_ptr
boost::shared_ptr< resource > resource_ptr
Definition: irods_resource_types.hpp:11
irods::resource_to_kvp
error resource_to_kvp(resource_ptr &, keyValPair_t *)
Definition: irods_resource_backport.cpp:15
irods::hierarchy_parser
Definition: irods_hierarchy_parser.hpp:14
rcMisc.h
irods::is_hier_live
error is_hier_live(const std::string &)
Definition: irods_resource_backport.cpp:234
FREE_SPACE_KW
#define FREE_SPACE_KW
Definition: rodsKeyWdDef.h:150
irods::set_default_resource
error set_default_resource(rsComm_t *, const std::string &, const std::string &, keyValPair_t *, std::string &)
Definition: irods_resource_backport.cpp:298
irods::RESOURCE_PATH
const std::string RESOURCE_PATH("resource_property_path")
irods_resource_backport.hpp
irods::get_resc_type_for_hier_string
error get_resc_type_for_hier_string(const std::string &, std::string &)
Definition: irods_resource_backport.cpp:677
PASSMSG
#define PASSMSG(message_, prev_error_)
Definition: irods_error.hpp:119
deploy_schemas_locally.parser
parser
Definition: deploy_schemas_locally.py:59
generate_iadmin_commands_for_41_to_42_upgrade.name
name
Definition: generate_iadmin_commands_for_41_to_42_upgrade.py:23
irods::RESOURCE_STATUS
const std::string RESOURCE_STATUS("resource_property_status")
trim
char * trim(char *str)
Definition: parser.cpp:1740
SYS_INVALID_INPUT_PARAM
@ SYS_INVALID_INPUT_PARAM
Definition: rodsErrorTable.h:195
irods::string_tokenize
void string_tokenize(const std::string &, const std::string &, std::vector< std::string > &)
Definition: irods_string_tokenize.cpp:9
id
long long id
Definition: filesystem.cpp:105
RESC_TYPE_KW
#define RESC_TYPE_KW
Definition: rodsKeyWdDef.h:144
RESC_LOC_KW
#define RESC_LOC_KW
Definition: rodsKeyWdDef.h:143
irods::get_resc_properties_as_kvp
error get_resc_properties_as_kvp(const std::string &, keyValPair_t *)
Definition: irods_resource_backport.cpp:500
RESC_INFO_KW
#define RESC_INFO_KW
Definition: rodsKeyWdDef.h:154
generate_iadmin_commands_for_41_to_42_upgrade.resources
dictionary resources
Definition: generate_iadmin_commands_for_41_to_42_upgrade.py:18
BACKUP_RESC_NAME_KW
#define BACKUP_RESC_NAME_KW
Definition: rodsKeyWdDef.h:22
DEST_RESC_NAME_KW
#define DEST_RESC_NAME_KW
Definition: rodsKeyWdDef.h:20
SUCCESS
#define SUCCESS()
Definition: irods_error.hpp:121
irods_string_tokenize.hpp
irods::hierarchy_parser::last_resc
error last_resc(std::string &_ret_resc) const
Definition: irods_hierarchy_parser.cpp:109
RESC_CREATE_KW
#define RESC_CREATE_KW
Definition: rodsKeyWdDef.h:159
rsComm_t::proxyUser
userInfo_t proxyUser
Definition: rcConnect.h:152
irods
Definition: apiHandler.hpp:35
irods::get_host_for_hier_string
error get_host_for_hier_string(const std::string &, int &, rodsServerHost_t *&)
Definition: irods_resource_backport.cpp:581
irods::RESOURCE_TYPE
const std::string RESOURCE_TYPE("resource_property_type")
irods::resource_manager::resolve
error resolve(std::string, resource_ptr &)
Definition: irods_resource_manager.cpp:51
irods::RESOURCE_ZONE
const std::string RESOURCE_ZONE("resource_property_zone")
irods::hierarchy_parser::set_string
error set_string(const std::string &_resc_hier)
Definition: irods_hierarchy_parser.cpp:36
LOCAL_PRIV_USER_AUTH
#define LOCAL_PRIV_USER_AUTH
Definition: rodsUser.h:36
USER_NO_RESC_INPUT_ERR
@ USER_NO_RESC_INPUT_ERR
Definition: rodsErrorTable.h:252
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
irods::RESOURCE_FREESPACE
const std::string RESOURCE_FREESPACE("resource_property_freespace")
irods::log
void log(const error &)
Definition: irods_log.cpp:13
DEF_RESC_NAME_KW
#define DEF_RESC_NAME_KW
Definition: rodsKeyWdDef.h:21
irods::RESOURCE_CREATE_TS
const std::string RESOURCE_CREATE_TS("resource_property_create_ts")
irods::RESOURCE_QUOTA
const std::string RESOURCE_QUOTA("resource_property_quota")
rsComm_t::clientUser
userInfo_t clientUser
Definition: rcConnect.h:153
ERROR
#define ERROR(code_, message_)
Definition: irods_error.hpp:117
INVALID_LOCATION
@ INVALID_LOCATION
Definition: rodsErrorTable.h:756
irods::error
Definition: irods_error.hpp:23
irods::resolve_resource_name
error resolve_resource_name(const std::string &, keyValPair_t *, std::string &)
Definition: irods_resource_backport.cpp:432
INT_RESC_STATUS_DOWN
#define INT_RESC_STATUS_DOWN
Definition: rodsDef.h:282
SYS_RESC_IS_DOWN
@ SYS_RESC_IS_DOWN
Definition: rodsErrorTable.h:170
irods::get_host_status_by_host_info
error get_host_status_by_host_info(rodsServerHost_t *)
Definition: irods_resource_backport.cpp:469
irods_hierarchy_parser.hpp
RESC_COMMENTS_KW
#define RESC_COMMENTS_KW
Definition: rodsKeyWdDef.h:158
irods::resource_manager::hier_to_leaf_id
error hier_to_leaf_id(const std::string &, rodsLong_t &)
Definition: irods_resource_manager.cpp:1082
irods::RESOURCE_MODIFY_TS
const std::string RESOURCE_MODIFY_TS("resource_property_modify_ts")
rodsServerHost
Definition: rodsConnect.h:62
irods::resource_manager::resolve_from_property
error resolve_from_property(std::string _prop, value_type _value, resource_ptr &_resc)
Definition: irods_resource_manager.hpp:126
CAT_NO_ROWS_FOUND
@ CAT_NO_ROWS_FOUND
Definition: rodsErrorTable.h:423
error
int error
Definition: filesystem.cpp:101
generate_iadmin_commands_for_41_to_42_upgrade.host
host
Definition: generate_iadmin_commands_for_41_to_42_upgrade.py:23
RESC_ID_KW
#define RESC_ID_KW
Definition: rodsKeyWdDef.h:157
userInfo_t::authInfo
authInfo_t authInfo
Definition: rodsUser.h:70
irods::RESOURCE_INFO
const std::string RESOURCE_INFO("resource_property_info")
irods::hierarchy_parser::const_iterator
resc_list_t::const_iterator const_iterator
Definition: irods_hierarchy_parser.hpp:17
irods::get_loc_for_hier_string
error get_loc_for_hier_string(const std::string &_hier, std::string &_loc)
Definition: irods_resource_backport.cpp:633
KeyValPair
Definition: objInfo.h:120
authInfo_t::authFlag
int authFlag
Definition: rodsUser.h:42
CODE
#define CODE(code_)
Definition: irods_error.hpp:120
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
type
int type
Definition: filesystem.cpp:103
irods::RESOURCE_HOST
const std::string RESOURCE_HOST("resource_property_host")
RESC_MODIFY_KW
#define RESC_MODIFY_KW
Definition: rodsKeyWdDef.h:160
RESC_VAULT_PATH_KW
#define RESC_VAULT_PATH_KW
Definition: rodsKeyWdDef.h:146
rodsLong_t
long long rodsLong_t
Definition: rodsType.h:32
irods::RESOURCE_ID
const std::string RESOURCE_ID("resource_property_id")
RESC_ZONE_KW
#define RESC_ZONE_KW
Definition: rodsKeyWdDef.h:142
irods::is_resc_live
error is_resc_live(rodsLong_t)
Definition: irods_resource_backport.cpp:263
RESC_CLASS_KW
#define RESC_CLASS_KW
Definition: rodsKeyWdDef.h:145