Skip to content

Commit e6bfd7a

Browse files
committed
change PhysicalNetworkTrafficType.isolationMethods -> string
1 parent 5336de2 commit e6bfd7a

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

api/src/main/java/org/apache/cloudstack/api/response/PhysicalNetworkResponse.java

Lines changed: 4 additions & 0 deletions
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
}

api/src/main/java/org/apache/cloudstack/api/response/TrafficTypeResponse.java

Lines changed: 4 additions & 5 deletions
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

@@ -64,7 +62,7 @@ public class TrafficTypeResponse extends BaseResponse {
6462

6563
@SerializedName(ApiConstants.ISOLATION_METHODS)
6664
@Param(description = "isolation methods for the physical network traffic")
67-
private List<String> isolationMethods;
65+
private String isolationMethods;
6866

6967
@SerializedName(ApiConstants.OVM3_NETWORK_LABEL)
7068
@Param(description = "The network name of the physical device dedicated to this traffic on an OVM3 host")
@@ -139,13 +137,14 @@ public void setOvm3Label(String ovm3Label) {
139137
this.ovm3NetworkLabel = ovm3Label;
140138
}
141139

142-
public List<String> getIsolationMethods() {
140+
public String getIsolationMethods() {
143141
return isolationMethods;
144142
}
145143

146-
public void setIsolationMethods(List<String> isolationMethods) {
144+
public void setIsolationMethods(String isolationMethods) {
147145
this.isolationMethods = isolationMethods;
148146
}
147+
149148
public String getVlan() {
150149
return vlan;
151150
}

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

Lines changed: 4 additions & 1 deletion
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)