Skip to content

Conversation

jirihnidek
Copy link
Contributor

@jirihnidek jirihnidek commented Apr 25, 2025

  • When rhc status --schema json is run, then rhc returns JSON scheme for given command. The generated schema contains description of each object property
  • Only JSON scheme is supported, because --format CLI option also support "json" argument
  • CLI options --format and --schema are mutually exclusive

* When "rhc status --schema json" is run, then rhc returns
  JSON scheme for given command. The generated schema contains
  description of each object property
* Only JSON scheme is supported, because --format CLI option
  also support "json" argument
* CLI options --format and --schema are mutually exclusive
@jirihnidek jirihnidek force-pushed the jhnidek/json_scheme_cli_option branch from ddc3aaa to ad1cc24 Compare April 25, 2025 10:36
@jirihnidek
Copy link
Contributor Author

The output of root@localhost:/# rhc status --schema json looks like this:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$ref": "#/$defs/SystemStatus",
  "$defs": {
    "SystemStatus": {
      "properties": {
        "hostname": {
          "type": "string",
          "description": "System Hostname"
        },
        "hostname_error": {
          "type": "string",
          "description": "Optional error message of getting system hostname"
        },
        "rhsm_connected": {
          "type": "boolean",
          "description": "Is true, when connected to Red Hat Subscription Management (RHSM)"
        },
        "rhsm_error": {
          "type": "string",
          "description": "Optional error message of connecting to RHSM"
        },
        "insights_connected": {
          "type": "boolean",
          "description": "Is true, when the system is connected to Insights server"
        },
        "insights_error": {
          "type": "string",
          "description": "Optional error message of connecting to Insights server"
        },
        "yggdrasil_running": {
          "type": "boolean",
          "description": "Is true, when yggdrasil.service is running"
        },
        "yggdrasil_error": {
          "type": "string",
          "description": "Optional error message from getting status of yggdrasil.service"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "hostname",
        "rhsm_connected",
        "insights_connected",
        "yggdrasil_running"
      ]
    }
  }
}

@jirihnidek jirihnidek marked this pull request as draft May 28, 2025 14:22
@jirihnidek jirihnidek changed the title feat: Added --scheme CLI option to status command feat: Added --schema CLI option to status command May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant