Skip to content
Snippets Groups Projects
Commit b4575b85 authored by sveseli's avatar sveseli
Browse files

added stat file interface

parent b20a7d26
No related branches found
No related tags found
No related merge requests found
......@@ -15,13 +15,26 @@ class FileRestApi(DsRestApi):
DsRestApi.__init__(self, username, password, host, port, protocol)
@DsRestApi.execute
def processFile(self, filePath, experimentName, fileInfo={}):
def processFile(self, experimentFilePath, experimentName, fileInfo={}):
url = '%s/files/processFile' % (self.getContextRoot())
if not filePath:
raise InvalidRequest('File path must be provided.')
if not experimentFilePath:
raise InvalidRequest('Experiment file 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')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment