Skip to content

Commit b275a05

Browse files
author
Till Brehm
committed
Merge branch 'master' into 'master'
Refactored login, enable batch and new functions See merge request ispconfig/ispconfig3!771
2 parents 8486d65 + 8627f04 commit b275a05

File tree

2 files changed

+146
-60
lines changed

2 files changed

+146
-60
lines changed

remoting_client/cli/README.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,47 @@
22
Command line for ISPConfig remote user REST API using either smart functions or raw methods.
33

44
## Getting Started
5-
This tool can be used and packaged stand alone, without ISPConfig itself. It is designed to have as few dependencies as possible.
5+
This tool can be used and packaged stand alone, without requiring ISPConfig to be installed locally. It is designed to have as few dependencies as possible.
66

77
The script has two main modes: smart functions and raw methods.
88

9-
Raw methods simply wrap your JSON to the arbitrary method name you've given. As such, it works with any method, and makes properly formatted requests with curl. It is a handy tool for custom requests, testing, advanced scripting and integration work.
9+
Raw methods simply wrap your JSON and use the arbitrary method name you've given when calling the API. As such, it works with any method, and makes properly formatted requests with curl. It is a handy tool for custom requests, testing, advanced scripting and integration work. The actual data is provided through a file, stdin or as an argument.
1010

11-
Functions in turn are combinations of methods and checks that act more like an intelligent tool and does not require the user to understand JSON. This is handy for manual interaction or for scripting.
11+
Functions, on the other hand, are combinations of methods and checks that act more like an intelligent tool and does not require the user to understand JSON. The functions are designed based on their method equivalent, but requiring only a single command and automating the rest (login, get ID's, check existing records etc.). This is handy for manual interaction or for scripting. Unlike methods, functions are limited to those methods implemented in the script itself. Functions are named as their method counterparts. The exception are ```login``` and ```logout``` in order to avoid collisions with system commands. They are called log_in and log_out, respectively.
12+
13+
Functions can also be processed as a batch from file or stdin, optimizing performance by using a single session and single bash instance.
1214

1315
> **Note:**
14-
Consider using -q for scripting, this will suppress everything but results and errors on the output.
16+
Consider using ```-q``` for scripting, this will suppress everything but results and errors on the output.
1517

16-
### Example function usage:
18+
### Example smart function usage:
1719
ispconfig-cli -f "dns_a_add example.com. www 192.168.0.2"
18-
1920
DNS zone example.com. has id 1.
2021
DNS A www exists with id 228, updating...
2122
Updated records: 1
2223

23-
### Example method usage:
24+
### Example raw method usage:
2425
ispconfig-cli -m login -j credentials.json
25-
2626
{"code":"ok","message":"","response":"dc39619b0ac9694cb85e93d8b3ac8258"}
2727

2828
> **Note:**
2929
The whole function has to be quoted as one due to how bash manages the command line arguments.
3030

3131
### Config file
32-
The script uses an optional config file, allowing commands as short as above.
33-
34-
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for
35-
notes on how to deploy the project on a live system.
32+
The script uses an optional config file, allowing commands as short as in the examples above.
3633

3734
## Dependencies
3835
- ```jq``` for working with JSON
3936
- ```curl``` for talking to the endpoint
4037

4138
On debian-based distributions such as ubuntu, you can ensure these are installed by running
39+
4240
sudo apt install jq curl
4341

4442
## Installing
45-
1. Place this script in your path, for example in your ```~/bin``` folder on many distros.
46-
2. Make it executable ```chmod 755 ispconfig-cli```
47-
3. Optionally create a config file in ```/etc/ispconfig-cli.conf``` or ```~/.ispconfig-cli```
43+
1. Place this script in your path. For example, placing it in your ```~/bin``` folder (and logging out and back in if you just created the folder) works on many distributions.
44+
2. Make it executable by running ```chmod 755 ispconfig-cli```.
45+
3. Optionally create a config file in ```/etc/ispconfig-cli.conf``` or ```~/.ispconfig-cli```.
4846

4947
## Details on usage
50-
Run the script without arguments for the full list of functionality and config file creation instructions.
48+
Run the script without arguments or with ```-h``` for the full list of functionality and config file creation instructions.

0 commit comments

Comments
 (0)