use of com.cloud.network.VirtualRouterProvider in project CloudStack-archive by CloudStack-extras.
the class CreateVirtualRouterElementCmd method execute.
@Override
public void execute() {
UserContext.current().setEventDetails("Virtual router element Id: " + getEntityId());
VirtualRouterProvider result = _service.getCreatedElement(getEntityId());
if (result != null) {
VirtualRouterProviderResponse response = _responseGenerator.createVirtualRouterProviderResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add Virtual Router entity to physical network");
}
}
use of com.cloud.network.VirtualRouterProvider in project cloudstack by apache.
the class CreateInternalLoadBalancerElementCmd method execute.
@Override
public void execute() {
CallContext.current().setEventDetails("Virtual router element Id: " + getEntityId());
VirtualRouterProvider result = _service.get(0).getInternalLoadBalancerElement(getEntityId());
if (result != null) {
InternalLoadBalancerElementResponse response = _responseGenerator.createInternalLbElementResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to add Virtual Router entity to physical network");
}
}
use of com.cloud.network.VirtualRouterProvider in project cloudstack by apache.
the class ListInternalLoadBalancerElementsCmd method execute.
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
List<? extends VirtualRouterProvider> providers = _service.searchForInternalLoadBalancerElements(getId(), getNspId(), getEnabled());
ListResponse<InternalLoadBalancerElementResponse> response = new ListResponse<InternalLoadBalancerElementResponse>();
List<InternalLoadBalancerElementResponse> providerResponses = new ArrayList<InternalLoadBalancerElementResponse>();
for (VirtualRouterProvider provider : providers) {
InternalLoadBalancerElementResponse providerResponse = _responseGenerator.createInternalLbElementResponse(provider);
providerResponses.add(providerResponse);
}
response.setResponses(providerResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.network.VirtualRouterProvider in project cloudstack by apache.
the class ConfigureInternalLoadBalancerElementCmd method execute.
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
CallContext.current().setEventDetails("Internal load balancer element: " + id);
VirtualRouterProvider result = _service.get(0).configureInternalLoadBalancerElement(getId(), getEnabled());
if (result != null) {
InternalLoadBalancerElementResponse routerResponse = _responseGenerator.createInternalLbElementResponse(result);
routerResponse.setResponseName(getCommandName());
this.setResponseObject(routerResponse);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to configure the internal load balancer element");
}
}
use of com.cloud.network.VirtualRouterProvider in project cloudstack by apache.
the class ConfigureVirtualRouterElementCmd method execute.
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
CallContext.current().setEventDetails("Virtual router element: " + id);
VirtualRouterProvider result = _service.get(0).configure(this);
if (result != null) {
VirtualRouterProviderResponse routerResponse = _responseGenerator.createVirtualRouterProviderResponse(result);
if (routerResponse != null) {
routerResponse.setResponseName(getCommandName());
this.setResponseObject(routerResponse);
}
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to configure the virtual router provider");
}
}
Aggregations