@RequestMapping(method = RequestMethod.POST, value = "/regions")
  public ResponseEntity<?> createRegion(
      @RequestParam(CliStrings.CREATE_REGION__REGION) String namePath,
      @RequestParam(value = CliStrings.CREATE_REGION__SKIPIFEXISTS,
          defaultValue = "false") Boolean skipIfExists,
      @RequestParam(value = CliStrings.CREATE_REGION__REGIONSHORTCUT,
          defaultValue = "PARTITION") RegionShortcut type)
      throws IOException {

    CommandStringBuilder command = new CommandStringBuilder(CliStrings.CREATE_REGION);

    command.addOption(CliStrings.CREATE_REGION__REGION, namePath);
    command.addOption(CliStrings.CREATE_REGION__REGIONSHORTCUT, type.name());

    Optional.ofNullable(skipIfExists)
        .ifPresent(it -> command.addOption(CliStrings.CREATE_REGION__SKIPIFEXISTS, it.toString()));

    return command(command.toString(), DEFAULT_MULTIPART_FILE);
  }
The ShellCommandsController class implements GemFire REST API calls for Gfsh Shell Commands.

@see org.springframework.stereotype.Controller
@see org.springframework.web.bind.annotation.RequestBody
@see org.springframework.web.bind.annotation.RequestMapping
@see org.springframework.web.bind.annotation.RequestMethod
@see org.springframework.web.bind.annotation.RequestParam
@see org.springframework.web.bind.annotation.ResponseBody
@since GemFire 8.0
geode-web/src/main/java/org/apache/geode/management/internal/web/controllers/ShellCommandsController.java