Menu Close
Settings Close

Language and Page Formatting Options

Chapter 1. Using APIs for Queries

The drift service enables you to compare the system configuration of one system to that of other systems and baselines registered in your Insights for RHEL inventory. It allows you to query system configurations using a REST API, create and manage baselines, and returns fact values as well as comparison states. You can also generate CSV output of the systems and baselines you are comparing.

Note

1.1. Schema

The API access is over HTTPS, and accessed from the root URL of https://access.redhat.com/documentation/en-us/red_hat_insights/2022/html/system_comparison_api_documentation/[System Comparison API Documentation. All data is sent and received as JSON. The JSON files include:

drift-openapi.json
historical-system-profiles-openapi.json
system-baseline-openapi.json

1.2. Basic Authentication

The user and password credentials are passed in with each HTTP request.

Request

$ curl --user username:password -i https://cloud.redhat.com/api/drift/v1/comparison_report?system_ids[]=<UUID>

or

$ curl --user username:password -i https://cloud.redhat.com/api/system-baseline/v1/baselines

1.3. Specification

1.3.1. REST API Entry Point

The REST API is available via the /api URL prefix. It is accessed on the server as follows:

"/api/drift/v1"

1.3.2. HTTP Methods

The HTTP methods currently supported for API requests are GET and POST.

1.3.3. Data Types

Data TypeDescription

Integer

Integer value

String

JSON string

Array

The items keyword is required in arrays. The value of items is a schema that describes the type and format of array items. Arrays can be nested.

Boolean

Value resulting in True or False

Timestamp

Timestamp in ISO8601 format

1.3.4. HTTP Status Codes

CodeTextDescription

200

OK

Success.

400

Bad Request

The request could not be understood by the server due to incorrect syntax.

500

Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request.