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

The API is version 1.0 and supports JSON format.

Base URL
https://access.redhat.com/product-life-cycles/api/v1/

List Product Life Cycle

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
Parameters
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

Support legacy API endpoint /lifecycle.

JSON
GET /plccapi/lifecycle.json
XML
GET /plccapi/lifecycle.xml
Parameters
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

#!/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('-----')