use of com.cloud.legacymodel.network.VirtualRouter in project cosmic by MissionCriticalCloud.
the class AdvancedNetworkVisitor method visit.
@Override
public boolean visit(final AdvancedVpnRules vpnRules) throws ResourceUnavailableException {
final VirtualRouter router = vpnRules.getRouter();
final Commands cmds = new Commands(Command.OnError.Continue);
final NetworkOverviewTO networkOverview = _commandSetupHelper.createNetworkOverviewFromRouter(router, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), null, null, null);
final UpdateNetworkOverviewCommand updateNetworkOverviewCommand = _commandSetupHelper.createUpdateNetworkOverviewCommand(router, networkOverview);
cmds.addCommand(updateNetworkOverviewCommand);
// results accordingly
return _networkGeneralHelper.sendCommandsToRouter(router, cmds);
}
use of com.cloud.legacymodel.network.VirtualRouter in project cosmic by MissionCriticalCloud.
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();
_commandSetupHelper.createPasswordCommand(router, profile, nicVO, commands);
final VMOverviewTO vmOverview = _commandSetupHelper.createVmOverviewFromRouter(router);
final UpdateVmOverviewCommand updateVmOverviewCommand = _commandSetupHelper.createUpdateVmOverviewCommand(router, vmOverview);
commands.addCommand(updateVmOverviewCommand);
return _networkGeneralHelper.sendCommandsToRouter(router, commands);
}
use of com.cloud.legacymodel.network.VirtualRouter in project cosmic by MissionCriticalCloud.
the class BasicNetworkVisitor method visit.
@Override
public boolean visit(final SshKeyToRouterRules sshkey) throws ResourceUnavailableException {
final VirtualRouter router = sshkey.getRouter();
final VirtualMachineProfile profile = sshkey.getProfile();
final Commands commands = new Commands(Command.OnError.Stop);
final NicVO nicVO = sshkey.getNicVo();
final VMTemplateVO template = sshkey.getTemplate();
if (template != null && template.getEnablePassword()) {
_commandSetupHelper.createPasswordCommand(router, profile, nicVO, commands);
}
final VMOverviewTO vmOverview = _commandSetupHelper.createVmOverviewFromRouter(router);
final UpdateVmOverviewCommand updateVmOverviewCommand = _commandSetupHelper.createUpdateVmOverviewCommand(router, vmOverview);
commands.addCommand(updateVmOverviewCommand);
return _networkGeneralHelper.sendCommandsToRouter(router, commands);
}
use of com.cloud.legacymodel.network.VirtualRouter in project cosmic by MissionCriticalCloud.
the class BasicNetworkVisitor method visit.
@Override
public boolean visit(final PasswordToRouterRules passwd) throws ResourceUnavailableException {
final VirtualRouter router = passwd.getRouter();
final NicVO nicVo = passwd.getNicVo();
final VirtualMachineProfile profile = passwd.getProfile();
final Commands cmds = new Commands(Command.OnError.Stop);
_commandSetupHelper.createPasswordCommand(router, profile, nicVo, cmds);
return _networkGeneralHelper.sendCommandsToRouter(router, cmds);
}
use of com.cloud.legacymodel.network.VirtualRouter in project cosmic by MissionCriticalCloud.
the class BasicNetworkVisitor method visit.
@Override
public boolean visit(final DhcpEntryRules dhcp) throws ResourceUnavailableException {
final VirtualRouter router = dhcp.getRouter();
final Commands commands = new Commands(Command.OnError.Stop);
final DeployDestination destination = dhcp.getDestination();
return router.getPodIdToDeployIn() != destination.getPod().getId() || _networkGeneralHelper.sendCommandsToRouter(router, commands);
}
Aggregations