Examples of NetworkUsageCommand


Examples of com.cloud.agent.api.NetworkUsageCommand

        command.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName());
        cmds.addCommand("getDomRVersion", command);

        // Network usage command to create iptables rules
        boolean forVpc = profile.getVirtualMachine().getVpcId() != null;
        cmds.addCommand("networkUsage", new NetworkUsageCommand(controlNic.getIp4Address(), router.getHostName(), "create", forVpc));
    }
View Full Code Here

Examples of com.cloud.agent.api.NetworkUsageCommand

            List<? extends Nic> routerNics = _nicDao.listByVmId(router.getId());
            for (Nic routerNic : routerNics) {
                Network network = _networkMgr.getNetwork(routerNic.getNetworkId());
                if (network.getTrafficType() == TrafficType.Public) {
                    boolean forVpc = router.getVpcId() != null;
                    final NetworkUsageCommand usageCmd = new NetworkUsageCommand(privateIP, router.getHostName(),
                            forVpc, routerNic.getIp4Address());
                    UserStatisticsVO previousStats = _statsDao.findBy(router.getAccountId(),
                            router.getDataCenterIdToDeployIn(), network.getId(), null, router.getId(), router.getType().toString());
                    NetworkUsageAnswer answer = null;
                    try {
View Full Code Here

Examples of com.cloud.agent.api.NetworkUsageCommand

                        List<? extends Nic> routerNics = _nicDao.listByVmId(router.getId());
                        for (Nic routerNic : routerNics) {
                            Network network = _networkMgr.getNetwork(routerNic.getNetworkId());
                            if (network.getTrafficType() == TrafficType.Public) {
                                boolean forVpc = router.getVpcId() != null;
                                final NetworkUsageCommand usageCmd = new NetworkUsageCommand(privateIP, router.getHostName(),
                                        forVpc, routerNic.getIp4Address());
                                UserStatisticsVO previousStats = _statsDao.findBy(router.getAccountId(),
                                        router.getDataCenterIdToDeployIn(), network.getId(), null, router.getId(), router.getType().toString());
                                NetworkUsageAnswer answer = null;
                                try {
View Full Code Here

Examples of com.cloud.agent.api.NetworkUsageCommand

        cmds.addCommand("getDomRVersion", command);

        // Network usage command to create iptables rules
        boolean forVpc = profile.getVirtualMachine().getVpcId() != null;
        if (!forVpc)
            cmds.addCommand("networkUsage", new NetworkUsageCommand(controlNic.getIp4Address(), router.getHostName(), "create", forVpc));
    }
View Full Code Here

Examples of com.cloud.agent.api.NetworkUsageCommand

            for (Nic routerNic : routerNics) {
                Network network = _networkModel.getNetwork(routerNic.getNetworkId());
                //Send network usage command for public nic in VPC VR
                //Send network usage command for isolated guest nic of non VPC VR
                if ((forVpc && network.getTrafficType() == TrafficType.Public) || (!forVpc && network.getTrafficType() == TrafficType.Guest && network.getGuestType() == Network.GuestType.Isolated)) {
                    final NetworkUsageCommand usageCmd = new NetworkUsageCommand(privateIP, router.getHostName(),
                            forVpc, routerNic.getIp4Address());
                    String routerType = router.getType().toString();
                    UserStatisticsVO previousStats = _userStatsDao.findBy(router.getAccountId(),
                            router.getDataCenterId(), network.getId(), (forVpc ? routerNic.getIp4Address() : null), router.getId(), routerType);
                    NetworkUsageAnswer answer = null;
View Full Code Here

Examples of com.cloud.agent.api.NetworkUsageCommand

                        for (Nic routerNic : routerNics) {
                            Network network = _networkModel.getNetwork(routerNic.getNetworkId());
                            //Send network usage command for public nic in VPC VR
                            //Send network usage command for isolated guest nic of non VPC VR                           
                            if ((forVpc && network.getTrafficType() == TrafficType.Public) || (!forVpc && network.getTrafficType() == TrafficType.Guest && network.getGuestType() == Network.GuestType.Isolated)) {
                                final NetworkUsageCommand usageCmd = new NetworkUsageCommand(privateIP, router.getHostName(),
                                        forVpc, routerNic.getIp4Address());
                                String routerType = router.getType().toString();
                                UserStatisticsVO previousStats = _userStatsDao.findBy(router.getAccountId(),
                                        router.getDataCenterId(), network.getId(), (forVpc ? routerNic.getIp4Address() : null), router.getId(), routerType);
                                NetworkUsageAnswer answer = null;
View Full Code Here

Examples of com.cloud.agent.api.NetworkUsageCommand

                            " in public network " + publicNtwk);
                    return false;
                }
            }
            //Create network usage commands. Send commands to router after IPAssoc
            NetworkUsageCommand netUsageCmd = new NetworkUsageCommand(router.getPrivateIpAddress(), router.getInstanceName(), true, defaultNic.getIp4Address(), vpc.getCidr());
            netUsagecmds.addCommand(netUsageCmd);
            UserStatisticsVO stats = _userStatsDao.findBy(router.getAccountId(), router.getDataCenterId(),
            publicNtwk.getId(), publicNic.getIp4Address(), router.getId(), router.getType().toString());
            if (stats == null) {
                stats = new UserStatisticsVO(router.getAccountId(), router.getDataCenterId(), publicNic.getIp4Address(), router.getId(),
View Full Code Here

Examples of com.cloud.agent.api.NetworkUsageCommand

                    }
                }
                PlugNicCommand plugNicCmd = new PlugNicCommand(getNicTO(router, publicNic.getNetworkId(), publicNic.getBroadcastUri().toString()), router.getInstanceName(), router.getType());
                cmds.addCommand(plugNicCmd);
                VpcVO vpc = _vpcDao.findById(router.getVpcId());
                NetworkUsageCommand netUsageCmd = new NetworkUsageCommand(router.getPrivateIpAddress(), router.getInstanceName(), true, publicNic.getIp4Address(), vpc.getCidr());
                usageCmds.add(netUsageCmd);
                UserStatisticsVO stats = _userStatsDao.findBy(router.getAccountId(), router.getDataCenterId(),
                publicNtwk.getId(), publicNic.getIp4Address(), router.getId(), router.getType().toString());
                if (stats == null) {
                    stats = new UserStatisticsVO(router.getAccountId(), router.getDataCenterId(), publicNic.getIp4Address(), router.getId(),
View Full Code Here

Examples of com.cloud.agent.api.NetworkUsageCommand

        cmds.addCommand("getDomRVersion", command);

        // Network usage command to create iptables rules
        boolean forVpc = vr.getVpcId() != null;
        if (!forVpc)
            cmds.addCommand("networkUsage", new NetworkUsageCommand(controlNic.getIp4Address(), router.getHostName(), "create", forVpc));
    }
View Full Code Here

Examples of com.cloud.agent.api.NetworkUsageCommand

            for (final Nic routerNic : routerNics) {
                final Network network = _networkModel.getNetwork(routerNic.getNetworkId());
                //Send network usage command for public nic in VPC VR
                //Send network usage command for isolated guest nic of non VPC VR
                if ((forVpc && network.getTrafficType() == TrafficType.Public) || (!forVpc && network.getTrafficType() == TrafficType.Guest && network.getGuestType() == Network.GuestType.Isolated)) {
                    final NetworkUsageCommand usageCmd = new NetworkUsageCommand(privateIP, router.getHostName(),
                            forVpc, routerNic.getIp4Address());
                    final String routerType = router.getType().toString();
                    final UserStatisticsVO previousStats = _userStatsDao.findBy(router.getAccountId(),
                            router.getDataCenterId(), network.getId(), (forVpc ? routerNic.getIp4Address() : null), router.getId(), routerType);
                    NetworkUsageAnswer answer = null;
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.