Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add example for 'metal device get --filter hostname=foo' #368

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/metal_device_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ metal device get [-p <project_id>] | [-i <device_id>] [flags]

# Gets a list of devices in the specified project:
metal device get -p 5ad070a5-62e8-4cfe-a0b9-3b79e59f1cfe

# Get a list of devices with the hostname foo and a default project configured:
metal device get --filter hostname=foo
```

### Options
Expand Down
5 changes: 4 additions & 1 deletion internal/devices/retrieve.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ func (c *Client) Retrieve() *cobra.Command {
metal device get -i 52b60ca7-1ae2-4875-846b-4e4635223471

# Gets a list of devices in the specified project:
metal device get -p 5ad070a5-62e8-4cfe-a0b9-3b79e59f1cfe`,
metal device get -p 5ad070a5-62e8-4cfe-a0b9-3b79e59f1cfe

# Get a list of devices with the hostname foo and a default project configured:
metal device get --filter hostname=foo`,

RunE: func(cmd *cobra.Command, args []string) error {
deviceID, _ := cmd.Flags().GetString("id")
Expand Down
Loading