Files
endoflife-date-release-data/src/nutanix.py
Marc Wrobel 3ca984522a [nutanix] Refactor script (#236)
Make the script more readable, mostly by:

- using the Product class,
- removing the use of functions when unnecessary,
- a little bit of renaming and documentation.
2023-12-11 21:24:32 +01:00

26 lines
882 B
Python

from common import dates
from common import endoflife
from common import http
"""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():
print(f"::group::{product_name}")
product = endoflife.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()
print("::endgroup::")