Search in sources :

Example 1 with ScriptConfigItem

use of com.cloud.agent.resource.virtualnetwork.ScriptConfigItem in project cloudstack by apache.

the class BumpUpPriorityConfigItem method generateConfig.

@Override
public List<ConfigItem> generateConfig(final NetworkElementCommand cmd) {
    final LinkedList<ConfigItem> cfg = new LinkedList<>();
    cfg.add(new ScriptConfigItem(VRScripts.RVR_BUMPUP_PRI, null));
    return cfg;
}
Also used : ConfigItem(com.cloud.agent.resource.virtualnetwork.ConfigItem) ScriptConfigItem(com.cloud.agent.resource.virtualnetwork.ScriptConfigItem) ScriptConfigItem(com.cloud.agent.resource.virtualnetwork.ScriptConfigItem) LinkedList(java.util.LinkedList)

Example 2 with ScriptConfigItem

use of com.cloud.agent.resource.virtualnetwork.ScriptConfigItem in project cosmic by MissionCriticalCloud.

the class AbstractConfigItemFacade method generateConfigItems.

protected List<ConfigItem> generateConfigItems(final Object configuration) {
    final List<ConfigItem> cfg = new LinkedList<>();
    final String remoteFilename = appendUuidToJsonFiles(destinationFile);
    s_logger.debug("Transformed filename " + destinationFile + " to " + remoteFilename);
    final String jsonConfigCommand = gson.toJson(configuration);
    s_logger.debug("Contents of jsonConfigCommand " + remoteFilename + " is: " + jsonConfigCommand);
    final ConfigItem configFile = new FileConfigItem(VRScripts.CONFIG_PERSIST_LOCATION, remoteFilename, jsonConfigCommand);
    cfg.add(configFile);
    final ConfigItem updateCommand = new ScriptConfigItem(VRScripts.UPDATE_CONFIG, remoteFilename);
    cfg.add(updateCommand);
    return cfg;
}
Also used : ConfigItem(com.cloud.agent.resource.virtualnetwork.ConfigItem) ScriptConfigItem(com.cloud.agent.resource.virtualnetwork.ScriptConfigItem) FileConfigItem(com.cloud.agent.resource.virtualnetwork.FileConfigItem) FileConfigItem(com.cloud.agent.resource.virtualnetwork.FileConfigItem) ScriptConfigItem(com.cloud.agent.resource.virtualnetwork.ScriptConfigItem) LinkedList(java.util.LinkedList)

Example 3 with ScriptConfigItem

use of com.cloud.agent.resource.virtualnetwork.ScriptConfigItem in project cloudstack by apache.

the class SetMonitorServiceConfigItem method generateConfig.

@Override
public List<ConfigItem> generateConfig(final NetworkElementCommand cmd) {
    final SetMonitorServiceCommand command = (SetMonitorServiceCommand) cmd;
    final MonitorService monitorService = new MonitorService(command.getConfiguration(), cmd.getAccessDetail(SetMonitorServiceCommand.ROUTER_MONITORING_ENABLED), cmd.getAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_ENABLED));
    setupHealthChecksRelatedInfo(monitorService, command);
    monitorService.setDeleteFromProcessedCache(command.shouldDeleteFromProcessedCache());
    List<ConfigItem> configItems = generateConfigItems(monitorService);
    if (configItems != null && command.shouldReconfigureAfterUpdate()) {
        configItems.add(new ScriptConfigItem(VRScripts.CONFIGURE, "monitor_service.json"));
    }
    return configItems;
}
Also used : SetMonitorServiceCommand(com.cloud.agent.api.routing.SetMonitorServiceCommand) MonitorService(com.cloud.agent.resource.virtualnetwork.model.MonitorService) ConfigItem(com.cloud.agent.resource.virtualnetwork.ConfigItem) ScriptConfigItem(com.cloud.agent.resource.virtualnetwork.ScriptConfigItem) ScriptConfigItem(com.cloud.agent.resource.virtualnetwork.ScriptConfigItem)

Example 4 with ScriptConfigItem

use of com.cloud.agent.resource.virtualnetwork.ScriptConfigItem in project cloudstack by apache.

the class AbstractConfigItemFacade method generateConfigItems.

protected List<ConfigItem> generateConfigItems(final ConfigBase configuration) {
    final List<ConfigItem> cfg = new LinkedList<>();
    final String remoteFilename = appendUuidToJsonFiles(destinationFile);
    if (s_logger.isDebugEnabled()) {
        s_logger.debug("Transformed filename: " + destinationFile + " to: " + remoteFilename);
    }
    final ConfigItem configFile = new FileConfigItem(VRScripts.CONFIG_PERSIST_LOCATION, remoteFilename, gson.toJson(configuration));
    cfg.add(configFile);
    // By default keep files in processed cache on VR
    final String args = configuration.shouldDeleteFromProcessedCache() ? remoteFilename + " false" : remoteFilename;
    final ConfigItem updateCommand = new ScriptConfigItem(VRScripts.UPDATE_CONFIG, args);
    cfg.add(updateCommand);
    return cfg;
}
Also used : ConfigItem(com.cloud.agent.resource.virtualnetwork.ConfigItem) ScriptConfigItem(com.cloud.agent.resource.virtualnetwork.ScriptConfigItem) FileConfigItem(com.cloud.agent.resource.virtualnetwork.FileConfigItem) FileConfigItem(com.cloud.agent.resource.virtualnetwork.FileConfigItem) ScriptConfigItem(com.cloud.agent.resource.virtualnetwork.ScriptConfigItem) LinkedList(java.util.LinkedList)

Aggregations

ConfigItem (com.cloud.agent.resource.virtualnetwork.ConfigItem)4 ScriptConfigItem (com.cloud.agent.resource.virtualnetwork.ScriptConfigItem)4 LinkedList (java.util.LinkedList)3 FileConfigItem (com.cloud.agent.resource.virtualnetwork.FileConfigItem)2 SetMonitorServiceCommand (com.cloud.agent.api.routing.SetMonitorServiceCommand)1 MonitorService (com.cloud.agent.resource.virtualnetwork.model.MonitorService)1