Skip to content
Snippets Groups Projects
Commit 403bbe3d authored by Valentin Pocotilenco's avatar Valentin Pocotilenco
Browse files

defined output array

parent 4ca705f3
No related branches found
No related tags found
No related merge requests found
...@@ -311,7 +311,7 @@ class WebData(Resource): ...@@ -311,7 +311,7 @@ class WebData(Resource):
if ('request_source' in in_data and in_data['request_source'] == 'divided'): if ('request_source' in in_data and in_data['request_source'] == 'divided'):
request_source = 'divided' request_source = 'divided'
if ('reg_auth' in in_data): if ('reg_auth' in in_data and in_data['reg_auth'] in regAuthDict):
reg_auth = in_data['reg_auth'] reg_auth = in_data['reg_auth']
if ('status' in in_data and in_data['status'].upper() in ['OK','DISABLED','ERROR','UNKNOWN']): if ('status' in in_data and in_data['status'].upper() in ['OK','DISABLED','ERROR','UNKNOWN']):
...@@ -320,6 +320,36 @@ class WebData(Resource): ...@@ -320,6 +320,36 @@ class WebData(Resource):
if ('idp' in in_data): if ('idp' in in_data):
idp = in_data['idp'] idp = in_data['idp']
# here I have to parse eccs-log file
# target result is array like:
# "YYYY-MM-DD" => [
# "request_count" => [
# web => 100,
# api => 200
# ],
# "uniqIP" => [
# web => 100,
# api => 200
# ],
# "requested_param" => [
# idp => 100,
# reg_auth => 200
# ],
# idp => [
# "xx" => [
# "api" => 1,
# "web" => 10
# ],
# ],
# reg_auth => [
# "xx" => [
# "api" => 1,
# "web" => 10
# ],
# ],
# ]
lines = [] lines = []
results = [] results = []
cur_date = date_from cur_date = date_from
...@@ -332,12 +362,9 @@ class WebData(Resource): ...@@ -332,12 +362,9 @@ class WebData(Resource):
lines = fo.readlines() lines = fo.readlines()
except FileNotFoundError as e: except FileNotFoundError as e:
if (eccsDataTable): results[cur_date] = []
return ''
else:
return jsonify(error=f'FileNotFound: ECCS script has not been executed on {date} yet')
cur_date += timedelta(days=1) cur_date += timedelta(days=1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment