From 8eb3893cf74e9efab9c8ee45c8b2be135fc80fdb Mon Sep 17 00:00:00 2001 From: Venkata Harish K Kajur Date: Fri, 22 Sep 2017 12:33:52 -0400 Subject: Add stored queries for port mirroring Issue-ID: AAI-373 Change-Id: I3356400a0d63791c0f959053e8a2d9fb784de456 Signed-off-by: Venkata Harish K Kajur --- .../etc/query/stored-queries.properties | 79 +++++++++++++++++++--- 1 file changed, 68 insertions(+), 11 deletions(-) (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 243c218..6a7c344 100644 --- a/aai-traversal/bundleconfig-local/etc/query/stored-queries.properties +++ b/aai-traversal/bundleconfig-local/etc/query/stored-queries.properties @@ -207,7 +207,7 @@ vserverlogicallink-frompServer=builder.createEdgeTraversal(EdgeType.COUSIN, 'pse .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(\ @@ -238,15 +238,7 @@ spaas-topology-fromServiceInstance=builder.createEdgeTraversal(EdgeType.COUSIN, vnfs-fromServiceInstance=builder.createEdgeTraversal(EdgeType.COUSIN, 'service-instance', 'generic-vnf')\ .store('x').cap('x').unfold().dedup() - - -vnfs-fromPserver=builder.where(\ - builder.newInstance().union(\ - builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'pserver').getVerticesByProperty('hostname', hostname),\ - builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'vserver').createEdgeTraversal(EdgeType.COUSIN, 'vserver', 'pserver').getVerticesByProperty('hostname', hostname)\ - )\ - ).store('x').cap('x').unfold().dedup() - + linked-devices=builder.store('x').union(\ builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'generic-vnf', 'l-interface'),\ builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'generic-vnf', 'lag-interface'),\ @@ -272,6 +264,33 @@ linked-devices=builder.store('x').union(\ builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'l-interface', 'vserver')\ ).dedup().simplePath()\ ).store('x').cap('x').unfold().dedup() +vnfs-fromPserver=builder.where(\ + builder.newInstance().union(\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'pserver').getVerticesByProperty('hostname', hostname),\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'vserver').createEdgeTraversal(EdgeType.COUSIN, 'vserver', 'pserver').getVerticesByProperty('hostname', hostname)\ + )\ + ).store('x').cap('x').unfold().dedup() + +network-name-fromNetwork-role=builder.createEdgeTraversal(EdgeType.COUSIN, 'cloud-region', 'l3-network')\ + .getVerticesByProperty('network-role', networkRole).store('x')\ + .createEdgeTraversal(EdgeType.COUSIN, 'l3-network', 'network-policy').store('x')\ + .cap('x').unfold().dedup() + +vserver-fromVnf=builder.createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'vnfc')\ + .getVerticesByProperty('nfc-function', nfcFunction).store('x')\ + .createEdgeTraversal(EdgeType.COUSIN, 'vnfc', 'vserver').store('x')\ + .createEdgeTraversal(EdgeType.TREE, 'vserver', 'l-interface').store('x')\ + .union(\ + builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'l-interface', 'l3-interface-ipv4-address-list').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'l-interface', 'l3-interface-ipv6-address-list').store('x')\ + ).cap('x').unfold().dedup() + +cloud-region-fromVnf=builder.createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'vnfc').store('x')\ + .createEdgeTraversal(EdgeType.COUSIN, 'vnfc', 'vserver').store('x')\ + .createEdgeTraversal(EdgeType.TREE, 'vserver', 'tenant').store('x')\ + .createEdgeTraversal(EdgeType.TREE, 'tenant', 'cloud-region').store('x')\ + .cap('x').unfold().dedup() + topology-detail-fromVserver=builder.store('x').union(\ builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'vserver', 'l-interface').store('x').union(\ builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'l-interface', 'l3-interface-ipv4-address-list').store('x')\ @@ -343,10 +362,48 @@ pending-topology-detail=builder.store('x').union(\ ).dedup()\ ).cap('x').unfold().dedup() +pserver-fromConfiguration=builder.store('x').createEdgeTraversal(EdgeType.COUSIN, 'configuration', 'logical-link')\ + .union(\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'logical-link', 'l-interface').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'logical-link', 'pserver').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'logical-link', 'generic-vnf').store('x')\ + ).cap('x').unfold().dedup() + +pserver-fromConfigurationFilterInterfaceId=builder.store('x').createEdgeTraversal(EdgeType.COUSIN, 'configuration', 'logical-link')\ + .where(\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'logical-link', 'l-interface').getVerticesByProperty('interface-id', interfaceId).store('x')\ + )\ + .union(\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'logical-link', 'pserver').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'logical-link', 'generic-vnf').store('x')\ + ).cap('x').unfold().dedup() + +fn-topology=builder.union(\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'line-of-business', 'generic-vnf').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'service-instance', 'generic-vnf').store('x')\ + ).dedup()\ + .union(\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'vnfc').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'vserver').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'pserver').store('x'),\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'pnf').store('x')\ + )\ + .cap('x').unfold().dedup() so-request-vfModule=builder.store('x').union(\ builder.newInstance().createEdgeTraversal(EdgeType.TREE, 'vf-module', 'generic-vnf').store('x')\ .createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'service-instance').store('x'),\ builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'vf-module', 'vserver')\ .createEdgeTraversal(EdgeType.TREE, 'vserver', 'tenant').createEdgeTraversal(EdgeType.TREE, 'tenant', 'cloud-region').store('x'),\ builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'vf-module', 'volume-group').store('x')\ - ).cap('x').unfold().dedup() \ No newline at end of file + ).cap('x').unfold().dedup() + +owning-entity-fromService-instance=builder.createEdgeTraversal(EdgeType.COUSIN,'service-instance', 'owning-entity').store('x').cap('x').unfold().dedup() + +queryvnfFromModelbyRegion=builder.createEdgeTraversal(EdgeType.COUSIN, 'service-instance', 'generic-vnf')\ + .where(\ + builder.newInstance().createEdgeTraversal(EdgeType.COUSIN, 'generic-vnf', 'vserver')\ + .createEdgeTraversal(EdgeType.TREE, 'vserver', 'tenant')\ + .createEdgeTraversal(EdgeType.TREE, 'tenant', 'cloud-region')\ + .getVerticesByProperty('cloud-region-id', cloudRegionId)\ + ).store('x')\ + .cap('x').unfold().dedup() \ No newline at end of file -- cgit 1.2.3-korg