Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SMART
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UNI-KLU
SMART
Commits
ba7a3462
Commit
ba7a3462
authored
Apr 07, 2021
by
Lubber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Vialog schema update
parent
d8826043
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
7 deletions
+51
-7
add_vialog_schema_new.py
...app/_add_use_case_scripts/vialog/add_vialog_schema_new.py
+41
-0
add_change.py
...ice/app/_add_use_case_scripts/vialog/tables/add_change.py
+3
-1
pull_video_data.py
src/rest-gateway/app/pull_video_data.py
+7
-6
No files found.
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/vialog/add_vialog_schema_new.py
0 → 100644
View file @
ba7a3462
import
sys
import
os
from
pathlib
import
Path
from
typing
import
Dict
,
Any
import
requests
modules_paths
=
[
'.'
,
'../../../modules/'
]
for
modules_path
in
modules_paths
:
if
os
.
path
.
exists
(
modules_path
):
sys
.
path
.
insert
(
1
,
modules_path
)
from
_add_use_case_scripts.vialog.tables
import
add_user
,
add_video
,
add_change
import
network_constants
as
nc
from
security.token_manager
import
TokenManager
def
add_use_case
(
use_case
:
str
):
#use_case = "vialog"
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
url
=
f
"https://articonf1.itec.aau.at:30420/api/use-cases"
response
=
requests
.
post
(
url
,
verify
=
False
,
proxies
=
{
"http"
:
None
,
"https"
:
None
},
headers
=
{
"Authorization"
:
f
"Bearer {jwt}"
},
json
=
{
"name"
:
use_case
}
)
print
(
url
+
": "
+
str
(
response
.
content
))
if
__name__
==
"__main__"
:
use_case
=
"vialog-new"
# disable ssl warnings :)
requests
.
packages
.
urllib3
.
disable_warnings
()
add_use_case
(
use_case
)
add_user
.
main
(
use_case
)
add_video
.
main
(
use_case
)
add_change
.
main
(
use_case
)
\ No newline at end of file
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/vialog/tables/add_change.py
View file @
ba7a3462
...
...
@@ -13,7 +13,7 @@ def add_table(use_case: str, table_name: str):
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"videoId"
columns
[
"UniqueID"
]
=
"videoId
+changeId
"
table
=
{
"name"
:
table_name
,
...
...
@@ -41,6 +41,8 @@ def add_layers(use_case:str, table_name: str):
"name"
:
"Changedvalue_Layer"
,
"properties"
:
[
"changedValue"
,
"previousValue"
,
"newValue"
],
"cluster_properties"
:
[
"changedValue"
...
...
src/rest-gateway/app/pull_video_data.py
View file @
ba7a3462
...
...
@@ -6,7 +6,7 @@ videoListUrl = "https://dev758755.vialog.app/Videos/Meta/ListAll"
videoUrl
=
"https://dev758755.vialog.app/stat/events?type=video&id="
# token from Rest Gateway to authorize
JWT_TOKEN
=
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InJlZ3VsYXJAaXRlYy5hYXUuYXQiLCJjcmVhdGVkX2F0IjoiMjAyM
C0xMC0wNiAwOTowNzoyMy44MjEyOTciLCJ2YWxpZF91bnRpbCI6IjIwMjAtMTAtMDcgMDk6MDc6MjMuODIxMjk3In0.orqTjn-3J4qMM0kpreWVPkwUEtUcgoqo6wsUFxKCrwg
'
JWT_TOKEN
=
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InJlZ3VsYXJAaXRlYy5hYXUuYXQiLCJjcmVhdGVkX2F0IjoiMjAyM
S0wNC0wNyAxMjo0OTo0MS43MTkzNjQiLCJ2YWxpZF91bnRpbCI6IjIwMjEtMDQtMDggMTI6NDk6NDEuNzE5MzY0In0.FN6qqBQeJSmXtS0-0dBiL-ojz6Ou7E5Tc9macrrhM4A
'
def
send_transaction_to_rest_gateway
(
transaction
:
dict
):
res
=
requests
.
post
(
...
...
@@ -48,8 +48,8 @@ for video in videosRequest.json():
if
i
==
0
:
lastState
=
eventMap
lastState
[
"AppicationType"
]
=
"vialog"
lastState
[
"docType"
]
=
"vi
alog-vi
deo"
lastState
[
"AppicationType"
]
=
"vialog
-new
"
lastState
[
"docType"
]
=
"video"
#send_transaction_to_rest_gateway(lastState)
print
(
lastState
)
...
...
@@ -77,11 +77,12 @@ for video in videosRequest.json():
change
=
{
"changeType"
:
"CustomLabel"
,
"changedValue"
:
"label"
,
"previousValue"
:
historyList
[
i
+
1
][
"label"
],
"newValue"
:
eventMap
[
"label"
]}
change
[
"videoId"
]
=
id
change
[
"changeId"
]
=
i
change
[
"timestamp"
]
=
eventMap
[
"moderationDate"
]
change
[
"ApplicationType"
]
=
"vialog"
change
[
"docType"
]
=
"
vialog-
change"
change
[
"ApplicationType"
]
=
"vialog
-new
"
change
[
"docType"
]
=
"change"
print
(
change
)
#
send_transaction_to_rest_gateway(change)
send_transaction_to_rest_gateway
(
change
)
i
+=
1
elif
videoRequest
.
text
==
""
:
empty
.
add
(
id
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment