Search in sources :

Example 1 with ApiPropertyBase

use of net.juniper.contrail.api.ApiPropertyBase in project cloudstack by apache.

the class ServerDBSyncImpl method deleteVirtualMachineInterfaces.

private void deleteVirtualMachineInterfaces(List<ObjectReference<ApiPropertyBase>> list, StringBuffer syncLogMesg) throws IOException {
    if (list == null) {
        return;
    }
    final ApiConnector api = _manager.getApiConnector();
    for (ObjectReference<ApiPropertyBase> vmiRef : list) {
        VirtualMachineInterface vmi = (VirtualMachineInterface) api.findById(VirtualMachineInterface.class, vmiRef.getUuid());
        deleteInstanceIps(vmi.getInstanceIpBackRefs(), syncLogMesg);
        deleteFloatingIps(vmi.getFloatingIpBackRefs(), syncLogMesg);
        api.delete(VirtualMachineInterface.class, vmiRef.getUuid());
        syncLogMesg.append("VNC vmi: " + vmi.getUuid() + " deleted\n");
    }
}
Also used : VirtualMachineInterface(net.juniper.contrail.api.types.VirtualMachineInterface) ApiConnector(net.juniper.contrail.api.ApiConnector) ApiPropertyBase(net.juniper.contrail.api.ApiPropertyBase)

Example 2 with ApiPropertyBase

use of net.juniper.contrail.api.ApiPropertyBase 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");
    }
}
Also used : ApiConnector(net.juniper.contrail.api.ApiConnector) ApiPropertyBase(net.juniper.contrail.api.ApiPropertyBase)

Aggregations

ApiConnector (net.juniper.contrail.api.ApiConnector)2 ApiPropertyBase (net.juniper.contrail.api.ApiPropertyBase)2 VirtualMachineInterface (net.juniper.contrail.api.types.VirtualMachineInterface)1