use of com.cloud.agent.api.UpdateNetworkOverviewCommand in project cosmic by MissionCriticalCloud.
the class VpcVirtualNetworkApplianceManagerImpl method refreshSite2SiteVpn.
@Override
public boolean refreshSite2SiteVpn(final Site2SiteVpnConnection conn, final VirtualRouter router) throws ResourceUnavailableException {
if (router.getState() != State.Running) {
s_logger.warn("Unable to apply site-to-site VPN configuration, virtual router is not in the right state " + router.getState());
throw new ResourceUnavailableException("Unable to apply site-to-site VPN configuration," + " virtual router is not in the right state", DataCenter.class, router.getDataCenterId());
}
final Commands cmds = new Commands(Command.OnError.Continue);
final NetworkOverviewTO networkOverview = _commandSetupHelper.createNetworkOverviewFromRouter(router, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), null, null);
final UpdateNetworkOverviewCommand updateNetworkOverviewCommand = _commandSetupHelper.createUpdateNetworkOverviewCommand(router, networkOverview);
cmds.addCommand(updateNetworkOverviewCommand);
return _nwHelper.sendCommandsToRouter(router, cmds);
}
use of com.cloud.agent.api.UpdateNetworkOverviewCommand 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);
final UpdateNetworkOverviewCommand updateNetworkOverviewCommand = _commandSetupHelper.createUpdateNetworkOverviewCommand(router, networkOverview);
cmds.addCommand(updateNetworkOverviewCommand);
// results accordingly
return _networkGeneralHelper.sendCommandsToRouter(router, cmds);
}
use of com.cloud.agent.api.UpdateNetworkOverviewCommand in project cosmic by MissionCriticalCloud.
the class CommandSetupHelper method createUpdateNetworkOverviewCommand.
public UpdateNetworkOverviewCommand createUpdateNetworkOverviewCommand(final VirtualRouter router, final NetworkOverviewTO networkOverview) {
final UpdateNetworkOverviewCommand cmd = new UpdateNetworkOverviewCommand(networkOverview);
cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, _routerControlHelper.getRouterControlIp(router.getId()));
cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName());
final Zone zone = zoneRepository.findOne(router.getDataCenterId());
cmd.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE, zone.getNetworkType().toString());
return cmd;
}
Aggregations