Search in sources :

Example 61 with CommandStringBuilder

use of org.apache.geode.management.internal.cli.util.CommandStringBuilder in project geode by apache.

the class IndexCommandsController method defineIndex.

@RequestMapping(method = RequestMethod.POST, value = "/indexes", params = "op=define")
@ResponseBody
public String defineIndex(@RequestParam(CliStrings.DEFINE_INDEX_NAME) final String name, @RequestParam(CliStrings.DEFINE_INDEX__EXPRESSION) final String expression, @RequestParam(CliStrings.DEFINE_INDEX__REGION) final String regionNamePath, @RequestParam(value = CliStrings.DEFINE_INDEX__TYPE, defaultValue = DEFAULT_INDEX_TYPE) final String type) {
    CommandStringBuilder command = new CommandStringBuilder(CliStrings.DEFINE_INDEX);
    command.addOption(CliStrings.DEFINE_INDEX_NAME, name);
    command.addOption(CliStrings.DEFINE_INDEX__EXPRESSION, expression);
    command.addOption(CliStrings.DEFINE_INDEX__REGION, regionNamePath);
    command.addOption(CliStrings.DEFINE_INDEX__TYPE, type);
    return processCommand(command.toString());
}
Also used : CommandStringBuilder(org.apache.geode.management.internal.cli.util.CommandStringBuilder) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 62 with CommandStringBuilder

use of org.apache.geode.management.internal.cli.util.CommandStringBuilder in project geode by apache.

the class IndexCommandsController method listIndex.

@RequestMapping(method = RequestMethod.GET, value = "/indexes")
@ResponseBody
public String listIndex(@RequestParam(value = CliStrings.LIST_INDEX__STATS, defaultValue = "false") final Boolean withStats) {
    CommandStringBuilder command = new CommandStringBuilder(CliStrings.LIST_INDEX);
    command.addOption(CliStrings.LIST_INDEX__STATS, String.valueOf(Boolean.TRUE.equals(withStats)));
    return processCommand(command.toString());
}
Also used : CommandStringBuilder(org.apache.geode.management.internal.cli.util.CommandStringBuilder) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 63 with CommandStringBuilder

use of org.apache.geode.management.internal.cli.util.CommandStringBuilder in project geode by apache.

the class MemberCommandsController method describeMember.

@RequestMapping(method = RequestMethod.GET, value = "/members/{name}")
@ResponseBody
public String describeMember(@PathVariable("name") final String memberNameId) {
    CommandStringBuilder command = new CommandStringBuilder(CliStrings.DESCRIBE_MEMBER);
    command.addOption(CliStrings.DESCRIBE_MEMBER__IDENTIFIER, decode(memberNameId));
    return processCommand(command.toString());
}
Also used : CommandStringBuilder(org.apache.geode.management.internal.cli.util.CommandStringBuilder) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 64 with CommandStringBuilder

use of org.apache.geode.management.internal.cli.util.CommandStringBuilder in project geode by apache.

the class PdxCommandsController method pdxRename.

@RequestMapping(method = RequestMethod.POST, value = "/pdx/type")
@ResponseBody
public String pdxRename(@RequestParam(value = CliStrings.PDX_RENAME_OLD) final String oldClassName, @RequestParam(value = CliStrings.PDX_RENAME_NEW) final String newClassName, @RequestParam(value = CliStrings.PDX_DISKSTORE) final String diskStore, @RequestParam(value = CliStrings.PDX_DISKDIR, required = false) final String[] diskDirs) {
    CommandStringBuilder command = new CommandStringBuilder(CliStrings.PDX_RENAME);
    command.addOption(CliStrings.PDX_RENAME_OLD, oldClassName);
    command.addOption(CliStrings.PDX_RENAME_NEW, newClassName);
    command.addOption(CliStrings.PDX_DISKSTORE, diskStore);
    if (hasValue(diskDirs)) {
        command.addOption(CliStrings.PDX_DISKDIR, StringUtils.join(diskDirs, StringUtils.COMMA_DELIMITER));
    }
    return processCommand(command.toString());
}
Also used : CommandStringBuilder(org.apache.geode.management.internal.cli.util.CommandStringBuilder) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 65 with CommandStringBuilder

use of org.apache.geode.management.internal.cli.util.CommandStringBuilder in project geode by apache.

the class MiscellaneousCommandsController method showDeadLock.

// TODO determine if Async functionality is required
@RequestMapping(method = RequestMethod.GET, value = "/deadlocks")
@ResponseBody
public String showDeadLock(@RequestParam(CliStrings.SHOW_DEADLOCK__DEPENDENCIES__FILE) final String dependenciesFile) {
    CommandStringBuilder command = new CommandStringBuilder(CliStrings.SHOW_DEADLOCK);
    command.addOption(CliStrings.SHOW_DEADLOCK__DEPENDENCIES__FILE, decode(dependenciesFile));
    return processCommand(command.toString());
}
Also used : CommandStringBuilder(org.apache.geode.management.internal.cli.util.CommandStringBuilder) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

CommandStringBuilder (org.apache.geode.management.internal.cli.util.CommandStringBuilder)186 Test (org.junit.Test)88 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)87 CommandResult (org.apache.geode.management.internal.cli.result.CommandResult)71 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)47 VM (org.apache.geode.test.dunit.VM)41 File (java.io.File)39 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)37 FlakyTest (org.apache.geode.test.junit.categories.FlakyTest)36 Properties (java.util.Properties)16 Region (org.apache.geode.cache.Region)14 Category (org.junit.experimental.categories.Category)14 Cache (org.apache.geode.cache.Cache)12 SerializableRunnable (org.apache.geode.test.dunit.SerializableRunnable)12 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)11 IOException (java.io.IOException)10 UnknownHostException (java.net.UnknownHostException)7 HashMap (java.util.HashMap)6 RegionAttributes (org.apache.geode.cache.RegionAttributes)6 ClusterConfigurationService (org.apache.geode.distributed.internal.ClusterConfigurationService)6