summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/src/tfe_resource.cpp7
-rw-r--r--conf/tfe/tfe.conf2
-rw-r--r--resource/pangu/pangu_http.json4
3 files changed, 9 insertions, 4 deletions
diff --git a/common/src/tfe_resource.cpp b/common/src/tfe_resource.cpp
index 5a3d8a8..1403db1 100644
--- a/common/src/tfe_resource.cpp
+++ b/common/src/tfe_resource.cpp
@@ -32,6 +32,7 @@ static Maat_feather_t create_maat_feather(const char *instance_name, const char
char redis_server[TFE_STRING_MAX] = {0};
char redis_port_range[TFE_STRING_MAX] = {0};
char accept_tags[TFE_STRING_MAX] = {0};
+ char accept_path[TFE_PATH_MAX]={0};
int redis_port_begin = 0, redis_port_end = 0;
int redis_port_select = 0;
int redis_db_idx = 0;
@@ -42,7 +43,7 @@ static Maat_feather_t create_maat_feather(const char *instance_name, const char
MESA_load_profile_int_def(profile, section, "stat_switch", &(maat_stat_on), 1);
MESA_load_profile_int_def(profile, section, "perf_switch", &(maat_perf_on), 1);
MESA_load_profile_string_def(profile, section, "table_info", table_info, sizeof(table_info), "");
- MESA_load_profile_string_def(profile, section, "accept_tags", accept_tags, sizeof(accept_tags), "");
+ MESA_load_profile_string_def(profile, section, "accept_path", accept_path, sizeof(accept_path), "");
MESA_load_profile_string_def(profile, section, "json_cfg_file", json_cfg_file, sizeof(json_cfg_file), "");
MESA_load_profile_string_def(profile, section, "maat_redis_server", redis_server, sizeof(redis_server), "");
MESA_load_profile_string_def(profile, section, "maat_redis_port_range", redis_port_range, sizeof(redis_server), "6379");
@@ -132,9 +133,11 @@ static Maat_feather_t create_maat_feather(const char *instance_name, const char
Maat_set_feather_opt(target, MAAT_OPT_DEFERRED_LOAD, &deferred_load_on, sizeof(deferred_load_on));
Maat_set_feather_opt(target, MAAT_OPT_EFFECT_INVERVAL_MS, &effect_interval, sizeof(effect_interval));
Maat_set_feather_opt(target, MAAT_OPT_SCAN_DETAIL, &scan_detail, sizeof(scan_detail));
- if (strlen(accept_tags) > 0)
+ if (strlen(accept_path) > 0)
{
+ MESA_load_profile_string_def(accept_path, "maat", "ACCEPT_TAGS", accept_tags, sizeof(accept_tags), "{\"tags\":[{\"tag\":\"device_id\",\"value\":\"device_1\"}]}");
Maat_set_feather_opt(target, MAAT_OPT_ACCEPT_TAGS, &accept_tags, sizeof(accept_tags));
+ TFE_LOG_INFO(logger, "tfe accept tags : %s", accept_tags);
}
ret = Maat_initiate_feather(target);
diff --git a/conf/tfe/tfe.conf b/conf/tfe/tfe.conf
index 347cef5..d59109a 100644
--- a/conf/tfe/tfe.conf
+++ b/conf/tfe/tfe.conf
@@ -95,7 +95,7 @@ maat_input_mode=1
stat_switch=1
perf_switch=1
table_info=resource/pangu/table_info.conf
-accept_tags={"tags":[{"tag":"location","value":"Astana"}]}
+accept_path=/opt/tsg/etc/tsg_device_tag.json
stat_file=log/pangu_scan.fs2
effect_interval_s=1
diff --git a/resource/pangu/pangu_http.json b/resource/pangu/pangu_http.json
index 0c8a47a..0c10e89 100644
--- a/resource/pangu/pangu_http.json
+++ b/resource/pangu/pangu_http.json
@@ -1,6 +1,7 @@
{
"compile_table": "PXY_CTRL_COMPILE",
- "group_table": "GROUP_COMPILE_RELATION",
+ "group2compile_table": "GROUP_COMPILE_RELATION",
+ "group2group_table": "GROUP_GROUP_RELATION",
"rules": [
{
"compile_id": 1021,
@@ -37,6 +38,7 @@
"do_blacklist": 1,
"do_log": 1,
"effective_range": 0,
+ "tags":"{\"tag_sets\":[[{\"tag\":\"device_id\",\"value\":[\"device_3\",\"device_4\"]}]]}",
"user_region": "{\"protocol\":\"http\",\"method\":\"redirect\",\"code\":302,\"to\":\"https://www.jd.com\"}",
"is_valid": "yes",
"groups": [