Add versions.json endpoint with latest release information

From: Sehrope Sarkuni <sehrope(at)jackdb(dot)com>
To: PostgreSQL WWW <pgsql-www(at)postgresql(dot)org>
Subject: Add versions.json endpoint with latest release information
Date: 2021-04-27 18:25:52
Message-ID: CAH7T-arRnBT4YGoJs__ANNDhr1TSowv-o-bTq84-B=H_D77Oww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

Attachment Content-Type Size
0001-Add-versions.json-endpoint.patch text/x-patch 2.0 KB

Responses

Browse pgsql-www by date

  From Date Subject
Next Message Ilaria 2021-04-27 19:44:16 Google Summer of Code 2021 - last call for mentors
Previous Message David Turoň 2021-04-23 05:36:18 Wiki editor request