Skip to content

Commit

Permalink
Add another filter.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed Sep 26, 2024
1 parent 4557baf commit f55f297
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions cmd/size_reservations.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ func newSizeReservationsCmd(c *config) *cobra.Command {
genericcli.Must(cmd.RegisterFlagCompletionFunc("partitions", c.comp.PartitionListCompletion))
},
ListCmdMutateFn: func(cmd *cobra.Command) {
cmd.Flags().String("id", "", "the id to filter")
cmd.Flags().String("size", "", "the size id to filter")
cmd.Flags().String("project", "", "the project id to filter")
cmd.Flags().String("partition", "", "the partition id to filter")

genericcli.Must(cmd.RegisterFlagCompletionFunc("id", c.comp.SizeReservationsListCompletion))
genericcli.Must(cmd.RegisterFlagCompletionFunc("size", c.comp.SizeListCompletion))
genericcli.Must(cmd.RegisterFlagCompletionFunc("project", c.comp.ProjectListCompletion))
genericcli.Must(cmd.RegisterFlagCompletionFunc("partition", c.comp.PartitionListCompletion))
Expand Down Expand Up @@ -133,6 +135,7 @@ func (c sizeReservationsCmd) Get(id string) (*models.V1SizeReservationResponse,

func (c sizeReservationsCmd) List() ([]*models.V1SizeReservationResponse, error) {
resp, err := c.client.Size().FindSizeReservations(sizemodel.NewFindSizeReservationsParams().WithBody(&models.V1SizeReservationListRequest{
ID: viper.GetString("id"),
Partitionid: viper.GetString("parition"),
Projectid: viper.GetString("project"),
Sizeid: viper.GetString("size"),
Expand Down
1 change: 1 addition & 0 deletions docs/metalctl_size_reservation_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ metalctl size reservation list [flags]

```
-h, --help help for list
--id string the id to filter
--partition string the partition id to filter
--project string the project id to filter
--size string the size id to filter
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/go-openapi/strfmt v0.23.0
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
github.com/metal-stack/metal-go v0.35.3-0.20240920140628-3a1fa9d19d6b
github.com/metal-stack/metal-go v0.35.3-0.20240926084747-24263b1712fc
github.com/metal-stack/metal-lib v0.18.3-0.20240919073100-437dee684212
github.com/metal-stack/updater v1.2.2
github.com/metal-stack/v v1.0.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ github.com/mdlayher/sdnotify v1.0.0 h1:Ma9XeLVN/l0qpyx1tNeMSeTjCPH6NtuD6/N9XdTlQ
github.com/mdlayher/sdnotify v1.0.0/go.mod h1:HQUmpM4XgYkhDLtd+Uad8ZFK1T9D5+pNxnXQjCeJlGE=
github.com/mdlayher/socket v0.5.1 h1:VZaqt6RkGkt2OE9l3GcC6nZkqD3xKeQLyfleW/uBcos=
github.com/mdlayher/socket v0.5.1/go.mod h1:TjPLHI1UgwEv5J1B5q0zTZq12A/6H7nKmtTanQE37IQ=
github.com/metal-stack/metal-go v0.35.3-0.20240920140628-3a1fa9d19d6b h1:yGGrbf+XogxtQalFximzaogC+Mm8dKTQ0e4ehMzGJPg=
github.com/metal-stack/metal-go v0.35.3-0.20240920140628-3a1fa9d19d6b/go.mod h1:3MJTYCS4YJz8D8oteTKhjpaAKNMMjMKYDrIy9awHGtQ=
github.com/metal-stack/metal-go v0.35.3-0.20240926084747-24263b1712fc h1:QKGuvGFDsjuPp8bbbB7OFa0M8C9FCRnaHpMISLsDEY8=
github.com/metal-stack/metal-go v0.35.3-0.20240926084747-24263b1712fc/go.mod h1:3MJTYCS4YJz8D8oteTKhjpaAKNMMjMKYDrIy9awHGtQ=
github.com/metal-stack/metal-lib v0.18.3-0.20240919073100-437dee684212 h1:iSJs+4QqUdwhcFH2dvp5CSfa8SIHDVG3M/mM66PhiAE=
github.com/metal-stack/metal-lib v0.18.3-0.20240919073100-437dee684212/go.mod h1:GJjipRpHmpd2vjBtsaw9gGk5ZFan7NlShyjIsTdY1x4=
github.com/metal-stack/security v0.8.1 h1:4zmVUxZvDWShVvVIxM3XhIv7pTmPe9DvACRIHW6YTsk=
Expand Down

0 comments on commit f55f297

Please sign in to comment.