Skip to content

Commit bc88d2e

Browse files
author
Murali Reddy
committed
specify which network service capabilities can be choosed as part of network offering
1 parent d836699 commit bc88d2e

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

api/src/com/cloud/api/ApiConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ public class ApiConstants {
281281
public static final String ACCOUNT_DETAILS = "accountdetails";
282282
public static final String SERVICE_PROVIDER_LIST = "serviceproviderlist";
283283
public static final String SERVICE_CAPABILITY_LIST = "servicecapabilitylist";
284+
public static final String CAN_CHOOSE_SERVICE_CAPABILITY = "canchooseservicecapability";
284285
public static final String PROVIDER = "provider";
285286
public static final String NETWORK_SPEED = "networkspeed";
286287
public static final String BROADCAST_DOMAIN_RANGE = "broadcastdomainrange";

api/src/com/cloud/api/response/CapabilityResponse.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public class CapabilityResponse extends BaseResponse {
2929
@SerializedName(ApiConstants.VALUE) @Param(description="the capability value")
3030
private String value;
3131

32+
@SerializedName(ApiConstants.CAN_CHOOSE_SERVICE_CAPABILITY) @Param(description="can this service capability value can be choosable while creatine network offerings")
33+
private boolean canChoose;
34+
3235
public String getName() {
3336
return name;
3437
}
@@ -44,4 +47,12 @@ public String getValue() {
4447
public void setValue(String value) {
4548
this.value = value;
4649
}
50+
51+
public boolean getCanChoose() {
52+
return canChoose;
53+
}
54+
55+
public void setCanChoose(boolean choosable) {
56+
this.canChoose = choosable;
57+
}
4758
}

server/src/com/cloud/api/ApiResponseHelper.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2606,7 +2606,7 @@ public NetworkOfferingResponse createNetworkOfferingResponse(NetworkOffering off
26062606
} else if (Service.Firewall.getName().equalsIgnoreCase(service)) {
26072607
List<CapabilityResponse> fwCapResponse = new ArrayList<CapabilityResponse>();
26082608
CapabilityResponse sharedSourceNat = new CapabilityResponse();
2609-
sharedSourceNat.setName(Capability.SupportedLBIsolation.getName());
2609+
sharedSourceNat.setName(Capability.SupportedSourceNatTypes.getName());
26102610
sharedSourceNat.setValue(offering.getSharedSourceNat()?"perzone":"peraccount");
26112611
fwCapResponse.add(sharedSourceNat);
26122612
svcRsp.setCapabilities(fwCapResponse);
@@ -3074,6 +3074,13 @@ public ServiceResponse createNetworkServiceResponse(Service service){
30743074
CapabilityResponse capabilityResponse = new CapabilityResponse();
30753075
capabilityResponse.setName(cap.getName());
30763076
capabilityResponse.setObjectName("capability");
3077+
if (cap.getName().equals(Capability.SupportedLBIsolation.getName()) ||
3078+
cap.getName().equals(Capability.SupportedSourceNatTypes.getName()) ||
3079+
cap.getName().equals(Capability.RedundantRouter.getName()) ) {
3080+
capabilityResponse.setCanChoose(true);
3081+
} else {
3082+
capabilityResponse.setCanChoose(false);
3083+
}
30773084
capabilityResponses.add(capabilityResponse);
30783085
}
30793086
response.setCapabilities(capabilityResponses);

0 commit comments

Comments
 (0)