Reverted heading formats

This commit is contained in:
Chris Buckland
2019-07-11 17:09:45 +02:00
committed by Sergi Delgado Segura
parent ec07434863
commit da5e0d37af

View File

@@ -1,26 +1,26 @@
# pisa-cli ## pisa-cli
`pisa-cli` is a command line interface to interact with the PISA server, written in Python3. `pisa-cli` is a command line interface to interact with the PISA server, written in Python3.
## Dependencies ### Dependencies
Refer to [DEPENDENCIES.md](DEPENDENCIES.md) Refer to [DEPENDENCIES.md](DEPENDENCIES.md)
## Installation ### Installation
Refer to [INSTALL.md](INSTALL.md) Refer to [INSTALL.md](INSTALL.md)
## Usage ### Usage
python pisa-cli.py [global options] command [command options] [arguments] python pisa-cli.py [global options] command [command options] [arguments]
### Global options #### Global options
- `-s, --server`: API server where to send the requests. Defaults to btc.pisa.watch (modifiable in \_\_init\_\_.py) - `-s, --server`: API server where to send the requests. Defaults to btc.pisa.watch (modifiable in \_\_init\_\_.py)
- `-p, --port` : API port where to send the requests. Defaults to 9814 (modifiable in \_\_init\_\_.py) - `-p, --port` : API port where to send the requests. Defaults to 9814 (modifiable in \_\_init\_\_.py)
- `-d, --debug`: shows debug information and stores it in pisa.log - `-d, --debug`: shows debug information and stores it in pisa.log
- `-h --help`: shows a list of commands or help for a specific command. - `-h --help`: shows a list of commands or help for a specific command.
### Commands #### Commands
The command line interface has, currently, three commands: The command line interface has, currently, three commands:
@@ -28,7 +28,7 @@ The command line interface has, currently, three commands:
- `get_appointment`: gets json formatted data about an appointment from the PISA server. - `get_appointment`: gets json formatted data about an appointment from the PISA server.
- `help`: shows a list of commands or help for a specific command. - `help`: shows a list of commands or help for a specific command.
## add_appointment ### add_appointment
This command is used to register appointments to the PISA server. Appointments **must** be `json` encoded, and match the following format: This command is used to register appointments to the PISA server. Appointments **must** be `json` encoded, and match the following format:
@@ -52,14 +52,14 @@ This command is used to register appointments to the PISA server. Appointments *
The API will return a `text/plain` HTTP response code `200/OK` if the appointment is accepted, with the locator encoded in the response text, or a `400/Bad Request` if the appointment is rejected, with the rejection reason encoded in the response text. The API will return a `text/plain` HTTP response code `200/OK` if the appointment is accepted, with the locator encoded in the response text, or a `400/Bad Request` if the appointment is rejected, with the rejection reason encoded in the response text.
### Usage #### Usage
python pisa-cli add_appointment [command options] <appointment>/<path_to_appointment_file> python pisa-cli add_appointment [command options] <appointment>/<path_to_appointment_file>
if `-f, --file` **is** specified, then the command expects a path to a json file instead of a json encoded if `-f, --file` **is** specified, then the command expects a path to a json file instead of a json encoded
string as parameter. string as parameter.
### Options #### Options
- `-f, --file path_to_json_file` loads the appointment data from the specified json file instead of command line. - `-f, --file path_to_json_file` loads the appointment data from the specified json file instead of command line.
**Appointment can be in three states** **Appointment can be in three states**
@@ -100,18 +100,18 @@ if `-f, --file` **is** specified, then the command expects a path to a json file
## help ### help
Shows the list of commands or help about how to run a specific command. Shows the list of commands or help about how to run a specific command.
### Usage #### Usage
python pisa-cli help python pisa-cli help
or or
python pisa-cli help command python pisa-cli help command
## Example ### Example
1. Generate a new dummy appointment. **Note:** this appointment will never be fulfilled (it will eventually expire) since it does not corresopond to a valid transaction. However it can be used to interact with the PISA API. 1. Generate a new dummy appointment. **Note:** this appointment will never be fulfilled (it will eventually expire) since it does not corresopond to a valid transaction. However it can be used to interact with the PISA API.
@@ -135,6 +135,6 @@ or
python pisa-cli.py get_appointment <appointment_locator> python pisa-cli.py get_appointment <appointment_locator>
``` ```
## PISA API ### PISA API
If you wish to read about the underlying API, and how to write your own tool to interact with it, refer to [PISA-API.md](PISA-API.md) If you wish to read about the underlying API, and how to write your own tool to interact with it, refer to [PISA-API.md](PISA-API.md)