Skip to content

Latest commit

 

History

History
67 lines (32 loc) · 3.16 KB

File metadata and controls

67 lines (32 loc) · 3.16 KB

RESTful API for managing machines in the cloud

The Tech Stack used for this repo is Node.js and Mongo Database These below API enpoints allows user to create clusters,machines and add tags to them.And also delete the clusters and machines and perform operation based on the tags. Basically APIs does everything required to manage the clusters and machines and it has been tested in Postman application

Deployed at : https://nodejs-restapi-backend.herokuapp.com/

API ENDPOINTS

To get all the data about clusters

DESCRIPTION : This GET request fetches the data about all clusters and machines information that is available in the Database

GET : localhost:9000 (or) https://nodejs-restapi-backend.herokuapp.com/

To add new clusters

DESCRIPTION : This POST request allows the user to create a new cluster with zero machines initially.

POST : localhost:9000/add (or) https://nodejs-restapi-backend.herokuapp.com/add

To Delete the cluster

DESCRIPTION : This DELETE request allows the user to delete the cluster based on the user requirement. The cluster name is fetched from the API params which allows the system to identify the clsuter and delete it

DELETE : localhost:9000/delete/:clusterName (or) https://nodejs-restapi-backend.herokuapp.com/delete/:clustername

To add machines to cluster

DESCRIPTION: This PUT request allows the user to add machines to the existing cluster based on the cluster name.Only new machines can be added to cluster.Existing machines can not be added to different cluster.

PUT : localhost:9000/machines/:clusterName (or) https://nodejs-restapi-backend.herokuapp.com/machines/:clusterName

To update tags on machine

DESCRIPTION: This PUT request allows the user to update tag in machines based on the user requirement of clustername and machine name.

PUT : localhost:9000/machines/tags/:clusterName/:machinename (or) https://nodejs-restapi-backend.herokuapp.com/machines/tags/:clusterName/:machinename

To delete machines from cluster

DESCRIPTION: This DELETE request allows user to delete machine from the cluster of user's choice.

DELETE : localhost:9000/machines/delete/:clusterName/:machinename (or) https://nodejs-restapi-backend.herokuapp.com/machines/delete/:clusterName/:machinename

To get data based on tags

DESCRIPTION: This GET request is to find out the clusters and machines which have tags as start,stop and reboot operations. For Example, If the user needs only machines that has the tags as Reboot, Then the system fetches only the reeboot machines. This request helps user to classify the tags and fetch them accordingly.

GET : localhost:9000/machines/tags/:tags (or) https://nodejs-restapi-backend.herokuapp.com/machines/tags/:tags

sample tags can be start/stop/reboot

To update multiple machines based on tags

DESCRIPTION: This PUT request allows user to update the tags on multiple machines at the same time. For Example, it helps the user to stop all the machines which are rebooting and start them through same api endpoint

PUT : localhost:9000/machines/tags/:tags (or) https://nodejs-restapi-backend.herokuapp.com/machines/tags/:tags