Adding StorageHub rules

This commit is contained in:
Luca Frosini 2020-04-03 16:16:45 +02:00
parent e73126d5c2
commit 458c274186
8 changed files with 47 additions and 2 deletions

View File

@ -220,7 +220,7 @@ public class TestRules extends ContextTest {
allRules();
File rulesDirectory = getRulesDirectory();
File rulesDirFile = new File(rulesDirectory, "StorageHub");
File ruleFile = new File(rulesDirFile, "StorageHub-getById.json");
File ruleFile = new File(rulesDirFile, "StorageHub-getHistory.json");
testRule(ruleFile);
}

View File

@ -0,0 +1,6 @@
DataAccess,StorageHub,/workspace/item/21449ee9-de89-41a7-b60e-c0e15975bbf5/download
DataAccess,StorageHub,/workspace/item/2ca7e04a-b461-4098-a8b9-a31ddb691a2d/download
DataAccess,StorageHub,/workspace/item/9666bbf1-3b06-487b-adaf-29e175b7fbc1/download
DataAccess,StorageHub,/workspace/item/ace9ea0c-2877-4659-bca8-9519fc9cef83/download
DataAccess,StorageHub,/workspace/item/be512d5c-6038-440c-bb05-914ce3f44f50/download
DataAccess,StorageHub,downloadById
1 DataAccess StorageHub /workspace/item/21449ee9-de89-41a7-b60e-c0e15975bbf5/download
2 DataAccess StorageHub /workspace/item/2ca7e04a-b461-4098-a8b9-a31ddb691a2d/download
3 DataAccess StorageHub /workspace/item/9666bbf1-3b06-487b-adaf-29e175b7fbc1/download
4 DataAccess StorageHub /workspace/item/ace9ea0c-2877-4659-bca8-9519fc9cef83/download
5 DataAccess StorageHub /workspace/item/be512d5c-6038-440c-bb05-914ce3f44f50/download
6 DataAccess StorageHub downloadById

View File

@ -0,0 +1,12 @@
{
"match": {
"serviceClassRegex": "DataAccess",
"serviceNameRegex": "StorageHub",
"calledMethodRegex": "^\/workspace\/item(s){0,1}\/[0-9a-zA-Z\\-_]*\/download(\/){0,1}$|downloadById"
},
"replace": {
"serviceClass": "DataAccess",
"serviceName": "StorageHub",
"calledMethod": "downloadById"
}
}

View File

@ -2,7 +2,7 @@
"match": {
"serviceClassRegex": "DataAccess",
"serviceNameRegex": "StorageHub",
"calledMethodRegex": "^\/workspace(\/item(s){0,1}){0,1}\/(?!(i$)|count|paged|v(re|ere|er)fo(ld|dl)ers{0,1}|((C|c)hi(dl|ld|d)ren))[0-9a-zA-Z\\-_]{1,}(\/){0,1}$|getById"
"calledMethodRegex": "^\/workspace(\/item(s){0,1}){0,1}\/(?!(i$)|count|groups|paged|v(re|ere|er)fo(ld|dl)ers{0,1}|((C|c)hi(dl|ld|d)ren))[0-9a-zA-Z\\-_]{1,}(\/){0,1}$|getById"
},
"replace": {
"serviceClass": "DataAccess",

View File

@ -0,0 +1,2 @@
DataAccess,StorageHub,/workspace/groups
DataAccess,StorageHub,/workspace/groups/gcube-preprod-preVRE/createVREFolder
1 DataAccess StorageHub /workspace/groups
2 DataAccess StorageHub /workspace/groups/gcube-preprod-preVRE/createVREFolder

View File

@ -0,0 +1,12 @@
{
"match": {
"serviceClassRegex": "DataAccess",
"serviceNameRegex": "StorageHub",
"calledMethodRegex": "^\/workspace\/group(s){0,1}\/{0,1}.*"
},
"replace": {
"serviceClass": "DataAccess",
"serviceName": "StorageHub",
"calledMethod": "getGroups"
}
}

View File

@ -0,0 +1 @@
DataAccess,StorageHub,/workspace/items/21449ee9-de89-41a7-b60e-c0e15975bbf5/history
1 DataAccess StorageHub /workspace/items/21449ee9-de89-41a7-b60e-c0e15975bbf5/history

View File

@ -0,0 +1,12 @@
{
"match": {
"serviceClassRegex": "DataAccess",
"serviceNameRegex": "StorageHub",
"calledMethodRegex": "^\/workspace\/item(s){0,1}\/[0-9a-zA-Z\\-_]*\/history(\/){0,1}$|getHistory"
},
"replace": {
"serviceClass": "DataAccess",
"serviceName": "StorageHub",
"calledMethod": "getHistory"
}
}