mirror of https://github.com/apache/cloudstack.git
Add changes to service creation logic
This commit is contained in:
parent
4f6f39ec8c
commit
1459eeac42
|
|
@ -668,10 +668,10 @@ public class NsxApiClient {
|
|||
|
||||
List<com.vmware.nsx_policy.model.Service> services = serviceList.getResults();
|
||||
List<String> matchedDefaultSvc = services.parallelStream().filter(svc ->
|
||||
(svc.getServiceEntries().get(0) instanceof L4PortSetServiceEntry) &&
|
||||
((L4PortSetServiceEntry) svc.getServiceEntries().get(0)).getDestinationPorts().get(0).equals(port)
|
||||
&& (((L4PortSetServiceEntry) svc.getServiceEntries().get(0)).getL4Protocol().equals(protocol)))
|
||||
.map(svc -> ((L4PortSetServiceEntry) svc.getServiceEntries().get(0)).getDestinationPorts().get(0))
|
||||
(svc.getServiceEntries().get(0)._getDataValue().getField("resource_type").toString().equals("L4PortSetServiceEntry")) &&
|
||||
svc.getServiceEntries().get(0)._getDataValue().getField("destination_ports").toString().equals("["+port+"]")
|
||||
&& svc.getServiceEntries().get(0)._getDataValue().getField("l4_protocol").toString().equals(protocol))
|
||||
.map(svc -> svc.getServiceEntries().get(0)._getDataValue().getField("parent_path").toString())
|
||||
.collect(Collectors.toList());
|
||||
if (!CollectionUtils.isEmpty(matchedDefaultSvc)) {
|
||||
return matchedDefaultSvc.get(0);
|
||||
|
|
|
|||
|
|
@ -475,6 +475,7 @@ export default {
|
|||
fetchData () {
|
||||
this.networks = this.resource.network
|
||||
this.fetchMtuForZone()
|
||||
this.getVpcNetworkOffering()
|
||||
if (!this.networks || this.networks.length === 0) {
|
||||
return
|
||||
}
|
||||
|
|
@ -483,7 +484,6 @@ export default {
|
|||
this.fetchVMs(network.id)
|
||||
}
|
||||
this.publicLBNetworkExists()
|
||||
this.getVpcNetworkOffering()
|
||||
},
|
||||
fetchMtuForZone () {
|
||||
api('listZones', {
|
||||
|
|
@ -524,9 +524,9 @@ export default {
|
|||
api('listVPCOfferings', {
|
||||
id: this.resource.vpcofferingid
|
||||
}).then(json => {
|
||||
var vpcOffering = json?.listvpcofferingsresponse?.vpcoffering[0]
|
||||
this.isOfferingNatMode = vpcOffering?.nsxmode === 'NATTED' || false
|
||||
const vpcOffering = json?.listvpcofferingsresponse?.vpcoffering[0]
|
||||
resolve(vpcOffering)
|
||||
this.isOfferingNatMode = vpcOffering?.nsxmode === 'NATTED' || false
|
||||
}).catch(e => {
|
||||
reject(e)
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue