Examples of NeutronNodesNorthboundAction


Examples of org.apache.cloudstack.network.opendaylight.api.resources.NeutronNodesNorthboundAction

        return new DestroyPortAnswer(cmd, true, "Port " + cmd.getPortId().toString() + " deleted");
    }

    private Answer executeRequest(AddHypervisorCommand cmd) {
        NeutronNodesNorthboundAction nodeActions = new NeutronNodesNorthboundAction(controllerUrl, controllerUsername, controllerPassword);
        try {
            NeutronNodesList<NeutronNodeWrapper> nodes = nodeActions.listAllNodes();
            if (nodes.getNodes() != null) {
                for (NeutronNodeWrapper nodeWrapper : nodes.getNodes()) {
                    NeutronNode node = nodeWrapper.getNode();
                    if (node.getId().equals(cmd.getHostId())) {
                        return new AddHypervisorAnswer(cmd, true, "Hypervisor already connected");
                    }
                }
            }

            // Not found in the existing node list, add it
            nodeActions.updateNeutronNodeV2("OVS", cmd.getHostId(), cmd.getIpAddress(), 6640);
        } catch (NeutronRestApiException e) {
            s_logger.error("Call to OpenDaylight failed", e);
            return new AddHypervisorAnswer(cmd, e);
        }
        return new AddHypervisorAnswer(cmd, true, "Hypervisor " + cmd.getHostId() + " added");
View Full Code Here

Examples of org.apache.cloudstack.network.opendaylight.api.resources.NeutronNodesNorthboundAction

    public void neutronNodesFail() throws NeutronRestApiException {
        URL url;
        try {
            url = new URL("http://localhost:8080");

            NeutronNodesNorthboundAction neutron = new NeutronNodesNorthboundAction(url, "admin", "admin");
            neutron.listAllNodes();
        } catch (MalformedURLException e) {
            Assert.fail("Should not fail here.");
        }
    }
View Full Code Here

Examples of org.apache.cloudstack.network.opendaylight.api.resources.NeutronNodesNorthboundAction

    public void neutronHTTPPutUriMethod() throws NeutronRestApiException {
        URL url;
        try {
            url = new URL("http://localhost:8080");

            NeutronNodesNorthboundAction neutron = new NeutronNodesNorthboundAction(url, "admin", "admin");
            neutron.updateNeutronNodeV1("ca31aa7f-84c7-416d-bc00-1f84927367e0", "1.1.1.1.", 6400);

        } catch (MalformedURLException e) {
            Assert.fail("Should not fail here.");
        }
    }
View Full Code Here

Examples of org.apache.cloudstack.network.opendaylight.api.resources.NeutronNodesNorthboundAction

    public void neutronListAllNodes() throws NeutronRestApiException {
        URL url;
        try {
            url = new URL("http://178.237.34.233:8080");

            NeutronNodesNorthboundAction neutron = new NeutronNodesNorthboundAction(url, "admin", "admin");
            NeutronNodesList<NeutronNodeWrapper> results = neutron.listAllNodes();

            Assert.assertNotNull(results);

        } catch (MalformedURLException e) {
            Assert.fail("Should not fail here.");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.