Each File Folder contains no. of Files and this service deals with File-related APIs.
The following are the operational APIs associated with the File Services API:
1. Delete File
(Note: Will be completed in next Release)
The Delete File method will delete File with given Id.
Method |
Url |
Parameter |
deleteFile |
/api/deletefile/{fileFolderId} |
{fileFolderId} |
Response
{
"status": true,
"statusCode": "Files are deleted for fileFolderId 1002",
"statusMsg": "",
"response": {}
}
2. Save File
( NOTE: This method is deprecated. To create a File, you should use crawlers in OvalEdge application)
The Save File method creates a new File with given input through the request body.
Method |
Url |
saveFile |
/api/file |
Request Body
{
"fileDescription": "string",
"fileFolderId": 0, *
"fileId": 0,
"fileLength": 0, *
"fileLocation": "string",*
"fileName": "string",*
"fileType": "string",*
"remoteTags": "string",
"userId": "string"
}
Response
{
"status": true,
"statusCode": "",
"statusMsg": "",
"response": {
"File": {
"fileId": 1024,
"filename": "testfile.csv",
"replication": 0,
"childrenNum": 0,
"blockSize": 0,
"datasetid": 0,
"group": null,
"owner": "admin",
"steward": null,
"length": 9999,
"type": "FILE",
"fileType": "FILE",
"permission": "",
"pathSuffix": "testfile.csv",
"modificationTime": null,
"catalogstatus": 1,
"usescore": 0,
"connectioninfoid": 0,
"connectionName": null,
"description": "testfile",
"rolesAndPermission": null,
"roles": null,
"filefolderid": 1002,
"location": "/ovaledge/f1",
"active": true,
"lastAnalyzedDate": 1580136721137,
"analyzedStatus": null,
"rowCount": 0,
"lastPopulatedDate": null,
"lastMetaSyncDate": null,
"inAudit": false,
"lastModDate": null,
"columnSecure": 0,
"rating": 0,
"createDate": 1580136721137,
"remoteTags": "",
"metaData": null,
"remoteKeys": null,
"businessGlossaryId": null,
"sizeinbytes": null,
"name": "testfile.csv",
"fileNameWithPath": "/ovaledge/f1/testfile.csv",
"inProject": false,
"profile": false
}
}
}
3. Get File By Id
The Get File By Id method returns File by input Id if it exists.
Mandatory Field: fileId
Method |
Url |
Parameter |
getFilebyId |
/api/file/{fileId} |
{fileId} |
Response
{
"status": true,
"statusCode": "",
"statusMsg": "",
"response": {
"File": {
"fileId": 1023,
"filename": null,
"replication": 0,
"childrenNum": 0,
"blockSize": 0,
"datasetid": 0,
"group": null,
"owner": "admin",
"steward": null,
"length": 0,
"type": null,
"fileType": "FILE",
"permission": "",
"pathSuffix": "fed.csv",
"modificationTime": null,
"catalogstatus": 1,
"usescore": 3,
"connectioninfoid": 1002,
"connectionName": "s3",
"description": "fed.csv",
"rolesAndPermission": null,
"roles": null,
"filefolderid": 1002,
"location": "/ovaledge/",
"active": true,
"lastAnalyzedDate": 1580063400000,
"analyzedStatus": "Not Analyzed",
"rowCount": 0,
"lastPopulatedDate": null,
"lastMetaSyncDate": null,
"inAudit": false,
"lastModDate": 1580063400000,
"columnSecure": 0,
"rating": 0,
"createDate": null,
"remoteTags": "",
"metaData": null,
"remoteKeys": null,
"businessGlossaryId": 0,
"sizeinbytes": 62567,
"name": "fed.csv",
"fileNameWithPath": "/ovaledge/fed.csv",
"inProject": false,
"profile": false
}
}
}
4. Get FileStats By Id
The Get FileStats By Id method returns FIleStats for a given File Id.
Mandatory Field: fileId
Method |
Url |
Parameter |
getFileStatsbyId |
/api/file/stats/{fileId} |
{fileId} |
Response
{
"status": true,
"statusCode": "",
"statusMsg": "",
"response": {
"FileStats": {
"usescore": 3,
"catalogdate": 1580063400000,
"lastmetasyncdate": null,
"filefolderid": 1002,
"fileid": 1023,
"sizeinbytes": 62567,
"max_usescore": 3
}
}
}
5. Upload file
This API is used to upload the files into the NFS path.
Mandatory Field: file
Method |
Url |
uploadFile |
api/file/uploadfile |
Response Body
{
"status": true,
"statusCode": "",
"statusMsg": "",
"response": {
"File Output path ": "D:/OvalEdge/Documents/nfs/test Path"
}
}
6. UploadFileUsingUrl
This API is used to download files and upload them into the NFS path.
Mandatory Field: fileurl, path
Method |
Url |
uploadFileUsingUrl |
api/file/uploadFileUsingUrl |
Request Body
{
"fileurl": [
"string"
],
"path": "string"
}
Response Body
{
"status": true,
"statusCode": "",
"statusMsg": "",
"response": {
"File Output path: ": "D:/NFS/Documents/CHD7/newfiles"
}
}