Add versions.json endpoint with latest release information

Поиск
Список
Период
Сортировка
От Sehrope Sarkuni
Тема Add versions.json endpoint with latest release information
Дата
Msg-id CAH7T-arRnBT4YGoJs__ANNDhr1TSowv-o-bTq84-B=H_D77Oww@mail.gmail.com
обсуждение исходный текст
Ответы Re: Add versions.json endpoint with latest release information
Список pgsql-www
Hello,

The attached patch adds a /versions.json endpoint with the latest release information. The response is a machine parseable JSON array with one entry per release.

For simplicity the patch keeps the same field names in the response as the django model. Someone else with more familiarity with django may want to change that (tree => major?).

Sample output:

[
  {
    "tree": "8.0",
    "latestminor": 21,
    "reldate": "2009-03-17",
    "current": false,
    "supported": true,
    "eoldate": "2010-10-01"
  },
  {
    "tree": "8.1",
    "latestminor": 17,
    "reldate": "2009-03-17",
    "current": false,
    "supported": true,
    "eoldate": "2010-11-01"
  },
  // ... truncated ...
  {
    "tree": "8.4",
    "latestminor": 0,
    "reldate": "2009-07-01",
    "current": false,
    "supported": true,
    "eoldate": "2014-07-01"
  }
]
The use case is for automatically determining the latest and greatest PG versions via simple scripting:

$ curl -s http://www.postgresql.org/versions.json | jq 'last'
{
  "tree": "8.4",
  "latestminor": 0,
  "reldate": "2009-07-01",
  "current": false,
  "supported": true,
  "eoldate": "2014-07-01"
}

Regards,
-- Sehrope Sarkuni
Founder & CEO | JackDB, Inc. | https://www.jackdb.com/

Вложения

В списке pgsql-www по дате отправления:

Предыдущее
От: David Turoň
Дата:
Сообщение: Wiki editor request
Следующее
От: Ilaria
Дата:
Сообщение: Google Summer of Code 2021 - last call for mentors