Skip to content

Commit 420d8da

Browse files
committed
added param examples
1 parent 0e159f5 commit 420d8da

File tree

2 files changed

+48
-9
lines changed

2 files changed

+48
-9
lines changed

README.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,14 +402,31 @@ All API calls can be called from the command line.
402402
The command will convert domain names on-the-fly into zone_identifier's.
403403

404404
```bash
405-
$ 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...
405+
$ 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...
406406

407407
```
408408

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

412-
The output from the CLI command is in JSON or YAML format (and human readable).
411+
For API calls that need to pass data or parameters there is various formats to use.
412+
413+
The simplest form is ```item=value```. This passes the value as a string within the APIs JSON data.
414+
415+
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.
416+
For example: ```item==value```.
417+
418+
if you need to pass a list of items; then _[]_ can be used. For example:
419+
420+
```
421+
pool_id1="11111111111111111111111111111111"
422+
pool_id2="22222222222222222222222222222222"
423+
pool_id3="33333333333333333333333333333333"
424+
cli4 --post global_pools="[ ${pool_id1}, ${pool_id2}, ${pool_id3} ]" region_pools="[ ]" /user/load_balancers/maps
425+
```
426+
427+
### CLI output
428+
429+
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).
413430

414431
### Simple CLI examples
415432

README.rst

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -448,14 +448,36 @@ convert domain names on-the-fly into zone\_identifier's.
448448

449449
.. code:: bash
450450
451-
$ 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...
451+
$ 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...
452452
453-
For API calls that need a set of date or parameters passed there is a
454-
item=value format. If you want a numeric value passed, then *==* can be
455-
used to force the value to be treated as a numeric value.
453+
CLI paramaters for POST/PUT/PATCH
454+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
455+
456+
For API calls that need to pass data or parameters there is various
457+
formats to use.
458+
459+
The simplest form is ``item=value``. This passes the value as a string
460+
within the APIs JSON data.
461+
462+
If you need a numeric value passed then *==* can be used to force the
463+
value to be treated as a numeric value within the APIs JSON data. For
464+
example: ``item==value``.
465+
466+
if you need to pass a list of items; then *[]* can be used. For example:
467+
468+
::
469+
470+
pool_id1="11111111111111111111111111111111"
471+
pool_id2="22222222222222222222222222222222"
472+
pool_id3="33333333333333333333333333333333"
473+
cli4 --post global_pools="[ ${pool_id1}, ${pool_id2}, ${pool_id3} ]" region_pools="[ ]" /user/load_balancers/maps
474+
475+
CLI output
476+
~~~~~~~~~~
456477

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

460482
Simple CLI examples
461483
~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)