Red Hat Subscription Management Integration Guide

Red Hat Subscription Management 1

Guidance for integrating your application with Red Hat Subscription Management

Red Hat Subscription Management Documentation Team

Abstract

This document provides information about using APIs exposed by Red Hat Subscription Management in order to query and update customer cases.

1. Introduction

It is now possible to integrate with the Customer Portal at http://access.redhat.com using an XML-based REST API [1]. This document outlines common use cases including examples in common clients and frameworks. The official API documentation can be found on the Customer Portal at https://access.redhat.com/site/documentation/Red_Hat_Customer_Portal/ and includes both XML Schema and RESTful resource information.

2. Clients

The Customer Portal API is, by nature, client-agnostic. It is expressed as a set of resource URLs which send and receive XML data. Some common clients and platforms include, but are not limited to, the following:
Client
Platform/Environment
Comments
cURL [a]
Command Line (Linux, UNIX, Mac OS X, Microsoft Windows)
Easy and transparent way to test commands and do simple integration
Apache HttpComponents [b]
Java
Most common Java library with which to talk HTTP; no intrinsic binding of XML
RESTeasy Client [c]
Java
Full Java model integration; no need to think about HTTP or XML; uses Apache HTTP Client underneath

3. API Commands in Red Hat Subscription Management

Table 1. Activation Keys

CommandDetails
GET/activation_keysLists activation keys
DELETE/activation_keys/{activation_key_id}Removes an activation key
GET/activation_keys/{activation_key_id}Lists an activation key
PUT/activation_keys/{activation_key_id}Update an activation key
GET/activation_keys/{activation_key_id}/poolsLists activation key pools
DELETE/activation_keys/{activation_key_id}/pools/{pool_id}Deletes a pool from an activation key
PUT/activation_keys/{activation_key_id}/pools/{pool_id}Updates a pool from an activation key
DELETE/activation_keys/{activation_key_id}/product/{product_id}Removes a product from an activation key
POST/activation_keys/{activation_key_id}/product/{product_id}Adds a product to an activation key

Table 2. Admin

CommandDetails
DELETE/admin/cache/productClears the product cache
GET/admin/initInitializes the Candlepin database
GET/admin/queuesRetrieves basic information on the HornetQ queues

Table 3. Atom

CommandDetails
GET/atomRetrieves an event atom feed

Table 4. CDN

CommandDetails
GET/cdnRetrieves a list of CDNs
DELETE/cdn/{label}Removes a CDN
POST/cdn/{label}Updates a CDN @return a CDN object

Table 5. Consumers

CommandDetails
GET/consumersRetrieves a list of consumers
POST/consumersCreates a consumer
GET/consumers/{consumer_uuid}Retrieves a single consumer
POST/consumers/{consumer_uuid}Updates a consumer
DELETE/consumers/{consumer_uuid}Deletes a consumer
POST/consumers/{consumer_uuid}Retrieves a single consumer
GET/consumers/{consumer_uuid}/accessible contentRetrieves the body of the Content Access Certificate for the consumer
GET/consumers/{consumer_uuid}/atomRetrieves an event feed for a consumer
PUT/consumers/{consumer_uuid}/certificatesGenerates the entitlement certificates for the consumer
GET/consumers/{consumer_uuid}/certificatesRetrieves the entitlement certificates for the consumer
DELETE/consumers/{consumer_uuid}/certificates/{serial}Removes an entitlement certificate using the certificate serial
GET/consumers/{consumer_uuid}/certificates/serialsRetrieves a list of the certificate seal’s client metadata for the consumer
GET/{consumer_uuid}/complianceRetrieves the compliance status of the consumer
DELETE/consumers/{consumer_uuid}/deletionrecordRemoves the deletion record for a consumer allowed
GET/consumers/{consumer_uuid}/entitlementsRetrieves a list of entitlements for the consumer
DELETE/consumers/{consumer_uuid}/entitlementsUnbinds entitlements for a consumer
GET/consumers/{consumer_uuid}/entitlements/dry-runRetrieves a list of pools and quantities that will auto-bind
DELETE/consumers/{consumer_uuid}/entitlements/pool/{pool_id}Removes all entitlements for a consumer
PUT/entitlements/product/{product_id}Regenerates an entitlement certificate for a product

Table 6. Environments

CommandDetails
GET/environmentsRetrieves a list of environments
DELETE/environments/{env_id}Deletes an environment
GET/environments/{env_id}Retrieves a single environment
POST/environments/{env_id}/consumersCreates an environment
DELETE/environments/contentDemotes content from an environment
POST/environments/contentPromotes content into an environment

Table 7. Events

CommandDetails
GET/eventsRetrieves a list of events
GET/events/{uuid}Retrieves a single event

Table 8. Hypervisors

CommandDetails
POST/hypervisors/{owner}Creates or updates the list of hypervisor hosts which allow agents such as virt-who to update hosts' information

Table 9. Jobs

CommandDetails
GET/jobsRetrieves a list of job status
DELETE/jobs/{job_id}Deletes a single job
POST/jobs/{job_id}Retrieves a job status and removes it if completed
POST/jobs/schedule/{task}Begins specific tasks
GET/jobs/schedulerRetrieves the scheduler status
POST/jobs/schedulerUpdates the scheduler status

Table 10. Owners

CommandDetails
GET/ownersRetrieves a list of owners
POST/ownersCreate an owner
DELETE/owners/{owner_key}Removes an owner
GET/owners/{owner_key}Retrieves a single owner
PUT/owners/{owner_key}Updates an owner
GET/owners/{owner_key}/activation_keysRetrieves a list of activation keys for an owner
POST/owners/{owner_key}/activation_keysCreates an activation key for an owner
GET/owners/{owner_key}/atomRetrieves an event atom feed for an owner
GET/owners/{owner_key}/consumersRetrieves a list of consumers for the owner
GET/owners/{owner_key}/consumers/countRetrieves a count of consumers for the owner
GET/owners/{owner_key}/contentRetrieves a list of content
POST/owners/{owner_key}/contentCreates a content
DELETE/owners/{owner_key}/content/{content_id}Deletes a content
GET/owners/{owner_key}/content/{content_id}Retrieves a single content
PUT/owners/{owner_key}/content/{content_id}Updates a content
POST/owners/{owner_key}/content/batchCreates contents in bulk
GET/owners/{owner_key}/entitlementsRetrieves the list of entitlements for an owner
POST/owners/{owner_key}/entitlementsStarts an asynchronous healing for an owner
GET/owners/{owner_key}/environmentsRetrieves a list of environments for an owner
POST/owners/{owner_key}/environmentsCreates an environment for an owner
GET/owners/{owner_key}/eventsRetrieves a list of events for an owner
GET/owners/{owner_key}/hypervisorRetrieves a list of hypervisors for an owner
DELETE/owners/{owner_key}/importsRemoves imports for an owner
GET/owners/{owner_key}/importsRetrieves a list of import records for an owner
POST/owners/{owner_key}/imports/asyncInitiates an asynchronous manifest import for the given organization
GET/owners/{owner_key}/infoRetrieves the owner info for an owner
DELETE/owners/{owner_key}/logRemove the log level of the owner
PUT/owners/{owner_key}/logSets the log level of an owner
GET/owners/{owner_key}/poolsRetrieves the list of pools for an owner
POST/owners/{owner_key}/poolsCreates a custom pool for an owner
PUT/owners/{owner_key}/poolsUpdates a pool for an owner
GET/owners/{owner_key}/productsRetrieves a list of products
POST/owners/{owner_key}/productsCreates a product
DELETE/owners/{owner_key}/products/{product_id}Removes a product
GET/owners/{owner_key}/products/{product_id}Retrieves a single product
PUT/owners/{owner_key}/products/{product_id}Updates a product
POST/owners/{owner_key}/products/{product_id}/batch_contentAdds content to a product batch node
GET/owners/{owner_key}rActivation Keys/products/{product_id}/certificateRetrieves a certificate for a product
DELETE/owners/{owner_key}/products/{product_id}/content/{condent_id}Removes content from a product
POST/owners/{owner_key}/products/{product_id}/content/{condent_id}Adds content to a product single mode
PUT/owners/{owner_key}/products/{product_id}/content/subscriptionsRefreshes pools by product
GET/owners/{owner_key}/servicelevelsRetrieves a list of support levels for a customer
GET/owners/{owner_key}/subscriptionsRetrieves a list of subscriptions for an owner
PUT/owners/{owner_key}subscriptionsTickle an owner to have all of their entitlement pools sync with their subscriptions
GET/owners/{owner_key}/uebercertRetrieves the Ueber entitlement certificate
POST/owners/{owner_key}/uebercertCreates an Ueber entitlement certificate
GET/owners/{owner_key}/upstream_customersRetrieves a list of upstream customers for an owner

Table 11. Pools

CommandDetails
DELETE/pools/{pool_id}Remove a pool
GET/pools/{pool_id}Retrieves a single pool
GET/pools/{pool_id}/cdnRetrieves a CDN for a pool
GET/pools/{pool_id}/entitlementsRetrieves a list of entitlements for a pool

Table 12. Products

CommandDetails
GET/products/{uuid}Retrieves a single product
GET/products/{product_uuid}/certificateRetrieves a certificate for a product
GET/products/ownersRetrieves a list of owners by product
PUT/products/subscriptionsRefreshes pools by product

Table 13. Roles

CommandDetails
GET/rolesRetrieves a list of roles
POST/rolesCreates a role
DELETE/roles/{role_id}Removes a role
GET/roles/{role_id}Retrieves a single role
PUT/roles/{role_id}Removes a permission from a role
DELETE/roles/{roles_id}permissions/username}Removes a user from a role
POST/roles/{roles_id}permissions/username}Adds a user to a role

Table 14. Rules

CommandDetails
DELETE/rulesDeletes a rule
GET/rulesRetrieves a rule
POST/rulesUpdates a rule

Table 15. Serials

CommandDetails
GET/serialsRetrieves a list of certificate serials
GET/serials/{serial_id}Retrieves a single certificate serial

Table 16. Status

CommandDetails
GET/statusReturns the status of a server

Table 17. Subsriptions

CommandDetails
GET/subscriptionsRetrieves a list of subscriptions
POST/subscriptionsActivates a subscription
DELETE/subscriptions/{subsctription_id}Removes a subscription
GET/subscription/{subscription_id}Retrieves a single subscription
GET/subscriptions/{subscription_id}/certRetrieves a subscription certificate

Table 18. Users

CommandDetails
GET/usersRetrieves a list of users
POST/userCreates a user
DELETE/users/{username}Removes a user
GET/users/{username}Retrieves a single user
POST/users/{username}Updates a user
GET/users/{username}/ownersRetrieves a list of owners that the user can register systems to
GET/users/{username}/rolesRetrieves a list of roles by the user

Legal Notice

Copyright © 2017 Red Hat, Inc..
This document is licensed by Red Hat under the Creative Commons Attribution-ShareAlike 3.0 Unported License. If you distribute this document, or a modified version of it, you must provide attribution to Red Hat, Inc. and provide a link to the original. If the document is modified, all Red Hat trademarks must be removed.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.