use of org.apache.geode.management.internal.cli.util.CommandStringBuilder in project geode by apache.
the class DurableClientCommandsController method listDurableClientContinuousQueries.
@RequestMapping(method = RequestMethod.GET, value = "/durable-clients/{durable-client-id}/cqs")
@ResponseBody
public String listDurableClientContinuousQueries(@PathVariable(ConfigurationProperties.DURABLE_CLIENT_ID) final String durableClientId, @RequestParam(value = CliStrings.LIST_DURABLE_CQS__MEMBER, required = false) final String memberNameId, @RequestParam(value = CliStrings.LIST_DURABLE_CQS__GROUP, required = false) final String[] groups) {
final CommandStringBuilder command = new CommandStringBuilder(CliStrings.LIST_DURABLE_CQS);
command.addOption(CliStrings.LIST_DURABLE_CQS__DURABLECLIENTID, decode(durableClientId));
if (hasValue(memberNameId)) {
command.addOption(CliStrings.LIST_DURABLE_CQS__MEMBER, memberNameId);
}
if (hasValue(groups)) {
command.addOption(CliStrings.LIST_DURABLE_CQS__GROUP, StringUtils.join(groups, StringUtils.COMMA_DELIMITER));
}
return processCommand(command.toString());
}
use of org.apache.geode.management.internal.cli.util.CommandStringBuilder in project geode by apache.
the class ExportLogController method exportLogs.
@RequestMapping(method = RequestMethod.GET, value = "/logs")
public ResponseEntity<InputStreamResource> exportLogs(@RequestParam(value = CliStrings.EXPORT_LOGS__DIR, required = false) final String directory, @RequestParam(value = CliStrings.EXPORT_LOGS__GROUP, required = false) final String[] groups, @RequestParam(value = CliStrings.EXPORT_LOGS__MEMBER, required = false) final String memberNameId, @RequestParam(value = CliStrings.EXPORT_LOGS__LOGLEVEL, required = false) final String logLevel, @RequestParam(value = CliStrings.EXPORT_LOGS__UPTO_LOGLEVEL, defaultValue = "false") final Boolean onlyLogLevel, @RequestParam(value = CliStrings.EXPORT_LOGS__MERGELOG, defaultValue = "false") final Boolean mergeLog, @RequestParam(value = CliStrings.EXPORT_LOGS__STARTTIME, required = false) final String startTime, @RequestParam(value = CliStrings.EXPORT_LOGS__ENDTIME, required = false) final String endTime, @RequestParam(value = CliStrings.EXPORT_LOGS__LOGSONLY, required = false) final boolean logsOnly, @RequestParam(value = CliStrings.EXPORT_LOGS__STATSONLY, required = false) final boolean statsOnly) {
final CommandStringBuilder command = new CommandStringBuilder(CliStrings.EXPORT_LOGS);
command.addOption(CliStrings.EXPORT_LOGS__DIR, decode(directory));
if (hasValue(groups)) {
command.addOption(CliStrings.EXPORT_LOGS__GROUP, StringUtils.join(groups, StringUtils.COMMA_DELIMITER));
}
if (hasValue(memberNameId)) {
command.addOption(CliStrings.EXPORT_LOGS__MEMBER, memberNameId);
}
if (hasValue(logLevel)) {
command.addOption(CliStrings.EXPORT_LOGS__LOGLEVEL, logLevel);
}
command.addOption(CliStrings.EXPORT_LOGS__UPTO_LOGLEVEL, String.valueOf(onlyLogLevel));
command.addOption(CliStrings.EXPORT_LOGS__MERGELOG, String.valueOf(mergeLog));
command.addOption(CliStrings.EXPORT_LOGS__LOGSONLY, String.valueOf(logsOnly));
command.addOption(CliStrings.EXPORT_LOGS__STATSONLY, String.valueOf(statsOnly));
if (hasValue(startTime)) {
command.addOption(CliStrings.EXPORT_LOGS__STARTTIME, startTime);
}
if (hasValue(endTime)) {
command.addOption(CliStrings.EXPORT_LOGS__ENDTIME, endTime);
}
String result = processCommand(command.toString());
return getResponse(result);
}
use of org.apache.geode.management.internal.cli.util.CommandStringBuilder in project geode by apache.
the class ConfigCommandsController method exportClusterConfig.
@RequestMapping(method = RequestMethod.GET, value = "/config/cluster")
public Callable<ResponseEntity<String>> exportClusterConfig(@RequestParam(CliStrings.EXPORT_SHARED_CONFIG__FILE) final String zipFile) {
final CommandStringBuilder command = new CommandStringBuilder(CliStrings.EXPORT_SHARED_CONFIG);
command.addOption(CliStrings.EXPORT_SHARED_CONFIG__FILE, zipFile);
return getProcessCommandCallable(command.toString());
}
use of org.apache.geode.management.internal.cli.util.CommandStringBuilder in project geode by apache.
the class DataCommandsController method locateEntry.
@RequestMapping(method = RequestMethod.GET, value = "/regions/{region}/data/location")
@ResponseBody
public String locateEntry(@PathVariable("region") final String regionNamePath, @RequestParam(CliStrings.LOCATE_ENTRY__KEY) final String key, @RequestParam(value = CliStrings.LOCATE_ENTRY__KEYCLASS, required = false) final String keyClassName, @RequestParam(value = CliStrings.LOCATE_ENTRY__VALUEKLASS, required = false) final String valueClassName, @RequestParam(value = CliStrings.LOCATE_ENTRY__RECURSIVE, defaultValue = "false") final Boolean recursive) {
final CommandStringBuilder command = new CommandStringBuilder(CliStrings.LOCATE_ENTRY);
command.addOption(CliStrings.LOCATE_ENTRY__REGIONNAME, decode(regionNamePath));
command.addOption(CliStrings.LOCATE_ENTRY__KEY, key);
if (hasValue(keyClassName)) {
command.addOption(CliStrings.LOCATE_ENTRY__KEYCLASS, keyClassName);
}
if (hasValue(valueClassName)) {
command.addOption(CliStrings.LOCATE_ENTRY__VALUEKLASS, valueClassName);
}
command.addOption(CliStrings.LOCATE_ENTRY__RECURSIVE, String.valueOf(recursive));
return processCommand(command.toString());
}
use of org.apache.geode.management.internal.cli.util.CommandStringBuilder in project geode by apache.
the class DataCommandsController method put.
@RequestMapping(method = RequestMethod.PUT, value = "/regions/{region}/data")
@ResponseBody
public String put(@PathVariable("region") final String regionNamePath, @RequestParam(CliStrings.PUT__KEY) final String key, @RequestParam(value = CliStrings.PUT__KEYCLASS, required = false) final String keyClassName, @RequestParam(CliStrings.PUT__VALUE) final String value, @RequestParam(value = CliStrings.PUT__VALUEKLASS, required = false) final String valueClassName, @RequestParam(value = CliStrings.PUT__PUTIFABSENT, defaultValue = "false") final Boolean putIfAbsent) {
final CommandStringBuilder command = new CommandStringBuilder(CliStrings.PUT);
command.addOption(CliStrings.PUT__REGIONNAME, decode(regionNamePath));
command.addOption(CliStrings.PUT__KEY, key);
command.addOption(CliStrings.PUT__VALUE, decode(value));
if (hasValue(keyClassName)) {
command.addOption(CliStrings.PUT__KEYCLASS, keyClassName);
}
if (hasValue(valueClassName)) {
command.addOption(CliStrings.PUT__VALUEKLASS, valueClassName);
}
command.addOption(CliStrings.PUT__PUTIFABSENT, String.valueOf(putIfAbsent));
return processCommand(command.toString());
}
Aggregations