rhsm-cli

command module
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 1 Imported by: 0

README

rhsm-cli

Getting a token

Please see Generating an offline token to generate a token.

export RHSM_TOKEN=<your offline token>

Building

I'll set up goreleaser later, but for now just do a go build

go build .

Using rhsm-cli

Listing all systems under account

./rhsm-cli list systems

List systems matching a filter

./rhsm-cli list systems --filter ocp

Show system details by UUID

Note: There were some systems that had duplicate hostnames, by using the system UUID instead hostname, it ensures that it brings back the system you intended.

./rhsm-cli list systems --systemID <SYSTEM UUID>
Hostname, UUID, Subscription Name, Sku, Entitlement ID
ocp-app-01l.lab1.example.com, SYSTEM_UUID, Red Hat Developer Subscription for Individuals, RH00798, ENTITLMENT_ID

List subscriptions under account

./rhsm-cli list subscriptions
Name, Subscription Number, SKU, Status, Pool ID, Quantity, Consumed
Red Hat Enterprise Linux Developer Suite, 4534066, RH2262474, Active
Red Hat Enterprise Linux Developer Suite, 4799758, RH2262474, Active
Red Hat Developer Subscription for Individuals, 9114433, RH00798, Active, 2c928081790fb14c01792457f16a2741, 16, 16
Red Hat Developer Subscription for Individuals, 9122320, RH00798, Active, 8a85f9997922d86501793771efe71fd2, 16, 16
Red Hat Developer Subscription for Individuals, 9340692, RH00798, Active, 8a85f99a7aaf8439017ace705f9b0fbf, 16, 16
Red Hat Enterprise Linux Server, Premium (Physical or Virtual Nodes), 9479832, RH00003S, Active, 8a85f9a07b54e268017be4927ec85f91, 4, 4

Searching subscriptions under account

./rhsm-cli list subscriptions | grep OpenShift
Red Hat OpenShift Container Platform Standard (2 Cores or 4 vCPUs), 10391081, MCT2736S, Active, 8a85f9997d484aeb017d6d59133e12fd, 46, 46
Red Hat OpenShift Container Platform Premium (2 Cores or 4 vCPUs), 10391080, MCT2735S, Active, 8a85f9997d484aeb017d6d591e031303, 71, 0
Red Hat OpenShift Container Platform Standard (2 Cores or 4 vCPUs), 10391083, MCT2736S, Active, 8a85f9997d484aeb017d6d591ebd1305, 28, 28
Red Hat OpenShift Container Platform Standard (2 Cores or 4 vCPUs), 10391086, MCT2736S, Active, 8a85f9997d484aeb017d6d591a6f1301, 62, 62
Red Hat OpenShift Container Platform Premium (2 Cores or 4 vCPUs), 10391089, MCT2735S, Active, 8a85f9997d484aeb017d6d5939591309, 132, 72
Red Hat OpenShift Container Platform Premium (2 Cores or 4 vCPUs), 10391108, MCT2735S, Active, 8a85f9997d484aeb017d6d58dc6712e8, 71, 0

View systems consuming subscription

./rhsm-cli list subscriptions --subscription <SUBSCRIPTION NUMBER>

Example:

./rhsm-cli list subscriptions --subscription 10391083
System Name, UUID, Entitlements Consumed
ocp-master-01c.dfw1.example.com, 8927e0e6-393b-468e-89bd-256055e6f79e, 18
ocp-infra-01d.lab1.example.com, 72a39136-a1c9-4fa9-a6bd-e7117012b5c1, 18
ocp-app-01g.atl1.example.com, 67225d64-f649-4321-b6aa-360fc0189db7, 18

Attach entitlement/Pool ID to system

./rhsm-cli add subscription --systemID <SYSTEM UUID> --poolID <POOL ID>

Remove entitlement/Pool ID from system

./rhsm-cli remove subscription --systemID <SYSTEM UUID> --entitlementID <ENTITLEMENT ID>

Documentation

Overview

Copyright © 2022 Felicia Lyn-Shue <flynshue@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL