"Fossies" - the Fresh Open Source Software Archive

Member "irods-4.2.8/lib/api/include/atomic_apply_metadata_operations.h" (14 May 2020, 2110 Bytes) of package /linux/misc/irods-4.2.8.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "atomic_apply_metadata_operations.h" see the Fossies "Dox" file reference documentation.

    1 #ifndef IRODS_ATOMIC_APPLY_METADATA_OPERATIONS_HPP
    2 #define IRODS_ATOMIC_APPLY_METADATA_OPERATIONS_HPP
    3 
    4 /// \file
    5 
    6 #include "rcConnect.h"
    7 
    8 #ifdef __cplusplus
    9 extern "C" {
   10 #endif
   11 
   12 /// Executes a list of metadata operations on a single object atomically.
   13 ///
   14 /// Sequentially executes all \p operations on \p entity_name as a single transaction. If an
   15 /// error occurs, all updates are rolled back and an error is returned. \p json_output will
   16 /// contain specific information about the error.
   17 ///
   18 /// \p json_input must have the following JSON structure:
   19 /// \code{.js}
   20 /// {
   21 ///   "entity_name": string,
   22 ///   "entity_type": string,
   23 ///   "operations": [
   24 ///     {
   25 ///       "operation": string,
   26 ///       "attribute": string,
   27 ///       "value": string,
   28 ///       "units": string
   29 ///     }
   30 ///   ]
   31 /// }
   32 /// \endcode
   33 ///
   34 /// \p entity_name must be one of the following:
   35 /// - A logical path pointing to a data object.
   36 /// - A logical path pointing to a collection.
   37 /// - A user name.
   38 /// - A resource name.
   39 ///
   40 /// \p entity_type must be one of the following:
   41 /// - collection
   42 /// - data_object
   43 /// - resource
   44 /// - user
   45 ///
   46 /// \p operations is the list of metadata operations to execute atomically. They will be
   47 /// executed in order.
   48 ///
   49 /// \p operation must be one of the following:
   50 /// - add
   51 /// - remove
   52 ///
   53 /// \p units are optional.
   54 ///
   55 /// On error, \p json_output will have the following JSON structure:
   56 /// \code{.js}
   57 /// {
   58 ///   "operation": string,
   59 ///   "operation_index": number,
   60 ///   "error_message": string
   61 /// }
   62 /// \endcode
   63 ///
   64 /// \user Client
   65 ///
   66 /// \since 4.2.8
   67 ///
   68 /// \param[in]  comm        A pointer to a rcComm_t.
   69 /// \param[in]  json_input  A JSON string containing the batch of metadata operations.
   70 /// \param[out] json_output A JSON string containing the error information on failure.
   71 ///
   72 /// \return An integer.
   73 /// \retval 0        On success.
   74 /// \retval non-zero On failure.
   75 int rc_atomic_apply_metadata_operations(rcComm_t* comm, const char* json_input, char** json_output);
   76 
   77 #ifdef __cplusplus
   78 } // extern "C"
   79 #endif
   80 
   81 #endif // IRODS_ATOMIC_APPLY_METADATA_OPERATIONS_HPP
   82