Skip to content

Commit 5d7236d

Browse files
committed
change PhysicalNetworkTrafficType.isolationMethods -> string
1 parent caa85fe commit 5d7236d

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

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

+4
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ public void setIsolationMethods(List<String> isolationMethods) {
139139
this.isolationMethods = buf.delete(buf.length() - 1, buf.length()).toString();
140140
}
141141

142+
public String getIsolationMethods() {
143+
return isolationMethods;
144+
}
145+
142146
public void setName(String name) {
143147
this.name = name;
144148
}

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

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

28-
import java.util.List;
29-
3028
@EntityReference(value = PhysicalNetworkTrafficType.class)
3129
public class TrafficTypeResponse extends BaseResponse {
3230

@@ -67,7 +65,7 @@ public class TrafficTypeResponse extends BaseResponse {
6765

6866
@SerializedName(ApiConstants.ISOLATION_METHODS)
6967
@Param(description = "isolation methods for the physical network traffic")
70-
private List<String> isolationMethods;
68+
private String isolationMethods;
7169

7270
@SerializedName(ApiConstants.OVM3_NETWORK_LABEL)
7371
@Param(description = "The network name of the physical device dedicated to this traffic on an OVM3 host")
@@ -142,13 +140,14 @@ public void setOvm3Label(String ovm3Label) {
142140
this.ovm3NetworkLabel = ovm3Label;
143141
}
144142

145-
public List<String> getIsolationMethods() {
143+
public String getIsolationMethods() {
146144
return isolationMethods;
147145
}
148146

149-
public void setIsolationMethods(List<String> isolationMethods) {
147+
public void setIsolationMethods(String isolationMethods) {
150148
this.isolationMethods = isolationMethods;
151149
}
150+
152151
public String getVlan() {
153152
return vlan;
154153
}

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -3082,7 +3082,10 @@ 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());
3085+
// using PhysicalNetworkResponse only to convert isolation methods to string
3086+
PhysicalNetworkResponse pnetResponse = new PhysicalNetworkResponse();
3087+
pnetResponse.setIsolationMethods(pnet.getIsolationMethods());
3088+
response.setIsolationMethods(pnetResponse.getIsolationMethods());
30863089
}
30873090
if (result.getTrafficType() != null) {
30883091
response.setTrafficType(result.getTrafficType().toString());

0 commit comments

Comments
 (0)