Product Life Cycle Data API
The API exposes a list of endpoints to query Red Hat Product Life Cycle data with certain parameters. placeholder
Overview Copy linkLink copied!
The API is version 1.0 and supports JSON format.
https://access.redhat.com/product-life-cycles/api/v1/
List Product Life Cycle Copy linkLink copied!
List all up-to-date product life cycle data when no parameter is passed. Returns a convenience object as response with all attributes.
JSON
GET /products
- Name
- name
- Description
- Index of products filter. Multi product names seperated by comma(,) is suppported.
- Example
- name=Red Hat Enterprise Linux,Openshift Container Platform 4
- Default
- all
Legacy Support Copy linkLink copied!
Support legacy API endpoint /lifecycle.
GET /plccapi/lifecycle.json
GET /plccapi/lifecycle.xml
| Name | Description | Example | Default |
|---|---|---|---|
| products | Index of products filter. Multi-products seperated by comma(,) is suppported. | products=Red%20Hat%20Enterprise%20Linux,Openshift%20Container%20Platform | all |
| all_versions | Index of all versions including ones that are out of Red Hat service. | all_versions=false | true |
Example script Copy linkLink copied!
#!/usr/bin/env python
from __future__ import print_function
import sys
import requests
from datetime import datetime, timedelta
API_HOST = 'https://access.redhat.com/product-life-cycles/api/v1'
def get_data(query):
full_query = API_HOST + query
r = requests.get(full_query)
if r.status_code != 200:
print('ERROR: Invalid request; returned {} for the following '
'query:\n{}'.format(r.status_code, full_query))
sys.exit(1)
if not r.json():
print('No data returned with the following query:')
print(full_query)
sys.exit(0)
return r.json()
# Get RHEL and Openshift Container Platform 4 life cycle data
endpoint = '/products'
params = 'name=Red Hat Enterprise Linux,Openshift Container Platform 4'
data = get_data(endpoint + '?' + params)
products = data['data']
for product in products:
print(product)
# Get RHEL and Openshift Container Platform 4 life cycle data using legacy JSON endpoint
endpoint = '/plccapi/lifecycle.json'
params = 'products=Red Hat Enterprise Linux,Openshift Container Platform 4'
data = get_data(endpoint + '?' + params)
for product in data:
print(product)
print('-----')