From e82cd004e6f3f80bac4b7c9a00a453a27fca7790 Mon Sep 17 00:00:00 2001 From: "Lin, Jerry (jl319x)" Date: Mon, 14 Aug 2017 12:47:28 -0400 Subject: [AAI-147 Amsterdam] add custom queries Change-Id: I0f03b5c63629a305d1156ff62902f872d50ff92d Signed-off-by: Lin, Jerry (jl319x) --- .../etc/query/stored-queries.properties | 56 +++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) (limited to 'aai-traversal/bundleconfig-local/etc/query') diff --git a/aai-traversal/bundleconfig-local/etc/query/stored-queries.properties b/aai-traversal/bundleconfig-local/etc/query/stored-queries.properties index 541cbc9..bc23513 100644 --- a/aai-traversal/bundleconfig-local/etc/query/stored-queries.properties +++ b/aai-traversal/bundleconfig-local/etc/query/stored-queries.properties @@ -180,4 +180,58 @@ cloudRegion-fromNfTypeVendorVersion=builder.createEdgeTraversal(EdgeType.COUSIN, .store('x').cap('x').unfold().dedup() vnf-instances-fromServiceInstancebyModelVersion=builder.createEdgeTraversal(EdgeType.COUSIN, 'service-instance', 'generic-vnf')\ .getVerticesByProperty('vnf-type', vnfType).getVerticesByProperty('model-version-id-local', modelVersionId)\ - .store('x').cap('x').unfold().dedup() \ No newline at end of file + .store('x').cap('x').unfold().dedup() + +topology-fromCloudRegionIdandServiceId=builder.createEdgeTraversal(EdgeType.TREE, 'cloud-region', 'availability-zone')\ + .createEdgeTraversal(EdgeType.COUSIN, 'availability-zone', 'generic-vnf').getVerticesByProperty('service-id',serviceId).union(\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'service-instance').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'vserver').store('x').union(\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'vserver', 'flavor').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'vserver', 'image').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'vserver', 'volume').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'vserver', 'vnfc').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'vserver', 'snapshot').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'vserver', 'vf-module').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'vserver', 'l-interface').store('x').union(\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'l-interface', 'logical-link').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'l-interface', 'l3-interface-ipv4-address-list').store('x')\ + .createEdgeTraversal(EdgeType.COUSIN, 'l3-interface-ipv4-address-list', 'subnet').store('x')\ + .createEdgeTraversal(EdgeType.TREE, 'subnet', 'l3-network').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'l-interface', 'l3-interface-ipv6-address-list').store('x')\ + .createEdgeTraversal(EdgeType.COUSIN, 'l3-interface-ipv6-address-list', 'subnet').store('x')\ + .createEdgeTraversal(EdgeType.TREE, 'subnet', 'l3-network').store('x')\ + )\ + )\ + ).cap('x').unfold().dedup() +vserverlogicallink-frompServer=builder.createEdgeTraversal(EdgeType.COUSIN, 'pserver', 'vserver').store('x')\ + .createEdgeTraversal(EdgeType.TREE, 'vserver', 'l-interface')\ + .createEdgeTraversal(EdgeType.COUSIN, 'l-interface', 'logical-link')\ + .store('x').cap('x').unfold().dedup() + +service-fromPserverandSubsName=builder.createEdgeTraversal(EdgeType.COUSIN, 'pserver', 'vserver')\ + .createEdgeTraversal(EdgeType.COUSIN, 'vserver', 'generic-vnf')\ + .createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'service-instance').where(\ + builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'service-instance', 'service-subscription').where(\ + builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'service-subscription', 'customer').getVerticesByProperty('subscriber-name', subscriberName)\ + ).store('x')\ + ).store('x').cap('x').unfold().dedup() + +spaas-topology-fromServiceInstance=builder.createEdgeTraversal(EdgeType.COUSIN, 'service-instance', 'generic-vnf')\ + .createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'vserver').store('x').union(\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'vserver', 'flavor').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'vserver', 'image').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'vserver', 'l-interface').store('x').union(\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'l-interface', 'logical-link').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'l-interface', 'l3-interface-ipv4-address-list').store('x')\ + .createEdgeTraversal(EdgeType.COUSIN, 'l3-interface-ipv4-address-list', 'subnet').store('x')\ + .createEdgeTraversal(EdgeType.TREE, 'subnet', 'l3-network').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'l-interface', 'l3-interface-ipv6-address-list').store('x')\ + .createEdgeTraversal(EdgeType.COUSIN, 'l3-interface-ipv6-address-list', 'subnet').store('x')\ + .createEdgeTraversal(EdgeType.TREE, 'subnet', 'l3-network').store('x')\ + ),\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'vserver', 'pserver').store('x').union(\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'pserver', 'complex').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'pserver', 'p-interface')\ + .createEdgeTraversal(EdgeType.COUSIN, 'p-interface', 'physical-link').store('x')\ + )\ + ).cap('x').unfold().dedup() -- cgit 1.2.3-korg