Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eduGAIN Connectivity Check
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
edugain
eduGAIN Connectivity Check
Commits
403bbe3d
Commit
403bbe3d
authored
1 year ago
by
Valentin Pocotilenco
Browse files
Options
Downloads
Patches
Plain Diff
defined output array
parent
4ca705f3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api.py
+33
-6
33 additions, 6 deletions
api.py
with
33 additions
and
6 deletions
api.py
+
33
−
6
View file @
403bbe3d
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment