Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DataCatalog
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
eFlows4HPC WP2
DataCatalog
Commits
93ed2db5
Commit
93ed2db5
authored
3 years ago
by
Christian Boettcher
Browse files
Options
Downloads
Patches
Plain Diff
revert latest change, as it does break testing. See issue
#19
parent
df6a884a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apiserver/main.py
+3
-3
3 additions, 3 deletions
apiserver/main.py
apiserver/storage/JsonFileStorageAdapter.py
+2
-2
2 additions, 2 deletions
apiserver/storage/JsonFileStorageAdapter.py
with
5 additions
and
5 deletions
apiserver/main.py
+
3
−
3
View file @
93ed2db5
...
...
@@ -4,7 +4,7 @@ Main module of data catalog api
import
logging
from
datetime
import
timedelta
from
enum
import
Enum
from
typing
import
Dict
,
List
,
Tuple
from
typing
import
List
,
Tuple
from
fastapi
import
FastAPI
,
HTTPException
,
Request
,
status
from
fastapi.param_functions
import
Depends
...
...
@@ -84,7 +84,7 @@ async def get_specific_dataset(location_data_type: LocationDataType, dataset_id:
"""
returns all information about a specific dataset, identified by id
"""
return
adapter
.
get_details
(
location_data_type
,
dataset_id
)
@app.post
(
"
/{location_data_type}
"
,
response_model
=
Dict
[
str
,
LocationData
])
@app.post
(
"
/{location_data_type}
"
,
response_model
=
Tuple
[
str
,
LocationData
])
async
def
add_dataset
(
location_data_type
:
LocationDataType
,
dataset
:
LocationData
,
user
:
User
=
Depends
(
my_user
)):
...
...
@@ -92,7 +92,7 @@ async def add_dataset(location_data_type: LocationDataType,
return
adapter
.
add_new
(
location_data_type
,
dataset
,
user
.
username
)
@app.put
(
"
/{location_data_type}/{dataset_id}
"
,
response_model
=
Dict
[
str
,
LocationData
])
@app.put
(
"
/{location_data_type}/{dataset_id}
"
,
response_model
=
Tuple
[
str
,
LocationData
])
async
def
update_specific_dataset
(
location_data_type
:
LocationDataType
,
dataset_id
:
str
,
dataset
:
LocationData
,
user
:
User
=
Depends
(
my_user
)):
...
...
This diff is collapsed.
Click to expand it.
apiserver/storage/JsonFileStorageAdapter.py
+
2
−
2
View file @
93ed2db5
...
...
@@ -73,7 +73,7 @@ class JsonFileStorageAdapter(AbstractLocationDataStorageAdapter):
to_store
=
StoredData
(
users
=
[
user_name
],
actualData
=
data
)
with
open
(
os
.
path
.
join
(
localpath
,
oid
),
'
w
'
)
as
json_file
:
json
.
dump
(
to_store
.
dict
(),
json_file
)
return
{
oid
:
data
}
return
(
oid
,
data
)
def
get_details
(
self
,
n_type
:
LocationDataType
,
oid
:
str
):
full_path
=
self
.
__get_object_path
(
value
=
n_type
.
value
,
oid
=
oid
)
...
...
@@ -89,7 +89,7 @@ class JsonFileStorageAdapter(AbstractLocationDataStorageAdapter):
with
open
(
full_path
,
'
w
'
)
as
f
:
json
.
dump
(
obj
.
dict
(),
f
)
return
{
oid
:
data
}
return
(
oid
,
data
)
def
delete
(
self
,
n_type
:
LocationDataType
,
oid
:
str
,
usr
:
str
):
full_path
=
self
.
__get_object_path
(
value
=
n_type
.
value
,
oid
=
oid
)
...
...
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