summaryrefslogtreecommitdiffstats
path: root/aai-traversal/bundleconfig-local/etc/query/stored-queries.properties
blob: 46e214850b16d71db41a602a542a5568c0230e8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
ucpe-instance=store('x').union(\
				__.out('locatedIn').has('aai-node-type', 'complex'),\
				__.out('locatedIn').has('aai-node-type', 'cloud-region').out('locatedIn').has('aai-node-type', 'complex')\
				).store('x').cap('x').unfold().dedup()
cloud-region-sites=has('aai-node-type', 'cloud-region').has('cloud-owner', owner).store('x').out('locatedIn').store('x').cap('x').unfold()
service-sites=has('global-customer-id', customerId).out('subscribesTo')\
				.has('service-type', type).out('hasInstance').store('x').in('hasInstance').has('aai-node-type', 'generic-vnf').store('x')\
				.out('runsOnVserver').union(\
					__.out('runsOnPserver').out('locatedIn'),\
					__.in('owns').in('has').has('aai-node-type', 'cloud-region')\
				).store('x')\
				.cap('x').unfold().dedup()
edge-tag=emit().repeat(__.union(__.outE().has(tag, true).inV(), __.inE().has(tag + "-REV", true).outV()).dedup())
ucpe-topology=store('x').union(\
                        __.out('hasPinterface').has('aai-node-type', 'p-interface')\
                        		.where(__.outE('usesPhysicalLink')).as('item').store('x')\
								.out('usesPhysicalLink').has('aai-node-type','physical-link').store('x')\
								.in('usesPhysicalLink').has('aai-node-type','p-interface').where(__.not(__.cap('item'))).store('x')\
                                .in('hasPinterface').has('aai-node-type','pnf').store('x'),\
                        __.in('runsOnPserver').has('aai-node-type', 'generic-vnf').store('x')\
                                .as('vnf').out('usesVnfImage').has('aai-node-type', 'vnf-image').store('x')\
                                .select('vnf')\
                                .out('hasInstance').has('aai-node-type', 'service-instance').store('x')\
                                .in('hasInstance').has('aai-node-type', 'service-subscription').store('x')\
                                .in('subscribesTo').has('aai-node-type', 'customer').store('x'),\
                        __.out('locatedIn').store('x'),\
                        __.in('runsOnPserver').has('aai-node-type', 'vserver').in('runsOnVserver').has('aai-node-type', 'generic-vnf').store('x')\
                                .as('vnf').out('usesVnfImage').has('aai-node-type', 'vnf-image').store('x')\
                                .select('vnf')\
                                .out('hasInstance').has('aai-node-type', 'service-instance').store('x')\
                                .in('hasInstance').has('aai-node-type', 'service-subscription').store('x')\
                                .in('subscribesTo').has('aai-node-type', 'customer').store('x')\
                        ).cap('x').unfold().dedup()
pnf-topology=store('x').union(\
				__.out('hasPinterface').has('aai-node-type', 'p-interface').where(__.outE('usesPhysicalLink')).as('item').store('x')\
				.out('usesPhysicalLink').has('aai-node-type','physical-link').store('x')\
				.in('usesPhysicalLink').has('aai-node-type','p-interface').where(__.not(__.cap('item'))).store('x')\
				.in('hasPinterface').has('aai-node-type', P.within('pserver', 'pnf')).store('x'),\
				__.out('locatedIn').store('x')\
				).cap('x').unfold().dedup()
topology-summary=store('x').union(\
						__.out('uses').has('aai-node-type', 'vnfc').store('x'),\
						__.out('runsOnVserver').store('x').union(\
							__.out('hosts').has('aai-node-type', 'vnfc').store('x'),\
							__.in('owns').has('aai-node-type', 'tenant').store('x').in('has').has('aai-node-type', 'cloud-region').store('x'),\
							__.out('hasImage').store('x'),\
							__.out('hasFlavor').store('x'),\
							__.out('runsOnPserver').store('x').out('locatedIn').store('x'))\
						).cap('x').unfold().dedup()
v2-legacy-subgraph=store('x').union(\
                    __.out('hasFlavor'), \
                    __.out('hasImage'), \
                    __.out('runsOnPserver').store('x').out('locatedIn').has('aai-node-type', 'complex')\
                ).store('x').cap('x').unfold()
                
sites-byCountryFilterCloudRegionVer=where(\
		__.out('usesL3Network').has('aai-node-type', 'l3-network')\
		.in('uses').has('aai-node-type', 'cloud-region').has('cloud-region-version', cloudRegionVersion))\
		.store('x').cap('x').unfold().dedup()
 
sites-byCloudRegionId=out('uses').has('aai-node-type', 'l3-network')\
                .in('usesL3Network').has('aai-node-type', 'complex')\
                .store('x').cap('x').unfold().dedup()

site-l3network-cloudRegion=store('x')\
			.out('usesL3Network').store('x')\
			.in('uses').has('aai-node-type', 'cloud-region').store('x').cap('x').unfold()
		
sites-byCountryFilterCloudRegionId=where(\
  		__.out('usesL3Network').in('uses').has('aai-node-type', 'cloud-region').has('cloud-region-id', cloudRegionId))\
  		.store('x').cap('x').unfold().dedup()
  		
complex-fromVnf=store('x').union(\
							__.out('runsOnPserver').has('aai-node-type', 'pserver').store('x')\
								.out('locatedIn').has('aai-node-type','complex'),\
							__.out('runsOnVserver').has('aai-node-type','vserver')\
								.out('runsOnPserver').has('aai-node-type', 'pserver').store('x')\
								.out('locatedIn').has('aai-node-type','complex')\
							).store('x').cap('x').unfold().dedup()		

colocated-devices=store('x').union(\
				__.out('hasPinterface').store('x').out('usesPhysicalLink').store('x'),\
				__.out('locatedIn').has('aai-node-type', 'complex')\
				.union(\
					__.in('locatedIn').has('aai-node-type', 'pserver').store('x')\
						.out('hasPinterface').store('x').out('usesPhysicalLink').store('x'),\
					__.in('locatedIn').has('aai-node-type', 'pnf').store('x')\
						.out('hasPinterface').store('x').out('usesPhysicalLink').store('x')\
				)).cap('x').unfold().dedup()

pservers-fromVnf=union(\
                __.out('runsOnPserver').store('x'),\
                __.out('runsOnVserver').out('runsOnPserver').store('x')\
                ).cap('x').unfold().dedup()

cloudRegion-fromNfType=out('runsOnVserver').in('owns').has('aai-node-type', 'tenant').in('has').has('aai-node-type','cloud-region')\
  						.store('x').cap('x').unfold().dedup()

nfType-fromCloudRegion=out('has').has('aai-node-type','tenant').out('owns').has('aai-node-type','vserver').in('runsOnVserver').has('aai-node-type','generic-vnf')\
  						.store('x').cap('x').unfold().dedup()

vnf-topology-fromServiceInstance=store('x').union(\
									__.in('hasInstance').has('aai-node-type', 'service-subscription').in('subscribesTo').has('aai-node-type','customer').store('x'),\
									__.out('has').has('aai-node-type','allotted-resource').store('x'),\
							 		__.in('hasInstance').has('aai-node-type', 'generic-vnf').store('x').union(\
										__.out('has').has('aai-node-type','vf-module').store('x'),\
										__.out('uses').has('aai-node-type','volume-group').store('x'),\
										__.out('hasLInterface').has ('aai-node-type','l-interface').union(\
											  __.out('hasIpAddress').has('aai-node-type','l3-interface-ipv4-address-list').store('x').out('isMemberOf').has('aai-node-type','l3-network').store('x'),\
											  __.out('hasIpAddress').has('aai-node-type','l3-interface-ipv6-address-list').store('x').out('isMemberOf').has('aai-node-type','l3-network').store('x')\
										  ),\
										__.out('runsOnVserver').has('aai-node-type','vserver').store('x').union(\
												__.in('owns').has('aai-node-type','tenant').store('x').in('has').has('aai-node-type','cloud-region').store('x'),\
												__.out('runsOnPserver').has('aai-node-type','pserver').store('x'),\
												__.out('hasLInterface').has('aai-node-type','l-interface').out('hasIpAddress').has('aai-node-type','l3-interface-ipv4-address-list').store('x').out('isMemberOf').has('aai-node-type','l3-network').store('x'),\
												__.out('hasLInterface').has('aai-node-type','l-interface').out('hasIpAddress').has('aai-node-type','l3-interface-ipv6-address-list').store('x').out('isMemberOf').has('aai-node-type','l3-network').store('x')\
										)\
									)\
								).cap('x').unfold().dedup()

vnf-topology-fromVnf=store('x').union(\
							   __.out('hasInstance').has('aai-node-type', 'service-instance').store('x').union(\
															__.in('hasInstance').has('aai-node-type', 'service-subscription').in('subscribesTo').has('aai-node-type','customer').store('x'),\
															__.out('has').has('aai-node-type','allotted-resource').store('x')\
                                                          ),\
  								__.out('has').has('aai-node-type','vf-module').store('x'),\
								__.out('uses').has('aai-node-type','volume-group').store('x'),\
								__.out('hasLInterface').has ('aai-node-type','l-interface').union(\
																								   __.out('hasIpAddress').has('aai-node-type','l3-interface-ipv4-address-list').store('x').out('isMemberOf').has('aai-node-type','l3-network').store('x'),\
																								   __.out('hasIpAddress').has('aai-node-type','l3-interface-ipv6-address-list').store('x').out('isMemberOf').has('aai-node-type','l3-network').store('x')\
																								 ),\
								__.out('runsOnVserver').has('aai-node-type','vserver').store('x').union(\
																										__.in('owns').has('aai-node-type','tenant').store('x').in('has').has('aai-node-type','cloud-region').store('x'),\
																										__.out('runsOnPserver').has('aai-node-type','pserver').store('x'),\
																										__.out('hasLInterface').has('aai-node-type','l-interface').out('hasIpAddress').has('aai-node-type','l3-interface-ipv4-address-list').store('x').out('isMemberOf').has('aai-node-type','l3-network').store('x'),\
																										__.out('hasLInterface').has('aai-node-type','l-interface').out('hasIpAddress').has('aai-node-type','l3-interface-ipv6-address-list').store('x').out('isMemberOf').has('aai-node-type','l3-network').store('x')\
																										)\
									).cap('x').unfold().dedup()

vnf-topology-fromVfModule=in('has').has('aai-node-type', 'generic-vnf').store('x').union(\
							     __.out('hasInstance').has('aai-node-type', 'service-instance').store('x').union(\
															__.in('hasInstance').has('aai-node-type', 'service-subscription').in('subscribesTo').has('aai-node-type','customer').store('x'),\
															__.out('has').has('aai-node-type','allotted-resource').store('x')\
                                                          ),\
  								__.out('has').has('aai-node-type','vf-module').store('x'),\
								__.out('uses').has('aai-node-type','volume-group').store('x'),\
								__.out('hasLInterface').has ('aai-node-type','l-interface').union(\
																								   __.out('hasIpAddress').has('aai-node-type','l3-interface-ipv4-address-list').store('x').out('isMemberOf').has('aai-node-type','l3-network').store('x'),\
																								   __.out('hasIpAddress').has('aai-node-type','l3-interface-ipv6-address-list').store('x').out('isMemberOf').has('aai-node-type','l3-network').store('x')\
																								 ),\
								__.out('runsOnVserver').has('aai-node-type','vserver').store('x').union(\
																										__.in('owns').has('aai-node-type','tenant').store('x').in('has').has('aai-node-type','cloud-region').store('x'),\
																										__.out('runsOnPserver').has('aai-node-type','pserver').store('x'),\
																										__.out('hasLInterface').has('aai-node-type','l-interface').out('hasIpAddress').has('aai-node-type','l3-interface-ipv4-address-list').store('x').out('isMemberOf').has('aai-node-type','l3-network').store('x'),\
																										__.out('hasLInterface').has('aai-node-type','l-interface').out('hasIpAddress').has('aai-node-type','l3-interface-ipv6-address-list').store('x').out('isMemberOf').has('aai-node-type','l3-network').store('x')\
																										)\
									).cap('x').unfold().dedup()									

cloudRegion-fromCountry=in('locatedIn').has('aai-node-type','cloud-region')\
								.store('x').cap('x').unfold().dedup()
cloudRegion-fromCountryCloudRegionVersion=in('locatedIn').has('aai-node-type','cloud-region').has('cloud-region-version', cloudRegionVersion)\
												.store('x').cap('x').unfold().dedup()
locationNetTypeNetRole-fromCloudRegion=store('x').out('locatedIn').has('aai-node-type','complex').store('x')\
											.out('usesL3Network').has('aai-node-type','l3-network')\
												.store('x').cap('x').unfold().dedup()
images-fromCloudRegionNfType=out('has').has('aai-node-type','tenant')\
			.out('owns').has('aai-node-type','vserver').where(\
			__.in('runsOnVserver').has('aai-node-type','generic-vnf').has('nf-type',nfType)\
		).out('hasImage').has('aai-node-type','image').store('x').cap('x').unfold().dedup()

cloudRegion-fromNfTypeVendorVersion=in('hasImage').has('aai-node-type','vserver').where(\
					__.in('runsOnVserver').has('aai-node-type','generic-vnf').has('nf-type',nfType)\
				).in('owns').has('aai-node-type','tenant').in('has').has('aai-node-type','cloud-region')\
				.store('x').cap('x').unfold().dedup()
vnf-instances-fromServiceInstancebyModelVersion=in('hasInstance').has('aai-node-type', 'generic-vnf')\
			.has('vnf-type', vnfType).has('model-version-id-local', modelVersionId)\
			.store('x').cap('x').unfold().dedup()