use of com.cloud.api.response.TrafficTypeResponse in project CloudStack-archive by CloudStack-extras.
the class UpdateTrafficTypeCmd method execute.
@Override
public void execute() {
PhysicalNetworkTrafficType result = _networkService.updatePhysicalNetworkTrafficType(getId(), getXenLabel(), getKvmLabel(), getVmwareLabel());
if (result != null) {
TrafficTypeResponse response = _responseGenerator.createTrafficTypeResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update traffic type");
}
}
use of com.cloud.api.response.TrafficTypeResponse in project CloudStack-archive by CloudStack-extras.
the class ListTrafficTypesCmd method execute.
@Override
public void execute() {
List<? extends PhysicalNetworkTrafficType> trafficTypes = _networkService.listTrafficTypes(getPhysicalNetworkId());
ListResponse<TrafficTypeResponse> response = new ListResponse<TrafficTypeResponse>();
List<TrafficTypeResponse> trafficTypesResponses = new ArrayList<TrafficTypeResponse>();
for (PhysicalNetworkTrafficType trafficType : trafficTypes) {
TrafficTypeResponse trafficTypeResponse = _responseGenerator.createTrafficTypeResponse(trafficType);
trafficTypesResponses.add(trafficTypeResponse);
}
response.setResponses(trafficTypesResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.TrafficTypeResponse in project CloudStack-archive by CloudStack-extras.
the class AddTrafficTypeCmd method execute.
@Override
public void execute() {
UserContext.current().setEventDetails("TrafficType Id: " + getEntityId());
PhysicalNetworkTrafficType result = _networkService.getPhysicalNetworkTrafficType(getEntityId());
if (result != null) {
TrafficTypeResponse response = _responseGenerator.createTrafficTypeResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add traffic type to physical network");
}
}
Aggregations