Search in sources :

Example 26 with CommandStringBuilder

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

the class ConfigCommandsController method describeConfig.

@RequestMapping(method = RequestMethod.GET, value = "/members/{member}/config")
@ResponseBody
public String describeConfig(@PathVariable("member") final String memberNameId, @RequestParam(value = CliStrings.DESCRIBE_CONFIG__HIDE__DEFAULTS, defaultValue = "true") final Boolean hideDefaults) {
    CommandStringBuilder command = new CommandStringBuilder(CliStrings.DESCRIBE_CONFIG);
    command.addOption(CliStrings.DESCRIBE_CONFIG__MEMBER, decode(memberNameId));
    command.addOption(CliStrings.DESCRIBE_CONFIG__HIDE__DEFAULTS, String.valueOf(hideDefaults));
    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 27 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 28 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 29 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 30 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)

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