Added JSON query to be used to interact with new IS

This commit is contained in:
Luca Frosini 2022-12-02 17:44:33 +01:00
parent 9c9e57314a
commit 8638559d43
8 changed files with 297 additions and 3 deletions

View File

@ -28,6 +28,7 @@ import org.gcube.resourcemanagement.model.reference.entities.resources.Configura
import org.gcube.resourcemanagement.model.reference.entities.resources.EService;
import org.gcube.resourcemanagement.model.reference.entities.resources.VirtualService;
import org.gcube.resourcemanagement.model.reference.relations.consistsof.IsIdentifiedBy;
import org.gcube.resourcemanagement.model.reference.relations.isrelatedto.CallsFor;
import org.gcube.resourcemanagement.model.reference.relations.isrelatedto.IsCustomizedBy;
import org.gcube.resourcemanagement.model.reference.relations.isrelatedto.Uses;
import org.slf4j.Logger;
@ -141,7 +142,7 @@ public class RestISConfigurationProxy extends ISConfigurationProxy<Configuration
protected EService queryCkanService(ResourceRegistryClient resourceRegistryClient, VirtualService virtualService) throws ResourceRegistryException, JsonProcessingException {
List<EService> eServices = resourceRegistryClient.getRelatedResourcesFromReferenceResource(
EService.class, Uses.class, virtualService, Direction.IN, true);
EService.class, CallsFor.class, virtualService, Direction.IN, true);
int size = eServices.size();
if(eServices==null || size==0) {
String message = String.format(
@ -155,7 +156,7 @@ public class RestISConfigurationProxy extends ISConfigurationProxy<Configuration
if(size>1) {
String message = String.format(
"Too many %s <--%s-- (%s uuid:%s) found (i.e. expected 1, found %d)). %s",
EService.NAME, IsCustomizedBy.NAME, VirtualService.NAME,
EService.NAME, CallsFor.NAME, VirtualService.NAME,
virtualService.getHeader().getUUID(), size, ElementMapper.marshal(eServices));
logger.error(message);
throw new InternalServerErrorException(message);

View File

@ -0,0 +1,55 @@
{
"@class": "AccessPointFacet",
"_in": {
"@class": "ConsistsOf",
"source": {
"@class": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"group": "org.postgresql",
"name": "postgresql"
}
}
],
"isRelatedTo": [
{
"@class": "Uses",
"source": {
"@class": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"group": "ckan-organization",
"name": "ckan"
}
}
],
"isRelatedTo": [
{
"@class": "CallsFor",
"source": {
"@class": "VirtualService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"group": "org.gcube.data-catalogue",
"name": "catalogue-virtual-service"
}
}
]
}
}
]
}
}
]
}
}
}

View File

@ -0,0 +1,37 @@
{
"@class": "AccessPointFacet",
"_in": {
"@class": "ConsistsOf",
"source": {
"@class": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"group": "ckan-organization",
"name": "ckan"
}
}
],
"isRelatedTo": [
{
"@class": "CallsFor",
"source": {
"@class": "VirtualService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"group": "org.gcube.data-catalogue",
"name": "catalogue-virtual-service"
}
}
]
}
}
]
}
}
}

View File

@ -0,0 +1,55 @@
{
"@class": "AccessPointFacet",
"_in": {
"@class": "ConsistsOf",
"source": {
"@class": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"group": "org.apache.solr",
"name": "solr"
}
}
],
"isRelatedTo": [
{
"@class": "Uses",
"source": {
"@class": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"group": "ckan-organization",
"name": "ckan"
}
}
],
"isRelatedTo": [
{
"@class": "CallsFor",
"source": {
"@class": "VirtualService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"group": "org.gcube.data-catalogue",
"name": "catalogue-virtual-service"
}
}
]
}
}
]
}
}
]
}
}
}

View File

@ -0,0 +1,49 @@
{
"@class": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"group": "org.postgresql",
"name": "postgresql"
}
}
],
"isRelatedTo": [
{
"@class": "Uses",
"source": {
"@class": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"group": "ckan-organization",
"name": "ckan"
}
}
],
"isRelatedTo": [
{
"@class": "CallsFor",
"source": {
"@class": "VirtualService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"group": "org.gcube.data-catalogue",
"name": "catalogue-virtual-service"
}
}
]
}
}
]
}
}
]
}

View File

@ -0,0 +1,31 @@
{
"@class": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"group": "ckan-organization",
"name": "ckan"
}
}
],
"isRelatedTo": [
{
"@class": "CallsFor",
"source": {
"@class": "VirtualService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"group": "org.gcube.data-catalogue",
"name": "catalogue-virtual-service"
}
}
]
}
}
]
}

View File

@ -1,6 +1,5 @@
{
"@class": "SimpleFacet",
"_in": {
"@class": "ConsistsOf",
"source": {
@ -13,6 +12,24 @@
"value": "gcat-configuration"
}
}
],
"isRelatedTo": [
{
"@class": "IsCustomizedBy",
"source": {
"@class": "VirtualService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"group": "org.gcube.data-catalogue",
"name": "catalogue-virtual-service"
}
}
]
}
}
]
}
}

View File

@ -0,0 +1,49 @@
{
"@class": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"group": "org.apache.solr",
"name": "solr"
}
}
],
"isRelatedTo": [
{
"@class": "Uses",
"source": {
"@class": "EService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"group": "ckan-organization",
"name": "ckan"
}
}
],
"isRelatedTo": [
{
"@class": "CallsFor",
"source": {
"@class": "VirtualService",
"consistsOf": [
{
"@class": "IsIdentifiedBy",
"target": {
"@class": "SoftwareFacet",
"group": "org.gcube.data-catalogue",
"name": "catalogue-virtual-service"
}
}
]
}
}
]
}
}
]
}