use of com.cloud.legacymodel.communication.command.SavePasswordCommand in project cosmic by MissionCriticalCloud.
the class SavePasswordConfigItem method generateConfig.
@Override
public List<ConfigItem> generateConfig(final NetworkElementCommand cmd) {
final SavePasswordCommand command = (SavePasswordCommand) cmd;
final VmPassword vmPassword = new VmPassword(command.getVmIpAddress(), command.getPassword());
return generateConfigItems(vmPassword);
}
use of com.cloud.legacymodel.communication.command.SavePasswordCommand in project cosmic by MissionCriticalCloud.
the class CommandSetupHelper method createPasswordCommand.
public void createPasswordCommand(final VirtualRouter router, final VirtualMachineProfile profile, final NicVO nic, final Commands cmds) {
final String password = (String) profile.getParameter(VirtualMachineProfile.Param.VmPassword);
final Zone zone = zoneRepository.findById(router.getDataCenterId()).orElse(null);
// password should be set only on default network element
if (password != null && nic.isDefaultNic()) {
final SavePasswordCommand cmd = new SavePasswordCommand(password, nic.getIPv4Address(), profile.getVirtualMachine().getHostName(), _networkModel.getExecuteInSeqNtwkElmtCmd());
cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, _routerControlHelper.getRouterControlIp(router.getId()));
cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName());
cmd.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE, zone.getNetworkType().toString());
cmds.addCommand("password", cmd);
}
}
Aggregations