From ead2ad393bbb147926aaefd3e752ab5077c48c8b Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Thu, 26 Mar 2020 15:10:49 +0100 Subject: [PATCH] Improved rules for data-transfer-service --- .../validations/validators/TestRules.java | 4 ++-- src/test/resources/rules/allRules.json.full | 17 ++++++++++++++--- src/test/resources/rules/allRules.json.min | 2 +- .../data-transfer-service-getCapabilities.json | 2 +- .../data-transfer-service-getTransferStatus.csv | 3 +++ ...ata-transfer-service-getTransferStatus.json} | 4 ++-- ...d.csv => data-transfer-service-transfer.csv} | 8 +++----- .../data-transfer-service-transfer.json | 12 ++++++++++++ 8 files changed, 38 insertions(+), 14 deletions(-) create mode 100644 src/test/resources/rules/data-transfer-service/data-transfer-service-getTransferStatus.csv rename src/test/resources/rules/data-transfer-service/{data-transfer-service-upload.json => data-transfer-service-getTransferStatus.json} (70%) rename src/test/resources/rules/data-transfer-service/{data-transfer-service-upload.csv => data-transfer-service-transfer.csv} (69%) create mode 100644 src/test/resources/rules/data-transfer-service/data-transfer-service-transfer.json diff --git a/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java b/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java index 2f04418..6db1ea7 100644 --- a/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java +++ b/src/test/java/org/gcube/accounting/datamodel/validations/validators/TestRules.java @@ -216,8 +216,8 @@ public class TestRules extends ContextTest { public void testSingleRule() throws Exception { allRules(); File rulesDirectory = getRulesDirectory(); - File rulesDirFile = new File(rulesDirectory, "geoanalytics-gos"); - File rulesFile = new File(rulesDirFile, "geoanalytics-gos-OTHER.json"); + File rulesDirFile = new File(rulesDirectory, "data-transfer-service"); + File rulesFile = new File(rulesDirFile, "data-transfer-service-transfer.json"); testRule(rulesFile); } diff --git a/src/test/resources/rules/allRules.json.full b/src/test/resources/rules/allRules.json.full index a923955..2701153 100644 --- a/src/test/resources/rules/allRules.json.full +++ b/src/test/resources/rules/allRules.json.full @@ -179,7 +179,7 @@ "match": { "serviceClassRegex": "DataTransfer", "serviceNameRegex": "data-transfer-service", - "calledMethodRegex": ".*Capabilities.*" + "calledMethodRegex": ".*(c|C)apabilities.*" }, "replace": { "serviceClass": "DataTransfer", @@ -190,12 +190,23 @@ "match": { "serviceClassRegex": "DataTransfer", "serviceNameRegex": "data-transfer-service", - "calledMethodRegex": ".*FileUpload.*" + "calledMethodRegex": ".*TransferStatus.*" }, "replace": { "serviceClass": "DataTransfer", "serviceName": "data-transfer-service", - "calledMethod": "upload" + "calledMethod": "getTransferStatus" + } +},{ + "match": { + "serviceClassRegex": "DataTransfer", + "serviceNameRegex": "data-transfer-service", + "calledMethodRegex": "\/{0,1}gcube\/service\/REST\/.*" + }, + "replace": { + "serviceClass": "DataTransfer", + "serviceName": "data-transfer-service", + "calledMethod": "transfer" } },{ "match": { diff --git a/src/test/resources/rules/allRules.json.min b/src/test/resources/rules/allRules.json.min index 781deda..54bf362 100644 --- a/src/test/resources/rules/allRules.json.min +++ b/src/test/resources/rules/allRules.json.min @@ -1 +1 @@ -[{"match":{"serviceClassRegex":"(?.*)","serviceNameRegex":"(?.*)","calledMethodRegex":"UNKNOWN"},"replace":{"serviceClass":"${ServiceClass}","serviceName":"${ServiceName}","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"(?.*)"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"${CalledMethod}"}},{"match":{"serviceClassRegex":"Common","serviceNameRegex":"AuthorizationService","calledMethodRegex":"^/{0,1}gcube/service/generate.*"},"replace":{"serviceClass":"Common","serviceName":"AuthorizationService","calledMethod":"generate"}},{"match":{"serviceClassRegex":"Common","serviceNameRegex":"AuthorizationService","calledMethodRegex":"^/{0,1}gcube/service/retrieve.*"},"replace":{"serviceClass":"Common","serviceName":"AuthorizationService","calledMethod":"retrieve"}},{"match":{"serviceClassRegex":"Common","serviceNameRegex":"AuthorizationService","calledMethodRegex":"^((e\/)|\/){0,1}gcube\/resource\/scopes"},"replace":{"serviceClass":"Common","serviceName":"AuthorizationService","calledMethod":"scopes"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"(^\/rest\/(api\/){0,1}licenses\/list)|(listLicenses)"},"replace":{"serviceClass":"DataPublishing","serviceName":"Catalogue-WS","calledMethod":"listLicenses"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"^\/rest\/api\/organi(s|z)ation(s){0,1}\/list.*"},"replace":{"serviceClass":"DataPublishing","serviceName":"Catalogue-WS","calledMethod":"listOrganizations"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"^\/rest$|^UNKNOWN$|^OTHER$"},"replace":{"serviceClass":"DataPublishing","serviceName":"Catalogue-WS","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"^\/rest\/api\/organi(s|z)ation(s){0,1}\/show.*"},"replace":{"serviceClass":"DataPublishing","serviceName":"Catalogue-WS","calledMethod":"showOrganizations"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"CkanConnector","calledMethodRegex":"^\/{0,1}gcube\/service\/connect.*"},"replace":{"serviceClass":"DataAccess","serviceName":"CkanConnector","calledMethod":"connect"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"CkanConnector","calledMethodRegex":"^\/{0,1}gcube\/service\/disconnect.*"},"replace":{"serviceClass":"DataAccess","serviceName":"CkanConnector","calledMethod":"disconnect"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}DescribeProcess.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"describeProcess"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}GetCapabilities.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"getCapabilities"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}RetrieveResult.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"getResult"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}(WebProcessingService|UNKNOWN|OTHER|gcube\/resource\/scopes).*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}CancelComputation.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"stop"}},{"match":{"serviceClassRegex":"DataTransfer","serviceNameRegex":"data-transfer-service","calledMethodRegex":".*Capabilities.*"},"replace":{"serviceClass":"DataTransfer","serviceName":"data-transfer-service","calledMethod":"getCapabilities"}},{"match":{"serviceClassRegex":"DataTransfer","serviceNameRegex":"data-transfer-service","calledMethodRegex":".*FileUpload.*"},"replace":{"serviceClass":"DataTransfer","serviceName":"data-transfer-service","calledMethod":"upload"}},{"match":{"serviceClassRegex":"ResourceManagement","serviceNameRegex":"FHNManager","calledMethodRegex":".*"},"replace":{"serviceClass":"ResourceManagement","serviceName":"FHNManager","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(Index)|(DataRetrieval)","serviceNameRegex":"(FullTextIndexNode)|(FullTextFullTextIndexNodeNode)","calledMethodRegex":".*"},"replace":{"serviceClass":"DataRetrieval","serviceName":"FullTextIndexNode","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(geoanalytics)|(SDI)","serviceNameRegex":"geoanalytics-gos.*","calledMethodRegex":".*"},"replace":{"serviceClass":"SDI","serviceName":"geoanalytics-gos","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"geoanalytics","serviceNameRegex":"geoanalytics-main-service","calledMethodRegex":".*"},"replace":{"serviceClass":"SDI","serviceName":"geoanalytics-main-service","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.create(\\.form){0,1}|\\.insert|\\.xmlinsert\\.form)$"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"create"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.delete(\\.batch|@json|$))"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"delete"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.list(@json|$))"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"list"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":"^(?!.*(read|create|insert|delete|list|get|show|info|search|update|edit)).*$|^(.*(updated|editors|pwupdate|(systeminfo.*)|forget-password|getmap.png|(GetCapabilities.*)|(\/codelists\/.*)))$"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.get(\\..*|\/.*|$)|\\.show(\\..*|$)|((\\.|/)info(?!edit).*))"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"read"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.|-|/|package_|open)search(\/.*|unused(.form){0,1}|\\..*|;jsessionid=.*|-.*|$)"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"search"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.update($|\\.finish)|\\.edit(!{0,1}|\\.save(only){0,1}|\\.commit)$|\\.infoedit$|\\.pwedit$)"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"update"}},{"match":{"serviceClassRegex":"(GeoServer)|(geoserver)|(SpatialData)|(SDI)","serviceNameRegex":"(GeoServer)|(geoserver)","calledMethodRegex":"^(?!.*\/(wfs|wms|wcs|wmts)).*$"},"replace":{"serviceClass":"SDI","serviceName":"GeoServer","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(GeoServer)|(geoserver)|(SpatialData)|(SDI)","serviceNameRegex":"(GeoServer)|(geoserver)","calledMethodRegex":"^.*\/(?(wfs|wms|wcs|wmts)).*$"},"replace":{"serviceClass":"SDI","serviceName":"GeoServer","calledMethod":"/${Protocol}","_comment" : "Do not remove the initial / to avoid that wms is replaced with OTHER"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":"(.*publish-product.*)|(.*create-product.*)|(create)"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"create"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":"(.*delete-product.*)|(delete)"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"delete"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*get-catalogue-id-(and-url-){0,1}from-name.*"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"getURLandIdFromName"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*(hello)|(UNKNOWN)|(OTHER)|(get-licenses).*"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*update-product.*"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"update"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"HomeLibraryFileSystem","calledMethodRegex":".*"},"replace":{"serviceClass":"DataAccess","serviceName":"HomeLibraryFileSystem","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"DataAnalysis","serviceNameRegex":"RConnector","calledMethodRegex":"^\/{0,1}gcube\/service\/connect.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"RConnector","calledMethod":"connect"}},{"match":{"serviceClassRegex":"DataAnalysis","serviceNameRegex":"RConnector","calledMethodRegex":"UNKNOWN|OTHER|^\/{0,1}gcube\/resource\/scopes"},"replace":{"serviceClass":"DataAnalysis","serviceName":"RConnector","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"InformationSystem","serviceNameRegex":"(resource-registry)|(joint-resource-registry)","calledMethodRegex":"(?!(listContexts|createContext|readContext|updateContext|deleteContext|listInstances|existInstance|createInstance|readInstance|updateInstance|deleteInstance|createType|readType|addToContext|removeFromContext|query|rawQuery)).*"},"replace":{"serviceClass":"InformationSystem","serviceName":"resource-registry","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"SDI","serviceNameRegex":"sdi-service","calledMethodRegex":".*"},"replace":{"serviceClass":"SDI","serviceName":"sdi-service","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"DataPublishing","serviceNameRegex":"SDMXDataSource.*","calledMethodRegex":".*"},"replace":{"serviceClass":"DataPublishing","serviceName":"SDMXDataSource","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"ShareLatex","calledMethodRegex":"^\/{0,1}gcube\/service\/connect.*"},"replace":{"serviceClass":"DataAccess","serviceName":"ShareLatex","calledMethod":"connect"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"ShareLatex","calledMethodRegex":"^\/{0,1}gcube\/service\/disconnect.*"},"replace":{"serviceClass":"DataAccess","serviceName":"ShareLatex","calledMethod":"disconnect"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"ShareLatex","calledMethodRegex":"^(?!(\/{0,1}gcube\/service\/){0,1}((connect)|(disconnect)|(project))).*"},"replace":{"serviceClass":"DataAccess","serviceName":"ShareLatex","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"ShareLatex","calledMethodRegex":"^\/{0,1}gcube\/service\/project.*"},"replace":{"serviceClass":"DataAccess","serviceName":"ShareLatex","calledMethod":"project"}},{"match":{"serviceClassRegex":"(Search)|(DataRetrieval)","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*"},"replace":{"serviceClass":"DataRetrieval","serviceName":"SimulFishGrowthData","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((launch)|(execute)|(POST .*executions)).*"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"execute"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((getAvailablePlugins.*)|(GET \/plugins(\/){0,1}$))"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"getAvailablePlugins"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((getScheduledExecution.*)|(GET .*executions(\/){0,1}$))"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"getScheduledExecution"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((getStateEvolution)|(getState)|(GET .*executions\/.{1,})).*"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"getState"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*(UNKNOWN)|(OTHER).*"},"replace":{"serviceClass":"VREManagement","serviceName":"smart-executor","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((stop)|(unSchedule)|(DELETE)|(PURGE)).*"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"stop"}},{"match":{"serviceClassRegex":"content-management","serviceNameRegex":"storage","calledMethodRegex":".*"},"replace":{"serviceClass":"content-management","serviceName":"storage","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"Application|DataAnalysis","serviceNameRegex":"TagMe","calledMethodRegex":"^((e\/)|\/){0,1}tag"},"replace":{"serviceClass":"Application","serviceName":"TagMe","calledMethod":"tag"}},{"match":{"serviceClassRegex":"SDI","serviceNameRegex":"Thredds","calledMethodRegex":"^(\/){1}(?[a-zA-Z0-9]*){1}(\/public\/netcdf\/){1}(?[a-zA-Z0-9_\\-%]*(?[a-zA-Z0-9]*){1}(\/public\/netcdf\/){1}[^\/]*((?[a-zA-Z0-9]*){1}(\/public\/netcdf\/){1}(?[a-zA-Z0-9_\\-%]*)(\/){1}(.*\\.(nc|asc|tiff))$"},"replace":{"serviceClass":"SDI","serviceName":"Thredds","calledMethod":"${Protocol}::${Collection}"}},{"match":{"serviceClassRegex":"SDI","serviceNameRegex":"Thredds","calledMethodRegex":"^(\/){1}(?[a-zA-Z0-9]*){1}(\/public\/netcdf\/){1}[^\/]*(\\.(nc|asc|tiff))$"},"replace":{"serviceClass":"SDI","serviceName":"Thredds","calledMethod":"${Protocol}::OTHER"}}] \ No newline at end of file +[{"match":{"serviceClassRegex":"(?.*)","serviceNameRegex":"(?.*)","calledMethodRegex":"UNKNOWN"},"replace":{"serviceClass":"${ServiceClass}","serviceName":"${ServiceName}","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"(?.*)"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"${CalledMethod}"}},{"match":{"serviceClassRegex":"Common","serviceNameRegex":"AuthorizationService","calledMethodRegex":"^/{0,1}gcube/service/generate.*"},"replace":{"serviceClass":"Common","serviceName":"AuthorizationService","calledMethod":"generate"}},{"match":{"serviceClassRegex":"Common","serviceNameRegex":"AuthorizationService","calledMethodRegex":"^/{0,1}gcube/service/retrieve.*"},"replace":{"serviceClass":"Common","serviceName":"AuthorizationService","calledMethod":"retrieve"}},{"match":{"serviceClassRegex":"Common","serviceNameRegex":"AuthorizationService","calledMethodRegex":"^((e\/)|\/){0,1}gcube\/resource\/scopes"},"replace":{"serviceClass":"Common","serviceName":"AuthorizationService","calledMethod":"scopes"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"(^\/rest\/(api\/){0,1}licenses\/list)|(listLicenses)"},"replace":{"serviceClass":"DataPublishing","serviceName":"Catalogue-WS","calledMethod":"listLicenses"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"^\/rest\/api\/organi(s|z)ation(s){0,1}\/list.*"},"replace":{"serviceClass":"DataPublishing","serviceName":"Catalogue-WS","calledMethod":"listOrganizations"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"^\/rest$|^UNKNOWN$|^OTHER$"},"replace":{"serviceClass":"DataPublishing","serviceName":"Catalogue-WS","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"^\/rest\/api\/organi(s|z)ation(s){0,1}\/show.*"},"replace":{"serviceClass":"DataPublishing","serviceName":"Catalogue-WS","calledMethod":"showOrganizations"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"CkanConnector","calledMethodRegex":"^\/{0,1}gcube\/service\/connect.*"},"replace":{"serviceClass":"DataAccess","serviceName":"CkanConnector","calledMethod":"connect"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"CkanConnector","calledMethodRegex":"^\/{0,1}gcube\/service\/disconnect.*"},"replace":{"serviceClass":"DataAccess","serviceName":"CkanConnector","calledMethod":"disconnect"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}DescribeProcess.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"describeProcess"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}GetCapabilities.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"getCapabilities"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}RetrieveResult.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"getResult"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}(WebProcessingService|UNKNOWN|OTHER|gcube\/resource\/scopes).*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(WPS)|(DataAnalysis)","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}CancelComputation.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"DataMiner","calledMethod":"stop"}},{"match":{"serviceClassRegex":"DataTransfer","serviceNameRegex":"data-transfer-service","calledMethodRegex":".*(c|C)apabilities.*"},"replace":{"serviceClass":"DataTransfer","serviceName":"data-transfer-service","calledMethod":"getCapabilities"}},{"match":{"serviceClassRegex":"DataTransfer","serviceNameRegex":"data-transfer-service","calledMethodRegex":".*TransferStatus.*"},"replace":{"serviceClass":"DataTransfer","serviceName":"data-transfer-service","calledMethod":"getTransferStatus"}},{"match":{"serviceClassRegex":"DataTransfer","serviceNameRegex":"data-transfer-service","calledMethodRegex":"\/{0,1}gcube\/service\/REST\/.*"},"replace":{"serviceClass":"DataTransfer","serviceName":"data-transfer-service","calledMethod":"transfer"}},{"match":{"serviceClassRegex":"ResourceManagement","serviceNameRegex":"FHNManager","calledMethodRegex":".*"},"replace":{"serviceClass":"ResourceManagement","serviceName":"FHNManager","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(Index)|(DataRetrieval)","serviceNameRegex":"(FullTextIndexNode)|(FullTextFullTextIndexNodeNode)","calledMethodRegex":".*"},"replace":{"serviceClass":"DataRetrieval","serviceName":"FullTextIndexNode","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(geoanalytics)|(SDI)","serviceNameRegex":"geoanalytics-gos.*","calledMethodRegex":".*"},"replace":{"serviceClass":"SDI","serviceName":"geoanalytics-gos","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"geoanalytics","serviceNameRegex":"geoanalytics-main-service","calledMethodRegex":".*"},"replace":{"serviceClass":"SDI","serviceName":"geoanalytics-main-service","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.create(\\.form){0,1}|\\.insert|\\.xmlinsert\\.form)$"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"create"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.delete(\\.batch|@json|$))"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"delete"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.list(@json|$))"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"list"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":"^(?!.*(read|create|insert|delete|list|get|show|info|search|update|edit)).*$|^(.*(updated|editors|pwupdate|(systeminfo.*)|forget-password|getmap.png|(GetCapabilities.*)|(\/codelists\/.*)))$"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.get(\\..*|\/.*|$)|\\.show(\\..*|$)|((\\.|/)info(?!edit).*))"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"read"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.|-|/|package_|open)search(\/.*|unused(.form){0,1}|\\..*|;jsessionid=.*|-.*|$)"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"search"}},{"match":{"serviceClassRegex":"(SDI)|(SpatialData)","serviceNameRegex":"GeoNetwork","calledMethodRegex":".*(\\.update($|\\.finish)|\\.edit(!{0,1}|\\.save(only){0,1}|\\.commit)$|\\.infoedit$|\\.pwedit$)"},"replace":{"serviceClass":"SDI","serviceName":"GeoNetwork","calledMethod":"update"}},{"match":{"serviceClassRegex":"(GeoServer)|(geoserver)|(SpatialData)|(SDI)","serviceNameRegex":"(GeoServer)|(geoserver)","calledMethodRegex":"^(?!.*\/(wfs|wms|wcs|wmts)).*$"},"replace":{"serviceClass":"SDI","serviceName":"GeoServer","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(GeoServer)|(geoserver)|(SpatialData)|(SDI)","serviceNameRegex":"(GeoServer)|(geoserver)","calledMethodRegex":"^.*\/(?(wfs|wms|wcs|wmts)).*$"},"replace":{"serviceClass":"SDI","serviceName":"GeoServer","calledMethod":"/${Protocol}","_comment" : "Do not remove the initial / to avoid that wms is replaced with OTHER"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":"(.*publish-product.*)|(.*create-product.*)|(create)"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"create"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":"(.*delete-product.*)|(delete)"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"delete"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*get-catalogue-id-(and-url-){0,1}from-name.*"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"getURLandIdFromName"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*(hello)|(UNKNOWN)|(OTHER)|(get-licenses).*"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(Data-Catalogue)|(DataPublishing)","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*update-product.*"},"replace":{"serviceClass":"DataPublishing","serviceName":"GRSFPublisher","calledMethod":"update"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"HomeLibraryFileSystem","calledMethodRegex":".*"},"replace":{"serviceClass":"DataAccess","serviceName":"HomeLibraryFileSystem","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"DataAnalysis","serviceNameRegex":"RConnector","calledMethodRegex":"^\/{0,1}gcube\/service\/connect.*"},"replace":{"serviceClass":"DataAnalysis","serviceName":"RConnector","calledMethod":"connect"}},{"match":{"serviceClassRegex":"DataAnalysis","serviceNameRegex":"RConnector","calledMethodRegex":"UNKNOWN|OTHER|^\/{0,1}gcube\/resource\/scopes"},"replace":{"serviceClass":"DataAnalysis","serviceName":"RConnector","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"InformationSystem","serviceNameRegex":"(resource-registry)|(joint-resource-registry)","calledMethodRegex":"(?!(listContexts|createContext|readContext|updateContext|deleteContext|listInstances|existInstance|createInstance|readInstance|updateInstance|deleteInstance|createType|readType|addToContext|removeFromContext|query|rawQuery)).*"},"replace":{"serviceClass":"InformationSystem","serviceName":"resource-registry","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"SDI","serviceNameRegex":"sdi-service","calledMethodRegex":".*"},"replace":{"serviceClass":"SDI","serviceName":"sdi-service","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"DataPublishing","serviceNameRegex":"SDMXDataSource.*","calledMethodRegex":".*"},"replace":{"serviceClass":"DataPublishing","serviceName":"SDMXDataSource","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"ShareLatex","calledMethodRegex":"^\/{0,1}gcube\/service\/connect.*"},"replace":{"serviceClass":"DataAccess","serviceName":"ShareLatex","calledMethod":"connect"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"ShareLatex","calledMethodRegex":"^\/{0,1}gcube\/service\/disconnect.*"},"replace":{"serviceClass":"DataAccess","serviceName":"ShareLatex","calledMethod":"disconnect"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"ShareLatex","calledMethodRegex":"^(?!(\/{0,1}gcube\/service\/){0,1}((connect)|(disconnect)|(project))).*"},"replace":{"serviceClass":"DataAccess","serviceName":"ShareLatex","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"DataAccess","serviceNameRegex":"ShareLatex","calledMethodRegex":"^\/{0,1}gcube\/service\/project.*"},"replace":{"serviceClass":"DataAccess","serviceName":"ShareLatex","calledMethod":"project"}},{"match":{"serviceClassRegex":"(Search)|(DataRetrieval)","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*"},"replace":{"serviceClass":"DataRetrieval","serviceName":"SimulFishGrowthData","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((launch)|(execute)|(POST .*executions)).*"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"execute"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((getAvailablePlugins.*)|(GET \/plugins(\/){0,1}$))"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"getAvailablePlugins"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((getScheduledExecution.*)|(GET .*executions(\/){0,1}$))"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"getScheduledExecution"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((getStateEvolution)|(getState)|(GET .*executions\/.{1,})).*"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"getState"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*(UNKNOWN)|(OTHER).*"},"replace":{"serviceClass":"VREManagement","serviceName":"smart-executor","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((stop)|(unSchedule)|(DELETE)|(PURGE)).*"},"replace":{"serviceClass":"VREManagement","serviceName":"SmartExecutor","calledMethod":"stop"}},{"match":{"serviceClassRegex":"content-management","serviceNameRegex":"storage","calledMethodRegex":".*"},"replace":{"serviceClass":"content-management","serviceName":"storage","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"Application|DataAnalysis","serviceNameRegex":"TagMe","calledMethodRegex":"^((e\/)|\/){0,1}tag"},"replace":{"serviceClass":"Application","serviceName":"TagMe","calledMethod":"tag"}},{"match":{"serviceClassRegex":"SDI","serviceNameRegex":"Thredds","calledMethodRegex":"^(\/){1}(?[a-zA-Z0-9]*){1}(\/public\/netcdf\/){1}(?[a-zA-Z0-9_\\-%]*(?[a-zA-Z0-9]*){1}(\/public\/netcdf\/){1}[^\/]*((?[a-zA-Z0-9]*){1}(\/public\/netcdf\/){1}(?[a-zA-Z0-9_\\-%]*)(\/){1}(.*\\.(nc|asc|tiff))$"},"replace":{"serviceClass":"SDI","serviceName":"Thredds","calledMethod":"${Protocol}::${Collection}"}},{"match":{"serviceClassRegex":"SDI","serviceNameRegex":"Thredds","calledMethodRegex":"^(\/){1}(?[a-zA-Z0-9]*){1}(\/public\/netcdf\/){1}[^\/]*(\\.(nc|asc|tiff))$"},"replace":{"serviceClass":"SDI","serviceName":"Thredds","calledMethod":"${Protocol}::OTHER"}}] \ No newline at end of file diff --git a/src/test/resources/rules/data-transfer-service/data-transfer-service-getCapabilities.json b/src/test/resources/rules/data-transfer-service/data-transfer-service-getCapabilities.json index 11b3941..00a9eb9 100644 --- a/src/test/resources/rules/data-transfer-service/data-transfer-service-getCapabilities.json +++ b/src/test/resources/rules/data-transfer-service/data-transfer-service-getCapabilities.json @@ -2,7 +2,7 @@ "match": { "serviceClassRegex": "DataTransfer", "serviceNameRegex": "data-transfer-service", - "calledMethodRegex": ".*Capabilities.*" + "calledMethodRegex": ".*(c|C)apabilities.*" }, "replace": { "serviceClass": "DataTransfer", diff --git a/src/test/resources/rules/data-transfer-service/data-transfer-service-getTransferStatus.csv b/src/test/resources/rules/data-transfer-service/data-transfer-service-getTransferStatus.csv new file mode 100644 index 0000000..8902a70 --- /dev/null +++ b/src/test/resources/rules/data-transfer-service/data-transfer-service-getTransferStatus.csv @@ -0,0 +1,3 @@ +DataTransfer,data-transfer-service,/gcube/service/TransferStatus/338d5081-f507-49fc-94ea-6514b6b98425 +DataTransfer,data-transfer-service,gcube/service/TransferStatus/338d5081-f507-49fc-94ea-6514b6b98425 +DataTransfer,data-transfer-service,getTransferStatus \ No newline at end of file diff --git a/src/test/resources/rules/data-transfer-service/data-transfer-service-upload.json b/src/test/resources/rules/data-transfer-service/data-transfer-service-getTransferStatus.json similarity index 70% rename from src/test/resources/rules/data-transfer-service/data-transfer-service-upload.json rename to src/test/resources/rules/data-transfer-service/data-transfer-service-getTransferStatus.json index 006c198..da61e99 100644 --- a/src/test/resources/rules/data-transfer-service/data-transfer-service-upload.json +++ b/src/test/resources/rules/data-transfer-service/data-transfer-service-getTransferStatus.json @@ -2,11 +2,11 @@ "match": { "serviceClassRegex": "DataTransfer", "serviceNameRegex": "data-transfer-service", - "calledMethodRegex": ".*FileUpload.*" + "calledMethodRegex": ".*TransferStatus.*" }, "replace": { "serviceClass": "DataTransfer", "serviceName": "data-transfer-service", - "calledMethod": "upload" + "calledMethod": "getTransferStatus" } } \ No newline at end of file diff --git a/src/test/resources/rules/data-transfer-service/data-transfer-service-upload.csv b/src/test/resources/rules/data-transfer-service/data-transfer-service-transfer.csv similarity index 69% rename from src/test/resources/rules/data-transfer-service/data-transfer-service-upload.csv rename to src/test/resources/rules/data-transfer-service/data-transfer-service-transfer.csv index 356ff5f..835e125 100644 --- a/src/test/resources/rules/data-transfer-service/data-transfer-service-upload.csv +++ b/src/test/resources/rules/data-transfer-service/data-transfer-service-transfer.csv @@ -8,8 +8,6 @@ DataTransfer,data-transfer-service,gcube/service/REST/FileUpload/data-transfer-s DataTransfer,data-transfer-service,gcube/service/REST/FileUpload/data-transfer-service/testFolder DataTransfer,data-transfer-service,gcube/service/REST/FileUpload/thredds/public/netcdf/Oscar DataTransfer,data-transfer-service,gcube/service/REST/FileUpload/thredds/public/netcdf/myCatalog -DataTransfer,data-transfer-service,fdgdgfdgf/FileUpload/c81a9e00-a27c-4fc3-8db8-d0c82f6633c5 -DataTransfer,data-transfer-service,gfdgfgfgff/FileUpload/data-transfer-service -DataTransfer,data-transfer-service,bnvmcfh/FileUpload/data-transfer-service/testFolder -DataTransfer,data-transfer-service,truizdh/FileUpload/thredds/public/netcdf/Oscar -DataTransfer,data-transfer-service,sgfdhhjj/FileUpload/thredds/public/netcdf/myCatalog \ No newline at end of file +DataTransfer,data-transfer-service,/gcube/service/REST/thredds/catalog.xml +DataTransfer,data-transfer-service,/gcube/service/REST/thredds/public/netcdf/CMEMS +DataTransfer,data-transfer-service,/gcube/service/REST/thredds/public/netcdf/Oscar \ No newline at end of file diff --git a/src/test/resources/rules/data-transfer-service/data-transfer-service-transfer.json b/src/test/resources/rules/data-transfer-service/data-transfer-service-transfer.json new file mode 100644 index 0000000..5b448f0 --- /dev/null +++ b/src/test/resources/rules/data-transfer-service/data-transfer-service-transfer.json @@ -0,0 +1,12 @@ +{ + "match": { + "serviceClassRegex": "DataTransfer", + "serviceNameRegex": "data-transfer-service", + "calledMethodRegex": "\/{0,1}gcube\/service\/REST\/.*" + }, + "replace": { + "serviceClass": "DataTransfer", + "serviceName": "data-transfer-service", + "calledMethod": "transfer" + } +} \ No newline at end of file