rhsm

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const EnvTypeContentTemplate = "content-template"

Variables

This section is empty.

Functions

func GetConsumerUUID

func GetConsumerUUID() (string, error)

func IsRHSMRegistered

func IsRHSMRegistered() (bool, error)

IsRHSMRegistered returns true, when system is registered

func RegisterRHSM

func RegisterRHSM(ctx *cli.Context, enableContent bool) (string, error)

RegisterRHSM tries to register system against Red Hat Subscription Management server (candlepin server)

func UnpackDBusError

func UnpackDBusError(err error) error

UnpackDBusError tries to unpack a JSON document (part of the error) into the structure DBusError. When it is not possible to parse an error into structure, then a corresponding or original error is returned. When it is possible to parse error into structure, then DBusError is returned

func Unregister

func Unregister() error

Types

type DBusError

type DBusError struct {
	Exception string `json:"exception"`
	Severity  string `json:"severity"`
	Message   string `json:"message"`
}

DBusError is used for parsing JSON document returned by D-Bus methods.

func (DBusError) Error

func (dbusError DBusError) Error() string

Error returns textual representation of DBusError. This implements all necessary methods for the error interface. Thus, DBusError can be handled as a regular error.

type Organization

type Organization struct {
	Key string `json:"key"`
}

Organization is structure containing information about RHSM organization (sometimes called owner) JSON document returned from candlepin server can have the following format. We care only about key, but it can be extended and more information can be added to the structure in the future.

{
   "created": "2022-11-02T16:00:23+0000",
   "updated": "2022-11-02T16:00:48+0000",
   "id": "4028face84391264018439127db10004",
   "displayName": "Donald Duck",
   "key": "donaldduck",
   "contentPrefix": null,
   "defaultServiceLevel": null,
   "logLevel": null,
   "contentAccessMode": "org_environment",
   "contentAccessModeList": "entitlement,org_environment",
   "autobindHypervisorDisabled": false,
   "autobindDisabled": false,
   "lastRefreshed": "2022-11-02T16:00:48+0000",
   "parentOwner": null,
   "upstreamConsumer": null
}

Jump to

Keyboard shortcuts

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