Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
New DP service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Yorgo EL MOUBAYED
New DP service
Commits
c082c9ed
Commit
c082c9ed
authored
3 years ago
by
Raphael Bourgeas
Browse files
Options
Downloads
Patches
Plain Diff
add connectDatasetDPStep & connectDPStepAutoproc & storeDPStep
parent
1ee1aca1
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
dataproc/api/views/input_view.py
+42
-0
42 additions, 0 deletions
dataproc/api/views/input_view.py
with
42 additions
and
0 deletions
dataproc/api/views/input_view.py
+
42
−
0
View file @
c082c9ed
...
...
@@ -15,6 +15,8 @@ from api.models.datacollection_model import DataCollection
from
api.models.construct_model
import
Construct
from
api.models.user_model
import
User
from
api.models.ocf_model
import
OCF
from
api.models.dpstep_model
import
DPStep
from
api.models.autoPROC_model
import
autoPROC
# Activate logger
logger
=
logging
.
getLogger
(
'
dataproc
'
)
...
...
@@ -47,6 +49,7 @@ def storeInput(request):
storeParseComputationHost
(
json_data_computationhost
)
storeParseDataCollection
(
json_data_datacollection
)
storeParseOCF
(
json_data_ocf
)
dpstep
=
storeDPStep
()
# Register relationships
connectConstructUser
(
json_data_construct
,
json_data_user
)
...
...
@@ -55,6 +58,7 @@ def storeInput(request):
connectDatasetConstruct
(
json_data_dataset
,
json_data_construct
)
connectDatasetStorageHost
(
json_data_dataset
,
json_data_storagehost
)
connectDataCollectionDataset
(
json_data_datacollection
,
json_data_dataset
)
connectDatasetDPStep
(
json_data_dataset
,
dpstep
)
for
input_ocf
in
json_data_ocf
:
connectConstructOCF
(
json_data_construct
,
input_ocf
)
...
...
@@ -64,6 +68,44 @@ def storeInput(request):
except
:
return
JsonResponse
({
"
STATUS
"
:
"
ERROR OCCURRED
"
},
safe
=
False
)
@csrf_exempt
def
connectDatasetDPStep
(
data1
,
dpstep
):
"""
Create a relationship between a dataset and a construct
"""
try
:
dataset
=
Dataset
.
nodes
.
get
(
uuid
=
data1
[
"
uuid
"
])
dataset
.
input_of
.
connect
(
dpstep
)
return
dataset
except
:
return
False
@csrf_exempt
def
connectDPStepAutoproc
(
dpstep
):
"""
Create a relationship between a dp step and the autoPROC node
"""
try
:
autoproc
=
autoPROC
.
nodes
.
first
()
dpstep
.
with_autoproc
.
connect
(
autoproc
)
return
dpstep
except
:
return
False
@csrf_exempt
def
storeDPStep
():
dpstep
=
DPStep
()
dpstep
.
save
()
dpstep
=
connectDPStepAutoproc
(
dpstep
)
return
dpstep
@csrf_exempt
def
storeParseDataset
(
data
):
...
...
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