Examples of NeutronPortsNorthboundAction


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

        return new DestroyNetworkAnswer(cmd, true, "Network " + cmd.getNetworkUuid() + " deleted");
    }

    private Answer executeRequest(ConfigurePortCommand cmd) {
        NeutronPortsNorthboundAction configurePort = new NeutronPortsNorthboundAction(controllerUrl, controllerUsername, controllerPassword);
        NeutronPort newPort = new NeutronPort();

        // Configuration from the command
        newPort.setId(cmd.getPortId());
        newPort.setTenantId(cmd.getTennantId());
        newPort.setAdminStateUp(true);
        newPort.setName(cmd.getPortId().toString());
        newPort.setNetworkId(cmd.getNetworkId());
        newPort.setMacAddress(cmd.getMacAddress());
        newPort.setDeviceId(UUID.randomUUID());

        // Static valus
        newPort.setStatus("ACTIVE");
        newPort.setFixedIps(Collections.<String> emptyList());

        NeutronPortWrapper portWrapper = new NeutronPortWrapper();
        portWrapper.setPort(newPort);
        try {
            portWrapper = configurePort.createNeutronPort(portWrapper);
        } catch (NeutronRestApiException e) {
            s_logger.error("createPortCommand failed", e);
            return new ConfigurePortAnswer(cmd, e);
        }
View Full Code Here

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

        return new ConfigurePortAnswer(cmd, true, "Port " + portWrapper.getPort().getId().toString() + " created");

    }

    private Answer executeRequest(DestroyPortCommand cmd) {
        NeutronPortsNorthboundAction configurePort = new NeutronPortsNorthboundAction(controllerUrl, controllerUsername, controllerPassword);
        try {
            configurePort.deleteNeutronPort(cmd.getPortId().toString());
        } catch (NeutronRestApiException e) {
            s_logger.error("deleteNeutronPort failed", e);
            return new DestroyPortAnswer(cmd, e);
        }
View Full Code Here

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

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

            NeutronPortsNorthboundAction neutron = new NeutronPortsNorthboundAction(url, "admin", "admin");
            NeutronPortsList<NeutronPortWrapper> results = neutron.listAllPorts();

            Assert.assertNotNull(results);

            List<NeutronPortWrapper> networks = results.getPorts();
            Assert.assertNotNull(networks);
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.