You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spot.apache.org by le...@apache.org on 2017/04/17 16:37:40 UTC

[11/16] incubator-spot git commit: Add functionality to reset scored dns

Add functionality to reset scored dns


Project: http://git-wip-us.apache.org/repos/asf/incubator-spot/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-spot/commit/ae3ea157
Tree: http://git-wip-us.apache.org/repos/asf/incubator-spot/tree/ae3ea157
Diff: http://git-wip-us.apache.org/repos/asf/incubator-spot/diff/ae3ea157

Branch: refs/heads/SPOT-35_graphql_api
Commit: ae3ea157a25eff52b2c292a9b8e6bb9b617b6e61
Parents: 6628aea
Author: Everardo Lopez Sandoval (Intel) <el...@elopezsa-mac02.zpn.intel.com>
Authored: Fri Apr 7 17:10:20 2017 -0500
Committer: LedaLima <le...@apache.org>
Committed: Sun Apr 9 21:26:10 2017 -0500

----------------------------------------------------------------------
 spot-oa/api/resources/dns.py | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-spot/blob/ae3ea157/spot-oa/api/resources/dns.py
----------------------------------------------------------------------
diff --git a/spot-oa/api/resources/dns.py b/spot-oa/api/resources/dns.py
index a2a8fea..0758812 100644
--- a/spot-oa/api/resources/dns.py
+++ b/spot-oa/api/resources/dns.py
@@ -348,3 +348,24 @@ def ingest_summary(start_date,end_date):
                 .format(db,start_date.year,end_date.year,start_date.month,end_date.month, start_date.day, end_date.day)
 
     return ImpalaEngine.execute_query_as_list(is_query)
+
+"""
+--------------------------------------------------------------------------
+Reset scored connections.
+--------------------------------------------------------------------------
+"""
+def reset_scored_connections(date):
+
+    dns_storyboard =  "dns/hive/oa/storyboard"
+    dns_threat_investigation = "dns_threat_dendro/hive/oa/threat_dendro"
+    dns_timeline = "dns/hive/oa/threat_investigation"    
+    app_path = Configuration.spot()   
+
+    # remove parquet files manually to allow the comments update.
+    HDFSClient.delete_folder("{0}/{1}/y={2}/m={3}/d={4}/".format( \
+        app_path,dns_storyboard,date.year,date.month,date.day) , "impala")
+    HDFSClient.delete_folder("{0}/{1}/y={2}/m={3}/d={4}/".format( \
+        app_path,dns_threat_investigation,date.year,date.month,date.day), "impala")
+    HDFSClient.delete_folder("{0}/{1}/y={2}/m={3}/d={4}/".format( \
+        app_path,dns_timeline,date.year,date.month,date.day), "impala")
+    ImpalaEngine.execute_query("invalidate metadata")
\ No newline at end of file