use of org.onosproject.openstacknode.api.NodeState.COMPLETE in project onos by opennetworkinglab.
the class OpenstackNodeWebResource method initIncompleteNodes.
/**
* Initializes openstack nodes which are in the stats other than COMPLETE.
*
* @return 200 OK with init result, 500 server error
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("init/incomplete")
public Response initIncompleteNodes() {
log.debug(String.format(MESSAGE_NODE, INIT));
osNodeService.nodes().stream().filter(n -> n.state() != COMPLETE).forEach(n -> {
log.info("Node {} isn't COMPLETE state so performs initialization again.", n.hostname());
OpenstackNode updated = n.updateState(NodeState.INIT);
osNodeAdminService.updateNode(updated);
});
return ok(mapper().createObjectNode()).build();
}
use of org.onosproject.openstacknode.api.NodeState.COMPLETE in project onos by opennetworkinglab.
the class OpenstackVtapManager method purgeVtap.
/**
* Purges all flow rules and group tables, tunneling interface for openstack vtap.
*/
@Override
public void purgeVtap() {
// Remove all flow rules
flowRuleService.removeFlowRulesById(appId);
// Remove all groups and tunnel interfaces
osNodeService.completeNodes(COMPUTE).stream().filter(osNode -> osNode.state() == COMPLETE).forEach(osNode -> {
groupService.getGroups(osNode.intgBridge(), appId).forEach(group -> groupService.removeGroup(osNode.intgBridge(), group.appCookie(), appId));
OpenstackVtapNetwork vtapNetwork = getVtapNetwork();
setTunnelInterface(osNode, vtapNetwork, false);
});
log.trace("{} all flow rules, groups, tunnel interface are purged", appId.name());
}
Aggregations