aboutsummaryrefslogtreecommitdiffstats
path: root/dcae-controller-core/dcae-controller-operation-utils/src/main/java/org/openecomp/dcae/controller/operation/utils/DcaePlatformConfiguration.groovy
diff options
context:
space:
mode:
Diffstat (limited to 'dcae-controller-core/dcae-controller-operation-utils/src/main/java/org/openecomp/dcae/controller/operation/utils/DcaePlatformConfiguration.groovy')
-rw-r--r--dcae-controller-core/dcae-controller-operation-utils/src/main/java/org/openecomp/dcae/controller/operation/utils/DcaePlatformConfiguration.groovy157
1 files changed, 0 insertions, 157 deletions
diff --git a/dcae-controller-core/dcae-controller-operation-utils/src/main/java/org/openecomp/dcae/controller/operation/utils/DcaePlatformConfiguration.groovy b/dcae-controller-core/dcae-controller-operation-utils/src/main/java/org/openecomp/dcae/controller/operation/utils/DcaePlatformConfiguration.groovy
index 234e98a..4f35b7e 100644
--- a/dcae-controller-core/dcae-controller-operation-utils/src/main/java/org/openecomp/dcae/controller/operation/utils/DcaePlatformConfiguration.groovy
+++ b/dcae-controller-core/dcae-controller-operation-utils/src/main/java/org/openecomp/dcae/controller/operation/utils/DcaePlatformConfiguration.groovy
@@ -38,7 +38,6 @@ import org.junit.After;
import groovy.text.SimpleTemplateEngine
import org.openecomp.ncomp.utils.CryptoUtils;
-import org.openecomp.ncomp.webservice.utils.IpUtils
class DcaePlatformConfiguration {
def env
@@ -428,162 +427,6 @@ class DcaePlatformConfiguration {
return res
}
- def eforc() {
- def res = [:]
- def list = []
- def d = [:]
- deploymentType.each { n, v ->
- d[n]=v
- }
- d['vm-all'] = [
- type : ['openstack-vm-type': networking ]
- ]
- d.each { n, v ->
-// println "n=$n v=${p(v)}"
- def x = [outbound:[:],inbound:[:]]
- res[n] = x
- def out
- if (n.startsWith('vm-')) {
- def vm = v.type['openstack-vm-type'] ?: [:]
-// println "n=$n vm=$vm"
- out = vm['application-outbound-security-rules'] ?: [:]
- }
- else {
- out = v.type['application-outbound-security-rules'] ?: [:]
- }
-// println "n=$n out=$out"
- out.each { n1, v1 ->
-// println "n1=$n1 v1=$v1 dest=${destination2deployment(n1,v1)}"
- if (v1['only-local']) return
- x.outbound[n1] = []
- findEndpoints(n).each { from ->
- destination2deployment(n1,v1).each { n2 ->
-// println "n1=$n1 v1=$v1 endpoints=${findEndpoints(n2,v1)}"
- findEndpoints(n2,v1).each { to ->
- if (from == to) return
- if (both_local(from,to)) return
- def ip1 = findIps(n,from)
- def ip2 = findIps(n2,to,v1)
- def ports = v1.ports ?: ( v1.port ?: 'TBD')
- def protocol = v1.protocol ?: 'tcp'
-// println "out=$n1 from=$from to=$to $ip1 $ip2"
- x.outbound[n1] += [
- from: "$n@$from($ip1)",
- to: "$n2@$to($ip2) ${protocol}:$ports",
- ]
- ip1.each { y1 ->
- def subnet1 = ip2subnet(y1,from)
- ip2.each { y2 ->
- def subnet2 = ip2subnet(y2,to)
- list += [[n,"in",n1,n,n2,from,to,y1,y2,subnet1,subnet2,protocol,ports]]
- }
- }
- }
- }
- }
- }
- def inn
- if (n.startsWith('vm-')) {
- def vm = v.type['openstack-vm-type'] ?: [:]
-// println "n=$n vm=$vm"
- inn = vm['application-inbound-security-rules'] ?: [:]
- }
- else {
- inn = v.type['application-inbound-security-rules'] ?: [:]
- }
-// println "n=$n in=$in"
- inn.each { n1, v1 ->
-// println "n1=$n1 v1=$v1"
- if (v1['only-local']) return
- x.inbound[n1] = []
- destination2deployment(n1,v1).each { n2 ->
- findEndpoints(n2,v1).each { from ->
- findEndpoints(n).each { to ->
- if (from == to) return
- if (both_local(from,to)) return
- def ip1 = findIps(n2,from,v1)
- def ip2 = findIps(n,to)
- def ports = v1.ports ?: [ ( v1.port ?: 'TBD') ]
- def protocol = v1.protocol ?: 'tcp'
- // println "in=$n1 from=$from to=$to $ip1 $ip2"
- x.inbound[n1] += [
- from: "$n2@$from($ip1)",
- to: "$n@$to($ip2) $protocol:$ports",
- ]
- ip1.each { y1 ->
- def subnet1 = ip2subnet(y1,from)
- ip2.each { y2 ->
- def subnet2 = ip2subnet(y2,to)
- list += [[n,"out",n1,n2,n,from,to,y1,y2,subnet1,subnet2,protocol,ports]]
- }
- }
- }
- }
- }
- }
-// println p(x)
-// println p(res)
-// System.exit(3)
- }
- def res1 = [:]
- res.each { n,v ->
- if (v.inbound.size()==0) v.inbound=null
- if (v.outbound.size()==0) v.outbound=null
- if (v.inbound == null && v.outbound ==null) return
- res1[n] = v
- }
- def m2 = [:]
- list.each { l ->
- def siteA = l[5]
- def siteB = l[6]
- def sA = l[9]
- def sB = l[10]
- def protocol = l[11]
- def ports = l[12]
- def k = "$siteA:$siteB:$sA:$sB:$protocol"
- if (m2[k] == null) {
- m2[k] = [
- siteA:siteA,
- siteB:siteB,
- subnetA:sA,
- subnetB:sB,
- protocol:protocol,
- ports : []
- ]
- }
- ports.each { port ->
- if ( ! m2[k].ports.contains(port))
- m2[k].ports.add(port)
- }
- }
- def list2 = []
- m2.each { n, v ->
- list2 += [ [ v.siteA, v.siteB, v.subnetA, v.subnetB, v.protocol, v.ports.join(":") ]]
- }
- return [m:res1,list:list,m2:m2,list2:list2]
- }
- def site2subnet = [:]
- def ip2subnet(ip,site) {
- if (tenants[site]== null) return ip
- if (! IpUtils.isIpv4(ip) ) return ip
- def subnets = tenants[site].subnets ?: []
- def res = null
- subnets.each { subnet ->
- if (res != null) return
- String[] a = subnet.split("/")
- def ip2 = a[0]
- def len = a[1]
- if (! IpUtils.isIpv4(ip2) || ! len.isInteger()) {
- println "Bad subnet: $subnet at $site"
- System.exit(2)
- }
- if (IpUtils.containedIn(IpUtils.toInetAddress(ip),IpUtils.toInetAddress(ip2),len.toInteger())) res = subnet
- }
- if (res != null) return res
- if (site2subnet[site] == null) site2subnet[site] = [] as Set
- site2subnet[site] += "${IpUtils.mask(IpUtils.toInetAddress(ip),29)}/29".substring(1)
- return "$ip not in any $site subnets"
- }
def both_local(from,to) {
if (tenants[from] == null || tenants[from].type != "opendcae-local-ntc") return false
if (tenants[to] == null || tenants[to].type != "opendcae-local-ntc") return false