From 10bb2434068f8907266d722280dab27db7c1cb66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Abdelkader=20Mart=C3=ADnez=20P=C3=A9rez?= Date: Fri, 22 Nov 2019 13:37:09 +0100 Subject: [PATCH] Brainstorming session about the tutorial. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: César Gallego --- docs/source/index.rst | 5 ++ docs/source/tutorial/_brainstorm.rst | 69 ++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 docs/source/tutorial/_brainstorm.rst diff --git a/docs/source/index.rst b/docs/source/index.rst index 826cba1..7dab6da 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -23,6 +23,11 @@ theory/route_matching theory/routes +.. toctree:: + :maxdepth: 2 + :caption: Tutorial + + tutorial/_brianstorm Indices and tables ================== diff --git a/docs/source/tutorial/_brainstorm.rst b/docs/source/tutorial/_brainstorm.rst new file mode 100644 index 0000000..657f02b --- /dev/null +++ b/docs/source/tutorial/_brainstorm.rst @@ -0,0 +1,69 @@ +User Profile +============ + +Before You Start +---------------- + +Needed Skills: + +#. Basic Linux +#. Proficient shell +#. How HTTP works + +Needed Tools: + +#. Linux machine +#. Installed Kapow! distribution + +Motive +------ + +Use Kapow! to expose some Linux Box internal metrics and actions as an HTTP API for third party users. + +Scenario +-------- + +User is a DevOps at ACME Company. + +ACME Company appears to be a conglomerate which produces and sells every product type imaginable. + +ACME's Infrastructure +--------------------- + +- 2 Linux machines + - Corporate Server + - Backup Server + +User Journey +------------ + +#. Actions over the database. Launch database backup script with an HTTP call. + - User Learns: Add a route that executes a command locally. + - Kapow! Concepts: `kapow route add` +#. Basic database monitorization + - User Learns: Execute local commands and output it results to the HTTP body. + - Kapow! Concepts: `kapow set /response/body` +#. Advanced database monitorization + - User Learns: Compose complex HTTP responses with more than one local command. + - Kapow! Concepts: HEREDOC and subshells +#. Share your achievements + - User Learns: Format a complex HTTP response with JSON format to feed the corporate dashboard. + - Kapow! Concepts: backtick interpolation and `kapow set /response/headers` +#. Unifing the interface (???) + - User Learns: Add logic to the handler. React to a specific request. + - Kapow! Concepts: `kapow get /request/headers` and IF (bash) + + + Ideas +------ + +/request/params -> Filter the results of a backup query +Use redirects to from one Kapow! server to another. I.e: 192.168.1.1/backups/{path:.*} --> 192.168.1.2/ +/request/files -> Firma el fichero que sube el usuario y te lo devuelve firmado. + + +.. note:: + + Add this to serve the webpage that uses the implemented HTTP API + kapow route add / -c 'kapow set /resonse/headers/Content-Type text/html ; curl --output - http:// | kapow set /response/body' +