Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
226 lines (176 sloc) 4.04 KB

IPv6DB APIv1

A RESTful Web service for IPv6-related data

  • Default Web service port: 4446

  • IPv6 addresses have just to be valid ones, but they are stored and returned canonized in conformation with RFC 5952.

  • The field "source" takes a schema-free JSON value.

  • In case of success, POST, PUT and DELETE returns a HTTP status 204 "No Content".

  • The field "ttl" is optional (default to null).

/ipv6db/v1/list/{listName}/addresses/{IPv6Address}

POST /ipv6db/v1/list/{listName}/addresses/{IPv6Address}

Creates a resource.

POST /ipv6db/v1/list/hosts/addresses/abcd::1234
    {
      "ttl": 3600,
      "source":
        {
          "services": ["smtp","imap"]
        }
    }

PUT /ipv6db/v1/list/{listName}/addresses/{IPv6Address}

Updates a resource.

    PUT /ipv6db/v1/list/hosts/addresses/abcd::1234
    {
      "ttl": 3600,
      "source":
        {
          "services": ["smtp","imap","ssh"]
        }
    }

Response:

If successful, returns HTTP Status 204 No Content

GET /ipv6db/v1/list/{listName}/addresses/{IPv6Address}

    GET /ipv6db/v1/list/hosts/addresses/abcd::1234

Response:

    {
      "list": "hosts",
      "address": "abcd::1234",
      "ttl": null,
      "source":
        {
          "services": ["smtp","imap","ssh"]
        }
    }

DELETE /ipv6db/v1/list/{listName}/addresses/{IPv6Address}

    DELETE /ipv6db/v1/hosts/addresses/abcd::1234

Response:

/ipv6db/v1/list/{listName}/addresses

POST /ipv6db/v1/list/{listName}/addresses

Creates many resources that belongs to the given list.

    POST /ipv6db/v1/hosts/addresses
    [
      {
        "address": "abcd::1234",
        "ttl": null,
        "source":
          {
            "services": ["smtp","imap","ssh"]
          }
      },
      {
        "address": "abcd::1235",
        "ttl": null,
        "source":
          {
            "services": ["http","https","ssh"]
          }
      }
    ]

PUT /ipv6db/v1/list/{listName}/addresses

Updates many resources that belongs to the given list.

    PUT /ipv6db/v1/hosts/addresses
    [
      {
        "address": "abcd::1234",
        "ttl": null,
        "source":
          {
            "services": ["smtp","imap","ssh"]
          }
      },
      {
        "address": "abcd::1235",
        "ttl": null,
        "source":
          {
            "services": ["http","https","ssh"]
          }
      }
    ]

GET /ipv6db/v1/list/{listName}/addresses

Gets many resources from the list based on a JSON array of IPv6 addresses.

    GET /ipv6db/v1/hosts/addresses
    [
      "abcd::1234",
      "abcd::1235"
    ]

DELETE /ipv6db/v1/list/{listName}/addresses

Deletes many resources from the list based on a JSON array of IPv6 addresses.

    DELETE /ipv6db/v1/hosts/addresses
    [
      "abcd::1234",
      "abcd::1235"
    ]

/ipv6db/v1/batch

PUT /ipv6db/v1/batch

Updates many resources possibly from different lists based on a JSON array.

    PUT /ipv6db/v1/batch
    [
      {
        "list": "hosts",
        "address": "abcd::1234",
        "ttl": null,
        "source":
          {
            "services": ["smtp","imap"]
          }
      },
      {
        "list": "blacklist",
         "address": "bad::1235",
         "ttl": 604800,
         "source": null
      }
    ]

GET /ipv6db/v1/batch

Gets many resources possibly from different lists based on a JSON array.

    GET /ipv6db/v1/batch
    [
      {
        "list": "hosts",
        "address": "abcd::1234"
      },
      {
        "list": "blacklist",
        "address": "bad::1234"
      }
    ]

DELETE /ipv6db/v1/batch

Deletes many resources possibly from different lists based on a JSON array.

    DELETE /ipv6db/v1/batch
    [
      {
        "list": "hosts",
        "address": "abcd::1234"
      },
      {
        "list": "backlist",
        "address": "bad::1234"
      }
    ]