Git Product home page Git Product logo

plant's Introduction

Plant API

This API provide a REST endpoint to maintain plants :)

Creating plants

POST /v1/plant

{
    "name": "happy plant",
    "qty_liters_per_watering": 0.8
}

HTTP/1.1 201 Created

{
    "plant_id": "36bf002e3a684376-847c-b5bfb52fd088",
    "name": "happy plant",
    "qty_liters_per_watering": 0.8
}

Getting plants

GET /v1/plant

HTTP/1.1 200 Ok
[
    {
        "plant_id": "36bf002e3a684376847cb5bfb52fd088",
        "name": "happy plant",
        "qty_liters_per_watering": 0.8
    },
    {
        "plant_id": "36bf002e3a684376847cdofdfioa3234ad",
        "name": "another plant",
        "qty_liters_per_watering": 2
    },
    {
        "plant_id": "fja0sd9fja09sdfja0d9fja0dfa0dfj0ad",
        "name": "another plant",
        "qty_liters_per_watering": 1.2
    }
]

Getting a plant

GET /v1/plant

HTTP/1.1 200 Ok

{
    "plant_id": "36bf002e3a684376847cb5bfb52fd088",
    "name": "happy plant",
    "qty_liters_per_watering": 0.8
}

Updating plants

PUT /v1/plant/36bf002e3a684376847cb5bfb52fd088

{
    "qty_liters_per_watering": 2.0
}


HTTP/1.1 200 Ok

{
    "plant_id": "36bf002e3a684376-847c-b5bfb52fd088",
    "name": "happy plant",
    "qty_liters_per_watering": 2.0
}

Deleting plants

DELETE /v1/plant/36bf002e3a684376847cb5bfb52fd088

HTTP/1.1 200 Ok

{
    "success": true
}

plant's People

Contributors

ricardotulio avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.