Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
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
RadioObservatory
LOFAR
Commits
ef4f9077
Commit
ef4f9077
authored
4 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-207
: added methods to get input- and output-dataproducts
parent
bed5a64e
No related branches found
No related tags found
1 merge request
!175
Resolve TMSS-207
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SAS/TMSS/client/lib/tmss_http_rest_client.py
+8
-0
8 additions, 0 deletions
SAS/TMSS/client/lib/tmss_http_rest_client.py
SAS/TMSS/src/tmss/tmssapp/viewsets/scheduling.py
+21
-0
21 additions, 0 deletions
SAS/TMSS/src/tmss/tmssapp/viewsets/scheduling.py
with
29 additions
and
0 deletions
SAS/TMSS/client/lib/tmss_http_rest_client.py
+
8
−
0
View file @
ef4f9077
...
@@ -204,6 +204,14 @@ class TMSSsession(object):
...
@@ -204,6 +204,14 @@ class TMSSsession(object):
return
None
return
None
return
result
return
result
def
get_subtask_output_dataproducts
(
self
,
subtask_id
:
int
)
->
[]:
'''
get the output dataproducts of the subtask with the given subtask_id
'''
return
self
.
get_path_as_json_object
(
'
subtask/%s/output_dataproducts
'
%
subtask_id
)
def
get_subtask_input_dataproducts
(
self
,
subtask_id
:
int
)
->
[]:
'''
get the input dataproducts of the subtask with the given subtask_id
'''
return
self
.
get_path_as_json_object
(
'
subtask/%s/input_dataproducts
'
%
subtask_id
)
def
specify_observation_task
(
self
,
task_id
:
int
)
->
requests
.
Response
:
def
specify_observation_task
(
self
,
task_id
:
int
)
->
requests
.
Response
:
"""
specify observation for the given draft task by just doing a REST API call
"""
"""
specify observation for the given draft task by just doing a REST API call
"""
result
=
self
.
session
.
get
(
url
=
'
%s/api/task/%s/specify_observation
'
%
(
self
.
base_url
,
task_id
))
result
=
self
.
session
.
get
(
url
=
'
%s/api/task/%s/specify_observation
'
%
(
self
.
base_url
,
task_id
))
...
...
This diff is collapsed.
Click to expand it.
SAS/TMSS/src/tmss/tmssapp/viewsets/scheduling.py
+
21
−
0
View file @
ef4f9077
...
@@ -224,6 +224,27 @@ class SubtaskViewSet(LOFARViewSet):
...
@@ -224,6 +224,27 @@ class SubtaskViewSet(LOFARViewSet):
context
=
{
'
request
'
:
request
})
context
=
{
'
request
'
:
request
})
return
RestResponse
(
serializer
.
data
)
return
RestResponse
(
serializer
.
data
)
@swagger_auto_schema
(
responses
=
{
200
:
'
The input dataproducts of this subtask.
'
,
403
:
'
forbidden
'
},
operation_description
=
"
Get the input dataproducts of this subtask.
"
)
@action
(
methods
=
[
'
get
'
],
detail
=
True
,
url_name
=
'
input_dataproducts
'
)
def
input_dataproducts
(
self
,
request
,
pk
=
None
):
dataproducts
=
models
.
Dataproduct
.
objects
.
filter
(
subtaskinput__subtask_id
=
pk
)
serializer
=
serializers
.
DataproductSerializer
(
dataproducts
,
many
=
True
,
context
=
{
'
request
'
:
request
})
return
RestResponse
(
serializer
.
data
)
@swagger_auto_schema
(
responses
=
{
200
:
'
The output dataproducts of this subtask.
'
,
403
:
'
forbidden
'
},
operation_description
=
"
Get the output dataproducts of this subtask.
"
)
@action
(
methods
=
[
'
get
'
],
detail
=
True
,
url_name
=
'
output_dataproducts
'
)
def
output_dataproducts
(
self
,
request
,
pk
=
None
):
dataproducts
=
models
.
Dataproduct
.
objects
.
filter
(
producer__subtask_id
=
pk
)
serializer
=
serializers
.
DataproductSerializer
(
dataproducts
,
many
=
True
,
context
=
{
'
request
'
:
request
})
return
RestResponse
(
serializer
.
data
)
class
SubtaskNestedViewSet
(
LOFARNestedViewSet
):
class
SubtaskNestedViewSet
(
LOFARNestedViewSet
):
queryset
=
models
.
Subtask
.
objects
.
all
()
queryset
=
models
.
Subtask
.
objects
.
all
()
serializer_class
=
serializers
.
SubtaskSerializer
serializer_class
=
serializers
.
SubtaskSerializer
...
...
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