Skip to content

Commit caa85fe

Browse files
committed
set vlan, isolationMethods in createTrafficTypeResponse()
1 parent 0bc9276 commit caa85fe

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

Diff for: api/src/main/java/com/cloud/network/PhysicalNetworkTrafficType.java

+2
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,6 @@ public interface PhysicalNetworkTrafficType extends InternalIdentity, Identity {
4141
String getHypervNetworkLabel();
4242

4343
String getOvm3NetworkLabel();
44+
45+
String getVlan();
4446
}

Diff for: api/src/main/java/org/apache/cloudstack/api/response/TrafficTypeResponse.java

+11-8
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import com.cloud.network.PhysicalNetworkTrafficType;
2626
import com.cloud.serializer.Param;
2727

28+
import java.util.List;
29+
2830
@EntityReference(value = PhysicalNetworkTrafficType.class)
2931
public class TrafficTypeResponse extends BaseResponse {
3032

@@ -61,9 +63,11 @@ public class TrafficTypeResponse extends BaseResponse {
6163
@Param(description = "The VLAN id to be used for Management traffic by VMware host")
6264
private String vlan;
6365

64-
@SerializedName(ApiConstants.ISOLATION_METHOD)
65-
@Param(description = "The isolation method for the traffic")
66-
private String isolationMethod;
66+
67+
68+
@SerializedName(ApiConstants.ISOLATION_METHODS)
69+
@Param(description = "isolation methods for the physical network traffic")
70+
private List<String> isolationMethods;
6771

6872
@SerializedName(ApiConstants.OVM3_NETWORK_LABEL)
6973
@Param(description = "The network name of the physical device dedicated to this traffic on an OVM3 host")
@@ -138,14 +142,13 @@ public void setOvm3Label(String ovm3Label) {
138142
this.ovm3NetworkLabel = ovm3Label;
139143
}
140144

141-
public String getIsolationMethod() {
142-
return isolationMethod;
145+
public List<String> getIsolationMethods() {
146+
return isolationMethods;
143147
}
144148

145-
public void setIsolationMethod(String isolationMethod) {
146-
this.isolationMethod = isolationMethod;
149+
public void setIsolationMethods(List<String> isolationMethods) {
150+
this.isolationMethods = isolationMethods;
147151
}
148-
149152
public String getVlan() {
150153
return vlan;
151154
}

Diff for: server/src/main/java/com/cloud/api/ApiResponseHelper.java

+2
Original file line numberDiff line numberDiff line change
@@ -3082,6 +3082,7 @@ public TrafficTypeResponse createTrafficTypeResponse(PhysicalNetworkTrafficType
30823082
PhysicalNetwork pnet = ApiDBUtils.findPhysicalNetworkById(result.getPhysicalNetworkId());
30833083
if (pnet != null) {
30843084
response.setPhysicalNetworkId(pnet.getUuid());
3085+
response.setIsolationMethods(pnet.getIsolationMethods());
30853086
}
30863087
if (result.getTrafficType() != null) {
30873088
response.setTrafficType(result.getTrafficType().toString());
@@ -3092,6 +3093,7 @@ public TrafficTypeResponse createTrafficTypeResponse(PhysicalNetworkTrafficType
30923093
response.setVmwareLabel(result.getVmwareNetworkLabel());
30933094
response.setHypervLabel(result.getHypervNetworkLabel());
30943095
response.setOvm3Label(result.getOvm3NetworkLabel());
3096+
response.setVlan(result.getVlan());
30953097

30963098
response.setObjectName("traffictype");
30973099
return response;

0 commit comments

Comments
 (0)