use of net.juniper.contrail.api.ApiConnector in project cloudstack by apache.
the class ServerDBSyncImpl method deleteInstanceIps.
private void deleteInstanceIps(List<ObjectReference<ApiPropertyBase>> list, StringBuffer syncLogMesg) throws IOException {
if (list == null) {
return;
}
final ApiConnector api = _manager.getApiConnector();
for (ObjectReference<ApiPropertyBase> instIp : list) {
api.delete(InstanceIp.class, instIp.getUuid());
syncLogMesg.append("VNC instance ip: " + instIp.getUuid() + " deleted\n");
}
}
use of net.juniper.contrail.api.ApiConnector in project cloudstack by apache.
the class ServerDBSyncImpl method deleteFloatingIp.
public void deleteFloatingIp(FloatingIp vnc, StringBuffer syncLogMesg) throws IOException {
final ApiConnector api = _manager.getApiConnector();
syncLogMesg.append("fip# DB: none; VNC: " + vnc.getAddress() + "(" + vnc.getUuid() + "); action: delete\n");
api.delete(vnc);
syncLogMesg.append("fip# VNC: " + vnc.getUuid() + " deleted\n");
}
use of net.juniper.contrail.api.ApiConnector in project cloudstack by apache.
the class ServerDBSyncImpl method deleteVirtualMachine.
public void deleteVirtualMachine(VirtualMachine vncVm, StringBuffer syncLogMesg) {
final ApiConnector api = _manager.getApiConnector();
syncLogMesg.append("VM# DB:none; VNC: " + vncVm.getName() + "/" + vncVm.getUuid() + "; action: delete\n");
if (!_rwMode) {
return;
}
try {
if (!api.read(vncVm)) {
return;
}
deleteVirtualMachineInterfaces(vncVm.getVirtualMachineInterfaces(), syncLogMesg);
api.delete(VirtualMachine.class, vncVm.getUuid());
} catch (IOException ex) {
s_logger.warn("delete virtual-machine", ex);
return;
}
syncLogMesg.append("VM# VNC: " + vncVm.getName() + " deleted\n");
}
use of net.juniper.contrail.api.ApiConnector in project cloudstack by apache.
the class ServerDBSyncImpl method deleteServiceInstance.
public void deleteServiceInstance(ServiceInstance siObj, StringBuffer logMsg) {
final ApiConnector api = _manager.getApiConnector();
s_logger.debug("delete " + siObj.getQualifiedName());
if (!_rwMode) {
return;
}
try {
api.delete(siObj);
} catch (IOException ex) {
s_logger.warn("service-instance delete", ex);
}
}
use of net.juniper.contrail.api.ApiConnector in project cloudstack by apache.
the class ServerDBSyncImpl method createDomain.
@Override
public void createDomain(DomainVO db, StringBuffer syncLogMesg) throws IOException {
final ApiConnector api = _manager.getApiConnector();
net.juniper.contrail.api.types.Domain vnc = new net.juniper.contrail.api.types.Domain();
vnc.setName(db.getName());
vnc.setUuid(db.getUuid());
if (!api.create(vnc)) {
s_logger.error("Unable to create domain " + vnc.getName());
syncLogMesg.append("Error: Virtual domain# VNC : Unable to create domain: " + vnc.getName() + "\n");
return;
}
syncLogMesg.append("Domain# VNC: " + vnc.getName() + " created \n");
}
Aggregations