Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.
/ ama Public archive

Ask Me Anything - Collection of HTTP API endpoints to provide information

License

Notifications You must be signed in to change notification settings

HowNetWorks/ama

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ask Me Everything CircleCI

Endpoints

Who am I?

$ curl https://$SERVER/ama/whoami/
{
  "data": {
    "ip": "185.38.2.2",
    "name": "nat2.panoulu.net"
  }
}

Resolve DNS name (PTR query)

$ curl https://$SERVER/ama/reverse/185.38.2.1
{
  "data": {
    "ip": "185.38.2.1",
    "name": "nat1.panoulu.net"
  }
}

What Cymry knows about IP?

$ curl https://$SERVER/ama/cymru/185.38.2.3
{
  "data": [
    {
      "ip_addr": "185.38.2.3",
      "bgp_prefix": "185.38.0.0/22",
      "as_number": 47605,
      "as_name": "FNE-AS , FI",
      "country_code": "FI",
      "registry": "ripencc",
      "allocated": "2013-10-17"
    }
  ]
}

Errors

Errors are reported with non-OK HTTP response (status code 400-499) with body containing JSON object with "errors". This tries to mimic what GitHub API v3 does.

$ curl https://$SERVER/ama/cymru/185.38.2
{
  "message": "invalid IP address syntax"
}

About

Ask Me Anything - Collection of HTTP API endpoints to provide information

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages