-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathlibirods_rule_engine_plugin-policy_engine-log_context.cpp
More file actions
84 lines (74 loc) · 2.5 KB
/
libirods_rule_engine_plugin-policy_engine-log_context.cpp
File metadata and controls
84 lines (74 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include <irods/policy_composition_framework_policy_engine.hpp>
#include <irods/policy_composition_framework_parameter_capture.hpp>
#include <irods/policy_composition_framework_configuration_manager.hpp>
#include <irods/filesystem.hpp>
#include <irods/rsModAVUMetadata.hpp>
#include <irods/rsOpenCollection.hpp>
#include <irods/rsReadCollection.hpp>
#include <irods/rsCloseCollection.hpp>
namespace
{
// clang-format off
namespace pc = irods::policy_composition;
namespace pe = irods::policy_composition::policy_engine;
using json = nlohmann::json;
// clang-format on
irods::error log_context(const pe::context& ctx, pe::arg_type out)
{
pc::logger::debug(
"{}: PARAMETERS: [{}]\nCONFIGURATION: [{}]",
__func__,
ctx.parameters.dump(4, ' ', false, json::error_handler_t::replace),
ctx.configuration.dump(4, ' ', false, json::error_handler_t::replace));
return SUCCESS();
} // log_context
} // namespace
const char usage[] = R"(
{
"$id": "https://schemas.irods.org/policy-composition/log_context.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "This is a test, this is only a test."
"input_interfaces": [
{
"name" : "event_handler-collection_modified",
"description" : "",
"json_schema" : ""
},
{
"name" : "event_handler-data_object_modified",
"description" : "",
"json_schema" : ""
},
{
"name" : "event_handler-metadata_modified",
"description" : "",
"json_schema" : ""
},
{
"name" : "event_handler-user_modified",
"description" : "",
"json_schema" : ""
},
{
"name" : "event_handler-resource_modified",
"description" : "",
"json_schema" : ""
},
{
"name" : "direct_invocation",
"description" : "",
"json_schema" : ""
},
{
"name" : "query_results"
"description" : "",
"json_schema" : ""
},
],
"output_json_for_validation" : ""
}
)";
extern "C" pe::plugin_pointer_type plugin_factory(const std::string& _plugin_name, const std::string&)
{
return pe::make(_plugin_name, "irods_policy_log_context", usage, log_context);
} // plugin_factory