use of net.juniper.contrail.api.ApiConnector in project cloudstack by apache.
the class ServerDBSyncImpl method deleteFloatingIps.
private void deleteFloatingIps(List<ObjectReference<ApiPropertyBase>> list, StringBuffer syncLogMesg) throws IOException {
if (list == null) {
return;
}
final ApiConnector api = _manager.getApiConnector();
for (ObjectReference<?> floatingIp : list) {
api.delete(FloatingIp.class, floatingIp.getUuid());
syncLogMesg.append("VNC instance ip: " + floatingIp.getUuid() + " deleted\n");
}
}
use of net.juniper.contrail.api.ApiConnector in project cloudstack by apache.
the class ServerDBSyncImpl method deleteVirtualNetwork.
public void deleteVirtualNetwork(VirtualNetwork vnet, StringBuffer syncLogMesg) throws IOException {
final ApiConnector api = _manager.getApiConnector();
if (_manager.isSystemDefaultNetwork(vnet)) {
syncLogMesg.append("VN# System default virtual Network# VNC: " + vnet.getName() + " can not be deleted\n");
return;
}
api.read(vnet);
deleteInstanceIps(vnet.getInstanceIpBackRefs(), syncLogMesg);
List<ObjectReference<ApiPropertyBase>> fipPools = vnet.getFloatingIpPools();
if (fipPools != null && !fipPools.isEmpty()) {
FloatingIpPool floatingIpPool = (FloatingIpPool) api.findById(FloatingIpPool.class, fipPools.get(0).getUuid());
if (floatingIpPool != null) {
deleteFloatingIps(floatingIpPool.getFloatingIps(), syncLogMesg);
}
}
deleteVirtualMachineInterfaces(vnet.getVirtualMachineInterfaceBackRefs(), syncLogMesg);
syncLogMesg.append("VN# DB: none; VNC: " + vnet.getName() + "(" + vnet.getUuid() + "); action: delete\n");
api.delete(vnet);
syncLogMesg.append("VN# VNC: " + vnet.getName() + " deleted\n");
}
use of net.juniper.contrail.api.ApiConnector in project cloudstack by apache.
the class ServerDBSyncImpl method syncDomain.
/*
* Domain Synchronization methods
*/
public boolean syncDomain() throws Exception {
final ApiConnector api = _manager.getApiConnector();
try {
List<?> dbList = _domainDao.listAll();
@SuppressWarnings("unchecked") List<?> vncList = api.list(net.juniper.contrail.api.types.Domain.class, null);
return _dbSync.syncGeneric(net.juniper.contrail.api.types.Domain.class, dbList, vncList);
} catch (Exception ex) {
s_logger.warn("syncDomain", ex);
throw ex;
}
}
use of net.juniper.contrail.api.ApiConnector in project cloudstack by apache.
the class ServerDBSyncImpl method deleteSecurityGroup.
/*
* Security Groups
*/
public void deleteSecurityGroup(net.juniper.contrail.api.types.SecurityGroup vnc, StringBuffer syncLogMesg) throws IOException {
final ApiConnector api = _manager.getApiConnector();
api.delete(vnc);
syncLogMesg.append("SecurityGroup# VNC: " + vnc.getName() + " deleted\n");
}
use of net.juniper.contrail.api.ApiConnector in project cloudstack by apache.
the class ServerDBSyncImpl method deleteNetworkPolicy.
public void deleteNetworkPolicy(NetworkPolicy policy, StringBuffer syncLogMesg) throws IOException {
final ApiConnector api = _manager.getApiConnector();
if (_manager.isSystemDefaultNetworkPolicy(policy)) {
syncLogMesg.append("Policy# System default Network Policy# VNC: " + policy.getName() + " can not be deleted\n");
return;
}
syncLogMesg.append("Policy# DB: none; VNC: " + policy.getName() + "(" + policy.getUuid() + "); action: delete\n");
api.delete(policy);
syncLogMesg.append("Policy# VNC: " + policy.getName() + " deleted\n");
}
Aggregations