Skip to content

Commit

Permalink
added param examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mahtin committed Dec 4, 2016
1 parent 0e159f5 commit 420d8da
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 9 deletions.
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,14 +402,31 @@ All API calls can be called from the command line.
The command will convert domain names on-the-fly into zone_identifier's.

```bash
$ cli4 [-V|--version] [-h|--help] [-v|--verbose] [-q|--quiet] [-j|--json] [-y|--yaml] [-r|--raw] [-d|--dump] [--get|--patch|--post|-put|--delete] [item=value ...] /command...
$ cli4 [-V|--version] [-h|--help] [-v|--verbose] [-q|--quiet] [-j|--json] [-y|--yaml] [-r|--raw] [-d|--dump] [--get|--patch|--post|--put|--delete] [item=value ...] /command...

```

For API calls that need a set of date or parameters passed there is a item=value format.
If you want a numeric value passed, then _==_ can be used to force the value to be treated as a numeric value.
### CLI paramaters for POST/PUT/PATCH

The output from the CLI command is in JSON or YAML format (and human readable).
For API calls that need to pass data or parameters there is various formats to use.

The simplest form is ```item=value```. This passes the value as a string within the APIs JSON data.

If you need a numeric value passed then _==_ can be used to force the value to be treated as a numeric value within the APIs JSON data.
For example: ```item==value```.

if you need to pass a list of items; then _[]_ can be used. For example:

```
pool_id1="11111111111111111111111111111111"
pool_id2="22222222222222222222222222222222"
pool_id3="33333333333333333333333333333333"
cli4 --post global_pools="[ ${pool_id1}, ${pool_id2}, ${pool_id3} ]" region_pools="[ ]" /user/load_balancers/maps
```

### CLI output

The output from the CLI command is in JSON or YAML format (and human readable). This is controled by the _--yaml_ or _--json_ flags (JSON is the default).

### Simple CLI examples

Expand Down
32 changes: 27 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -448,14 +448,36 @@ convert domain names on-the-fly into zone\_identifier's.

.. code:: bash
$ cli4 [-V|--version] [-h|--help] [-v|--verbose] [-q|--quiet] [-j|--json] [-y|--yaml] [-r|--raw] [-d|--dump] [--get|--patch|--post|-put|--delete] [item=value ...] /command...
$ cli4 [-V|--version] [-h|--help] [-v|--verbose] [-q|--quiet] [-j|--json] [-y|--yaml] [-r|--raw] [-d|--dump] [--get|--patch|--post|--put|--delete] [item=value ...] /command...
For API calls that need a set of date or parameters passed there is a
item=value format. If you want a numeric value passed, then *==* can be
used to force the value to be treated as a numeric value.
CLI paramaters for POST/PUT/PATCH
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For API calls that need to pass data or parameters there is various
formats to use.

The simplest form is ``item=value``. This passes the value as a string
within the APIs JSON data.

If you need a numeric value passed then *==* can be used to force the
value to be treated as a numeric value within the APIs JSON data. For
example: ``item==value``.

if you need to pass a list of items; then *[]* can be used. For example:

::

pool_id1="11111111111111111111111111111111"
pool_id2="22222222222222222222222222222222"
pool_id3="33333333333333333333333333333333"
cli4 --post global_pools="[ ${pool_id1}, ${pool_id2}, ${pool_id3} ]" region_pools="[ ]" /user/load_balancers/maps

CLI output
~~~~~~~~~~

The output from the CLI command is in JSON or YAML format (and human
readable).
readable). This is controled by the *--yaml* or *--json* flags (JSON is
the default).

Simple CLI examples
~~~~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit 420d8da

Please sign in to comment.