use of net.juniper.contrail.api.ApiConnector in project cloudstack by apache.
the class InstanceIpModel method delete.
@Override
public void delete(ModelController controller) throws IOException {
ApiConnector api = controller.getApiAccessor();
if (_uuid != null) {
api.delete(InstanceIp.class, _uuid);
}
_uuid = null;
}
use of net.juniper.contrail.api.ApiConnector in project cloudstack by apache.
the class NetworkPolicyModel method delete.
@Override
public void delete(ModelController controller) throws IOException {
ApiConnector api = controller.getApiAccessor();
if (_policy != null) {
api.delete(_policy);
_policy = null;
}
}
use of net.juniper.contrail.api.ApiConnector in project cloudstack by apache.
the class ServiceInstanceModel method delete.
@Override
public void delete(ModelController controller) throws IOException {
ApiConnector api = controller.getApiAccessor();
clearServicePolicy(controller);
if (_serviceInstance != null) {
api.delete(_serviceInstance);
}
}
use of net.juniper.contrail.api.ApiConnector in project cloudstack by apache.
the class ServiceInstanceModel method createServiceInstance.
private ServiceInstance createServiceInstance(ModelController controller) {
Project project = null;
if (_projectId != null) {
try {
ApiConnector api = controller.getApiAccessor();
project = (Project) api.findById(Project.class, _projectId);
} catch (IOException ex) {
s_logger.warn("project read", ex);
throw new CloudRuntimeException("Unable to create service-instance object", ex);
}
}
ServiceInstance si_obj = new ServiceInstance();
if (project != null) {
si_obj.setParent(project);
}
si_obj.setName(getName());
si_obj.setServiceTemplate(_tmpl);
si_obj.setProperties(new ServiceInstanceType(false, _mgmtName, _leftName, null, _rightName, null, new ServiceInstanceType.ServiceScaleOutType(1, false)));
try {
ApiConnector api = controller.getApiAccessor();
api.create(si_obj);
} catch (IOException ex) {
s_logger.warn("service-instance create", ex);
throw new CloudRuntimeException("Unable to create service-instance object", ex);
}
return si_obj;
}
use of net.juniper.contrail.api.ApiConnector in project cloudstack by apache.
the class VMInterfaceModel method delete.
@Override
public void delete(ModelController controller) throws IOException {
for (ModelObject successor : successors()) {
successor.delete(controller);
}
ApiConnector api = controller.getApiAccessor();
api.delete(VirtualMachineInterface.class, _uuid);
}
Aggregations