mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fixes on merged result
This commit is contained in:
parent
924e556c95
commit
79e39c20fb
@ -52,6 +52,7 @@ public class CreateNetworkCmd extends BaseCmd {
|
||||
@Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="the display text of the network")
|
||||
private String displayText;
|
||||
|
||||
@IdentityMapper(entityTableName="network_offerings")
|
||||
@Parameter(name=ApiConstants.NETWORK_OFFERING_ID, type=CommandType.LONG, required=true, description="the network offering id")
|
||||
private Long networkOfferingId;
|
||||
|
||||
|
||||
27
server/src/com/cloud/Identity/dao/IdentityDao.java
Normal file
27
server/src/com/cloud/Identity/dao/IdentityDao.java
Normal file
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Copyright (C) 2011 Citrix Systems, Inc. All rights reserved.
|
||||
*
|
||||
* This software is licensed under the GNU General Public License v3 or later.
|
||||
*
|
||||
* It is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or any later version.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.cloud.Identity.dao;
|
||||
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
|
||||
public interface IdentityDao extends GenericDao<IdentityVO, Long> {
|
||||
Long getIdentityId(IdentityMapper mapper, String identityString);
|
||||
String getIdentityUuid(String tableName, String identityString);
|
||||
}
|
||||
27
server/src/com/cloud/Identity/dao/IdentityVO.java
Normal file
27
server/src/com/cloud/Identity/dao/IdentityVO.java
Normal file
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Copyright (C) 2011 Citrix Systems, Inc. All rights reserved.
|
||||
*
|
||||
* This software is licensed under the GNU General Public License v3 or later.
|
||||
*
|
||||
* It is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or any later version.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.cloud.Identity.dao;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
|
||||
/**
|
||||
* This is a dummy class to fit for CloudStack Dao framework
|
||||
*/
|
||||
@Entity
|
||||
public class IdentityVO {
|
||||
}
|
||||
@ -40,8 +40,8 @@ import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.PermissionDeniedException;
|
||||
import com.cloud.exception.ResourceAllocationException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.identity.dao.IdentityDao;
|
||||
import com.cloud.identity.dao.IdentityDaoImpl;
|
||||
import com.cloud.Identity.dao.IdentityDao;
|
||||
import com.cloud.Identity.dao.IdentityDaoImpl;
|
||||
import com.cloud.server.ManagementServer;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
@ -26,7 +26,6 @@ public class ApiGsonHelper {
|
||||
s_gBuilder = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
|
||||
s_gBuilder.setVersion(1.3);
|
||||
s_gBuilder.registerTypeAdapter(ResponseObject.class, new ResponseObjectTypeAdapter());
|
||||
s_gBuilder.registerTypeAdapter(IdentityProxy.class, new IdentityTypeAdapter());
|
||||
}
|
||||
|
||||
public static GsonBuilder getBuilder() {
|
||||
|
||||
@ -1189,11 +1189,6 @@ public class ApiResponseHelper implements ResponseGenerator {
|
||||
return vmResponses;
|
||||
}
|
||||
|
||||
userVmResponse.setId(userVm.getId());
|
||||
userVmResponse.setName(userVm.getInstanceName());
|
||||
userVmResponse.setDisplayName(userVm.getDisplayName());
|
||||
userVmResponse.setIpAddress(userVm.getPrivateIpAddress());
|
||||
userVmResponse.setHaEnable(userVm.isHaEnabled());
|
||||
|
||||
@Override
|
||||
public DomainRouterResponse createDomainRouterResponse(VirtualRouter router) {
|
||||
|
||||
@ -19,8 +19,8 @@ package com.cloud.api;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import com.cloud.identity.dao.IdentityDao;
|
||||
import com.cloud.identity.dao.IdentityDaoImpl;
|
||||
import com.cloud.Identity.dao.IdentityDao;
|
||||
import com.cloud.Identity.dao.IdentityDaoImpl;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
|
||||
@ -65,8 +65,7 @@ import com.cloud.host.dao.HostDetailsDaoImpl;
|
||||
import com.cloud.host.dao.HostTagsDaoImpl;
|
||||
import com.cloud.hypervisor.HypervisorGuruManagerImpl;
|
||||
import com.cloud.hypervisor.dao.HypervisorCapabilitiesDaoImpl;
|
||||
import com.cloud.identity.IdentityServiceImpl;
|
||||
import com.cloud.identity.dao.IdentityDaoImpl;
|
||||
import com.cloud.Identity.dao.IdentityDaoImpl;
|
||||
import com.cloud.keystore.KeystoreDaoImpl;
|
||||
import com.cloud.keystore.KeystoreManagerImpl;
|
||||
import com.cloud.maint.UpgradeManagerImpl;
|
||||
@ -158,6 +157,7 @@ import com.cloud.utils.component.ComponentLibraryBase;
|
||||
import com.cloud.utils.component.ComponentLocator.ComponentInfo;
|
||||
import com.cloud.utils.component.Manager;
|
||||
import com.cloud.utils.db.GenericDao;
|
||||
import com.cloud.uuididentity.IdentityServiceImpl;
|
||||
import com.cloud.vm.ClusteredVirtualMachineManagerImpl;
|
||||
import com.cloud.vm.ItWorkDaoImpl;
|
||||
import com.cloud.vm.UserVmManagerImpl;
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.cloud.identity.dao;
|
||||
package com.cloud.Identity.dao;
|
||||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
package com.cloud.identity;
|
||||
package com.cloud.uuididentity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -24,7 +24,7 @@ import javax.naming.ConfigurationException;
|
||||
|
||||
import com.cloud.api.IdentityMapper;
|
||||
import com.cloud.api.IdentityService;
|
||||
import com.cloud.identity.dao.IdentityDao;
|
||||
import com.cloud.Identity.dao.IdentityDao;
|
||||
import com.cloud.utils.component.Inject;
|
||||
import com.cloud.utils.component.Manager;
|
||||
|
||||
@ -75,32 +75,6 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use
|
||||
"GROUP BY pod_id HAVING count(id) > 0 ORDER BY count(id) DESC";
|
||||
|
||||
private static final int VM_DETAILS_BATCH_SIZE=100;
|
||||
private static final String VM_DETAILS = "select vm_instance.id, vm_instance.uuid, " +
|
||||
"account.id, account.account_name, account.type, domain.name, instance_group.id, instance_group.name," +
|
||||
"data_center.id, data_center.name, data_center.is_security_group_enabled, host.id, host.name, " +
|
||||
"vm_template.id, vm_template.name, vm_template.display_text, iso.id, iso.name, " +
|
||||
"vm_template.enable_password, service_offering.id, disk_offering.name, storage_pool.id, storage_pool.pool_type, " +
|
||||
"service_offering.cpu, service_offering.speed, service_offering.ram_size, volumes.id, volumes.device_id, volumes.volume_type, security_group.id, security_group.name, " +
|
||||
"security_group.description, nics.id, nics.ip4_address, nics.gateway, nics.network_id, nics.netmask, nics.mac_address, nics.broadcast_uri, nics.isolation_uri, " +
|
||||
"networks.traffic_type, networks.guest_type, networks.is_default from vm_instance " +
|
||||
"left join account on vm_instance.account_id=account.id " +
|
||||
"left join domain on vm_instance.domain_id=domain.id " +
|
||||
"left join instance_group_vm_map on vm_instance.id=instance_group_vm_map.instance_id " +
|
||||
"left join instance_group on instance_group_vm_map.group_id=instance_group.id " +
|
||||
"left join data_center on vm_instance.data_center_id=data_center.id " +
|
||||
"left join host on vm_instance.host_id=host.id " +
|
||||
"left join vm_template on vm_instance.vm_template_id=vm_template.id " +
|
||||
"left join user_vm on vm_instance.id=user_vm.id " +
|
||||
"left join vm_template iso on iso.id=user_vm.iso_id " +
|
||||
"left join service_offering on vm_instance.service_offering_id=service_offering.id " +
|
||||
"left join disk_offering on vm_instance.service_offering_id=disk_offering.id " +
|
||||
"left join volumes on vm_instance.id=volumes.instance_id " +
|
||||
"left join storage_pool on volumes.pool_id=storage_pool.id " +
|
||||
"left join security_group_vm_map on vm_instance.id=security_group_vm_map.instance_id " +
|
||||
"left join security_group on security_group_vm_map.security_group_id=security_group.id " +
|
||||
"left join nics on vm_instance.id=nics.instance_id " +
|
||||
"left join networks on nics.network_id=networks.id " +
|
||||
"where vm_instance.id in (";
|
||||
|
||||
protected final UserVmDetailsDaoImpl _detailsDao = ComponentLocator.inject(UserVmDetailsDaoImpl.class);
|
||||
protected final NicDaoImpl _nicDao = ComponentLocator.inject(NicDaoImpl.class);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user