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
4be7d693
Commit
4be7d693
authored
Dec 10, 2020
by
Bogdan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Schemas for: crowd_journalism and vialog
parent
4644e420
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
942 additions
and
0 deletions
+942
-0
add_crowdjournalism_schema.py
...se_scripts/crowd_journalism/add_crowdjournalism_schema.py
+43
-0
add_classification.py
...ase_scripts/crowd_journalism/tables/add_classification.py
+123
-0
add_event.py
...add_use_case_scripts/crowd_journalism/tables/add_event.py
+99
-0
add_purchase.py
..._use_case_scripts/crowd_journalism/tables/add_purchase.py
+118
-0
add_tag.py
.../_add_use_case_scripts/crowd_journalism/tables/add_tag.py
+72
-0
add_video.py
...add_use_case_scripts/crowd_journalism/tables/add_video.py
+231
-0
add_vialog_schema.py
...ice/app/_add_use_case_scripts/vialog/add_vialog_schema.py
+41
-0
add_user.py
...rvice/app/_add_use_case_scripts/vialog/tables/add_user.py
+71
-0
add_video.py
...vice/app/_add_use_case_scripts/vialog/tables/add_video.py
+144
-0
No files found.
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/crowd_journalism/add_crowdjournalism_schema.py
0 → 100644
View file @
4be7d693
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.crowd_journalism.tables
import
add_video
,
add_tag
,
add_purchase
,
add_event
,
add_classification
import
network_constants
as
nc
from
security.token_manager
import
TokenManager
def
add_use_case
(
use_case
:
str
):
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
=
"crowd_journalism"
# disable ssl warnings :)
requests
.
packages
.
urllib3
.
disable_warnings
()
add_use_case
(
use_case
)
add_video
.
main
(
use_case
)
add_tag
.
main
(
use_case
)
add_classification
.
main
(
use_case
)
add_event
.
main
(
use_case
)
add_purchase
.
main
(
use_case
)
\ No newline at end of file
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/crowd_journalism/tables/add_classification.py
0 → 100644
View file @
4be7d693
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
columns
=
[
# "docType",
"objecttype"
,
"userid"
,
"videoid"
,
"informative"
,
"impact"
,
"trustiness"
,
"lastupdate"
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"userid+videoid"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
#Useless as all objects aree Classification?
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Object_Type_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"userid"
,
"videoid"
,
"informative"
,
"impact"
,
"trustiness"
,
"lastupdate"
],
"cluster_properties"
:
[
"objecttype"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Informative_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"userid"
,
"videoid"
,
"informative"
,
"impact"
,
"trustiness"
,
"lastupdate"
],
"cluster_properties"
:
[
"informative"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Impact_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"userid"
,
"videoid"
,
"informative"
,
"impact"
,
"trustiness"
,
"lastupdate"
],
"cluster_properties"
:
[
"impact"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Trust_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"userid"
,
"videoid"
,
"informative"
,
"impact"
,
"trustiness"
,
"lastupdate"
],
"cluster_properties"
:
[
"trustiness"
]
}
]
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
for
layer
in
layers
:
url
=
f
"https://articonf1.itec.aau.at:30420/api/layers"
response
=
requests
.
post
(
url
,
verify
=
False
,
proxies
=
{
"http"
:
None
,
"https"
:
None
},
headers
=
{
"Authorization"
:
f
"Bearer {jwt}"
},
json
=
layer
)
print
(
url
+
": "
+
str
(
response
.
status_code
))
def
main
(
use_case
:
str
):
print
(
"Classification"
)
table_name
=
"classification"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
\ No newline at end of file
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/crowd_journalism/tables/add_event.py
0 → 100644
View file @
4be7d693
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
#TODO: split eventEpicenter
#TODO: tags is an array, deal with arrays
columns
=
[
# "docType",
"objecttype"
,
"eventid"
,
#"tags",
"eventEpicenter"
,
#TODO
"range"
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"eventid"
columns
[
"firstTag"
]
=
"tags[0]"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
#Useless as all objects are of the same type???
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Object_Type_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"eventid"
,
"eventEpicenter"
,
"range"
,
"firstTag"
],
"cluster_properties"
:
[
"objecttype"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Tag_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"eventid"
,
"evenEpicenter"
,
"range"
,
"firstTag"
],
"cluster_properties"
:
[
"firstTag"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Event_Epicenter_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"eventid"
,
"evenEpicenter"
,
"range"
,
"firstTag"
],
"cluster_properties"
:
[
"eventEpicenter"
]
}
]
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
for
layer
in
layers
:
url
=
f
"https://articonf1.itec.aau.at:30420/api/layers"
response
=
requests
.
post
(
url
,
verify
=
False
,
proxies
=
{
"http"
:
None
,
"https"
:
None
},
headers
=
{
"Authorization"
:
f
"Bearer {jwt}"
},
json
=
layer
)
print
(
url
+
": "
+
str
(
response
.
status_code
))
def
main
(
use_case
:
str
):
print
(
"event"
)
table_name
=
"event"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
\ No newline at end of file
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/crowd_journalism/tables/add_purchase.py
0 → 100644
View file @
4be7d693
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
columns
=
[
# "docType",
"objecttype"
,
"timestamp"
,
"userid"
,
"videoid"
,
"price"
,
"ownerid"
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"userid+videoid+ownerid"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
#Useless as all objects aree Classification?
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Object_Type_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"timestamp"
,
"userid"
,
"videoid"
,
"price"
,
"ownerid"
],
"cluster_properties"
:
[
"objecttype"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Price_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"timestamp"
,
"userid"
,
"videoid"
,
"price"
,
"ownerid"
],
"cluster_properties"
:
[
"price"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Owner_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"timestamp"
,
"userid"
,
"videoid"
,
"price"
,
"ownerid"
],
"cluster_properties"
:
[
"ownerid"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Buyer_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"timestamp"
,
"userid"
,
"videoid"
,
"price"
,
"ownerid"
],
"cluster_properties"
:
[
"userid"
]
}
]
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
for
layer
in
layers
:
url
=
f
"https://articonf1.itec.aau.at:30420/api/layers"
response
=
requests
.
post
(
url
,
verify
=
False
,
proxies
=
{
"http"
:
None
,
"https"
:
None
},
headers
=
{
"Authorization"
:
f
"Bearer {jwt}"
},
json
=
layer
)
print
(
url
+
": "
+
str
(
response
.
status_code
))
def
main
(
use_case
:
str
):
print
(
"purchase"
)
table_name
=
"purchase"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
\ No newline at end of file
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/crowd_journalism/tables/add_tag.py
0 → 100644
View file @
4be7d693
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
columns
=
[
# "docType",
"objecttype"
,
"tag"
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"objecttype+tag"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
#Useless as all objects aree Classification?
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Object_Type_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"tag"
],
"cluster_properties"
:
[
"objecttype"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Tag_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"tag"
],
"cluster_properties"
:
[
"tag"
]
}
]
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
for
layer
in
layers
:
url
=
f
"https://articonf1.itec.aau.at:30420/api/layers"
response
=
requests
.
post
(
url
,
verify
=
False
,
proxies
=
{
"http"
:
None
,
"https"
:
None
},
headers
=
{
"Authorization"
:
f
"Bearer {jwt}"
},
json
=
layer
)
print
(
url
+
": "
+
str
(
response
.
status_code
))
def
main
(
use_case
:
str
):
print
(
"tag"
)
table_name
=
"tag"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
\ No newline at end of file
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/crowd_journalism/tables/add_video.py
0 → 100644
View file @
4be7d693
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
columns
=
[
# "docType",
"objecttype"
,
"videoid"
,
"duration"
,
"price"
,
"creator"
,
"creationTimestamp"
,
#"tags",
"geolocation"
,
"eventid"
,
"lastupdate"
,
"md5"
,
"informativeRating"
,
"impactRating"
,
"trustinessRating"
,
"ready"
,
"path"
,
"preview"
,
#"thumbnails" #not important?
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"videoid"
columns
[
"encodedAudio"
]
=
"codec//audio"
columns
[
"encodedVideo"
]
=
"codec//video"
columns
[
"firstTag"
]
=
"tags[0]"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
#Useless as all objects are Classification?
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Object_Type_Layer"
,
"properties"
:
[
"objecttype"
,
"videoid"
,
"duration"
,
"price"
,
"creator"
,
"creationTimestamp"
,
"lastupdate"
,
"firstTag"
],
"cluster_properties"
:
[
"objecttype"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Price_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"creationTimestamp"
,
"geolocation"
,
"userid"
,
"videoid"
,
"price"
,
"informativeRating"
,
"impactRating"
,
"trustinessRating"
,
"firstTag"
],
"cluster_properties"
:
[
"price"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Tag_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"creationTimestamp"
,
"geolocation"
,
"userid"
,
"videoid"
,
"price"
,
"informativeRating"
,
"impactRating"
,
"trustinessRating"
,
"firstTag"
],
"cluster_properties"
:
[
"firstTag"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Informative_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"creationTimestamp"
,
"geolocation"
,
"userid"
,
"videoid"
,
"price"
,
"informativeRating"
,
"impactRating"
,
"trustinessRating"
,
"firstTag"
],
"cluster_properties"
:
[
"informativeRating"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Impact_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"creationTimestamp"
,
"geolocation"
,
"userid"
,
"videoid"
,
"price"
,
"informativeRating"
,
"impactRating"
,
"trustinessRating"
,
"firstTag"
],
"cluster_properties"
:
[
"impactRating"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Trust_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"creationTimestamp"
,
"geolocation"
,
"userid"
,
"videoid"
,
"price"
,
"informativeRating"
,
"impactRating"
,
"trustinessRating"
,
"firstTag"
],
"cluster_properties"
:
[
"trustinessRating"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Location_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"creationTimestamp"
,
"geolocation"
,
"userid"
,
"videoid"
,
"price"
,
"informativeRating"
,
"impactRating"
,
"trustinessRating"
,
"firstTag"
],
"cluster_properties"
:
[
"geolocation"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Video_Age_Layer"
,
"properties"
:
[
"UniqueID"
,
"objecttype"
,
"creationTimestamp"
,
"geolocation"
,
"userid"
,
"videoid"
,
"price"
,
"informativeRating"
,
"impactRating"
,
"trustinessRating"
,
"firstTag"
],
"cluster_properties"
:
[
"creationTimestamp"
]
}
]
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
for
layer
in
layers
:
url
=
f
"https://articonf1.itec.aau.at:30420/api/layers"
response
=
requests
.
post
(
url
,
verify
=
False
,
proxies
=
{
"http"
:
None
,
"https"
:
None
},
headers
=
{
"Authorization"
:
f
"Bearer {jwt}"
},
json
=
layer
)
print
(
url
+
": "
+
str
(
response
.
status_code
))
def
main
(
use_case
:
str
):
print
(
"video"
)
table_name
=
"video"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
\ No newline at end of file
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/vialog/add_vialog_schema.py
0 → 100644
View file @
4be7d693
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
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"
# disable ssl warnings :)
requests
.
packages
.
urllib3
.
disable_warnings
()
add_use_case
(
use_case
)
add_user
.
main
(
use_case
)
add_video
.
main
(
use_case
)
\ No newline at end of file
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/vialog/tables/add_user.py
0 → 100644
View file @
4be7d693
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
columns
=
[
# "docType",
"userId"
,
"rewardBalance"
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"userId"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"User_Layer"
,
"properties"
:
[
"UniqueID"
,
"rewardBalance"
],
"cluster_properties"
:
[
"UniqueID"
,
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"User_Balance_Layer"
,
"properties"
:
[
"UniqueID"
,
"rewardBalance"
],
"cluster_properties"
:
[
"rewardBalance"
]
}
]
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
for
layer
in
layers
:
url
=
f
"https://articonf1.itec.aau.at:30420/api/layers"
response
=
requests
.
post
(
url
,
verify
=
False
,
proxies
=
{
"http"
:
None
,
"https"
:
None
},
headers
=
{
"Authorization"
:
f
"Bearer {jwt}"
},
json
=
layer
)
print
(
url
+
": "
+
str
(
response
.
status_code
))
def
main
(
use_case
:
str
):
print
(
"user"
)
table_name
=
"user"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
\ No newline at end of file
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/vialog/tables/add_video.py
0 → 100644
View file @
4be7d693
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
columns
=
[
# "docType",
"videoId"
,
"Video_Token"
,
"replyTo"
,
"Created"
,
"Duration"
,
"videoResolution"
,
"Label"
,
"ThreadId"
,
"Position"
,
"ModifiedDate"
,
"Views"
,
"ModeratedBy"
,
"CommunityManagerNotes"
,
"Rewards"
,
"Video_State"
,
"Video_Type"
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"videoId"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Manager_Layer"
,
"properties"
:
[
"UniqueID"
,
"ModifiedDate"
,
"ModeratedBy"
,
"Video_State"
,
"Video_Type"
],
"cluster_properties"
:
[
"ModeratedBy"
,
"Video_State"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Video_Popularity_Layer"
,
"properties"
:
[
"UniqueID"
,
"Label"
,
"Created"
,
"Views"
,
"Rewards"
,
"Video_State"
,
"Video_Type"
],
"cluster_properties"
:
[
"Views"
,
"Video_Type"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Video_Age_Layer"
,
"properties"
:
[
"UniqueID"
,
"Label"
,
"Created"
,
"Views"
,
"Rewards"
,
"Video_State"
,
"Video_Type"
],
"cluster_properties"
:
[
"Created"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Rewards_Layer"
,
"properties"
:
[
"UniqueID"
,
"Label"
,
"Created"
,
"Views"
,
"Rewards"
,
"Video_State"
,
"Video_Type"
],
"cluster_properties"
:
[
"Rewards"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Video_Lenght_Layer"
,
"properties"
:
[
"UniqueID"
,
"Created"
,
"Views"
,
"Duration"
,
"Video_State"
,
"Video_Type"
],
"cluster_properties"
:
[
"Duration"
]
}
]
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
for
layer
in
layers
:
url
=
f
"https://articonf1.itec.aau.at:30420/api/layers"
response
=
requests
.
post
(
url
,
verify
=
False
,
proxies
=
{
"http"
:
None
,
"https"
:
None
},
headers
=
{
"Authorization"
:
f
"Bearer {jwt}"
},
json
=
layer
)
print
(
url
+
": "
+
str
(
response
.
status_code
))
def
main
(
use_case
:
str
):
print
(
"Video"
)
table_name
=
"video"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
\ No newline at end of file
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