Search in sources :

Example 46 with VirtualRouter

use of com.cloud.network.router.VirtualRouter in project cloudstack by apache.

the class BasicNetworkVisitor method visit.

@Override
public boolean visit(final IpAssociationRules ipRules) throws ResourceUnavailableException {
    final Network network = ipRules.getNetwork();
    final VirtualRouter router = ipRules.getRouter();
    final Commands commands = new Commands(Command.OnError.Continue);
    final List<? extends PublicIpAddress> ips = ipRules.getIpAddresses();
    _commandSetupHelper.createAssociateIPCommands(router, ips, commands, network.getId());
    return _networkGeneralHelper.sendCommandsToRouter(router, commands);
}
Also used : Network(com.cloud.network.Network) Commands(com.cloud.agent.manager.Commands) VirtualRouter(com.cloud.network.router.VirtualRouter)

Example 47 with VirtualRouter

use of com.cloud.network.router.VirtualRouter in project cloudstack by apache.

the class BasicNetworkVisitor method visit.

@Override
public boolean visit(final UserdataToRouterRules userdata) throws ResourceUnavailableException {
    final VirtualRouter router = userdata.getRouter();
    final UserVmVO userVM = userdata.getUserVM();
    final NicVO nicVo = userdata.getNicVo();
    final Commands commands = new Commands(Command.OnError.Stop);
    _commandSetupHelper.createVmDataCommand(router, userVM, nicVo, null, commands);
    return _networkGeneralHelper.sendCommandsToRouter(router, commands);
}
Also used : UserVmVO(com.cloud.vm.UserVmVO) Commands(com.cloud.agent.manager.Commands) NicVO(com.cloud.vm.NicVO) VirtualRouter(com.cloud.network.router.VirtualRouter)

Example 48 with VirtualRouter

use of com.cloud.network.router.VirtualRouter in project cloudstack by apache.

the class AdvancedNetworkVisitor method visit.

@Override
public boolean visit(final UserdataPwdRules userdata) throws ResourceUnavailableException {
    final VirtualRouter router = userdata.getRouter();
    final Commands commands = new Commands(Command.OnError.Stop);
    final VirtualMachineProfile profile = userdata.getProfile();
    final NicVO nicVo = userdata.getNicVo();
    final UserVmVO userVM = userdata.getUserVM();
    _commandSetupHelper.createPasswordCommand(router, profile, nicVo, commands);
    _commandSetupHelper.createVmDataCommand(router, userVM, nicVo, userVM.getDetail("SSH.PublicKey"), commands);
    return _networkGeneralHelper.sendCommandsToRouter(router, commands);
}
Also used : UserVmVO(com.cloud.vm.UserVmVO) Commands(com.cloud.agent.manager.Commands) VirtualMachineProfile(com.cloud.vm.VirtualMachineProfile) NicVO(com.cloud.vm.NicVO) VirtualRouter(com.cloud.network.router.VirtualRouter)

Example 49 with VirtualRouter

use of com.cloud.network.router.VirtualRouter in project cloudstack by apache.

the class AdvancedNetworkVisitor method visit.

@Override
public boolean visit(final NetworkAclsRules acls) throws ResourceUnavailableException {
    final VirtualRouter router = acls.getRouter();
    final Network network = acls.getNetwork();
    final Commands commands = new Commands(Command.OnError.Continue);
    final List<? extends NetworkACLItem> rules = acls.getRules();
    _commandSetupHelper.createNetworkACLsCommands(rules, router, commands, network.getId(), acls.isPrivateGateway());
    return _networkGeneralHelper.sendCommandsToRouter(router, commands);
}
Also used : Network(com.cloud.network.Network) Commands(com.cloud.agent.manager.Commands) VirtualRouter(com.cloud.network.router.VirtualRouter)

Example 50 with VirtualRouter

use of com.cloud.network.router.VirtualRouter in project cloudstack by apache.

the class AdvancedNetworkVisitor method visit.

@Override
public boolean visit(final StaticRoutesRules staticRoutesRules) throws ResourceUnavailableException {
    final VirtualRouter router = staticRoutesRules.getRouter();
    final List<StaticRouteProfile> staticRoutes = staticRoutesRules.getStaticRoutes();
    final Commands cmds = new Commands(Command.OnError.Continue);
    _commandSetupHelper.createStaticRouteCommands(staticRoutes, router, cmds);
    return _networkGeneralHelper.sendCommandsToRouter(router, cmds);
}
Also used : StaticRouteProfile(com.cloud.network.vpc.StaticRouteProfile) Commands(com.cloud.agent.manager.Commands) VirtualRouter(com.cloud.network.router.VirtualRouter)

Aggregations

VirtualRouter (com.cloud.network.router.VirtualRouter)72 Commands (com.cloud.agent.manager.Commands)34 DomainRouterResponse (com.cloud.api.response.DomainRouterResponse)11 NicVO (com.cloud.vm.NicVO)11 ServerApiException (com.cloud.api.ServerApiException)10 UserVmVO (com.cloud.vm.UserVmVO)10 VirtualMachineProfile (com.cloud.vm.VirtualMachineProfile)10 ResourceUnavailableException (com.cloud.exception.ResourceUnavailableException)9 ArrayList (java.util.ArrayList)9 ServerApiException (org.apache.cloudstack.api.ServerApiException)9 DataCenter (com.cloud.dc.DataCenter)8 Network (com.cloud.network.Network)8 DomainRouterResponse (org.apache.cloudstack.api.response.DomainRouterResponse)8 InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)6 UpdateVmOverviewCommand (com.cloud.agent.api.UpdateVmOverviewCommand)5 VMOverviewTO (com.cloud.agent.api.to.overviews.VMOverviewTO)5 UpdateNetworkOverviewCommand (com.cloud.agent.api.UpdateNetworkOverviewCommand)4 NetworkOverviewTO (com.cloud.agent.api.to.overviews.NetworkOverviewTO)4 DeployDestination (com.cloud.deploy.DeployDestination)4 PvlanSetupCommand (com.cloud.agent.api.PvlanSetupCommand)2