use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow in project java-dialogflow-cx by googleapis.
the class ITSystemTest method getFlowTest.
@Test
public void getFlowTest() {
GetFlowRequest request = GetFlowRequest.newBuilder().setName(flowName).build();
Flow flow = flowsClient.getFlow(request);
assertFlowDetails(flow);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow in project java-dialogflow-cx by googleapis.
the class ITSystemTest method listFlowsTest.
@Test
public void listFlowsTest() {
ListFlowsRequest request = ListFlowsRequest.newBuilder().setParent(agentName).build();
FlowsClient.ListFlowsPagedResponse pagedListResponse = flowsClient.listFlows(request);
List<Flow> flows = Lists.newArrayList(pagedListResponse.iterateAll());
boolean isFlowExists = false;
for (Flow flow : flows) {
if (flow.getName().equals(flowName)) {
assertFlowDetails(flow);
isFlowExists = true;
}
}
assertTrue(isFlowExists);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow in project java-dialogflow-cx by googleapis.
the class CreateFlowIT method testCreateFlowGlobal.
@Test
public void testCreateFlowGlobal() throws Exception {
Flow result = CreateFlow.createFlow(DISPLAY_NAME, PROJECT_ID, LOCATION_GLOBAL, AGENT_ID_GLOBAL, EVENT_TO_FULFILLMENT_MESSAGES);
newFlowNameGlobal = result.getName();
assertEquals(result.getDisplayName(), DISPLAY_NAME);
// Number of added event handlers + 2 default event handlers.
assertEquals(result.getEventHandlersCount(), EVENT_TO_FULFILLMENT_MESSAGES.size() + 2);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow in project opennms-opendaylight-plugin by OpenNMS.
the class OpendaylightTopologyHandler method onEvent.
@Override
public void onEvent(InMemoryEvent event) {
if (event == null || !IMPORT_SUCCESSFUL_UEI.equals(event.getUei())) {
return;
}
// Extract the name of the referenced FS
final String foreignSource = event.getParameterValue(PARM_FOREIGN_SOURCE).orElse(null);
if (foreignSource == null) {
LOG.warn("No foreign source parameter found on import successful event. Ignoring.");
return;
}
if (!DEFAULT_FOREIGN_SOURCE.equals(foreignSource)) {
LOG.debug("Ignoring foreign source: {}", foreignSource);
return;
}
/*
// TODO: Quickly determine whether or not we need to load the requisition - it may be large and unrelated
// Retrieve a copy of the requisition in question
final Requisition requisition = requisitionRepository.getDeployedRequisition(foreignSource);
requisition.getNodes();
// TODO: Figure out which controller
*/
// Load the topology
Topology operationalTopology;
try {
operationalTopology = client.getOperationalTopology("flow:1");
} catch (Exception e) {
LOG.error("Failed to load operational topology.", e);
return;
}
// Index the links by source id
final Map<String, List<Link>> linksBySourceId = operationalTopology.getLink().stream().collect(Collectors.groupingBy(l -> l.getSource().getSourceNode().getValue()));
// Build a "ODL Node ID" to "OpenNMS Node" map
final List<Node> nodes = nodeDao.getNodesInForeignSource(foreignSource);
final Map<String, Node> nodesByLabel = nodes.stream().collect(Collectors.toMap(Node::getLabel, n -> n));
for (Node node : nodes) {
List<Link> expectedLinks = linksBySourceId.get(node.getLabel());
pushLinkUpdates(node, expectedLinks, nodesByLabel);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow in project opennms-opendaylight-plugin by OpenNMS.
the class OpendaylightRestconfClientIT method canGetNodeFromOperationalTopology.
@Test
public void canGetNodeFromOperationalTopology() throws Exception {
stubFor(get(urlEqualTo("/restconf/operational/network-topology:network-topology/topology/flow:1/node/openflow:1")).willReturn(aResponse().withHeader("Content-Type", "Content-Type: application/yang.data+json; charset=utf-8").withBodyFile("operational-topology-node.json")));
// Make the call
OpendaylightRestconfClient client = new OpendaylightRestconfClient(String.format("http://localhost:%s", wireMockRule.port()));
Node node = client.getNodeFromOperationalTopology("flow:1", "openflow:1");
// Verify
assertEquals("openflow:1", node.getNodeId().getValue());
}
Aggregations