uncloud/doc/uncloud-manual-2020-08-01.org

36 lines
1.1 KiB
Org Mode
Raw Normal View History

2020-08-01 12:05:12 +00:00
* Bootstrap
- Login via a user so that the user object gets created
- Run the following (replace nicocustomer with the username)
#+BEGIN_SRC sh
python manage.py bootstrap-user --username nicocustomer
#+END_SRC
2020-08-01 11:07:44 +00:00
* Testing / CLI Access
Access via the commandline (CLI) can be done using curl or
httpie. In our examples we will use httpie.
** Checkout out the API
#+BEGIN_SRC sh
http localhost:8000/api/
#+END_SRC
** Authenticate via ldap user in password store
#+BEGIN_SRC sh
http --auth nicocustomer:$(pass ldap/nicocustomer) localhost:8000/api/
#+END_SRC
* URLs
- api/ - the rest API
2020-08-01 12:05:12 +00:00
* Models
** Bill
Bills are summarising usage in a specific timeframe. Bills usually
spawn one month.
** BillRecord
Bill records are used to model the usage of one order during the
timeframe.
** Order
Orders register the intent of a user to buy something. They might
refer to a product. (???)
Order register the one time price and the recurring price. These
fields should be treated as immutable. If they need to be modified,
a new order that replaces the current order should be created.