Skip to content

feat(smd): add list alias to rfe and component get commands - #121

Open
TheSabari07 wants to merge 1 commit into
OpenCHAMI:mainfrom
TheSabari07:feat/add-list-aliases
Open

feat(smd): add list alias to rfe and component get commands#121
TheSabari07 wants to merge 1 commit into
OpenCHAMI:mainfrom
TheSabari07:feat/add-list-aliases

Conversation

@TheSabari07

@TheSabari07 TheSabari07 commented Jul 23, 2026

Copy link
Copy Markdown

Checklist

  • My code follows the style guidelines of this project
  • I have added/updated comments where needed
  • I have added tests that prove my fix is effective or my feature works
  • I have run make test (or equivalent) locally and all tests pass
  • DCO Sign-off: All commits are signed off (git commit -s) with my real name and email
  • REUSE Compliance:
    • Each new/modified source file has SPDX copyright and license headers
    • Any non-commentable files include a <filename>.license sidecar
    • All referenced licenses are present in the LICENSES/ directory

Description

Summary:
This PR introduces list as an alias for the ochami smd rfe get and ochami smd component get commands.

Motivation and Context:
Older CSM-based commands lacked a list alias, causing inconsistencies in user experience when compared to newer commands in the OpenCHAMI CLI. This simple quality-of-life update allows users to type list intuitively while mapping directly to the underlying get logic. The respective man pages (ochami-smd.1.sc) have also been updated to reflect the availability of the alias.

Fixes #(issue)
#116

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

For more info, see Contributing Guidelines.

@alexlovelltroy
alexlovelltroy requested a review from synackd July 23, 2026 11:31
Comment thread man/ochami-smd.1.sc Outdated

*get* [-F _format_] [--nid _nid_] [--xname _xname_]
Get all components or one identified by xname or node ID.
Get all components or one identified by xname or node ID. Note: `list` is an available alias for this command.

@davidallendj davidallendj Jul 23, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@synackd Is this how you want to specify aliases in the man page documentation or do you have another way?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll want the aliases to be discoverable, so they should be near the top of the command section. I'm thinking we do it like this:

*get* [-F _format_] [--nid _nid_] [--xname _xname_]
	Aliases: *list*

	Get all components or one identified by xname or node ID.

This seems idiomatic with manual pages of some other popular projects I've come across.

@davidallendj

Copy link
Copy Markdown
Contributor

One thing that stood out at a glance is that this only covers ochami smd rfe and ochami smd component as mentioned in #116. Do we want to extend this to include other SMD commands with similar behaviors (e.g. compep, group, and iface? Do we want to also extend this to the similar BSS commands (e.g. params, script, hosts)?

@synackd

synackd commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Yes, we'll want to implement this for all commands that have a get subcommand.

@synackd synackd linked an issue Jul 23, 2026 that may be closed by this pull request
1 task
@TheSabari07

Copy link
Copy Markdown
Author

Thanks for the feedback, @synackd and @davidallendj! Just to confirm, can I start implementing the man page formatting as suggested and add the list alias to all get subcommands across the entire CLI?

@synackd

synackd commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Yes. All service commands with a get subcommand (smd, bss, pcs, and rcs).

@TheSabari07

TheSabari07 commented Jul 26, 2026

Copy link
Copy Markdown
Author

Yes. All service commands with a get subcommand (smd, bss, pcs, and rcs).

Okay @synackd,
I will start to implement it and will update the changes soon.

@TheSabari07
TheSabari07 force-pushed the feat/add-list-aliases branch from f61e33d to 505c4d9 Compare August 3, 2026 04:30
@TheSabari07

TheSabari07 commented Aug 3, 2026

Copy link
Copy Markdown
Author

Hi @synackd and @davidallendj,

First, I'm really sorry for the late reply! I haven't been feeling well for the past few days.

I've just pushed the updates.

  • The man pages have all been reformatted exactly as requested.

  • I audited the whole CLI and added the list alias to all get subcommands across smd, bss, cloud-init, metadata, and boot.

Please review at your convenience and let me know if any changes are needed.

@synackd synackd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The boot and metadata commands' resources already have a list command, so we shouldn't add a list alias to their get commands (they are different commands). We should only add them to bss, smd, and cloud-init.

Signed-off-by: Sabari07 <sabursd18@gmail.com>
@TheSabari07
TheSabari07 force-pushed the feat/add-list-aliases branch from 505c4d9 to e8b5298 Compare August 5, 2026 09:03
@TheSabari07

Copy link
Copy Markdown
Author

@synackd! Thank you for pointing that out.

The list alias is now correctly scoped to just smd, bss, and cloud-init.
I've pushed the updates. Please review at your convenience and let me know if any changes are needed.

@synackd synackd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better, thank you.

Just a small change requested (and a requested change I missed) and we should be good to go.

Comment thread man/ochami-boot.1.sc

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we revert the changes in this file? They are inconsistent with ochami-metadata.1.sc and are out-of-scope for this PR.

Comment thread man/ochami-smd.1.sc

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized that there's no iface command documentation in here! Could you add it in this PR? Just apply the following diff (git apply ...):

diff --git a/man/ochami-smd.1.sc b/man/ochami-smd.1.sc
index dc7e481..78830b7 100644
--- a/man/ochami-smd.1.sc
+++ b/man/ochami-smd.1.sc
@@ -440,6 +440,56 @@ Subcommands for this command are as follows:
 		this flag can be specified multiple times or this flag can be specified
 		once and multiple xnames, separated by commas.
 
+## iface
+
+Manage Ethernet interfaces.
+
+*get* [-F _format_] [--by-ip] [--comp-id _xname_,...] [-i _id_] [--ip _ip_,...] [-m _mac_,...] [--net _network_,...] [--newer-than _timestamp_] [--older-than _timestamp_] [--type _type_,...]
+	Aliases: *list*
+
+	Get all Ethernet interfaces or a subset based on filter options.
+
+	This command sends a GET request to SMD's /Inventory/EthernetInterfaces
+	endpoint.
+
+	This command accepts the following options:
+
+	*--by-ip*
+		Get all IP addresses for the Ethernet interface specified by *--id*.
+
+	*--comp-id* _xname_,...
+		Filter Ethernet interfaces by one or more component IDs.
+
+	*-F, --format-output* _format_
+		Output response data in specified _format_. Supported values are:
+
+		- _json_ (default)
+		- _json-pretty_
+		- _yaml_
+
+	*-i, --id* _id_
+		Get an Ethernet interface by its ID.
+
+	*--ip* _ip_,...
+		Filter Ethernet interfaces by one or more IP addresses.
+
+	*-m, --mac* _mac_,...
+		Filter Ethernet interfaces by one or more MAC addresses.
+
+	*--net* _network_,...
+		Filter Ethernet interfaces by IP address on one or more networks.
+
+	*--newer-than* _timestamp_
+		Filter Ethernet interfaces by update time newer than the specified
+		RFC3339-formatted timestamp.
+
+	*--older-than* _timestamp_
+		Filter Ethernet interfaces by update time older than the specified
+		RFC3339-formatted timestamp.
+
+	*--type* _type_,...
+		Filter Ethernet interfaces by one or more types.
+
 ## rfe
 
 Manage Redfish endpoints. 

@synackd

synackd commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Also, if you could rebase onto the current main, that would be helpful.

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.

[Feature]: Add list alias to make CLI consistent

3 participants