Package net.juniper.contrail.contrail_vrouter_api

Examples of net.juniper.contrail.contrail_vrouter_api.ContrailVRouterApi


       
    @Before
    public void setUp() throws Exception {
        s_logger.debug("Setting up ContrailVRouterApiTest");
        int port = -1;
        apiTest = spy(new ContrailVRouterApi(InetAddress.getLocalHost(),
            port, false));
        doReturn(mockClient).when(apiTest).CreateRpcClient();
    }
View Full Code Here


        if (vrouterIpAddress == null) {
            s_logger.info("Virtual machine interface: " + vmInterfaceUuid +
                    " delete notification NOT sent");
            return;
        }
        ContrailVRouterApi vrouterApi = vrouterApiMap.get(vrouterIpAddress);
        if (vrouterApi == null) {
            vrouterApi = new ContrailVRouterApi(
                    InetAddress.getByName(vrouterIpAddress),
                    vrouterApiPort, false);
            vrouterApiMap.put(vrouterIpAddress, vrouterApi);
        }
        boolean ret = vrouterApi.DeletePort(UUID.fromString(vmInterfaceUuid));
        if ( ret == true) {
            s_logger.debug("VRouterAPi Delete Port success - port name: "
                          + vmInterfaceName + "(" + vmInterfaceDisplayName + ")");
        } else {
            // log failure but don't worry. Periodic KeepAlive task will
View Full Code Here

            if (vrouterIpAddress == null) {
                s_logger.info("Virtual machine interace: " + vmInterfaceUuid +
                        " delete notification NOT sent");
                continue;
            }
            ContrailVRouterApi vrouterApi = vrouterApiMap.get(vrouterIpAddress);
            if (vrouterApi == null) {
                vrouterApi = new ContrailVRouterApi(
                        InetAddress.getByName(vrouterIpAddress),
                        vrouterApiPort, false);
                vrouterApiMap.put(vrouterIpAddress, vrouterApi);
            }
            vrouterApi.DeletePort(UUID.fromString(vmInterfaceUuid));
        }
        apiConnector.delete(VirtualMachine.class, vmUuid);
        s_logger.info("Delete virtual machine: " + vmUuid);
    }
View Full Code Here

            s_logger.info("Virtual machine: " + vmName + " host: " + hostName
                + " create notification NOT sent");
            return;
        }
        try {
            ContrailVRouterApi vrouterApi = vrouterApiMap.get(vrouterIpAddress);
            if (vrouterApi == null) {
                   vrouterApi = new ContrailVRouterApi(
                         InetAddress.getByName(vrouterIpAddress),
                         vrouterApiPort, false);
                   vrouterApiMap.put(vrouterIpAddress, vrouterApi);
            }
            vrouterApi.AddPort(UUID.fromString(vmiUuid),
                                         UUID.fromString(vmUuid), vmInterface.getName(),
                                         InetAddress.getByName(vmIpAddress),
                                         Utils.parseMacAddress(macAddress),
                                         UUID.fromString(vnUuid), isolatedVlanId, primaryVlanId);
            s_logger.debug("VRouterAPi Add Port success - port name: " + vmInterface.getName() + "(" + vmInterface.getDisplayName() + ")");
View Full Code Here

            s_logger.info("Virtual machine: " + vmName + " host: " + hostName
                + " create notification NOT sent");
            return;
        }
        try {
            ContrailVRouterApi vrouterApi = vrouterApiMap.get(vrouterIpAddress);
            if (vrouterApi == null) {
                   vrouterApi = new ContrailVRouterApi(
                         InetAddress.getByName(vrouterIpAddress),
                         vrouterApiPort, false);
                   vrouterApiMap.put(vrouterIpAddress, vrouterApi);
            }
            boolean ret = vrouterApi.AddPort(UUID.fromString(vmInterface.getUuid()),
                               UUID.fromString(vmUuid), vmInterface.getName(),
                               InetAddress.getByName(vmIpAddress),
                               Utils.parseMacAddress(macAddress),
                               UUID.fromString(vnUuid), isolatedVlanId, primaryVlanId);
            if ( ret == true) {
View Full Code Here

    }

    // KeepAlive with all active vRouter Agent Connections.
    public void vrouterAgentPeriodicConnectionCheck() {
        for (String vrouterIpAddress : vrouterApiMap.keySet()) {
            ContrailVRouterApi vrouterApi = vrouterApiMap.get(vrouterIpAddress);
            // run Keep Alive with vRouter Agent.
            if (vrouterApi != null) {
              vrouterApi.PeriodicConnectionCheck();
            }
        }
    }
View Full Code Here

TOP

Related Classes of net.juniper.contrail.contrail_vrouter_api.ContrailVRouterApi

Copyright © 2018 www.massapicom. 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.