Files
endoflife-date-release-data/src/nutanix.py
Marc Wrobel b339c81ead Split endoflife.date and releasedata models in separate files (#276)
This makes the code easier to read.
2024-01-07 20:22:46 +01:00

22 lines
786 B
Python

from common import dates, http, releasedata
"""Fetch Nutanix products versions from https://portal.nutanix.com/api/v1."""
PRODUCTS = {
'nutanix-aos': 'https://portal.nutanix.com/api/v1/eol/find?type=NOS',
'nutanix-files': 'https://portal.nutanix.com/api/v1/eol/find?type=FILES',
'nutanix-prism': 'https://portal.nutanix.com/api/v1/eol/find?type=PC',
}
for product_name, url in PRODUCTS.items():
product = releasedata.Product(product_name)
data = http.fetch_url(url).json()
for version_data in data["contents"]:
if 'GENERAL_AVAILABILITY' in version_data:
version = version_data["version"]
date = dates.parse_datetime(version_data["GENERAL_AVAILABILITY"])
product.declare_version(version, date)
product.write()