cyber-dojo-retired / avatars

repo for the cyberdojo/avatars Docker image; a cyber-dojo microservice

Home Page:https://cyber-dojo.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CircleCI

cyberdojo/avatars docker image

all avatars


API


GET alive?

Used as a k8s liveness probe.

  • returns
    • true
    { "ready?": true }
  • parameters
    • none
    {}

GET ready?

Used as a k8s readiness probe.

  • returns
    • true if the service is ready
    { "ready?": true }
    • false if the service is not ready
    { "ready?": false }
  • parameters
    • none
    {}

GET sha

The git commit sha used to create the Docker image.

  • returns
    • The 40 character sha String.
    • eg
    { "sha": "b28b3e13c0778fe409a50d23628f631f87920ce5" }
  • parameters
    • none
    {}

GET names

The names of all 64 avatars.

  • returns
    • An array of 64 strings
    • eg
    { "names": [
        "alligator",
        "antelope",
        "bat",
        ...,
        "whale",
        "wolf",
        "zebra"
      ]
    }
  • parameters
    • none
    {}

GET image(n)

The avatar image with the given index, or the avatar image showing all 64 avatars.

  • returns
    • An image (eg jpg,png,gif,etc)
  • parameters
    • if n == 'all', returns the 8x8 image showing all avatars.
    • if n == 0..63, returns the image showing the n'th avatar, eg, n==0 returns the 'alligator' image, eg, n==63 returns the 'zebra' image.

JSON in, JSON out

  • All methods receive a JSON hash.
    • The hash contains any method arguments as key-value pairs.
  • All methods except image(n) return a JSON hash.
    • If the method completes a key equals the method's name.
    • If the method raises an exception, a key equals "exception".
  • The method image(n) returns a jpg/png image.

cyber-dojo.org home page

About

repo for the cyberdojo/avatars Docker image; a cyber-dojo microservice

https://cyber-dojo.org

License:BSD 2-Clause "Simplified" License


Languages

Language:HTML 52.7%Language:CSS 21.9%Language:Ruby 16.7%Language:Shell 8.3%Language:Dockerfile 0.4%