This is an automated email from the ASF dual-hosted git repository.

kmiller pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 3eaa095  GEODE-4737 Document JSON spec for gfsh command options (#1509)
3eaa095 is described below

commit 3eaa095b0e0ba97e83ebce78b1e0163f0e4dba63
Author: Karen Miller <[email protected]>
AuthorDate: Mon Feb 26 16:59:37 2018 -0800

    GEODE-4737 Document JSON spec for gfsh command options (#1509)
    
    * GEODE-4737 Document JSON spec for gfsh command options
    
    * GEODE-4737 Revise gfsh command JSON spec per review
---
 .../source/subnavs/geode-subnav.erb                |  3 +
 .../gfsh/chapter_overview.html.md.erb              |  4 ++
 .../gfsh/command-pages/alter.html.md.erb           |  3 +
 .../gfsh/command-pages/create.html.md.erb          |  3 +
 .../tools_modules/gfsh/json_in_gfsh.html.md.erb    | 80 ++++++++++++++++++++++
 5 files changed, 93 insertions(+)

diff --git a/geode-book/master_middleman/source/subnavs/geode-subnav.erb 
b/geode-book/master_middleman/source/subnavs/geode-subnav.erb
index 0624fc2..a335acb 100644
--- a/geode-book/master_middleman/source/subnavs/geode-subnav.erb
+++ b/geode-book/master_middleman/source/subnavs/geode-subnav.erb
@@ -1730,6 +1730,9 @@ gfsh</a>
                                 <a 
href="/docs/guide/<%=vars.product_version_nodot%>/tools_modules/gfsh/getting_started_gfsh.html">Basic
 Shell Features and Command-Line Usage</a>
                             </li>
                             <li>
+                                <a 
href="/docs/guide/<%=vars.product_version_nodot%>/tools_modules/gfsh/json_in_gfsh.html">Specifying
 JSON within Command-Line Options</a>
+                            </li>
+                            <li>
                                 <a 
href="/docs/guide/<%=vars.product_version_nodot%>/tools_modules/gfsh/tour_of_gfsh.html">Tutorial—Performing
 Common Tasks with gfsh</a>
                             </li>
                             <li class="has_submenu">
diff --git a/geode-docs/tools_modules/gfsh/chapter_overview.html.md.erb 
b/geode-docs/tools_modules/gfsh/chapter_overview.html.md.erb
index 318dc99..c64bb64 100644
--- a/geode-docs/tools_modules/gfsh/chapter_overview.html.md.erb
+++ b/geode-docs/tools_modules/gfsh/chapter_overview.html.md.erb
@@ -41,6 +41,10 @@ limitations under the License.
 
     The `gfsh` utility provides useful features for a shell environment, 
including command auto-complete, preserved command history, and delimiting of 
multi-line commands. Context-sensitive help is available by command and by 
topic.
 
+-   **[Specifying JSON within Command-Line Options](json_in_gfsh.html)**
+
+    Some `gfsh` commands allow JSON specifications within command-line options.
+
 -   **[Tutorial—Performing Common Tasks with gfsh](tour_of_gfsh.html)**
 
     This topic takes you through a typical sequence of tasks that you execute 
after starting `gfsh`.
diff --git a/geode-docs/tools_modules/gfsh/command-pages/alter.html.md.erb 
b/geode-docs/tools_modules/gfsh/command-pages/alter.html.md.erb
index b406855..c40a93a 100644
--- a/geode-docs/tools_modules/gfsh/command-pages/alter.html.md.erb
+++ b/geode-docs/tools_modules/gfsh/command-pages/alter.html.md.erb
@@ -182,6 +182,9 @@ alter disk-store --name=DiskStore1 --region=region1 
--disk-dirs=/Disks/DiskStore
 
 Alters the configuration of a region.
 
+See [Specifying JSON within Command-Line Options](../json_in_gfsh.html)
+for syntax details.
+
 **Availability:** Online. You must be connected in <span class="keyword 
parmname">gfsh</span> to a JMX Manager member to use this command.
 
 **Syntax:**
diff --git a/geode-docs/tools_modules/gfsh/command-pages/create.html.md.erb 
b/geode-docs/tools_modules/gfsh/command-pages/create.html.md.erb
index 728881a..dbfe98b 100644
--- a/geode-docs/tools_modules/gfsh/command-pages/create.html.md.erb
+++ b/geode-docs/tools_modules/gfsh/command-pages/create.html.md.erb
@@ -726,6 +726,9 @@ You must specify either a `--type` or a `--template-region` 
for initial configur
 
 See [Region Data Storage and 
Distribution](../../../developing/region_options/chapter_overview.html).
 
+See [Specifying JSON within Command-Line Options](../json_in_gfsh.html)
+for syntax details.
+
 **Availability:** Online. You must be connected in `gfsh` to a JMX Manager 
member to use this command.
 
 **Syntax:**
diff --git a/geode-docs/tools_modules/gfsh/json_in_gfsh.html.md.erb 
b/geode-docs/tools_modules/gfsh/json_in_gfsh.html.md.erb
new file mode 100644
index 0000000..982fc4f
--- /dev/null
+++ b/geode-docs/tools_modules/gfsh/json_in_gfsh.html.md.erb
@@ -0,0 +1,80 @@
+---
+title:  Specifying JSON within Command-Line Options
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+Some `gfsh` commands allow JSON specifications within some options.
+These JSON strings specify initialization properties in the form of
+key/value pairs.
+
+A JSON string is appended to a fully qualified class name,
+for those classes that implement the `Declarable` interface.
+The parameter to the interface's `init` method is an
+object that contains initialization properties.
+The JSON string is parsed and broken into a set of
+property names and values that define the object. 
+
+The specification of a cache loader class in the `gfsh create region`
+command may have a JSON specification.
+For example,
+
+```
+gfsh>create region --name=region1 --type=PARTITION \
+   --cache-loader=com.example.Setup{'k1':'v1','k2':'v2','k3':'v3'} 
+```
+
+The JSON string in this example is
+
+``` pre
+{'k1':'v1','k2':'v2','k3':'v3'} 
+```
+
+The JSON string is surrounded by curly braces, and the pairs
+are separated by commas.  
+Each pair is separated by a colon.
+Each of the two strings that define a pair
+is enclosed with single or double quote characters.
+Be consistent throughout the JSON string in the use of
+either single or double quote characters.
+
+Space characters separate `gfsh` command-line options,
+and the tokenizing of the options occurs before the parsing
+of JSON strings.
+If the value within the command-line option contains a space,
+delimit it with double quote marks.
+
+As an example, assume that there is a single pair, and the
+value of the pair is `value with space`.
+The right-hand side of the `--cache-loader` example option becomes
+
+```
+gfsh>create region --name=region2 --type=PARTITION \
+   --cache-loader="com.example.Setup{'k1':'value with space'}" 
+```
+
+To incorporate a single quote character within a value,
+escape it with two backslash characters.
+For example,
+
+```
+gfsh>create region --name=region3 --type=PARTITION \
+   --cache-loader="com.example.Setup{'k1':'property\\'s value'}" 
+```
+
+The value of the pair is `property's value`.

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to