Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dm-docs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hammonds
dm-docs
Commits
b4575b85
Commit
b4575b85
authored
9 years ago
by
sveseli
Browse files
Options
Downloads
Patches
Plain Diff
added stat file interface
parent
b20a7d26
No related branches found
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/python/dm/ds_web_service/api/fileRestApi.py
+17
-4
17 additions, 4 deletions
src/python/dm/ds_web_service/api/fileRestApi.py
with
17 additions
and
4 deletions
src/python/dm/ds_web_service/api/fileRestApi.py
+
17
−
4
View file @
b4575b85
...
...
@@ -15,13 +15,26 @@ class FileRestApi(DsRestApi):
DsRestApi
.
__init__
(
self
,
username
,
password
,
host
,
port
,
protocol
)
@DsRestApi.execute
def
processFile
(
self
,
f
ilePath
,
experimentName
,
fileInfo
=
{}):
def
processFile
(
self
,
experimentF
ilePath
,
experimentName
,
fileInfo
=
{}):
url
=
'
%s/files/processFile
'
%
(
self
.
getContextRoot
())
if
not
f
ilePath
:
raise
InvalidRequest
(
'
F
ile path must be provided.
'
)
if
not
experimentF
ilePath
:
raise
InvalidRequest
(
'
Experiment f
ile path must be provided.
'
)
if
not
experimentName
:
raise
InvalidRequest
(
'
Experiment name must be provided.
'
)
fileInfo
[
'
filePath
'
]
=
filePath
fileInfo
[
'
experimentFilePath
'
]
=
experimentFilePath
fileInfo
[
'
experimentName
'
]
=
experimentName
url
+=
'
?fileInfo=%s
'
%
(
Encoder
.
encode
(
json
.
dumps
(
fileInfo
)))
responseDict
=
self
.
sendSessionRequest
(
url
=
url
,
method
=
'
POST
'
)
return
FileMetadata
(
responseDict
)
@DsRestApi.execute
def
statFile
(
self
,
experimentFilePath
,
experimentName
,
fileInfo
=
{}):
url
=
'
%s/files/statFile
'
%
(
self
.
getContextRoot
())
if
not
experimentFilePath
:
raise
InvalidRequest
(
'
Experiment file path must be provided.
'
)
if
not
experimentName
:
raise
InvalidRequest
(
'
Experiment name must be provided.
'
)
fileInfo
[
'
experimentFilePath
'
]
=
experimentFilePath
fileInfo
[
'
experimentName
'
]
=
experimentName
url
+=
'
?fileInfo=%s
'
%
(
Encoder
.
encode
(
json
.
dumps
(
fileInfo
)))
responseDict
=
self
.
sendSessionRequest
(
url
=
url
,
method
=
'
POST
'
)
...
...
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