mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-11-04 00:02:37 +01:00 
			
		
		
		
	adding service capabities to network offering response
This commit is contained in:
		
							parent
							
								
									8f9a06fb41
								
							
						
					
					
						commit
						cbc72f3ef7
					
				@ -2337,10 +2337,7 @@ public class ApiResponseHelper implements ResponseGenerator {
 | 
			
		||||
        response.setIsDefault(offering.isDefault());
 | 
			
		||||
        response.setSpecifyVlan(offering.getSpecifyVlan());
 | 
			
		||||
        response.setAvailability(offering.getAvailability().toString());
 | 
			
		||||
        response.setNetworkRate(ApiDBUtils.getNetworkRate(offering.getId()));
 | 
			
		||||
        response.setIsLBShared(!offering.getDedicatedLB());
 | 
			
		||||
        response.setIsSourceNatShared(offering.getSharedSourceNat());
 | 
			
		||||
        response.setIsRedundantRouter(offering.getRedundantRouter());
 | 
			
		||||
        response.setNetworkRate(ApiDBUtils.getNetworkRate(offering.getId()));
 | 
			
		||||
        if (offering.getGuestType() != null) {
 | 
			
		||||
            response.setGuestIpType(offering.getGuestType().toString());
 | 
			
		||||
        }
 | 
			
		||||
@ -2359,6 +2356,30 @@ public class ApiResponseHelper implements ResponseGenerator {
 | 
			
		||||
                providers.add(providerRsp);
 | 
			
		||||
            }
 | 
			
		||||
            svcRsp.setProviders(providers);
 | 
			
		||||
 | 
			
		||||
            if (Service.Lb.getName().equalsIgnoreCase(service)) {
 | 
			
		||||
                List<CapabilityResponse> lbCapResponse = new ArrayList<CapabilityResponse>();
 | 
			
		||||
                CapabilityResponse lbIsoaltion = new CapabilityResponse();
 | 
			
		||||
                lbIsoaltion.setName(Capability.SupportedLBIsolation.getName());
 | 
			
		||||
                lbIsoaltion.setValue(offering.getDedicatedLB()?"dedicated":"shared");
 | 
			
		||||
                lbCapResponse.add(lbIsoaltion);
 | 
			
		||||
                svcRsp.setCapabilities(lbCapResponse);
 | 
			
		||||
            } else if (Service.Firewall.getName().equalsIgnoreCase(service)) {
 | 
			
		||||
                List<CapabilityResponse> fwCapResponse = new ArrayList<CapabilityResponse>();
 | 
			
		||||
                CapabilityResponse sharedSourceNat = new CapabilityResponse();
 | 
			
		||||
                sharedSourceNat.setName(Capability.SupportedLBIsolation.getName());
 | 
			
		||||
                sharedSourceNat.setValue(offering.getSharedSourceNat()?"perzone":"peraccount");
 | 
			
		||||
                fwCapResponse.add(sharedSourceNat);
 | 
			
		||||
                svcRsp.setCapabilities(fwCapResponse);
 | 
			
		||||
            } else if (Service.Gateway.getName().equalsIgnoreCase(service)) {
 | 
			
		||||
                List<CapabilityResponse> gatewayCapResponse = new ArrayList<CapabilityResponse>();
 | 
			
		||||
                CapabilityResponse redundantRouter = new CapabilityResponse();
 | 
			
		||||
                redundantRouter.setName(Capability.RedundantRouter.getName());
 | 
			
		||||
                redundantRouter.setValue(offering.getRedundantRouter()?"true":"false");
 | 
			
		||||
                gatewayCapResponse.add(redundantRouter);
 | 
			
		||||
                svcRsp.setCapabilities(gatewayCapResponse);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            serviceResponses.add(svcRsp);
 | 
			
		||||
        }
 | 
			
		||||
        response.setServices(serviceResponses);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user