Skip to content

RafaelFino/learnops-api-python

Repository files navigation

Learnops API with Python

APIs with Python - Intro with KillerCoda

Content aggregated and developed for the study about APIs

Quick Start

  1. Create an Ubuntu instance in KillerCoda

  2. Run This command on VM Terminal:

curl https://raw.githubusercontent.com/RafaelFino/learnops-api-python/main/prepare.sh | bash && zsh
  1. Run the command, for application path (~/learnops-api-python):
cd ~/learnops-api-python
source bin/activate
pip3 install -r requirements.txt
  1. Run command, to upload the server:
./run-server.sh {api-name}

If you run ./run-server.sh and don't provide the endpoint, you'll get the following return:

API name are expected! Try one of available options:
#       ping
#       example
#       hello
#       body
#       sum
#       crud
#       currency
#       auth
#       auth-jwt
  1. Open a second tab in the console, to run the client commands

  2. Run command, for application path (~/learnops-api-python):

cd ~/learnops-api-python
source bin/activate
  1. Run the command to make the requests
./run-client.sh {api-name}

Available APIs:

Name Description HTTP return Swagger Args Return type Diagram
ping A ping pong example API 𐄂 𐄂 𐄂 text ping diagram
example Simple API, using swagger in code 𐄂 json body example diagram
hello API with one path GET method in file in path json body hello diagram
body API with one POST method, passing args in body in file in body json body body diagram
sum A sum calc API, to show a simple service in file in body json body sum diagram
crud REST API with CRUD example, to show REST Methods indivual files in body and path json body crud diagram
currency API to query and convert currency values, args on path and body indivual files in body and path json body currency diagram
auth Simple API to show a how a login and token works indivual files in body and header json body auth diagram
auth-jwt Login API example with JWT indivual files in body, header and path json body auth-jwt diagram

More info

  1. Distributed Systems
  2. What is an API?
  3. HTTP Pattern
  4. REST APIs
  5. JSON Format
  6. Auth and Sec
  7. JWT - Json Web Token
  8. Micro Services and APIs
  9. Arch and best pratices

Special Thanks!

Thanks!

About

APIs with Python - Intro with KillerCoda

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published