00001 /** 00002 * @file icatGeneralMS.c 00003 * 00004 */ 00005 00006 /*** Copyright (c), The Regents of the University of California *** 00007 *** For more information please refer to files in the COPYRIGHT directory ***/ 00008 #include "reGlobalsExtern.h" 00009 #include "icatHighLevelRoutines.h" 00010 #include "objMetaOpr.h" 00011 00012 /** \mainpage iRODS Documentation 00013 00014 This documentation is generated from the iRODS code. 00015 00016 \section overview Overview 00017 - http://www.irods.org 00018 00019 - <a href="globals.html">Full Alphabetical List of Microservices</a> 00020 00021 - <a href="workflow.html">Rule Engine Workflow Microservices</a> 00022 - #msiGoodFailure - Useful when you want to fail but no recovery initiated 00023 - #msiSleep - Sleep 00024 00025 \section msicore Core Microservices 00026 00027 \subsection msiruleengine Rule Engine Microservices 00028 - #msiAdmChangeCoreIRB - Changes the core.irb file from the client 00029 - #msiAdmAppendToTopOfCoreIRB - Prepends another irb file to the core.irb file 00030 - #msiAdmAddAppRuleStruct - Adds application level IRB rules and DVM and FNM mappings to the rule engine 00031 - #msiAdmClearAppRuleStruct - Clears application level IRB rules and DVM and FNM mappings that were loaded into the rule engine 00032 00033 - #msiAdmShowIRB - Displays the currently loaded rules 00034 - #msiAdmShowDVM - Displays the currently loaded data variable mappings 00035 - #msiAdmShowFNM - Displays the currently loaded microservices and action (function) name mappings 00036 00037 - #msiAdmReadRulesFromFileIntoStruct - Reads a rule configuration file into a rule structure 00038 - #msiAdmInsertRulesFromStructIntoDB - Writes a rule structure into the current rule base 00039 - #msiGetRulesFromDBIntoStruct - Populates a rule structure with rules from the given base name 00040 - #msiAdmWriteRulesFromStructIntoFile - Writes to file the rules within a given rule structure 00041 00042 - #msiAdmReadDVMapsFromFileIntoStruct - Reads a DVM configuration file into a DVM structure 00043 - #msiAdmInsertDVMapsFromStructIntoDB - Writes a DVM structure into the current DVM base 00044 - #msiGetDVMapsFromDBIntoStruct - Populates a DVM structure with DVMs from the given base name 00045 - #msiAdmWriteDVMapsFromStructIntoFile - Writes to file the DVMs within a given DVM structure 00046 00047 - #msiAdmReadFNMapsFromFileIntoStruct - Reads a FNM configuration file into a FNM structure 00048 - #msiAdmInsertFNMapsFromStructIntoDB - Writes an FNM structure into the current FNM base 00049 - #msiGetFNMapsFromDBIntoStruct - Populates an FNM structure with FNMs from the given base name 00050 - #msiAdmWriteFNMapsFromStructIntoFile - Writes to file the FNMs within a given FNM structure 00051 00052 - #msiAdmReadMSrvcsFromFileIntoStruct - Reads a microservice configuration file into a microservice structure 00053 - #msiAdmInsertMSrvcsFromStructIntoDB - Writes a microservice structure into the current microservices base 00054 - #msiGetMSrvcsFromDBIntoStruct - Populates a microservice structure with microservices from the given base name 00055 - #msiAdmWriteMSrvcsFromStructIntoFile - Writes to file the microservices within a given microservice structure 00056 00057 \subsection msihelper Helper Microservices 00058 Can be called by client through irule. 00059 - #msiGetStdoutInExecCmdOut - Gets stdout buffer from ExecCmdOut into buffer 00060 - #msiGetStderrInExecCmdOut - Gets stderr buffer from ExecCmdOut into buffer 00061 - #msiWriteRodsLog - Writes a message into the server rodsLog 00062 - #msiAddKeyValToMspStr - Adds a key and value to existing msKeyValStr 00063 - #msiSplitPath - Splits a pathname into parent and child values 00064 - #msiGetSessionVarValue - Gets the value of a session variable in the rei 00065 - #msiExit - Add a user message to the error stack 00066 00067 \subsection msidatabase Database Object (DBO) and DB Resource (DBR) Microservices 00068 Can be called by client through irule. 00069 - #msiDboExec - Execute a database object on a DBR 00070 - #msiDbrCommit - Executes a commit on a DBR 00071 - #msiDbrRollback - Executes a rollback on a DBR 00072 00073 \subsection msilowlevel Data Object Low-level Microservices 00074 Can be called by client through irule. 00075 - #msiDataObjCreate - Create a data object 00076 - #msiDataObjOpen - Open a data object 00077 - #msiDataObjClose - Close an opened data object 00078 - #msiDataObjLseek - Repositions the read/write offset of an open data object 00079 - #msiDataObjRead - Read an opened data object 00080 - #msiDataObjWrite - Write to an opened data object 00081 00082 \subsection msidataobject Data Object Microservices 00083 Can be called by client through irule. 00084 - #msiDataObjUnlink - Delete a data object 00085 - #msiDataObjRepl - Replicate a data object 00086 - #msiDataObjCopy - Copy a data object 00087 - #msiDataObjGet - Get a data object 00088 - #msiDataObjPut - Put a data object 00089 - #msiDataObjChksum - Checksum a data object 00090 - #msiDataObjPhymv - Move a data object from one resource to another 00091 - #msiDataObjRename - Rename a data object 00092 - #msiDataObjTrim - Trim the replicas of a data object 00093 - #msiPhyPathReg - Register a physical file into iRODS 00094 - #msiObjStat - Stat an iRODS object 00095 - #msiDataObjRsync - Syncs a data object from a source to a destination 00096 - #msiCollRsync - Recursively syncs a source collection to a target collection 00097 - #msiGetObjType - Finds if a given value is a data, coll, resc, ... 00098 - #msiCheckPermission - Check if a data object permission is the same as the one given 00099 - #msiCheckOwner - Check if the user is the owner of the data object 00100 - #msiSetReplComment - Sets the data_comments attribute of a data object 00101 00102 \subsection msicollection Collection Microservices 00103 - #msiCollCreate - Create a collection 00104 - #msiCollRepl - Replicate all files in a collection 00105 - #msiRmColl - Delete a collection 00106 - #msiAutoReplicateService - Checks and repairs up to n replicas 00107 - #msiDataObjAutoMove - Used to automatically move the newly created file into a destination collection 00108 - #msiTarFileExtract - Extracts a tar object file into a target collection 00109 - #msiTarFileCreate - Creates a tar object file from a target collection 00110 - #msiPhyBundleColl - Bundles a collection into a number of tar files, similar to the iphybun command 00111 00112 \subsection msiproxy Proxy Command Microservices 00113 - #msiExecCmd - Remotely execute a command 00114 00115 \subsection msiicat iCAT Microservices 00116 iCAT System Services 00117 - #msiVacuum - Postgres vacuum - done periodically 00118 - #msiQuota - Calculates storage usage and sets quota values 00119 - #msiCommit - Commits the database transaction 00120 - #msiRollback - Rollback the current database transaction 00121 - #msiSetACL - Changes the ACL for a given pathname, either a collection or a data object 00122 - #msiCreateUser - Creates a new user 00123 - #msiDeleteUser - Deletes a user 00124 - #msiAddUserToGroup - Adds a user to a group 00125 - #msiCreateCollByAdmin - Creates a collection by administrator 00126 - #msiDeleteCollByAdmin - Deletes a collection by administrator 00127 - #msiRenameLocalZone - Renames the local zone by updating various tables 00128 - #msiRenameCollection - Renames a collection; used via a rule with the above #msiRenameLocalZone 00129 - #msiExecStrCondQuery - Creates an iCAT query, given a condition string, and executes it and returns the values 00130 - #msiExecStrCondQueryWithOptions - Like #msiExecStrCondQuery, with extra options 00131 - #msiExecGenQuery - Executes a given general query structure and returns results 00132 - #msiMakeQuery - Creates a psuedo-SQL query, given a select list and a condition list 00133 - #msiGetMoreRows - Continues an unfinished query and #msiExecStrCondQuery and returns results 00134 - #msiCloseGenQuery - Closes an unfinished query. Based on #msiGetMoreRows. 00135 - #msiMakeGenQuery - A combination of #msiMakeQuery and #msiExecGenQuery and returns the results of the execution 00136 - #msiGetContInxFromGenQueryOut - Gets continue index value generated by #msiExecGenQuery 00137 - #msiAddSelectFieldToGenQuery - Sets a select field in a genQueryInp_t 00138 - #msiPrintGenQueryInp - Prints the given GenQueryInp_MS_T to the given target buffer 00139 - #msiAddConditionToGenQuery - Adds a condition to a genQueryInp_t 00140 - #msiPrintGenQueryOutToBuffer - Writes the contents of a GenQueryOut_MS_T into a BUF_LEN_MS_T 00141 - #msiDeleteUnusedAVUs - Deletes unused AVUs from the iCAT 00142 00143 \subsection msirda Rule-oriented Database Access Microservices 00144 - #msiRdaToStdout - Calls new RDA functions to interface to an arbitrary database returning results in stdout 00145 - #msiRdaToDataObj - As above but stores results in an iRODS DataObject 00146 - #msiRdaNoResults - As above, performs a SQL operation but without resulting output 00147 - #msiRdaCommit - Commit changes to the database 00148 - #msiRdaRollback - Rollback (don't commit) changes to the database 00149 00150 \subsection msixmsg XMessaging System Microservices 00151 - #msiXmsgServerConnect - Connects to the XMessage Server as designate by iRODS Environment file/variable 00152 - #msiXmsgCreateStream - Creates a new Message Stream 00153 - #msiCreateXmsgInp - Creates an Xmsg packet, given all information values 00154 - #msiSendXmsg - Sends an Xmsg packet 00155 - #msiRcvXmsg - Receives an Xmsg packet 00156 - #msiXmsgServerDisConnect - Disconnects from the XMessage Server 00157 - #readXMsg - Reads a message packet from an XMsgStream 00158 - #writeXMsg - Writes a given string into an XMsgStream 00159 00160 \subsection msistring String Manipulation Microservices 00161 - #msiStrlen - Returns the length of a given string 00162 - #msiStrchop - Removes the last character of a given string 00163 - #msiSubstr - Returns a substring of the given string 00164 00165 \subsection msiemail Email Microservices 00166 - #msiSendMail - Sends email 00167 - #msiSendStdoutAsEmail - Sends rei's stdout as email 00168 00169 \subsection msikv Key-Value (Attr-Value) Microservices 00170 - #writeKeyValPairs - Writes key-value pairs to stdout or stderr and with given separator 00171 - #msiPrintKeyValPair - Prints key-value pairs to rei's stdout separated by = 00172 - #msiGetValByKey - Extracts the corresponding value, given a key and a keyValPair struct 00173 - #msiString2KeyValPair - Converts a \%-separated key=value pair strings into keyValPair structure 00174 - #msiStrArray2String - Converts an array of strings to a string separated by \%-signs 00175 - #msiAssociateKeyValuePairsToObj - Ingests object metadata into iCAT from a AVU structure 00176 - #msiRemoveKeyValuePairsFromObj - Removes object metadata from iCAT using a AVU structure 00177 - #msiSetKeyValuePairsToObj - Ingests or overwrites object metadata into iCAT from a AVU structure 00178 - #msiAddKeyVal - Adds a new key and value to a keyValPair_t 00179 00180 \subsection msinetcdf NETCDF Microservices 00181 - #msiNcOpen - Open an iRODS data object for netcdf operation (equivalent to nc_open) 00182 - #msiNcCreate - Create an iRODS data object for netcdf operation (equivalent to nc_create) 00183 - #msiNcClose - Close an opened iRODS data object (equivalent to nc_close) 00184 - #msiNcInqId - A general netcdf inquiry for id (equivalent to nc_inq_dimid, nc_inq_varid, .... This msi is superceded by the more comprehensive msiNcInq API 00185 - #msiNcInqWithId - A general netcdf inquiry with id (equivalent nc_inq_dim, nc_inq_dim, nc_inq_var ....) This API is superceded by the more comprehensive rcNcInq API 00186 - #msiNcGetVarsByType - A general NETCDF variable subsetting microservice (equivalent to nc_get_vars_type API) 00187 - #msiNcGetArrayLen - Get the array length of a NcInqWithIdOut_MS_T or NcGetVarOut_MS_T 00188 - #msiNcGetNumDim - Get the number of dimensions of a NcInqWithIdOut_MS_T or NcGetVarOut_MS_T 00189 - #msiNcGetDataType - Get the dataType of a NcInqWithIdOut_MS_T, NcGetVarInp_MS_T or NcGetVarOut_MS_T 00190 - #msiNcGetElementInArray - Get the value of an element in an array 00191 - #msiFloatToString - Convert a floating point number to a string 00192 - #msiNcInq - A gGeneral netcdf inquiry (This msi is more comprehensive and supercede the msiNcInqId and msiNcInqWithId msi) 00193 - #msiNcGetNdimsInInqOut - Get the number of dimensions of a variable in a NcInqOut_MS_T 00194 - #msiNcGetNattsInInqOut - Get the number of attributes associated with a variable in a NcInqOut_MS_T 00195 - #msiNcGetNvarsInInqOut - Get the number of variables in a NcInqOut_MS_T 00196 - #msiNcGetFormatInInqOut - Get the format of the NETCDF file in a NcInqOut_MS_T 00197 - #msiNcGetVarNameInInqOut - Get the name of a variable in an array of variables in a NcInqOut_MS_T 00198 00199 - #msiNcGetVarIdInInqOut - Get the NETCDF variable ID of a variable in a NcInqOut_MS_T 00200 - #msiNcGetDimNameInInqOut - Get the name of a dimension in a NcInqOut_MS_T 00201 - #msiNcGetDimLenInInqOut - Get the length of a dimension of a variable in a NcInqOut_MS_T 00202 - #msiNcGetAttNameInInqOut - Get the name of an attribute of a varible in a NcInqOut_MS_T 00203 - #msiNcGetAttValStrInInqOut - Get the value of an atrribute of a variable in a NcInqOut_MS_T 00204 - #msiNcGetVarTypeInInqOut - Get the dataType of a variable in a NcInqOut_MS_T 00205 - #msiNcIntDataTypeToStr - Covert an integer NETCDF type to string 00206 - #msiAddToNcArray - Add a value to a variable value array in a DataArray_PI 00207 - #msiFreeNcStruct - Free the NcGetVarOut_MS_T and its content 00208 - #msiNcInqGrps - Given the group ncid, returns all full group paths 00209 - #msiNcOpenGroup - Open a fully qualified group name and get the group id 00210 - #msiNcGetNGrpsInInqOut - Get the number of groups in a NcInqGrpsOut_MS_T 00211 - #msiNcGetGrpInInqOut - Get the name of a group in a NcInqGrpsOut_MS_T 00212 - #msiNcRegGlobalAttr - Extract the NETCDF global variables in an iRODS data object and register them as AUV 00213 - #msiNcSubsetVar - NETCDF subsetting operation 00214 - #msiNcVarStat - Compute the maximum, minimum and average of a variable in a NcGetVarOut_MS_T 00215 00216 \subsection msiotheruser Other User Microservices 00217 - #msiExtractNaraMetadata - Extracts NARA style metadata from a local configuration file 00218 - #msiApplyDCMetadataTemplate - Adds Dublin Core Metadata fields to an object or collection 00219 - #msiRegisterData - Registers a new data object 00220 - #writeBytesBuf - Writes the buffer in an inOutStruct to stdout or stderr 00221 - #msiStrToBytesBuf - Converts a string to a bytesBuf_t 00222 - #msiFreeBuffer - Frees a buffer in an inOutStruct, or stdout or stderr 00223 - #writePosInt - Writes an integer to stdout or stderr 00224 - #msiGetDiffTime - Returns the difference between two system timestamps given in unix format (stored in string) 00225 - #msiGetSystemTime - Returns the local system time of server 00226 - #msiGetFormattedSystemTime - Returns the local system time, formatted 00227 - #msiHumanToSystemTime - Converts a human readable date to a system timestamp 00228 - #msiGetIcatTime - Returns the system time for the iCAT server 00229 - #msiGetTaggedValueFromString - Gets the value from a file in tagged-format (psuedo-XML), given a tag-name 00230 - #msiExtractTemplateMDFromBuf - Extracts AVU info using template 00231 - #msiReadMDTemplateIntoTagStruct - Loads template file contents into tag structure 00232 00233 \subsection msisystem System Microservices 00234 Can only be called by the server process 00235 - #msiSetDefaultResc - Sets the default resource 00236 - #msiSetNoDirectRescInp - Sets a list of resources that cannot be used by a normal user directly 00237 - #msiSetRescSortScheme - Sets the scheme for selecting the best resource to use 00238 - #msiSetMultiReplPerResc - Sets the number of copies per resource to unlimited 00239 - #msiSetDataObjPreferredResc - Specifies the preferred copy to use, if the data has multiple copies 00240 - #msiSetDataObjAvoidResc - Specifies the copy to avoid 00241 - #msiSetGraftPathScheme - Sets the scheme for composing the physical path in the vault to GRAFT_PATH 00242 - #msiSetRandomScheme - Sets the the scheme for composing the physical path in the vault to RANDOM 00243 - #msiSetResource - sets the resource from default 00244 - #msiSortDataObj - Sort the replica randomly when choosing which copy to use 00245 - #msiSetNumThreads - specify the parameters for determining the number of threads to use for data transfer 00246 - #msiSysChksumDataObj - Checksums a data object 00247 - #msiSysReplDataObj - Replicates a data object 00248 - #msiSysMetaModify - Modifies system metadata 00249 - #msiStageDataObj - Stages the data object to the specified resource before operation 00250 - #msiNoChkFilePathPerm - Does not check file path permission when registering a file 00251 - #msiSetChkFilePathPerm - Sets the check type for file path permission check when registering a file 00252 - #msiNoTrashCan - Sets the policy to no trash can 00253 - #msiSetPublicUserOpr - Sets a list of operations that can be performed by the user "public" 00254 - #msiCheckHostAccessControl - Sets the access control policy 00255 - #msiServerMonPerf - Monitors the servers' activity and performance 00256 - #msiFlushMonStat - Flushes the servers' monitoring statistics 00257 - #msiDigestMonStat - Calculates and stores a digest performance value for each connected resource 00258 - #msiDeleteDisallowed - Sets the policy for determining certain data cannot be deleted 00259 - #msiSetDataTypeFromExt - Gets the data type based on file name extension 00260 - #msiSetReServerNumProc - Sets the number of processes for the rule engine server 00261 - #msiSetRescQuotaPolicy - Sets the resource quota to on or off 00262 - #msiListEnabledMS - Returns the list of compiled microservices on the local iRODS server 00263 - #msiSetBulkPutPostProcPolicy - Sets whether acPostProcForPut should be run after a bulk put 00264 00265 \section msiadmin Admin Microservices 00266 Can only be called by an administrator 00267 - #msiServerBackup - Copies iRODS server files to the local resource 00268 - #msiSetQuota - Sets disk usage quota for a user or group 00269 00270 \section msimodules Module Microservices 00271 00272 \subsection msiera ERA - Electronic Records Archives Program 00273 - #msiRecursiveCollCopy - Recursively copies a collection and its contents including metadata 00274 - #msiGetDataObjACL - Gets ACL (Access Control List) for a data object in | separated format 00275 - #msiGetCollectionACL- Gets ACL (Access Control List) for a collection in | separated format 00276 - #msiGetDataObjAVUs - Retrieves metadata AVU triplets for a data object and returns them as an XML file 00277 - #msiGetDataObjPSmeta - Retrieves metadata AVU triplets for a data object in | separated format 00278 - #msiGetCollectionPSmeta- Retrieves metadata AVU triplets for a collection in | separated format 00279 - #msiGetDataObjAIP - Gets the Archival Information Package of a data object in XML format 00280 - #msiLoadMetadataFromDataObj - Parses an iRODS object for new metadata AVUs from | separated format 00281 - #msiExportRecursiveCollMeta - Exports metadata AVU triplets for a collection and its contents in | separated format 00282 - #msiCopyAVUMetadata - Copies metadata triplets from an iRODS object to another 00283 - #msiStripAVUs - Strips a data object of its metadata AVU triplets 00284 - #msiGetUserInfo - Gets Information about user 00285 - #msiGetUserACL - Gets User ACL for all objects and collections 00286 - #msiCreateUserAccountsFromDataObj - Creates new user from information in an iRODS data object 00287 - #msiLoadUserModsFromDataObj - Modifies user information from information in an iRODS data object 00288 - #msiDeleteUsersFromDataObj - Deletes user from information in an iRODS data object 00289 - #msiLoadACLFromDataObj - Loads ACL from information in an iRODS data object 00290 - #msiGetAuditTrailInfoByUserID - Retrieves Audit Trail information for a user ID 00291 - #msiGetAuditTrailInfoByObjectID - Retrieves Audit Trail information for an object ID 00292 - #msiGetAuditTrailInfoByActionID - Retrieves Audit Trail information for a given action ID 00293 - #msiGetAuditTrailInfoByKeywords - Retrieves Audit Trail information by keywords in the comment field 00294 - #msiGetAuditTrailInfoByTimeStamp - Retrieves Audit Trail information by timestamp period 00295 - #msiSetDataType - Sets data type for an object 00296 - #msiGuessDataType - Guesses the data type of an object based on its file extension 00297 - #msiMergeDataCopies - Custom microservice for NARA consolidation rule 00298 - #msiFlagDataObjwithAVU - Flags a data object with an AVU 00299 - #msiGetCollectionContentsReport - Returns the number of objects in a collection by data type 00300 - #msiGetCollectionSize - Returns the object count and total disk usage of a collection 00301 - #msiGetObjectPath - Returns the path of an iRODS object 00302 - #msiCollectionSpider - Applies a microservice sequence to all data objects in a collection, recursively 00303 - #msiIsColl - Checks if an iRODS path is a collection. For use in workflows 00304 - #msiIsData - Checks if an iRODS path is a data object (an iRODS file). For use in workflows 00305 - #msiStructFileBundle - Bundles a collection for export 00306 - #msiFlagInfectedObjs - Parses output from clamscan and flags infected objects 00307 - #msiStoreVersionWithTS - Creates a timestamped backup version of an iRODS data object 00308 00309 \subsection msiurl URL 00310 - #msiFtpGet - Gets a remote file using FTP and writes it to an iRODS object 00311 - #msiTwitterPost - Posts a message to twitter.com 00312 00313 \subsection msixml XML 00314 - #msiLoadMetadataFromXml - Loads AVU metadata from an XML file of AVU triplets 00315 - #msiXmlDocSchemaValidate - Validates an XML file against an XSD schema, both iRODS objects 00316 - #msiXsltApply - Returns the xml object after applying the xslt transformation, given an xml object and an xslt object 00317 00318 \subsection msimsodrivers Microservice Object (MSO) Drivers 00319 - #msiobjget_dbo - Gets a DBO object 00320 - #msiobjput_dbo - Puts a DBO object 00321 - #msiobjget_http - Gets an HTTP/HTTPS/FTP object 00322 - #msiobjput_http - Puts an HTTP/HTTPS/FTP object 00323 - #msiobjget_irods - Gets an iRODS object 00324 - #msiobjput_irods - Puts an iRODS object 00325 - #msiobjget_slink - Gets an SLINK object 00326 - #msiobjput_slink - Puts an SLINK object 00327 - #msiobjget_srb - Gets an SRB object 00328 - #msiobjput_srb - Puts an SRB object 00329 - #msiobjget_test - Gets a test object 00330 - #msiobjput_test - Puts a test object 00331 - #msiobjget_z3950 - Gets a Z39.50 object 00332 - #msiobjput_z3950 - Puts a Z39.50 object 00333 00334 \subsection msiimage Image 00335 - #msiImageConvert - Reads a source image file and write it out as a new image file in a chosen format 00336 - #msiImageGetProperties - Gets the properties of an image file 00337 - #msiImageScale - Reads a source image file, scale it up or down in size, and write it out as a new image file in a chosen format 00338 00339 \subsection msihdf HDF 00340 - #msiH5File_open - Opens an HDF file 00341 - #msiH5File_close - Closes an HDF file 00342 - #msiH5Dataset_read - Reads data from an HDF file 00343 - #msiH5Dataset_read_attribute - Reads data attribute from an HDF file 00344 - #msiH5Group_read_attribute - Reads attributes of a group in an HDF file 00345 00346 \subsection msiproperties Properties 00347 - #msiPropertiesNew - Creates a new empty property list 00348 - #msiPropertiesClear - Clears a property list 00349 - #msiPropertiesClone - Clones a property list, returning a new property list 00350 - #msiPropertiesAdd - Adds a property and value to a property list. If the property is already in the list, its value is changed. Otherwise the property is added. 00351 - #msiPropertiesRemove - Removes a property from the list 00352 - #msiPropertiesGet - Gets the value of a property in a property list. The property list is left unmodified. 00353 - #msiPropertiesSet - Sets the value of a property in a property list. If the property is already in the list, its value is changed. Otherwise the property is added. 00354 - #msiPropertiesExists - Returns true (integer 1) if the keyword has a property value in the property list, and false (integer 0) otherwise. The property list is unmodified. 00355 - #msiPropertiesToString - Converts a property list into a string buffer. The property list is left unmodified. 00356 - #msiPropertiesFromString - Parses a string into a new property list. The existing property list, if any, is deleted. 00357 00358 \subsection msiwebservices Web Services 00359 - #msiGetQuote - Returns stock quotation (delayed by web service) using web service provided by http://www.webserviceX.NET 00360 - #msiIp2location - Returns host name and other details given an ipaddress using web service provided by http://ws.fraudlabs.com/ 00361 - #msiConvertCurrency - Returns conversion rate for currencies from one country to another using web service provided by http://www.webserviceX.NET/ 00362 - #msiObjByName - Returns position and type of an astronomical object given a name from the NASA/IPAC Extragalactic Database (NED) using web service at http://voservices.net/NED/ws_v2_0/NED.asmx 00363 - #msiSdssImgCutout_GetJpeg - Returns an image buffer given a position and cutout from the SDSS Image Cut Out service using web service provided by http://skyserver.sdss.org 00364 00365 \subsection msiz3950 Z3950 00366 - #msiz3950Submit - Retrieves a record from a Z39.50 server 00367 00368 **/ 00369 00370 /** 00371 For Inclusion above, later 00372 \subsection msinetcdf NetCDF Microservices 00373 - #msiNcOpen 00374 - #msiNcCreate 00375 - #msiNcClose 00376 - #msiNcInqId 00377 - #msiNcInqWithId 00378 - #msiNcGetVarsByType 00379 - #msiNccfGetVara 00380 - #msiNcGetArrayLen 00381 - #msiNcGetNumDim 00382 - #msiNcGetDataType 00383 - #msiNcGetElementInArray 00384 - #msiFloatToString 00385 **/ 00386 00387 00388 00389 /** 00390 * \fn msiGetIcatTime (msParam_t *timeOutParam, msParam_t *typeInParam, ruleExecInfo_t *rei) 00391 * 00392 * \brief This function returns the system time for the iCAT server 00393 * 00394 * \module core 00395 * 00396 * \since pre-2.1 00397 * 00398 * \author DICE 00399 * \date 2008 00400 * 00401 * \usage See clients/icommands/test/rules3.0/ 00402 * 00403 * \param[out] timeOutParam - a msParam of type STR_MS_T 00404 * \param[in] typeInParam - a msParam of type STR_MS_T 00405 * \li "icat" or "unix" will return seconds since epoch 00406 * \li otherwise, human friendly 00407 * \param[in,out] rei - The RuleExecInfo structure that is automatically 00408 * handled by the rule engine. The user does not include rei as a 00409 * parameter in the rule invocation. 00410 * 00411 * \DolVarDependence none 00412 * \DolVarModified none 00413 * \iCatAttrDependence none 00414 * \iCatAttrModified none 00415 * \sideeffect none 00416 * 00417 * \return integer 00418 * \retval 0 on success 00419 * \pre none 00420 * \post none 00421 * \sa none 00422 **/ 00423 int 00424 msiGetIcatTime(msParam_t* timeOutParam, msParam_t* typeInParam, ruleExecInfo_t *rei) 00425 { 00426 char *type; 00427 char tStr0[TIME_LEN],tStr[TIME_LEN]; 00428 int i; 00429 00430 type = (char*)typeInParam->inOutStruct; 00431 00432 if (!strcmp(type,"icat") || !strcmp(type,"unix")) { 00433 getNowStr(tStr); 00434 } 00435 else { /* !strcmp(type,"human") */ 00436 getNowStr(tStr0); 00437 getLocalTimeFromRodsTime(tStr0,tStr); 00438 } 00439 i = fillStrInMsParam (timeOutParam,tStr); 00440 return(i); 00441 } 00442 00443 /** 00444 * \fn msiVacuum (ruleExecInfo_t *rei) 00445 * 00446 * \brief Postgres vacuum, done periodically to optimize indices and performance 00447 * 00448 * \module core 00449 * 00450 * \since pre-2.1 00451 * 00452 * \author Wayne Schroeder 00453 * \date December 2006 00454 * 00455 * \note The effect of this is that iCAT database gets vacuumed. 00456 * This microservice works with PostgreSQL only. 00457 * 00458 * \note This is run via an 'iadmin' command (iadmin pv) via a rule 00459 * in the core.irb. It is not designed for general use in other 00460 * situations (i.e. don't call this from other rules). 00461 * 00462 * \usage See clients/icommands/test/rules3.0/ 00463 * 00464 * \param[in,out] rei - The RuleExecInfo structure that is automatically 00465 * handled by the rule engine. The user does not include rei as a 00466 * parameter in the rule invocation. 00467 * 00468 * \DolVarDependence none 00469 * \DolVarModified none 00470 * \iCatAttrDependence none 00471 * \iCatAttrModified none 00472 * \sideeffect none 00473 * 00474 * \return integer 00475 * \retval 0 on success 00476 * \pre none 00477 * \post none 00478 * \sa none 00479 **/ 00480 int 00481 msiVacuum(ruleExecInfo_t *rei) 00482 { 00483 int i; 00484 rodsLog(LOG_NOTICE, "msiVacuum called\n"); 00485 00486 i = doForkExec("/usr/bin/perl", "./vacuumdb.pl"); 00487 00488 if (i) { 00489 rodsLog(LOG_ERROR, "msiVacuum doForkExec failure\n"); 00490 } 00491 00492 rodsLog(LOG_NOTICE, "msiVacuum done\n"); 00493 00494 return(0); 00495 } 00496 00497 00498 /** 00499 * \fn msiQuota (ruleExecInfo_t *rei) 00500 * 00501 * \brief Calculates storage usage and sets quota values (over/under/how-much). 00502 * 00503 * \module core 00504 * 00505 * \since pre-2.3 00506 * 00507 * \author Wayne Schroeder 00508 * \date January 2010 00509 * 00510 * \note Causes the iCAT quota tables to be updated. 00511 * 00512 * \note This is run via an admin rule 00513 * 00514 * \usage See clients/icommands/test/rules3.0/ and https://www.irods.org/index.php/Quotas 00515 * 00516 * \param[in,out] rei - The RuleExecInfo structure that is automatically 00517 * handled by the rule engine. The user does not include rei as a 00518 * parameter in the rule invocation. 00519 * 00520 * \DolVarDependence rei->rsComm->clientUser.authFlag (must be admin) 00521 * \DolVarModified none 00522 * \iCatAttrDependence Utilizes ICAT data-object information 00523 * \iCatAttrModified Updates the quota tables 00524 * \sideeffect none 00525 * \return integer 00526 * \retval 0 on success 00527 * \pre none 00528 * \post none 00529 * \sa none 00530 **/ 00531 int 00532 msiQuota(ruleExecInfo_t *rei) 00533 { 00534 int status; 00535 00536 #ifdef RODS_CAT 00537 rodsLog(LOG_NOTICE, "msiQuota/chlCalcUsageAndQuota called\n"); 00538 status = chlCalcUsageAndQuota(rei->rsComm); 00539 #else 00540 status = SYS_NO_RCAT_SERVER_ERR; 00541 #endif 00542 return(status); 00543 } 00544 00545 /** 00546 *\fn msiSetResource (msParam_t *xrescName, ruleExecInfo_t *rei) 00547 * 00548 * \brief This microservice sets the resource as part of a workflow execution. 00549 * 00550 * \module core 00551 * 00552 * \since pre-2.1 00553 * 00554 * \author DICE 00555 * \date 2008 00556 * 00557 * \note This microservice sets the resource as part of a workflow execution. 00558 * 00559 * \usage See clients/icommands/test/rules3.0/ 00560 * 00561 * \param[in] xrescName - is a msParam of type STR_MS_T 00562 * \param[in,out] rei - The RuleExecInfo structure that is automatically 00563 * handled by the rule engine. The user does not include rei as a 00564 * parameter in the rule invocation. 00565 * 00566 * \DolVarDependence none 00567 * \DolVarModified none 00568 * \iCatAttrDependence none 00569 * \iCatAttrModified none 00570 * \sideeffect none 00571 * 00572 * \return integer 00573 * \retval 0 on success 00574 * \pre none 00575 * \post none 00576 * \sa none 00577 **/ 00578 int msiSetResource(msParam_t* xrescName, ruleExecInfo_t *rei) 00579 { 00580 char *rescName; 00581 00582 rescName = (char *) xrescName->inOutStruct; 00583 if (reTestFlag > 0 ) { 00584 if (reTestFlag == LOG_TEST_1) 00585 rodsLog (LOG_NOTICE," Calling msiSetResource\n"); 00586 } 00587 00588 strcpy(rei->doi->rescName,rescName); 00589 return(0); 00590 } 00591 00592 00593 /** 00594 * \fn msiCheckOwner (ruleExecInfo_t *rei) 00595 * 00596 * \brief This microservice checks whether the user is the owner 00597 * 00598 * \module core 00599 * 00600 * \since pre-2.1 00601 * 00602 * \author DICE 00603 * \date 2008 00604 * 00605 * \usage See clients/icommands/test/rules3.0/ 00606 * 00607 * \param[in,out] rei - The RuleExecInfo structure that is automatically 00608 * handled by the rule engine. The user does not include rei as a 00609 * parameter in the rule invocation. 00610 * 00611 * \DolVarDependence none 00612 * \DolVarModified none 00613 * \iCatAttrDependence none 00614 * \iCatAttrModified none 00615 * \sideeffect none 00616 * 00617 * \return integer 00618 * \retval 0 on success 00619 * \pre none 00620 * \post none 00621 * \sa none 00622 **/ 00623 int msiCheckOwner(ruleExecInfo_t *rei) 00624 { 00625 if (reTestFlag > 0 ) { 00626 if (reTestFlag == LOG_TEST_1) 00627 rodsLog (LOG_NOTICE," Calling msiCheckOwner\n"); 00628 } 00629 00630 if (!strcmp(rei->doi->dataOwnerName,rei->uoic->userName) && 00631 !strcmp(rei->doi->dataOwnerZone,rei->uoic->rodsZone)) 00632 return(0); 00633 else 00634 return(ACTION_FAILED_ERR); 00635 00636 } 00637 00638 /** 00639 * \fn msiCheckPermission (msParam_t *xperm, ruleExecInfo_t *rei) 00640 * 00641 * \brief This microservice checks the authorization permission (whether or not permission is granted) 00642 * 00643 * \module core 00644 * 00645 * \since pre-2.1 00646 * 00647 * \author DICE 00648 * \date 2008 00649 * 00650 * \usage See clients/icommands/test/rules3.0/ 00651 * 00652 * \param[in] xperm - a msParam of type STR_MS_T 00653 * \param[in,out] rei - The RuleExecInfo structure that is automatically 00654 * handled by the rule engine. The user does not include rei as a 00655 * parameter in the rule invocation. 00656 * 00657 * \DolVarDependence none 00658 * \DolVarModified none 00659 * \iCatAttrDependence none 00660 * \iCatAttrModified none 00661 * \sideeffect none 00662 * 00663 * \return integer 00664 * \retval 0 on success 00665 * \pre none 00666 * \post none 00667 * \sa none 00668 **/ 00669 int msiCheckPermission(msParam_t* xperm, ruleExecInfo_t *rei) 00670 { 00671 char *perm; 00672 00673 perm = (char *) xperm->inOutStruct; 00674 if (reTestFlag > 0 ) { 00675 if (reTestFlag == LOG_TEST_1) 00676 rodsLog (LOG_NOTICE," Calling msiCheckPermission\n"); 00677 } 00678 if (strstr(rei->doi->dataAccess,perm) != NULL) 00679 return(0); 00680 else 00681 return(ACTION_FAILED_ERR); 00682 00683 } 00684 00685 00686 /** 00687 * \fn msiCheckAccess(msParam_t *inObjName, msParam_t * inOperation, msParam_t * outResult, ruleExecInfo_t *rei) 00688 * 00689 * \brief This microservice checks the access permission to perform a given operation 00690 * 00691 * \module core 00692 * 00693 * \since 3.0 00694 * 00695 * \author Arcot Rajasekar 00696 * \date July 2011 00697 * 00698 * \usage See clients/icommands/test/rules3.0/ 00699 * 00700 * \param[in] inObjName - name of Object. A param of type STR_MS_T 00701 * \param[in] inOperation - type of Operation that will be performed. A param of type STR_MS_T. 00702 * \param[out] outResult - result of the operation. 0 for failure and 1 for success. a param of type INT_MS_T. 00703 * \param[in,out] rei - The RuleExecInfo structure that is automatically 00704 * handled by the rule engine. The user does not include rei as a 00705 * parameter in the rule invocation. 00706 * 00707 * \DolVarDependence none 00708 * \DolVarModified none 00709 * \iCatAttrDependence none 00710 * \iCatAttrModified none 00711 * \sideeffect none 00712 * 00713 * \return integer 00714 * \retval 0 on success 00715 * \pre none 00716 * \post none 00717 * \sa none 00718 **/ 00719 int msiCheckAccess(msParam_t *inObjName, msParam_t * inOperation, 00720 msParam_t * outResult, ruleExecInfo_t *rei) 00721 { 00722 char *objName, *oper; 00723 char objType[MAX_NAME_LEN]; 00724 int i; 00725 char *user; 00726 char *zone; 00727 00728 RE_TEST_MACRO (" Calling msiCheckAccess"); 00729 00730 if (inObjName == NULL || inObjName->inOutStruct == NULL || 00731 inObjName->type == NULL || strcmp(inObjName->type, STR_MS_T) != 0 ) 00732 return (USER_PARAM_TYPE_ERR); 00733 00734 if (inOperation == NULL || inOperation->inOutStruct == NULL || 00735 inOperation->type == NULL || strcmp(inOperation->type, STR_MS_T) != 0 ) 00736 return (USER_PARAM_TYPE_ERR); 00737 00738 if (rei == NULL || rei->rsComm == NULL) 00739 return (SYS_INTERNAL_NULL_INPUT_ERR); 00740 00741 if (strlen(rei->rsComm->clientUser.userName) == 0 || 00742 strlen(rei->rsComm->clientUser.rodsZone) == 0) 00743 return (SYS_INTERNAL_NULL_INPUT_ERR); 00744 00745 oper = (char *) inOperation->inOutStruct; 00746 objName = (char *) inObjName->inOutStruct; 00747 user = rei->rsComm->clientUser.userName; 00748 zone = rei->rsComm->clientUser.rodsZone; 00749 00750 i = getObjType(rei->rsComm, objName, objType); 00751 if (i < 0) 00752 return(i); 00753 00754 i = checkPermissionByObjType(rei->rsComm, objName, objType, user, zone, oper); 00755 if (i < 0) 00756 return(i); 00757 fillIntInMsParam (outResult, i); 00758 00759 return(0); 00760 00761 } 00762 00763 00764 /** 00765 * \fn msiCommit (ruleExecInfo_t *rei) 00766 * 00767 * \brief This microservice commits pending database transactions, 00768 * registering the new state information into the iCAT. 00769 * 00770 * \module core 00771 * 00772 * \since pre-2.1 00773 * 00774 * \author Wayne Schroeder 00775 * \date June 2009 00776 * 00777 * \note This is used to commit changes (in any) into the iCAT 00778 * database as part of a rule and microservice chain. See core.irb 00779 * for examples. In other cases, iCAT updates and inserts are 00780 * automatically committed into the iCAT Database as part of the 00781 * normal operations (in the 'C' code). 00782 * 00783 * \usage See clients/icommands/test/rules3.0/ 00784 * 00785 * \param[in,out] rei - The RuleExecInfo structure that is automatically 00786 * handled by the rule engine. The user does not include rei as a 00787 * parameter in the rule invocation. 00788 * 00789 * \DolVarDependence none 00790 * \DolVarModified none 00791 * \iCatAttrDependence commits pending updates (if any) 00792 * \iCatAttrModified pending updates (if any) are committed into the iCAT db 00793 * \sideeffect none 00794 * 00795 * \return integer 00796 * \retval (status) 00797 * \pre none 00798 * \post none 00799 * \sa none 00800 **/ 00801 int 00802 msiCommit(ruleExecInfo_t *rei) { 00803 int status; 00804 00805 /**** This is Just a Test Stub ****/ 00806 if (reTestFlag > 0 ) { 00807 if (reTestFlag == LOG_TEST_1) { 00808 rodsLog (LOG_NOTICE," Calling msiCommit\n"); 00809 } 00810 if (reLoopBackFlag > 0) 00811 return(0); 00812 } 00813 /**** This is Just a Test Stub ****/ 00814 #ifdef RODS_CAT 00815 status = chlCommit(rei->rsComm); 00816 #else 00817 status = SYS_NO_RCAT_SERVER_ERR; 00818 #endif 00819 return(status); 00820 } 00821 00822 /** 00823 * \fn msiRollback (ruleExecInfo_t *rei) 00824 * 00825 * \brief This function deletes user and collection information from the iCAT by rolling back the database transaction 00826 * 00827 * \module core 00828 * 00829 * \since pre-2.1 00830 * 00831 * \author Wayne Schroeder 00832 * \date June 2009 00833 * 00834 * \note This is used to not-commit changes into the iCAT database as 00835 * part of a rule and microservice chain. See core.irb for examples. 00836 * In other cases, iCAT updates and inserts are automatically 00837 * rolled-back as part of the normal operations (in the 'C' code). 00838 * 00839 * \usage See clients/icommands/test/rules3.0/ 00840 * 00841 * \param[in,out] rei - The RuleExecInfo structure that is automatically 00842 * handled by the rule engine. The user does not include rei as a 00843 * parameter in the rule invocation. 00844 * 00845 * \DolVarDependence none 00846 * \DolVarModified none 00847 * \iCatAttrDependence pending updates (if any) are canceled 00848 * \iCatAttrModified pending updates (if any) are canceled 00849 * \sideeffect none 00850 * 00851 * \return integer 00852 * \retval 0 on success 00853 * \pre none 00854 * \post none 00855 * \sa none 00856 **/ 00857 int 00858 msiRollback(ruleExecInfo_t *rei) 00859 { 00860 int status; 00861 /**** This is Just a Test Stub ****/ 00862 if (reTestFlag > 0 ) { 00863 if (reTestFlag == LOG_TEST_1) { 00864 rodsLog (LOG_NOTICE," Calling msiRollback\n"); 00865 } 00866 if (reLoopBackFlag > 0) 00867 return(0); 00868 } 00869 /**** This is Just a Test Stub ****/ 00870 00871 00872 #ifdef RODS_CAT 00873 status = chlRollback(rei->rsComm); 00874 #else 00875 status = SYS_NO_RCAT_SERVER_ERR; 00876 #endif 00877 return(status); 00878 } 00879 00880 /** 00881 * \fn msiSetACL (msParam_t *recursiveFlag, msParam_t *accessLevel, msParam_t *userName, msParam_t *pathName, ruleExecInfo_t *rei) 00882 * 00883 * \brief This microservice changes the ACL for a given pathname, 00884 * either a collection or a data object. 00885 * 00886 * \module core 00887 * 00888 * \since 2.3 00889 * 00890 * \author Jean-Yves Nief 00891 * \date 2010-02-11 00892 * 00893 * \note This microservice modifies the access rights on a given iRODS object or 00894 * collection. For the collections, the modification can be recursive and the 00895 * inheritence bit can be changed as well. 00896 * For admin mode, add MOD_ADMIN_MODE_PREFIX to the access level string, 00897 * e.g: msiSetACL("default", "admin:read", "rods", *path) 00898 * 00899 * \usage See clients/icommands/test/rules3.0/ 00900 * 00901 * \param[in] recursiveFlag - a STR_MS_T, either "default" or "recursive". "recursive" 00902 * is only relevant if set with accessLevel set to "inherit". 00903 * \param[in] accessLevel - a STR_MS_T containing one of the following: 00904 * \li read 00905 * \li write 00906 * \li own 00907 * \li inherit 00908 * \li null 00909 * \param[in] userName - a STR_MS_T, the user name or group name who will have ACL changed. 00910 * \param[in] pathName - a STR_MS_T, the collection or data object that will have its ACL changed. 00911 * \param[in,out] rei - The RuleExecInfo structure that is automatically 00912 * handled by the rule engine. The user does not include rei as a 00913 * parameter in the rule invocation. 00914 * 00915 * \DolVarDependence $userName and/or $objPath and/or $collName 00916 * \DolVarModified none 00917 * \iCatAttrDependence none 00918 * \iCatAttrModified none 00919 * \sideeffect none 00920 * 00921 * \return integer 00922 * \retval 0 on success 00923 * \pre N/A 00924 * \post N/A 00925 * \sa N/A 00926 **/ 00927 int msiSetACL (msParam_t *recursiveFlag, msParam_t *accessLevel, msParam_t *userName, 00928 msParam_t *pathName, ruleExecInfo_t *rei) { 00929 char *acl, *path, *recursiveFlg, *user, uname[NAME_LEN], *zone; 00930 int recFlg, rc; 00931 modAccessControlInp_t modAccessControlInp; 00932 rsComm_t *rsComm = 0; // JMC cppcheck - uninit var 00933 00934 RE_TEST_MACRO (" Calling msiSetACL") 00935 /* the above line is needed for loop back testing using irule -i option */ 00936 00937 if ( recursiveFlag == NULL || accessLevel == NULL || userName == NULL || 00938 pathName == NULL ) { 00939 rodsLogAndErrorMsg (LOG_ERROR, &rsComm->rError, rei->status, 00940 "msiSetACL: one of the input parameter is NULL"); 00941 return (SYS_INTERNAL_NULL_INPUT_ERR); 00942 } 00943 00944 recFlg = 0; /* non recursive mode */ 00945 if ( strcmp (recursiveFlag->type, STR_MS_T) == 0 ) { 00946 recursiveFlg = (char *) recursiveFlag->inOutStruct; 00947 if ( strcmp(recursiveFlg,"recursive") == 0 ) { 00948 /* recursive mode */ 00949 recFlg = 1; 00950 } 00951 } 00952 else { 00953 rodsLogAndErrorMsg (LOG_ERROR, &rsComm->rError, rei->status, 00954 "msiSetACL: Unsupported input recursiveFlag type %i", 00955 recursiveFlag->type); 00956 return (USER_PARAM_TYPE_ERR); 00957 } 00958 00959 if ( strcmp (accessLevel->type, STR_MS_T) == 0 ) { 00960 acl = (char *) accessLevel->inOutStruct; 00961 } 00962 else { 00963 rodsLogAndErrorMsg (LOG_ERROR, &rsComm->rError, rei->status, 00964 "msiSetACL: Unsupported input accessLevel type %s", 00965 accessLevel->type); 00966 return (USER_PARAM_TYPE_ERR); 00967 } 00968 00969 if ( strcmp (userName->type, STR_MS_T) == 0 ) { 00970 user = (char *) userName->inOutStruct; 00971 } 00972 else { 00973 rodsLogAndErrorMsg (LOG_ERROR, &rsComm->rError, rei->status, 00974 "msiSetACL: Unsupported input userName type %s", 00975 userName->type); 00976 return (USER_PARAM_TYPE_ERR); 00977 } 00978 00979 if ( strcmp (pathName->type, STR_MS_T) == 0 ) { 00980 path = (char *) pathName->inOutStruct; 00981 } 00982 else { 00983 rodsLogAndErrorMsg (LOG_ERROR, &rsComm->rError, rei->status, 00984 "msiSetACL: Unsupported input pathName type %s", 00985 pathName->type); 00986 return (USER_PARAM_TYPE_ERR); 00987 } 00988 00989 rsComm = rei->rsComm; 00990 modAccessControlInp.recursiveFlag = recFlg; 00991 modAccessControlInp.accessLevel = acl; 00992 if ( strchr(user, '#') == NULL ) { 00993 modAccessControlInp.userName = user; 00994 modAccessControlInp.zone = rei->uoic->rodsZone; 00995 } 00996 else { 00997 zone = strchr(user, '#') + 1; 00998 memset(uname, '\0', NAME_LEN); 00999 strncpy(uname, user, strlen(user) - strlen(zone) - 1); 01000 modAccessControlInp.userName = uname; 01001 modAccessControlInp.zone = zone; 01002 } 01003 modAccessControlInp.path = path; 01004 rc = rsModAccessControl(rsComm, &modAccessControlInp); 01005 if ( rc < 0 ) { 01006 rodsLog (LOG_NOTICE, "msiSetACL: ACL modifications has failed for user %s on object %s, error = %i\n", user, path, rc); 01007 } 01008 01009 return (rc); 01010 } 01011 01012 /** 01013 * \fn msiDeleteUnusedAVUs (ruleExecInfo_t *rei) 01014 * 01015 * \brief This microservice deletes unused AVUs from the iCAT. See 'iadmin rum'. 01016 * 01017 * \module core 01018 * 01019 * \since post-2.3 01020 * 01021 * \author Wayne Schroeder 01022 * \date April 13, 2010 01023 * 01024 * \note See 'iadmin help rum'. Do not call this directly. 01025 * 01026 * \usage See clients/icommands/test/rules3.0/ 01027 * 01028 * \param[in,out] rei - The RuleExecInfo structure that is automatically 01029 * handled by the rule engine. The user does not include rei as a 01030 * parameter in the rule invocation. 01031 * 01032 * \DolVarDependence rei->rsComm->clientUser.authFlag (must be admin) 01033 * \DolVarModified none 01034 * \iCatAttrDependence check AVU table 01035 * \iCatAttrModified update AVU table 01036 * \sideeffect none 01037 * 01038 * \return integer 01039 * \retval (status) 01040 * \pre none 01041 * \post none 01042 * \sa none 01043 **/ 01044 int 01045 msiDeleteUnusedAVUs(ruleExecInfo_t *rei) 01046 { 01047 int status; 01048 01049 /**** This is Just a Test Stub ****/ 01050 if (reTestFlag > 0 ) { 01051 if (reTestFlag == LOG_TEST_1) { 01052 rodsLog (LOG_NOTICE," Calling msiDeleteUnusedAVUs\n"); 01053 } 01054 if (reLoopBackFlag > 0) 01055 return(0); 01056 } 01057 /**** This is Just a Test Stub ****/ 01058 01059 #ifdef RODS_CAT 01060 rodsLog(LOG_NOTICE, "msiDeleteUnusedAVUs/chlDelUnusedAVUs called\n"); 01061 status = chlDelUnusedAVUs(rei->rsComm); 01062 #else 01063 status = SYS_NO_RCAT_SERVER_ERR; 01064 #endif 01065 return(status); 01066 }