From 0cdc4aba7583d70bf4ea9473219218b70db8b550 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Tue, 17 Mar 2020 10:47:25 +0100 Subject: [PATCH] Forced SDI as service class for all the spatial data services --- .../rules/GeoServer/GeoServer_OTHER.json | 2 +- .../rules/GeoServer/GeoServer_PROTOCOL.json | 2 +- src/test/resources/rules/allRules-min.json | 1 - src/test/resources/rules/allRules.json | 1495 ++++++++--------- src/test/resources/rules/allRules.min.json | 1 + .../resources/rules/generate-all-rules.sh | 12 + .../geoanalytics-gos-GeoserverManagement.json | 2 +- .../geoanalytics-gos-ShapeManagement.json | 2 +- .../geoanalytics-main-service-OTHER.json | 2 +- 9 files changed, 733 insertions(+), 786 deletions(-) delete mode 100644 src/test/resources/rules/allRules-min.json create mode 100644 src/test/resources/rules/allRules.min.json create mode 100755 src/test/resources/rules/generate-all-rules.sh diff --git a/src/test/resources/rules/GeoServer/GeoServer_OTHER.json b/src/test/resources/rules/GeoServer/GeoServer_OTHER.json index e25baa1..ab1ffe0 100644 --- a/src/test/resources/rules/GeoServer/GeoServer_OTHER.json +++ b/src/test/resources/rules/GeoServer/GeoServer_OTHER.json @@ -5,7 +5,7 @@ "calledMethodRegex": "^(?!.*\/(wfs|wms|wcs|wmts)).*$" }, "replace": { - "serviceClass": "GeoServer", + "serviceClass": "SDI", "serviceName": "GeoServer", "calledMethod": "OTHER" } diff --git a/src/test/resources/rules/GeoServer/GeoServer_PROTOCOL.json b/src/test/resources/rules/GeoServer/GeoServer_PROTOCOL.json index 7711f51..d0a20b1 100644 --- a/src/test/resources/rules/GeoServer/GeoServer_PROTOCOL.json +++ b/src/test/resources/rules/GeoServer/GeoServer_PROTOCOL.json @@ -5,7 +5,7 @@ "calledMethodRegex": "^.*\/(?(wfs|wms|wcs|wmts)).*$" }, "replace": { - "serviceClass": "GeoServer", + "serviceClass": "SDI", "serviceName": "GeoServer", "calledMethod": "/${Protocol}", "_comment" : "Do not remove the initial / to avoid that wms is replaced with OTHER" diff --git a/src/test/resources/rules/allRules-min.json b/src/test/resources/rules/allRules-min.json deleted file mode 100644 index 62fd7d9..0000000 --- a/src/test/resources/rules/allRules-min.json +++ /dev/null @@ -1 +0,0 @@ -[{"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","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"^\/rest\/(api\/){0,1}licenses\/list"},"replace":{"serviceClass":"Data-Catalogue","serviceName":"Catalogue-WS","calledMethod":"\/rest\/api\/licenses\/list"}},{"match":{"serviceClassRegex":"Data-Catalogue","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"^\/rest\/api\/organi(s|z)ation(s){0,1}\/list"},"replace":{"serviceClass":"Data-Catalogue","serviceName":"Catalogue-WS","calledMethod":"\/rest\/api\/organizations\/list"}},{"match":{"serviceClassRegex":"Data-Catalogue","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"^\/rest$|^UNKNOWN|^OTHER$"},"replace":{"serviceClass":"Data-Catalogue","serviceName":"Catalogue-WS","calledMethod":"OTHER"}},{"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","serviceNameRegex":"DataMiner","calledMethodRegex":"^\/{0,1}DescribeProcess.*"},"replace":{"serviceClass":"WPS","serviceName":"DataMiner","calledMethod":"describeProcess"}},{"match":{"serviceClassRegex":"WPS","serviceNameRegex":"DataMiner","calledMethodRegex":"^\/{0,1}GetCapabilities.*"},"replace":{"serviceClass":"WPS","serviceName":"DataMiner","calledMethod":"getCapabilities"}},{"match":{"serviceClassRegex":"WPS","serviceNameRegex":"DataMiner","calledMethodRegex":"^\/{0,1}RetrieveResult.*"},"replace":{"serviceClass":"WPS","serviceName":"DataMiner","calledMethod":"getResult"}},{"match":{"serviceClassRegex":"WPS","serviceNameRegex":"DataMiner","calledMethodRegex":"^\/{0,1}(WebProcessingService|UNKNOWN|OTHER|gcube\/resource\/scopes).*"},"replace":{"serviceClass":"WPS","serviceName":"DataMiner","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"WPS","serviceNameRegex":"DataMiner","calledMethodRegex":"^\/{0,1}CancelComputation.*"},"replace":{"serviceClass":"WPS","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":"Index","serviceNameRegex":"FullTextIndexNode","calledMethodRegex":"^\/{0,1}delete.*"},"replace":{"serviceClass":"Index","serviceName":"FullTextIndexNode","calledMethod":"delete"}},{"match":{"serviceClassRegex":"Index","serviceNameRegex":"FullTextIndexNode","calledMethodRegex":"^\/{0,1}dropCollection.*"},"replace":{"serviceClass":"Index","serviceName":"FullTextIndexNode","calledMethod":"dropCollection"}},{"match":{"serviceClassRegex":"Index","serviceNameRegex":"FullTextIndexNode","calledMethodRegex":"^\/{0,1}insert.*"},"replace":{"serviceClass":"Index","serviceName":"FullTextIndexNode","calledMethod":"insert"}},{"match":{"serviceClassRegex":"Index","serviceNameRegex":"FullTextIndexNode","calledMethodRegex":"^\/{0,1}listCollections.*"},"replace":{"serviceClass":"Index","serviceName":"FullTextIndexNode","calledMethod":"listCollections"}},{"match":{"serviceClassRegex":"Index","serviceNameRegex":"FullTextIndexNode","calledMethodRegex":"^\/{0,1}search.*"},"replace":{"serviceClass":"Index","serviceName":"FullTextIndexNode","calledMethod":"search"}},{"match":{"serviceClassRegex":"geoanalytics","serviceNameRegex":"geoanalytics-gos","calledMethodRegex":".*GeoserverManagement.*"},"replace":{"serviceClass":"geoanalytics","serviceName":"geoanalytics-gos","calledMethod":"GeoserverManagement"}},{"match":{"serviceClassRegex":"geoanalytics","serviceNameRegex":"geoanalytics-gos","calledMethodRegex":".*ShapeManagement.*"},"replace":{"serviceClass":"geoanalytics","serviceName":"geoanalytics-gos","calledMethod":"ShapeManagement"}},{"match":{"serviceClassRegex":"geoanalytics","serviceNameRegex":"geoanalytics-main-service","calledMethodRegex":".*"},"replace":{"serviceClass":"geoanalytics","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(\\..*|\\.*|@json|$)))"},"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)","serviceNameRegex":"(GeoServer)|(geoserver)","calledMethodRegex":"^(?!.*\/(wfs|wms|wcs|wmts)).*$"},"replace":{"serviceClass":"GeoServer","serviceName":"GeoServer","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(GeoServer)|(geoserver)|(SpatialData)","serviceNameRegex":"(GeoServer)|(geoserver)","calledMethodRegex":"^.*\/(?(wfs|wms|wcs|wmts)).*$"},"replace":{"serviceClass":"GeoServer","serviceName":"GeoServer","calledMethod":"\/${Protocol}","_comment":"Do not remove the initial \/ to avoid that wms is replaced with OTHER"}},{"match":{"serviceClassRegex":"Data-Catalogue","serviceNameRegex":"GRSFPublisher","calledMethodRegex":"(.*publish-product.*)|(.*create-product.*)"},"replace":{"serviceClass":"Data-Catalogue","serviceName":"GRSFPublisher","calledMethod":"create"}},{"match":{"serviceClassRegex":"Data-Catalogue","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*delete-product.*"},"replace":{"serviceClass":"Data-Catalogue","serviceName":"GRSFPublisher","calledMethod":"delete"}},{"match":{"serviceClassRegex":"Data-Catalogue","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*get-catalogue-id-(and-url-){0,1}from-name.*"},"replace":{"serviceClass":"Data-Catalogue","serviceName":"GRSFPublisher","calledMethod":"getURLandIdFromName"}},{"match":{"serviceClassRegex":"Data-Catalogue","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*(hello)|(UNKNOWN)|(OTHER)|(get-licenses).*"},"replace":{"serviceClass":"Data-Catalogue","serviceName":"GRSFPublisher","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"Data-Catalogue","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*update-product.*"},"replace":{"serviceClass":"Data-Catalogue","serviceName":"GRSFPublisher","calledMethod":"update"}},{"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","calledMethodRegex":"^(?!(GET|HEAD|POST|PUT|DELETE|PURGE|OPTIONS|TRACE|CONNECT))\/.*"},"replace":{"serviceClass":"InformationSystem","serviceName":"resource-registry","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":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*BroodstockQuality.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"BroodstockQuality"}},{"match":{"serviceClassRegex":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*CurrentRating.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"CurrentRating"}},{"match":{"serviceClassRegex":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*FeedQuality.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"FeedQuality"}},{"match":{"serviceClassRegex":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*Modeler.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"Modeler"}},{"match":{"serviceClassRegex":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*Called Method.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*OxygenRating.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"OxygenRating"}},{"match":{"serviceClassRegex":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*Region.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"Region"}},{"match":{"serviceClassRegex":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*Scenario.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"Scenario"}},{"match":{"serviceClassRegex":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*Site.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"Site"}},{"match":{"serviceClassRegex":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*Species.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"Species"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((launch)|(execute)|(POST .*executions)).*"},"replace":{"serviceClass":"VREManagement","serviceName":"smart-executor","calledMethod":"execute"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((getAvailablePlugins.*)|(GET \/plugins(\/){0,1}$))"},"replace":{"serviceClass":"VREManagement","serviceName":"smart-executor","calledMethod":"getAvailablePlugins"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((getScheduledExecution.*)|(GET .*executions(\/){0,1}$))"},"replace":{"serviceClass":"VREManagement","serviceName":"smart-executor","calledMethod":"getScheduledExecution"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((getStateEvolution)|(getState)|(GET .*executions\/.{1,})).*"},"replace":{"serviceClass":"VREManagement","serviceName":"smart-executor","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":"smart-executor","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/allRules.json b/src/test/resources/rules/allRules.json index 0232148..56e21fc 100644 --- a/src/test/resources/rules/allRules.json +++ b/src/test/resources/rules/allRules.json @@ -1,783 +1,718 @@ [ - { - "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/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", - "serviceNameRegex": "Catalogue-WS", - "calledMethodRegex": "^\/rest\/(api\/){0,1}licenses\/list" - }, - "replace": { - "serviceClass": "Data-Catalogue", - "serviceName": "Catalogue-WS", - "calledMethod": "/rest/api/licenses/list" - } - }, - { - "match": { - "serviceClassRegex": "Data-Catalogue", - "serviceNameRegex": "Catalogue-WS", - "calledMethodRegex": "^\/rest\/api\/organi(s|z)ation(s){0,1}\/list" - }, - "replace": { - "serviceClass": "Data-Catalogue", - "serviceName": "Catalogue-WS", - "calledMethod": "/rest/api/organizations/list" - } - }, - { - "match": { - "serviceClassRegex": "Data-Catalogue", - "serviceNameRegex": "Catalogue-WS", - "calledMethodRegex": "^\/rest$|^UNKNOWN|^OTHER$" - }, - "replace": { - "serviceClass": "Data-Catalogue", - "serviceName": "Catalogue-WS", - "calledMethod": "OTHER" - } - }, - { - "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", - "serviceNameRegex": "DataMiner", - "calledMethodRegex": "^/{0,1}DescribeProcess.*" - }, - "replace": { - "serviceClass": "WPS", - "serviceName": "DataMiner", - "calledMethod": "describeProcess" - } - }, - { - "match": { - "serviceClassRegex": "WPS", - "serviceNameRegex": "DataMiner", - "calledMethodRegex": "^/{0,1}GetCapabilities.*" - }, - "replace": { - "serviceClass": "WPS", - "serviceName": "DataMiner", - "calledMethod": "getCapabilities" - } - }, - { - "match": { - "serviceClassRegex": "WPS", - "serviceNameRegex": "DataMiner", - "calledMethodRegex": "^/{0,1}RetrieveResult.*" - }, - "replace": { - "serviceClass": "WPS", - "serviceName": "DataMiner", - "calledMethod": "getResult" - } - }, - { - "match": { - "serviceClassRegex": "WPS", - "serviceNameRegex": "DataMiner", - "calledMethodRegex": "^/{0,1}(WebProcessingService|UNKNOWN|OTHER|gcube\/resource\/scopes).*" - }, - "replace": { - "serviceClass": "WPS", - "serviceName": "DataMiner", - "calledMethod": "OTHER" - } - }, - { - "match": { - "serviceClassRegex": "WPS", - "serviceNameRegex": "DataMiner", - "calledMethodRegex": "^/{0,1}CancelComputation.*" - }, - "replace": { - "serviceClass": "WPS", - "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": "Index", - "serviceNameRegex": "FullTextIndexNode", - "calledMethodRegex": "^\/{0,1}delete.*" - }, - "replace": { - "serviceClass": "Index", - "serviceName": "FullTextIndexNode", - "calledMethod": "delete" - } - }, - { - "match": { - "serviceClassRegex": "Index", - "serviceNameRegex": "FullTextIndexNode", - "calledMethodRegex": "^\/{0,1}dropCollection.*" - }, - "replace": { - "serviceClass": "Index", - "serviceName": "FullTextIndexNode", - "calledMethod": "dropCollection" - } - }, - { - "match": { - "serviceClassRegex": "Index", - "serviceNameRegex": "FullTextIndexNode", - "calledMethodRegex": "^\/{0,1}insert.*" - }, - "replace": { - "serviceClass": "Index", - "serviceName": "FullTextIndexNode", - "calledMethod": "insert" - } - }, - { - "match": { - "serviceClassRegex": "Index", - "serviceNameRegex": "FullTextIndexNode", - "calledMethodRegex": "^\/{0,1}listCollections.*" - }, - "replace": { - "serviceClass": "Index", - "serviceName": "FullTextIndexNode", - "calledMethod": "listCollections" - } - }, - { - "match": { - "serviceClassRegex": "Index", - "serviceNameRegex": "FullTextIndexNode", - "calledMethodRegex": "^\/{0,1}search.*" - }, - "replace": { - "serviceClass": "Index", - "serviceName": "FullTextIndexNode", - "calledMethod": "search" - } - }, - { - "match": { - "serviceClassRegex": "geoanalytics", - "serviceNameRegex": "geoanalytics-gos", - "calledMethodRegex": ".*GeoserverManagement.*" - }, - "replace": { - "serviceClass": "geoanalytics", - "serviceName": "geoanalytics-gos", - "calledMethod": "GeoserverManagement" - } - }, - { - "match": { - "serviceClassRegex": "geoanalytics", - "serviceNameRegex": "geoanalytics-gos", - "calledMethodRegex": ".*ShapeManagement.*" - }, - "replace": { - "serviceClass": "geoanalytics", - "serviceName": "geoanalytics-gos", - "calledMethod": "ShapeManagement" - } - }, - { - "match": { - "serviceClassRegex": "geoanalytics", - "serviceNameRegex": "geoanalytics-main-service", - "calledMethodRegex": ".*" - }, - "replace": { - "serviceClass": "geoanalytics", - "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(\\..*|\\.*|@json|$)))" - }, - "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)", - "serviceNameRegex": "(GeoServer)|(geoserver)", - "calledMethodRegex": "^(?!.*\/(wfs|wms|wcs|wmts)).*$" - }, - "replace": { - "serviceClass": "GeoServer", - "serviceName": "GeoServer", - "calledMethod": "OTHER" - } - }, - { - "match": { - "serviceClassRegex": "(GeoServer)|(geoserver)|(SpatialData)", - "serviceNameRegex": "(GeoServer)|(geoserver)", - "calledMethodRegex": "^.*\/(?(wfs|wms|wcs|wmts)).*$" - }, - "replace": { - "serviceClass": "GeoServer", - "serviceName": "GeoServer", - "calledMethod": "/${Protocol}", - "_comment": "Do not remove the initial / to avoid that wms is replaced with OTHER" - } - }, - { - "match": { - "serviceClassRegex": "Data-Catalogue", - "serviceNameRegex": "GRSFPublisher", - "calledMethodRegex": "(.*publish-product.*)|(.*create-product.*)" - }, - "replace": { - "serviceClass": "Data-Catalogue", - "serviceName": "GRSFPublisher", - "calledMethod": "create" - } - }, - { - "match": { - "serviceClassRegex": "Data-Catalogue", - "serviceNameRegex": "GRSFPublisher", - "calledMethodRegex": ".*delete-product.*" - }, - "replace": { - "serviceClass": "Data-Catalogue", - "serviceName": "GRSFPublisher", - "calledMethod": "delete" - } - }, - { - "match": { - "serviceClassRegex": "Data-Catalogue", - "serviceNameRegex": "GRSFPublisher", - "calledMethodRegex": ".*get-catalogue-id-(and-url-){0,1}from-name.*" - }, - "replace": { - "serviceClass": "Data-Catalogue", - "serviceName": "GRSFPublisher", - "calledMethod": "getURLandIdFromName" - } - }, - { - "match": { - "serviceClassRegex": "Data-Catalogue", - "serviceNameRegex": "GRSFPublisher", - "calledMethodRegex": ".*(hello)|(UNKNOWN)|(OTHER)|(get-licenses).*" - }, - "replace": { - "serviceClass": "Data-Catalogue", - "serviceName": "GRSFPublisher", - "calledMethod": "OTHER" - } - }, - { - "match": { - "serviceClassRegex": "Data-Catalogue", - "serviceNameRegex": "GRSFPublisher", - "calledMethodRegex": ".*update-product.*" - }, - "replace": { - "serviceClass": "Data-Catalogue", - "serviceName": "GRSFPublisher", - "calledMethod": "update" - } - }, - { - "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", - "calledMethodRegex": "^(?!(GET|HEAD|POST|PUT|DELETE|PURGE|OPTIONS|TRACE|CONNECT))\/.*" - }, - "replace": { - "serviceClass": "InformationSystem", - "serviceName": "resource-registry", - "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": "Search", - "serviceNameRegex": "SimulFishGrowthData", - "calledMethodRegex": ".*BroodstockQuality.*" - }, - "replace": { - "serviceClass": "Search", - "serviceName": "SimulFishGrowthData", - "calledMethod": "BroodstockQuality" - } - }, - { - "match": { - "serviceClassRegex": "Search", - "serviceNameRegex": "SimulFishGrowthData", - "calledMethodRegex": ".*CurrentRating.*" - }, - "replace": { - "serviceClass": "Search", - "serviceName": "SimulFishGrowthData", - "calledMethod": "CurrentRating" - } - }, - { - "match": { - "serviceClassRegex": "Search", - "serviceNameRegex": "SimulFishGrowthData", - "calledMethodRegex": ".*FeedQuality.*" - }, - "replace": { - "serviceClass": "Search", - "serviceName": "SimulFishGrowthData", - "calledMethod": "FeedQuality" - } - }, - { - "match": { - "serviceClassRegex": "Search", - "serviceNameRegex": "SimulFishGrowthData", - "calledMethodRegex": ".*Modeler.*" - }, - "replace": { - "serviceClass": "Search", - "serviceName": "SimulFishGrowthData", - "calledMethod": "Modeler" - } - }, - { - "match": { - "serviceClassRegex": "Search", - "serviceNameRegex": "SimulFishGrowthData", - "calledMethodRegex": ".*Called Method.*" - }, - "replace": { - "serviceClass": "Search", - "serviceName": "SimulFishGrowthData", - "calledMethod": "OTHER" - } - }, - { - "match": { - "serviceClassRegex": "Search", - "serviceNameRegex": "SimulFishGrowthData", - "calledMethodRegex": ".*OxygenRating.*" - }, - "replace": { - "serviceClass": "Search", - "serviceName": "SimulFishGrowthData", - "calledMethod": "OxygenRating" - } - }, - { - "match": { - "serviceClassRegex": "Search", - "serviceNameRegex": "SimulFishGrowthData", - "calledMethodRegex": ".*Region.*" - }, - "replace": { - "serviceClass": "Search", - "serviceName": "SimulFishGrowthData", - "calledMethod": "Region" - } - }, - { - "match": { - "serviceClassRegex": "Search", - "serviceNameRegex": "SimulFishGrowthData", - "calledMethodRegex": ".*Scenario.*" - }, - "replace": { - "serviceClass": "Search", - "serviceName": "SimulFishGrowthData", - "calledMethod": "Scenario" - } - }, - { - "match": { - "serviceClassRegex": "Search", - "serviceNameRegex": "SimulFishGrowthData", - "calledMethodRegex": ".*Site.*" - }, - "replace": { - "serviceClass": "Search", - "serviceName": "SimulFishGrowthData", - "calledMethod": "Site" - } - }, - { - "match": { - "serviceClassRegex": "Search", - "serviceNameRegex": "SimulFishGrowthData", - "calledMethodRegex": ".*Species.*" - }, - "replace": { - "serviceClass": "Search", - "serviceName": "SimulFishGrowthData", - "calledMethod": "Species" - } - }, - { - "match": { - "serviceClassRegex": "VREManagement", - "serviceNameRegex": "(SmartExecutor)|(smart-executor)", - "calledMethodRegex": ".*((launch)|(execute)|(POST .*executions)).*" - }, - "replace": { - "serviceClass": "VREManagement", - "serviceName": "smart-executor", - "calledMethod": "execute" - } - }, - { - "match": { - "serviceClassRegex": "VREManagement", - "serviceNameRegex": "(SmartExecutor)|(smart-executor)", - "calledMethodRegex": ".*((getAvailablePlugins.*)|(GET \/plugins(\/){0,1}$))" - }, - "replace": { - "serviceClass": "VREManagement", - "serviceName": "smart-executor", - "calledMethod": "getAvailablePlugins" - } - }, - { - "match": { - "serviceClassRegex": "VREManagement", - "serviceNameRegex": "(SmartExecutor)|(smart-executor)", - "calledMethodRegex": ".*((getScheduledExecution.*)|(GET .*executions(\/){0,1}$))" - }, - "replace": { - "serviceClass": "VREManagement", - "serviceName": "smart-executor", - "calledMethod": "getScheduledExecution" - } - }, - { - "match": { - "serviceClassRegex": "VREManagement", - "serviceNameRegex": "(SmartExecutor)|(smart-executor)", - "calledMethodRegex": ".*((getStateEvolution)|(getState)|(GET .*executions\/.{1,})).*" - }, - "replace": { - "serviceClass": "VREManagement", - "serviceName": "smart-executor", - "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": "smart-executor", - "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" - } + "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", + "serviceNameRegex": "Catalogue-WS", + "calledMethodRegex": "^\/rest\/(api\/){0,1}licenses\/list" + }, + "replace": { + "serviceClass": "Data-Catalogue", + "serviceName": "Catalogue-WS", + "calledMethod": "/rest/api/licenses/list" + } +},{ + "match": { + "serviceClassRegex": "Data-Catalogue", + "serviceNameRegex": "Catalogue-WS", + "calledMethodRegex": "^\/rest\/api\/organi(s|z)ation(s){0,1}\/list" + }, + "replace": { + "serviceClass": "Data-Catalogue", + "serviceName": "Catalogue-WS", + "calledMethod": "/rest/api/organizations/list" + } +},{ + "match": { + "serviceClassRegex": "Data-Catalogue", + "serviceNameRegex": "Catalogue-WS", + "calledMethodRegex": "^\/rest$|^UNKNOWN|^OTHER$" + }, + "replace": { + "serviceClass": "Data-Catalogue", + "serviceName": "Catalogue-WS", + "calledMethod": "OTHER" + } +},{ + "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", + "serviceNameRegex": "DataMiner", + "calledMethodRegex": "^/{0,1}DescribeProcess.*" + }, + "replace": { + "serviceClass": "WPS", + "serviceName": "DataMiner", + "calledMethod": "describeProcess" + } +},{ + "match": { + "serviceClassRegex": "WPS", + "serviceNameRegex": "DataMiner", + "calledMethodRegex": "^/{0,1}GetCapabilities.*" + }, + "replace": { + "serviceClass": "WPS", + "serviceName": "DataMiner", + "calledMethod": "getCapabilities" + } +},{ + "match": { + "serviceClassRegex": "WPS", + "serviceNameRegex": "DataMiner", + "calledMethodRegex": "^/{0,1}RetrieveResult.*" + }, + "replace": { + "serviceClass": "WPS", + "serviceName": "DataMiner", + "calledMethod": "getResult" + } +},{ + "match": { + "serviceClassRegex": "WPS", + "serviceNameRegex": "DataMiner", + "calledMethodRegex": "^/{0,1}(WebProcessingService|UNKNOWN|OTHER|gcube\/resource\/scopes).*" + }, + "replace": { + "serviceClass": "WPS", + "serviceName": "DataMiner", + "calledMethod": "OTHER" + } +},{ + "match": { + "serviceClassRegex": "WPS", + "serviceNameRegex": "DataMiner", + "calledMethodRegex": "^/{0,1}CancelComputation.*" + }, + "replace": { + "serviceClass": "WPS", + "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": "Index", + "serviceNameRegex": "FullTextIndexNode", + "calledMethodRegex": "^\/{0,1}delete.*" + }, + "replace": { + "serviceClass": "Index", + "serviceName": "FullTextIndexNode", + "calledMethod": "delete" + } +},{ + "match": { + "serviceClassRegex": "Index", + "serviceNameRegex": "FullTextIndexNode", + "calledMethodRegex": "^\/{0,1}dropCollection.*" + }, + "replace": { + "serviceClass": "Index", + "serviceName": "FullTextIndexNode", + "calledMethod": "dropCollection" + } +},{ + "match": { + "serviceClassRegex": "Index", + "serviceNameRegex": "FullTextIndexNode", + "calledMethodRegex": "^\/{0,1}insert.*" + }, + "replace": { + "serviceClass": "Index", + "serviceName": "FullTextIndexNode", + "calledMethod": "insert" + } +},{ + "match": { + "serviceClassRegex": "Index", + "serviceNameRegex": "FullTextIndexNode", + "calledMethodRegex": "^\/{0,1}listCollections.*" + }, + "replace": { + "serviceClass": "Index", + "serviceName": "FullTextIndexNode", + "calledMethod": "listCollections" + } +},{ + "match": { + "serviceClassRegex": "Index", + "serviceNameRegex": "FullTextIndexNode", + "calledMethodRegex": "^\/{0,1}search.*" + }, + "replace": { + "serviceClass": "Index", + "serviceName": "FullTextIndexNode", + "calledMethod": "search" + } +},{ + "match": { + "serviceClassRegex": "geoanalytics", + "serviceNameRegex": "geoanalytics-gos", + "calledMethodRegex": ".*GeoserverManagement.*" + }, + "replace": { + "serviceClass": "SDI", + "serviceName": "geoanalytics-gos", + "calledMethod": "GeoserverManagement" + } +},{ + "match": { + "serviceClassRegex": "geoanalytics", + "serviceNameRegex": "geoanalytics-gos", + "calledMethodRegex": ".*ShapeManagement.*" + }, + "replace": { + "serviceClass": "SDI", + "serviceName": "geoanalytics-gos", + "calledMethod": "ShapeManagement" + } +},{ + "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(\\..*|\\.*|@json|$)))" + }, + "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)", + "serviceNameRegex": "(GeoServer)|(geoserver)", + "calledMethodRegex": "^(?!.*\/(wfs|wms|wcs|wmts)).*$" + }, + "replace": { + "serviceClass": "SDI", + "serviceName": "GeoServer", + "calledMethod": "OTHER" + } +},{ + "match": { + "serviceClassRegex": "(GeoServer)|(geoserver)|(SpatialData)", + "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", + "serviceNameRegex": "GRSFPublisher", + "calledMethodRegex": "(.*publish-product.*)|(.*create-product.*)" + }, + "replace": { + "serviceClass": "Data-Catalogue", + "serviceName": "GRSFPublisher", + "calledMethod": "create" + } +},{ + "match": { + "serviceClassRegex": "Data-Catalogue", + "serviceNameRegex": "GRSFPublisher", + "calledMethodRegex": ".*delete-product.*" + }, + "replace": { + "serviceClass": "Data-Catalogue", + "serviceName": "GRSFPublisher", + "calledMethod": "delete" + } +},{ + "match": { + "serviceClassRegex": "Data-Catalogue", + "serviceNameRegex": "GRSFPublisher", + "calledMethodRegex": ".*get-catalogue-id-(and-url-){0,1}from-name.*" + }, + "replace": { + "serviceClass": "Data-Catalogue", + "serviceName": "GRSFPublisher", + "calledMethod": "getURLandIdFromName" + } +},{ + "match": { + "serviceClassRegex": "Data-Catalogue", + "serviceNameRegex": "GRSFPublisher", + "calledMethodRegex": ".*(hello)|(UNKNOWN)|(OTHER)|(get-licenses).*" + }, + "replace": { + "serviceClass": "Data-Catalogue", + "serviceName": "GRSFPublisher", + "calledMethod": "OTHER" + } +},{ + "match": { + "serviceClassRegex": "Data-Catalogue", + "serviceNameRegex": "GRSFPublisher", + "calledMethodRegex": ".*update-product.*" + }, + "replace": { + "serviceClass": "Data-Catalogue", + "serviceName": "GRSFPublisher", + "calledMethod": "update" + } +},{ + "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", + "calledMethodRegex": "^(?!(GET|HEAD|POST|PUT|DELETE|PURGE|OPTIONS|TRACE|CONNECT))\/.*" + }, + "replace": { + "serviceClass": "InformationSystem", + "serviceName": "resource-registry", + "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": "Search", + "serviceNameRegex": "SimulFishGrowthData", + "calledMethodRegex": ".*BroodstockQuality.*" + }, + "replace": { + "serviceClass": "Search", + "serviceName": "SimulFishGrowthData", + "calledMethod": "BroodstockQuality" + } +},{ + "match": { + "serviceClassRegex": "Search", + "serviceNameRegex": "SimulFishGrowthData", + "calledMethodRegex": ".*CurrentRating.*" + }, + "replace": { + "serviceClass": "Search", + "serviceName": "SimulFishGrowthData", + "calledMethod": "CurrentRating" + } +},{ + "match": { + "serviceClassRegex": "Search", + "serviceNameRegex": "SimulFishGrowthData", + "calledMethodRegex": ".*FeedQuality.*" + }, + "replace": { + "serviceClass": "Search", + "serviceName": "SimulFishGrowthData", + "calledMethod": "FeedQuality" + } +},{ + "match": { + "serviceClassRegex": "Search", + "serviceNameRegex": "SimulFishGrowthData", + "calledMethodRegex": ".*Modeler.*" + }, + "replace": { + "serviceClass": "Search", + "serviceName": "SimulFishGrowthData", + "calledMethod": "Modeler" + } +},{ + "match": { + "serviceClassRegex": "Search", + "serviceNameRegex": "SimulFishGrowthData", + "calledMethodRegex": ".*Called Method.*" + }, + "replace": { + "serviceClass": "Search", + "serviceName": "SimulFishGrowthData", + "calledMethod": "OTHER" + } +},{ + "match": { + "serviceClassRegex": "Search", + "serviceNameRegex": "SimulFishGrowthData", + "calledMethodRegex": ".*OxygenRating.*" + }, + "replace": { + "serviceClass": "Search", + "serviceName": "SimulFishGrowthData", + "calledMethod": "OxygenRating" + } +},{ + "match": { + "serviceClassRegex": "Search", + "serviceNameRegex": "SimulFishGrowthData", + "calledMethodRegex": ".*Region.*" + }, + "replace": { + "serviceClass": "Search", + "serviceName": "SimulFishGrowthData", + "calledMethod": "Region" + } +},{ + "match": { + "serviceClassRegex": "Search", + "serviceNameRegex": "SimulFishGrowthData", + "calledMethodRegex": ".*Scenario.*" + }, + "replace": { + "serviceClass": "Search", + "serviceName": "SimulFishGrowthData", + "calledMethod": "Scenario" + } +},{ + "match": { + "serviceClassRegex": "Search", + "serviceNameRegex": "SimulFishGrowthData", + "calledMethodRegex": ".*Site.*" + }, + "replace": { + "serviceClass": "Search", + "serviceName": "SimulFishGrowthData", + "calledMethod": "Site" + } +},{ + "match": { + "serviceClassRegex": "Search", + "serviceNameRegex": "SimulFishGrowthData", + "calledMethodRegex": ".*Species.*" + }, + "replace": { + "serviceClass": "Search", + "serviceName": "SimulFishGrowthData", + "calledMethod": "Species" + } +},{ + "match": { + "serviceClassRegex": "VREManagement", + "serviceNameRegex": "(SmartExecutor)|(smart-executor)", + "calledMethodRegex": ".*((launch)|(execute)|(POST .*executions)).*" + }, + "replace": { + "serviceClass": "VREManagement", + "serviceName": "smart-executor", + "calledMethod": "execute" + } +},{ + "match": { + "serviceClassRegex": "VREManagement", + "serviceNameRegex": "(SmartExecutor)|(smart-executor)", + "calledMethodRegex": ".*((getAvailablePlugins.*)|(GET \/plugins(\/){0,1}$))" + }, + "replace": { + "serviceClass": "VREManagement", + "serviceName": "smart-executor", + "calledMethod": "getAvailablePlugins" + } +},{ + "match": { + "serviceClassRegex": "VREManagement", + "serviceNameRegex": "(SmartExecutor)|(smart-executor)", + "calledMethodRegex": ".*((getScheduledExecution.*)|(GET .*executions(\/){0,1}$))" + }, + "replace": { + "serviceClass": "VREManagement", + "serviceName": "smart-executor", + "calledMethod": "getScheduledExecution" + } +},{ + "match": { + "serviceClassRegex": "VREManagement", + "serviceNameRegex": "(SmartExecutor)|(smart-executor)", + "calledMethodRegex": ".*((getStateEvolution)|(getState)|(GET .*executions\/.{1,})).*" + }, + "replace": { + "serviceClass": "VREManagement", + "serviceName": "smart-executor", + "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": "smart-executor", + "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" + } +}] diff --git a/src/test/resources/rules/allRules.min.json b/src/test/resources/rules/allRules.min.json new file mode 100644 index 0000000..2ce2785 --- /dev/null +++ b/src/test/resources/rules/allRules.min.json @@ -0,0 +1 @@ +[{"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","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"^\/rest\/(api\/){0,1}licenses\/list"},"replace":{"serviceClass":"Data-Catalogue","serviceName":"Catalogue-WS","calledMethod":"/rest/api/licenses/list"}},{"match":{"serviceClassRegex":"Data-Catalogue","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"^\/rest\/api\/organi(s|z)ation(s){0,1}\/list"},"replace":{"serviceClass":"Data-Catalogue","serviceName":"Catalogue-WS","calledMethod":"/rest/api/organizations/list"}},{"match":{"serviceClassRegex":"Data-Catalogue","serviceNameRegex":"Catalogue-WS","calledMethodRegex":"^\/rest$|^UNKNOWN|^OTHER$"},"replace":{"serviceClass":"Data-Catalogue","serviceName":"Catalogue-WS","calledMethod":"OTHER"}},{"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","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}DescribeProcess.*"},"replace":{"serviceClass":"WPS","serviceName":"DataMiner","calledMethod":"describeProcess"}},{"match":{"serviceClassRegex":"WPS","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}GetCapabilities.*"},"replace":{"serviceClass":"WPS","serviceName":"DataMiner","calledMethod":"getCapabilities"}},{"match":{"serviceClassRegex":"WPS","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}RetrieveResult.*"},"replace":{"serviceClass":"WPS","serviceName":"DataMiner","calledMethod":"getResult"}},{"match":{"serviceClassRegex":"WPS","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}(WebProcessingService|UNKNOWN|OTHER|gcube\/resource\/scopes).*"},"replace":{"serviceClass":"WPS","serviceName":"DataMiner","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"WPS","serviceNameRegex":"DataMiner","calledMethodRegex":"^/{0,1}CancelComputation.*"},"replace":{"serviceClass":"WPS","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":"Index","serviceNameRegex":"FullTextIndexNode","calledMethodRegex":"^\/{0,1}delete.*"},"replace":{"serviceClass":"Index","serviceName":"FullTextIndexNode","calledMethod":"delete"}},{"match":{"serviceClassRegex":"Index","serviceNameRegex":"FullTextIndexNode","calledMethodRegex":"^\/{0,1}dropCollection.*"},"replace":{"serviceClass":"Index","serviceName":"FullTextIndexNode","calledMethod":"dropCollection"}},{"match":{"serviceClassRegex":"Index","serviceNameRegex":"FullTextIndexNode","calledMethodRegex":"^\/{0,1}insert.*"},"replace":{"serviceClass":"Index","serviceName":"FullTextIndexNode","calledMethod":"insert"}},{"match":{"serviceClassRegex":"Index","serviceNameRegex":"FullTextIndexNode","calledMethodRegex":"^\/{0,1}listCollections.*"},"replace":{"serviceClass":"Index","serviceName":"FullTextIndexNode","calledMethod":"listCollections"}},{"match":{"serviceClassRegex":"Index","serviceNameRegex":"FullTextIndexNode","calledMethodRegex":"^\/{0,1}search.*"},"replace":{"serviceClass":"Index","serviceName":"FullTextIndexNode","calledMethod":"search"}},{"match":{"serviceClassRegex":"geoanalytics","serviceNameRegex":"geoanalytics-gos","calledMethodRegex":".*GeoserverManagement.*"},"replace":{"serviceClass":"SDI","serviceName":"geoanalytics-gos","calledMethod":"GeoserverManagement"}},{"match":{"serviceClassRegex":"geoanalytics","serviceNameRegex":"geoanalytics-gos","calledMethodRegex":".*ShapeManagement.*"},"replace":{"serviceClass":"SDI","serviceName":"geoanalytics-gos","calledMethod":"ShapeManagement"}},{"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(\\..*|\\.*|@json|$)))"},"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)","serviceNameRegex":"(GeoServer)|(geoserver)","calledMethodRegex":"^(?!.*\/(wfs|wms|wcs|wmts)).*$"},"replace":{"serviceClass":"SDI","serviceName":"GeoServer","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"(GeoServer)|(geoserver)|(SpatialData)","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","serviceNameRegex":"GRSFPublisher","calledMethodRegex":"(.*publish-product.*)|(.*create-product.*)"},"replace":{"serviceClass":"Data-Catalogue","serviceName":"GRSFPublisher","calledMethod":"create"}},{"match":{"serviceClassRegex":"Data-Catalogue","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*delete-product.*"},"replace":{"serviceClass":"Data-Catalogue","serviceName":"GRSFPublisher","calledMethod":"delete"}},{"match":{"serviceClassRegex":"Data-Catalogue","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*get-catalogue-id-(and-url-){0,1}from-name.*"},"replace":{"serviceClass":"Data-Catalogue","serviceName":"GRSFPublisher","calledMethod":"getURLandIdFromName"}},{"match":{"serviceClassRegex":"Data-Catalogue","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*(hello)|(UNKNOWN)|(OTHER)|(get-licenses).*"},"replace":{"serviceClass":"Data-Catalogue","serviceName":"GRSFPublisher","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"Data-Catalogue","serviceNameRegex":"GRSFPublisher","calledMethodRegex":".*update-product.*"},"replace":{"serviceClass":"Data-Catalogue","serviceName":"GRSFPublisher","calledMethod":"update"}},{"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","calledMethodRegex":"^(?!(GET|HEAD|POST|PUT|DELETE|PURGE|OPTIONS|TRACE|CONNECT))\/.*"},"replace":{"serviceClass":"InformationSystem","serviceName":"resource-registry","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":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*BroodstockQuality.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"BroodstockQuality"}},{"match":{"serviceClassRegex":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*CurrentRating.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"CurrentRating"}},{"match":{"serviceClassRegex":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*FeedQuality.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"FeedQuality"}},{"match":{"serviceClassRegex":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*Modeler.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"Modeler"}},{"match":{"serviceClassRegex":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*Called Method.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"OTHER"}},{"match":{"serviceClassRegex":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*OxygenRating.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"OxygenRating"}},{"match":{"serviceClassRegex":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*Region.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"Region"}},{"match":{"serviceClassRegex":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*Scenario.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"Scenario"}},{"match":{"serviceClassRegex":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*Site.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"Site"}},{"match":{"serviceClassRegex":"Search","serviceNameRegex":"SimulFishGrowthData","calledMethodRegex":".*Species.*"},"replace":{"serviceClass":"Search","serviceName":"SimulFishGrowthData","calledMethod":"Species"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((launch)|(execute)|(POST .*executions)).*"},"replace":{"serviceClass":"VREManagement","serviceName":"smart-executor","calledMethod":"execute"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((getAvailablePlugins.*)|(GET \/plugins(\/){0,1}$))"},"replace":{"serviceClass":"VREManagement","serviceName":"smart-executor","calledMethod":"getAvailablePlugins"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((getScheduledExecution.*)|(GET .*executions(\/){0,1}$))"},"replace":{"serviceClass":"VREManagement","serviceName":"smart-executor","calledMethod":"getScheduledExecution"}},{"match":{"serviceClassRegex":"VREManagement","serviceNameRegex":"(SmartExecutor)|(smart-executor)","calledMethodRegex":".*((getStateEvolution)|(getState)|(GET .*executions\/.{1,})).*"},"replace":{"serviceClass":"VREManagement","serviceName":"smart-executor","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":"smart-executor","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/generate-all-rules.sh b/src/test/resources/rules/generate-all-rules.sh new file mode 100755 index 0000000..a889993 --- /dev/null +++ b/src/test/resources/rules/generate-all-rules.sh @@ -0,0 +1,12 @@ +#!/bin/bash +echo "[" > allRules.json +cat **/*.json >> allRules.json +echo "]" >> allRules.json +sed -i 's/}{/},{/g' allRules.json + + +tr -d '\n' < allRules.json > allRules.min.json +sed -i 's/\t//g' allRules.min.json +sed -i 's/ / /g' allRules.min.json +sed -i 's/": "/":"/g' allRules.min.json +sed -i 's/": {/":{/g' allRules.min.json \ No newline at end of file diff --git a/src/test/resources/rules/geoanalytics-gos/geoanalytics-gos-GeoserverManagement.json b/src/test/resources/rules/geoanalytics-gos/geoanalytics-gos-GeoserverManagement.json index 2024630..0240c5a 100644 --- a/src/test/resources/rules/geoanalytics-gos/geoanalytics-gos-GeoserverManagement.json +++ b/src/test/resources/rules/geoanalytics-gos/geoanalytics-gos-GeoserverManagement.json @@ -5,7 +5,7 @@ "calledMethodRegex": ".*GeoserverManagement.*" }, "replace": { - "serviceClass": "geoanalytics", + "serviceClass": "SDI", "serviceName": "geoanalytics-gos", "calledMethod": "GeoserverManagement" } diff --git a/src/test/resources/rules/geoanalytics-gos/geoanalytics-gos-ShapeManagement.json b/src/test/resources/rules/geoanalytics-gos/geoanalytics-gos-ShapeManagement.json index 5a74759..434b29e 100644 --- a/src/test/resources/rules/geoanalytics-gos/geoanalytics-gos-ShapeManagement.json +++ b/src/test/resources/rules/geoanalytics-gos/geoanalytics-gos-ShapeManagement.json @@ -5,7 +5,7 @@ "calledMethodRegex": ".*ShapeManagement.*" }, "replace": { - "serviceClass": "geoanalytics", + "serviceClass": "SDI", "serviceName": "geoanalytics-gos", "calledMethod": "ShapeManagement" } diff --git a/src/test/resources/rules/geoanalytics-main-service/geoanalytics-main-service-OTHER.json b/src/test/resources/rules/geoanalytics-main-service/geoanalytics-main-service-OTHER.json index 13df6f6..c03e711 100644 --- a/src/test/resources/rules/geoanalytics-main-service/geoanalytics-main-service-OTHER.json +++ b/src/test/resources/rules/geoanalytics-main-service/geoanalytics-main-service-OTHER.json @@ -5,7 +5,7 @@ "calledMethodRegex": ".*" }, "replace": { - "serviceClass": "geoanalytics", + "serviceClass": "SDI", "serviceName": "geoanalytics-main-service", "calledMethod": "OTHER" }