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