Coder Social home page Coder Social logo

okteto-pods's Introduction

Okteto Pods

Okteto Pods is an Offline Exercise that provides an API REST to get Pods Data.

Features

  • Endpoint to get Total Pods.
  • Endpoint to get a Sorted List of Pods using the next posible options: name, restarts and age.

API Usage & Example

URL Base: https://pods-mig-elgt.assessment.jdm.okteto.net

Endpoint to get the number of pods.

Endpoint: /pods/total

Example

Request:
GET https://pods-mig-elgt.assessment.jdm.okteto.net/pods/total

Responses:

Status: 200 - Ok
Body Respose
{
   "total": 100
}

Status: 500 - Internal Server Error
Body Respose
{
   "error": {
      "status": 500,
      "error": "INTERNAL",
      "description": "Something went wrong...",
   }
}

Endpoint to a Sort List of Pods


Endpoint: /pods?sort=field:order

Query Parameters
 - sort
 - values
    // field posible values
    - field: name, restarts, age
    // order posible values
    - order: asc, desc

Example

Request:
GET https://pods-mig-elgt.assessment.jdm.okteto.net/pods?sort=age:desc,name:asc

Responses:

Status: 200 - Ok
Body Respose
{
  "status": 200,
  "pods": [
    {
      "name": "mongodb-0",
      "restarts": 0,
      "status": "Running",
      "age": "18h2m37s"
    },
    {
      "name": "pods-79bf8477c8-wc64q",
      "restarts": 0,
      "status": "Running",
      "age": "43m28s"
    },
    {
      "name": "pods-79bf8477c8-st7wx",
      "restarts": 0,
      "status": "Running",
      "age": "43m28s"
    },
    {
      "name": "pods-79bf8477c8-mj7v6",
      "restarts": 0,
      "status": "Running",
      "age": "43m27s"
    },
    {
      "name": "pods-79bf8477c8-4bfvh",
      "restarts": 0,
      "status": "Running",
      "age": "43m27s"
    }
  ]
}

Status 400 - Bad Request
{
  "error": {
    "status": 400,
    "error": "INVALID_ARGUMENT",
    "description": "One or more fields raised validation errors.",
    "fields": {
      "sort": "Incorrect field order value, should be asc or desc."
    }
  }
}


Status: 500 - Internal Sever Error
Body Respose
{
   "error": {
      "status": 500,
      "error": "INTERNAL",
      "description": "Something went wrong...",
   }
}

okteto-pods's People

Contributors

mig-elgt avatar

Watchers

 avatar  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.