use of org.apache.cloudstack.api.response.NetworkACLResponse in project cloudstack by apache.
the class ListNetworkACLListsCmd method execute.
@Override
public void execute() {
Pair<List<? extends NetworkACL>, Integer> result = _networkACLService.listNetworkACLs(this);
ListResponse<NetworkACLResponse> response = new ListResponse<NetworkACLResponse>();
List<NetworkACLResponse> aclResponses = new ArrayList<NetworkACLResponse>();
for (NetworkACL acl : result.first()) {
NetworkACLResponse aclResponse = _responseGenerator.createNetworkACLResponse(acl);
aclResponses.add(aclResponse);
}
response.setResponses(aclResponses, result.second());
response.setResponseName(getCommandName());
setResponseObject(response);
}
use of org.apache.cloudstack.api.response.NetworkACLResponse in project cloudstack by apache.
the class CreateNetworkACLListCmd method execute.
@Override
public void execute() throws ResourceUnavailableException {
NetworkACL acl = _networkACLService.getNetworkACL(getEntityId());
if (acl != null) {
NetworkACLResponse aclResponse = _responseGenerator.createNetworkACLResponse(acl);
setResponseObject(aclResponse);
aclResponse.setResponseName(getCommandName());
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create network ACL");
}
}
use of org.apache.cloudstack.api.response.NetworkACLResponse in project cloudstack by apache.
the class UpdateNetworkACLListCmd method execute.
@Override
public void execute() throws ResourceUnavailableException {
NetworkACL acl = _networkACLService.updateNetworkACL(this);
NetworkACLResponse aclResponse = _responseGenerator.createNetworkACLResponse(acl);
setResponseObject(aclResponse);
aclResponse.setResponseName(getCommandName());
}
use of org.apache.cloudstack.api.response.NetworkACLResponse in project cloudstack by apache.
the class ApiResponseHelper method createNetworkACLResponse.
@Override
public NetworkACLResponse createNetworkACLResponse(NetworkACL networkACL) {
NetworkACLResponse response = new NetworkACLResponse();
response.setId(networkACL.getUuid());
response.setName(networkACL.getName());
response.setDescription(networkACL.getDescription());
response.setForDisplay(networkACL.isDisplay());
Vpc vpc = ApiDBUtils.findVpcById(networkACL.getVpcId());
if (vpc != null) {
response.setVpcId(vpc.getUuid());
}
response.setObjectName("networkacllist");
return response;
}
Aggregations