diff --git a/cmd/admin/v2/commands.go b/cmd/admin/v2/commands.go index 5bd0a65..bcdc35a 100644 --- a/cmd/admin/v2/commands.go +++ b/cmd/admin/v2/commands.go @@ -17,6 +17,7 @@ func AddCmds(cmd *cobra.Command, c *config.Config) { adminCmd.AddCommand(newAuditCmd(c)) adminCmd.AddCommand(newComponentCmd(c)) adminCmd.AddCommand(newImageCmd(c)) + adminCmd.AddCommand(newPartitionCmd(c)) adminCmd.AddCommand(newProjectCmd(c)) adminCmd.AddCommand(newProjectCmd(c)) adminCmd.AddCommand(newSwitchCmd(c)) diff --git a/cmd/admin/v2/partition.go b/cmd/admin/v2/partition.go new file mode 100644 index 0000000..f621feb --- /dev/null +++ b/cmd/admin/v2/partition.go @@ -0,0 +1,137 @@ +package v2 + +import ( + "fmt" + "strings" + + adminv2 "github.com/metal-stack/api/go/metalstack/admin/v2" + apiv2 "github.com/metal-stack/api/go/metalstack/api/v2" + "github.com/metal-stack/cli/cmd/config" + "github.com/metal-stack/cli/cmd/sorters" + "github.com/metal-stack/metal-lib/pkg/genericcli" + "github.com/metal-stack/metal-lib/pkg/genericcli/printers" + "github.com/metal-stack/metal-lib/pkg/pointer" + "github.com/spf13/cobra" + "github.com/spf13/viper" +) + +type partition struct { + c *config.Config +} + +func newPartitionCmd(c *config.Config) *cobra.Command { + w := &partition{ + c: c, + } + + gcli := genericcli.NewGenericCLI(w).WithFS(c.Fs) + + cmdsConfig := &genericcli.CmdsConfig[any, any, *apiv2.Partition]{ + BinaryName: config.BinaryName, + GenericCLI: gcli, + Singular: "partition", + Plural: "partitions", + Description: "manage partitions", + DescribePrinter: func() printers.Printer { return c.DescribePrinter }, + ListPrinter: func() printers.Printer { return c.ListPrinter }, + OnlyCmds: genericcli.OnlyCmds(genericcli.DescribeCmd, genericcli.ListCmd), + DescribeCmdMutateFn: func(cmd *cobra.Command) { + cmd.RunE = func(cmd *cobra.Command, args []string) error { + return gcli.DescribeAndPrint("", w.c.DescribePrinter) + } + }, + } + + capacityCmd := &cobra.Command{ + Use: "capacity", + Short: "show partition capacity", + RunE: func(cmd *cobra.Command, args []string) error { + return w.capacity() + }, + } + + capacityCmd.Flags().StringP("id", "", "", "filter on partition id.") + capacityCmd.Flags().StringP("size", "", "", "filter on size id.") + capacityCmd.Flags().StringP("project", "", "", "consider project-specific counts, e.g. size reservations.") + capacityCmd.Flags().StringSlice("sort-by", []string{}, fmt.Sprintf("order by (comma separated) column(s), sort direction can be changed by appending :asc or :desc behind the column identifier. possible values: %s", strings.Join(sorters.PartitionCapacitySorter().AvailableKeys(), "|"))) + genericcli.Must(capacityCmd.RegisterFlagCompletionFunc("id", c.Completion.PartitionListCompletion)) + genericcli.Must(capacityCmd.RegisterFlagCompletionFunc("project", c.Completion.ProjectListCompletion)) + genericcli.Must(capacityCmd.RegisterFlagCompletionFunc("size", c.Completion.SizeListCompletion)) + genericcli.Must(capacityCmd.RegisterFlagCompletionFunc("sort-by", cobra.FixedCompletions(sorters.PartitionCapacitySorter().AvailableKeys(), cobra.ShellCompDirectiveNoFileComp))) + + return genericcli.NewCmds(cmdsConfig, capacityCmd) +} + +func (c *partition) capacity() error { + ctx, cancel := c.c.NewRequestContext() + defer cancel() + + req := &adminv2.PartitionServiceCapacityRequest{} + + if viper.IsSet("id") { + req.Id = new(viper.GetString("id")) + } + if viper.IsSet("size") { + req.Size = new(viper.GetString("size")) + } + if viper.IsSet("project") { + req.Project = new(viper.GetString("project")) + } + resp, err := c.c.Client.Adminv2().Partition().Capacity(ctx, req) + if err != nil { + return fmt.Errorf("failed to get partition capacity: %w", err) + } + + err = sorters.PartitionCapacitySorter().SortBy(resp.PartitionCapacity) + if err != nil { + return err + } + + return c.c.ListPrinter.Print(resp.PartitionCapacity) +} + +func (c *partition) Get(id string) (*apiv2.Partition, error) { + ctx, cancel := c.c.NewRequestContext() + defer cancel() + + req := &apiv2.PartitionServiceGetRequest{Id: id} + + resp, err := c.c.Client.Apiv2().Partition().Get(ctx, req) + if err != nil { + return nil, fmt.Errorf("failed to get partition: %w", err) + } + + return resp.Partition, nil +} + +func (c *partition) List() ([]*apiv2.Partition, error) { + ctx, cancel := c.c.NewRequestContext() + defer cancel() + + req := &apiv2.PartitionServiceListRequest{Query: &apiv2.PartitionQuery{ + Id: pointer.PointerOrNil(viper.GetString("id")), + }} + + resp, err := c.c.Client.Apiv2().Partition().List(ctx, req) + if err != nil { + return nil, fmt.Errorf("failed to get partitions: %w", err) + } + + return resp.Partitions, nil +} + +func (c *partition) Create(rq any) (*apiv2.Partition, error) { + panic("unimplemented") +} + +func (c *partition) Delete(id string) (*apiv2.Partition, error) { + panic("unimplemented") +} + +func (t *partition) Convert(r *apiv2.Partition) (string, any, any, error) { + panic("unimplemented") +} + +func (t *partition) Update(rq any) (*apiv2.Partition, error) { + panic("unimplemented") +} diff --git a/cmd/admin/v2/partition_test.go b/cmd/admin/v2/partition_test.go new file mode 100644 index 0000000..d20e695 --- /dev/null +++ b/cmd/admin/v2/partition_test.go @@ -0,0 +1,250 @@ +package v2_test + +import ( + "testing" + + adminv2 "github.com/metal-stack/api/go/metalstack/admin/v2" + apiv2 "github.com/metal-stack/api/go/metalstack/api/v2" + apitests "github.com/metal-stack/api/go/tests" + "github.com/metal-stack/cli/pkg/test" + "github.com/stretchr/testify/mock" +) + +// Generated with AI + +var ( + testPartition1 = &apiv2.Partition{ + Id: "1", + Description: "partition 1", + MgmtServiceAddresses: []string{ + "192.168.1.1:1234", + }, + BootConfiguration: &apiv2.PartitionBootConfiguration{ + Commandline: "commandline", + ImageUrl: "imageurl", + KernelUrl: "kernelurl", + }, + Meta: &apiv2.Meta{ + Labels: &apiv2.Labels{ + Labels: map[string]string{ + "a": "b", + }, + }, + }, + } + testPartition2 = &apiv2.Partition{ + Id: "2", + Description: "partition 2", + MgmtServiceAddresses: []string{ + "192.168.1.2:1234", + }, + BootConfiguration: &apiv2.PartitionBootConfiguration{ + Commandline: "commandline", + ImageUrl: "imageurl", + KernelUrl: "kernelurl", + }, + Meta: &apiv2.Meta{ + Labels: &apiv2.Labels{ + Labels: nil, + }, + }, + } +) + +func Test_AdminPartitionCmd_List(t *testing.T) { + tests := []*test.Test[[]*apiv2.Partition]{ + { + Name: "list", + Cmd: func(want []*apiv2.Partition) []string { + return []string{"admin", "partition", "list"} + }, + ClientMocks: &apitests.ClientMockFns{ + Apiv2Mocks: &apitests.Apiv2MockFns{ + Partition: func(m *mock.Mock) { + m.On("List", mock.Anything, mock.Anything).Return(&apiv2.PartitionServiceListResponse{ + Partitions: []*apiv2.Partition{ + testPartition1, + testPartition2, + }, + }, nil) + }, + }, + }, + Want: []*apiv2.Partition{ + testPartition1, + testPartition2, + }, + WantTable: new(` +ID DESCRIPTION +1 partition 1 +2 partition 2 +`), + }, + } + for _, tt := range tests { + tt.TestCmd(t) + } +} + +func Test_AdminPartitionCmd_Describe(t *testing.T) { + tests := []*test.Test[*apiv2.Partition]{ + { + Name: "describe", + Cmd: func(want *apiv2.Partition) []string { + return []string{"admin", "partition", "describe", want.Id} + }, + ClientMocks: &apitests.ClientMockFns{ + Apiv2Mocks: &apitests.Apiv2MockFns{ + Partition: func(m *mock.Mock) { + m.On("Get", mock.Anything, mock.Anything).Return(&apiv2.PartitionServiceGetResponse{ + Partition: testPartition1, + }, nil) + }, + }, + }, + Want: testPartition1, + WantTable: new(` +ID DESCRIPTION +1 partition 1 +`), + }, + } + for _, tt := range tests { + tt.TestCmd(t) + } +} + +func Test_AdminPartitionCmd_Capacity(t *testing.T) { + tests := []*test.Test[[]*adminv2.PartitionCapacity]{ + { + Name: "capacity", + Cmd: func(want []*adminv2.PartitionCapacity) []string { + return []string{"admin", "partition", "capacity"} + }, + ClientMocks: &apitests.ClientMockFns{ + Adminv2Mocks: &apitests.Adminv2MockFns{ + Partition: func(m *mock.Mock) { + m.On("Capacity", mock.Anything, mock.Anything).Return(&adminv2.PartitionServiceCapacityResponse{ + PartitionCapacity: []*adminv2.PartitionCapacity{ + { + Partition: "partition-1", + MachineSizeCapacities: []*adminv2.MachineSizeCapacity{ + { + Size: "size-1", + Free: 3, + Allocated: 1, + Total: 5, + Faulty: 2, + Reservations: 3, + UsedReservations: 1, + }, + }, + }, + }, + }, nil) + }, + }, + }, + Want: []*adminv2.PartitionCapacity{ + { + Partition: "partition-1", + MachineSizeCapacities: []*adminv2.MachineSizeCapacity{ + { + Size: "size-1", + Free: 3, + Allocated: 1, + Total: 5, + Faulty: 2, + Reservations: 3, + UsedReservations: 1, + }, + }, + }, + }, + WantTable: new(` +PARTITION SIZE ALLOCATED FREE UNAVAILABLE RESERVATIONS | TOTAL | FAULTY +partition-1 size-1 1 3 0 2 (1/3 used) | 5 | 2 +Total 1 3 0 2 | 5 | 2 +`), + }, + { + Name: "capacity with filters", + Cmd: func(want []*adminv2.PartitionCapacity) []string { + return []string{"admin", "partition", "capacity", "--id", "partition-1", "--size", "size-1", "--project", "project-123", "--sort-by", "id"} + }, + ClientMocks: &apitests.ClientMockFns{ + Adminv2Mocks: &apitests.Adminv2MockFns{ + Partition: func(m *mock.Mock) { + m.On("Capacity", mock.Anything, mock.Anything).Return(&adminv2.PartitionServiceCapacityResponse{ + PartitionCapacity: []*adminv2.PartitionCapacity{ + { + Partition: "partition-1", + MachineSizeCapacities: []*adminv2.MachineSizeCapacity{ + { + Size: "size-1", + Free: 3, + Allocated: 1, + Total: 5, + Faulty: 2, + Reservations: 3, + UsedReservations: 1, + }, + }, + }, + }, + }, nil) + }, + }, + }, + Want: []*adminv2.PartitionCapacity{ + { + Partition: "partition-1", + MachineSizeCapacities: []*adminv2.MachineSizeCapacity{ + { + Size: "size-1", + Free: 3, + Allocated: 1, + Total: 5, + Faulty: 2, + Reservations: 3, + UsedReservations: 1, + }, + }, + }, + }, + WantTable: new(` +PARTITION SIZE ALLOCATED FREE UNAVAILABLE RESERVATIONS | TOTAL | FAULTY +partition-1 size-1 1 3 0 2 (1/3 used) | 5 | 2 +Total 1 3 0 2 | 5 | 2 +`), + }, + } + for _, tt := range tests { + tt.TestCmd(t) + } +} + +func Test_AdminPartitionCmd_ExhaustiveArgs(t *testing.T) { + tests := []struct { + name string + args []string + }{ + { + name: "list", + args: []string{"admin", "partition", "list"}, + }, + { + name: "describe", + args: []string{"admin", "partition", "describe", "1"}, + }, + { + name: "capacity", + args: []string{"admin", "partition", "capacity", "--id", "partition-1", "--size", "size-1", "--project", "project-123", "--sort-by", "id"}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + test.AssertExhaustiveArgs(t, tt.args) + }) + } +} diff --git a/cmd/api/v2/commands.go b/cmd/api/v2/commands.go index d79e964..cdd621c 100644 --- a/cmd/api/v2/commands.go +++ b/cmd/api/v2/commands.go @@ -11,6 +11,7 @@ func AddCmds(cmd *cobra.Command, c *config.Config) { cmd.AddCommand(newImageCmd(c)) cmd.AddCommand(newIPCmd(c)) cmd.AddCommand(newMethodsCmd(c)) + cmd.AddCommand(newPartitionCmd(c)) cmd.AddCommand(newProjectCmd(c)) cmd.AddCommand(newTenantCmd(c)) cmd.AddCommand(newTokenCmd(c)) diff --git a/cmd/api/v2/partition.go b/cmd/api/v2/partition.go new file mode 100644 index 0000000..ead6d61 --- /dev/null +++ b/cmd/api/v2/partition.go @@ -0,0 +1,87 @@ +package v2 + +import ( + "fmt" + + apiv2 "github.com/metal-stack/api/go/metalstack/api/v2" + "github.com/metal-stack/cli/cmd/config" + "github.com/metal-stack/metal-lib/pkg/genericcli" + "github.com/metal-stack/metal-lib/pkg/genericcli/printers" + "github.com/metal-stack/metal-lib/pkg/pointer" + "github.com/spf13/cobra" + "github.com/spf13/viper" +) + +type partition struct { + c *config.Config +} + +func newPartitionCmd(c *config.Config) *cobra.Command { + w := &partition{ + c: c, + } + + gcli := genericcli.NewGenericCLI(w).WithFS(c.Fs) + + cmdsConfig := &genericcli.CmdsConfig[any, any, *apiv2.Partition]{ + BinaryName: config.BinaryName, + GenericCLI: gcli, + Singular: "partition", + Plural: "partitions", + Description: "list and get partitions", + DescribePrinter: func() printers.Printer { return c.DescribePrinter }, + ListPrinter: func() printers.Printer { return c.ListPrinter }, + OnlyCmds: genericcli.OnlyCmds(genericcli.DescribeCmd, genericcli.ListCmd), + ListCmdMutateFn: func(cmd *cobra.Command) { + cmd.Flags().StringP("id", "", "", "image id to filter for") + }, + } + + return genericcli.NewCmds(cmdsConfig) +} + +func (c *partition) Get(id string) (*apiv2.Partition, error) { + ctx, cancel := c.c.NewRequestContext() + defer cancel() + + req := &apiv2.PartitionServiceGetRequest{Id: id} + + resp, err := c.c.Client.Apiv2().Partition().Get(ctx, req) + if err != nil { + return nil, fmt.Errorf("failed to get partition: %w", err) + } + + return resp.Partition, nil +} + +func (c *partition) List() ([]*apiv2.Partition, error) { + ctx, cancel := c.c.NewRequestContext() + defer cancel() + + req := &apiv2.PartitionServiceListRequest{Query: &apiv2.PartitionQuery{ + Id: pointer.PointerOrNil(viper.GetString("id")), + }} + + resp, err := c.c.Client.Apiv2().Partition().List(ctx, req) + if err != nil { + return nil, fmt.Errorf("failed to get partitions: %w", err) + } + + return resp.Partitions, nil +} + +func (c *partition) Create(rq any) (*apiv2.Partition, error) { + panic("unimplemented") +} + +func (c *partition) Delete(id string) (*apiv2.Partition, error) { + panic("unimplemented") +} + +func (t *partition) Convert(r *apiv2.Partition) (string, any, any, error) { + panic("unimplemented") +} + +func (t *partition) Update(rq any) (*apiv2.Partition, error) { + panic("unimplemented") +} diff --git a/cmd/completion/partition.go b/cmd/completion/partition.go new file mode 100644 index 0000000..0e71613 --- /dev/null +++ b/cmd/completion/partition.go @@ -0,0 +1,19 @@ +package completion + +import ( + apiv2 "github.com/metal-stack/api/go/metalstack/api/v2" + "github.com/spf13/cobra" +) + +func (c *Completion) PartitionListCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + req := &apiv2.PartitionServiceListRequest{} + resp, err := c.Client.Apiv2().Partition().List(c.Ctx, req) + if err != nil { + return nil, cobra.ShellCompDirectiveError + } + var names []string + for _, p := range resp.Partitions { + names = append(names, p.Id+"\t"+p.Description) + } + return names, cobra.ShellCompDirectiveNoFileComp +} diff --git a/cmd/completion/size.go b/cmd/completion/size.go new file mode 100644 index 0000000..8ebd814 --- /dev/null +++ b/cmd/completion/size.go @@ -0,0 +1,19 @@ +package completion + +import ( + apiv2 "github.com/metal-stack/api/go/metalstack/api/v2" + "github.com/spf13/cobra" +) + +func (c *Completion) SizeListCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { + req := &apiv2.SizeServiceListRequest{} + resp, err := c.Client.Apiv2().Size().List(c.Ctx, req) + if err != nil { + return nil, cobra.ShellCompDirectiveError + } + var names []string + for _, s := range resp.Sizes { + names = append(names, s.Id) + } + return names, cobra.ShellCompDirectiveNoFileComp +} diff --git a/cmd/sorters/partition.go b/cmd/sorters/partition.go new file mode 100644 index 0000000..c0f2c46 --- /dev/null +++ b/cmd/sorters/partition.go @@ -0,0 +1,30 @@ +package sorters + +import ( + adminv2 "github.com/metal-stack/api/go/metalstack/admin/v2" + apiv2 "github.com/metal-stack/api/go/metalstack/api/v2" + "github.com/metal-stack/metal-lib/pkg/multisort" +) + +func PartitionSorter() *multisort.Sorter[*apiv2.Partition] { + return multisort.New(multisort.FieldMap[*apiv2.Partition]{ + "id": func(a, b *apiv2.Partition, descending bool) multisort.CompareResult { + return multisort.Compare(a.Id, b.Id, descending) + }, + "description": func(a, b *apiv2.Partition, descending bool) multisort.CompareResult { + return multisort.Compare(a.Description, b.Description, descending) + }, + }, multisort.Keys{{ID: "id"}, {ID: "description"}}) +} + +func PartitionCapacitySorter() *multisort.Sorter[*adminv2.PartitionCapacity] { + return multisort.New(multisort.FieldMap[*adminv2.PartitionCapacity]{ + "id": func(a, b *adminv2.PartitionCapacity, descending bool) multisort.CompareResult { + return multisort.Compare(a.Partition, b.Partition, descending) + }, + "size": func(a, b *adminv2.PartitionCapacity, descending bool) multisort.CompareResult { + // FIXME implement + return multisort.Compare(a.Partition, b.Partition, descending) + }, + }, multisort.Keys{{ID: "id"}, {ID: "size"}}) +} diff --git a/cmd/tableprinters/common.go b/cmd/tableprinters/common.go index 317eeb8..09ca10f 100644 --- a/cmd/tableprinters/common.go +++ b/cmd/tableprinters/common.go @@ -83,6 +83,15 @@ func (t *TablePrinter) ToHeaderAndRows(data any, wide bool) ([]string, [][]strin case []*apiv2.ProjectMember: return t.ProjectMemberTable(d, wide) + case *apiv2.Partition: + return t.PartitionTable(pointer.WrapInSlice(d), wide) + case []*apiv2.Partition: + return t.PartitionTable(d, wide) + case *adminv2.PartitionCapacity: + return t.PartitionCapacityTable(pointer.WrapInSlice(d), wide) + case []*adminv2.PartitionCapacity: + return t.PartitionCapacityTable(d, wide) + case *apiv2.Token: return t.TokenTable(pointer.WrapInSlice(d), wide) case []*apiv2.Token: diff --git a/cmd/tableprinters/partition.go b/cmd/tableprinters/partition.go new file mode 100644 index 0000000..0c99a83 --- /dev/null +++ b/cmd/tableprinters/partition.go @@ -0,0 +1,134 @@ +package tableprinters + +import ( + "fmt" + "sort" + "strings" + + adminv2 "github.com/metal-stack/api/go/metalstack/admin/v2" + apiv2 "github.com/metal-stack/api/go/metalstack/api/v2" + "github.com/metal-stack/metal-lib/pkg/genericcli" +) + +func (t *TablePrinter) PartitionTable(data []*apiv2.Partition, wide bool) ([]string, [][]string, error) { + var ( + header = []string{"ID", "Description"} + rows [][]string + ) + + if wide { + header = []string{"ID", "Description", "Labels"} + } + + for _, p := range data { + row := []string{p.Id, p.Description} + + if wide { + labels := genericcli.MapToLabels(p.Meta.Labels.Labels) + sort.Strings(labels) + row = append(row, strings.Join(labels, "\n")) + } + + rows = append(rows, row) + } + + return header, rows, nil +} + +func (t *TablePrinter) PartitionCapacityTable(data []*adminv2.PartitionCapacity, wide bool) ([]string, [][]string, error) { + var ( + header = []string{"Partition", "Size", "Allocated", "Free", "Unavailable", "Reservations", "|", "Total", "|", "Faulty"} + rows [][]string + + allocatedCount int64 + faultyCount int64 + freeCount int64 + otherCount int64 + phonedHomeCount int64 + reservationCount int64 + totalCount int64 + unavailableCount int64 + usedReservationCount int64 + waitingCount int64 + ) + + if wide { + header = append(header, "Phoned Home", "Waiting", "Other") + } + + for _, pc := range data { + for _, c := range pc.MachineSizeCapacities { + id := c.Size + var ( + allocated = fmt.Sprintf("%d", c.Allocated) + faulty = fmt.Sprintf("%d", c.Faulty) + free = fmt.Sprintf("%d", c.Free) + other = fmt.Sprintf("%d", c.Other) + phonedHome = fmt.Sprintf("%d", c.PhonedHome) + reservations = "0" + total = fmt.Sprintf("%d", c.Total) + unavailable = fmt.Sprintf("%d", c.Unavailable) + waiting = fmt.Sprintf("%d", c.Waiting) + ) + + if c.Reservations > 0 { + reservations = fmt.Sprintf("%d (%d/%d used)", c.Reservations-c.UsedReservations, c.UsedReservations, c.Reservations) + } + + allocatedCount += c.Allocated + faultyCount += c.Faulty + freeCount += c.Free + otherCount += c.Other + phonedHomeCount += c.PhonedHome + reservationCount += c.Reservations + totalCount += c.Total + unavailableCount += c.Unavailable + usedReservationCount += c.UsedReservations + waitingCount += c.Waiting + + row := []string{pc.Partition, id, allocated, free, unavailable, reservations, "|", total, "|", faulty} + if wide { + row = append(row, phonedHome, waiting, other) + } + + rows = append(rows, row) + } + } + + footerRow := ([]string{ + "Total", + "", + fmt.Sprintf("%d", allocatedCount), + fmt.Sprintf("%d", freeCount), + fmt.Sprintf("%d", unavailableCount), + fmt.Sprintf("%d", reservationCount-usedReservationCount), + "|", + fmt.Sprintf("%d", totalCount), + "|", + fmt.Sprintf("%d", faultyCount), + }) + + if wide { + footerRow = append(footerRow, []string{ + fmt.Sprintf("%d", phonedHomeCount), + fmt.Sprintf("%d", waitingCount), + fmt.Sprintf("%d", otherCount), + }...) + } + + // if t.markdown { + // // for markdown we already have enough dividers, remove them + // removeDivider := func(e string) bool { + // return e == "|" + // } + // header = slices.DeleteFunc(header, removeDivider) + // footerRow = slices.DeleteFunc(footerRow, removeDivider) + // for i, row := range rows { + // rows[i] = slices.DeleteFunc(row, removeDivider) + // } + // } + + rows = append(rows, footerRow) + + return header, rows, nil +} diff --git a/docs/metalctlv2.md b/docs/metalctlv2.md index 378c0ce..3f1af67 100644 --- a/docs/metalctlv2.md +++ b/docs/metalctlv2.md @@ -11,7 +11,7 @@ cli for managing entities in metal-stack --debug debug output --force-color force colored output even without tty -h, --help help for metalctlv2 - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` @@ -28,6 +28,7 @@ cli for managing entities in metal-stack * [metalctlv2 login](metalctlv2_login.md) - login * [metalctlv2 logout](metalctlv2_logout.md) - logout * [metalctlv2 markdown](metalctlv2_markdown.md) - create markdown documentation +* [metalctlv2 partition](metalctlv2_partition.md) - manage partition entities * [metalctlv2 project](metalctlv2_project.md) - manage project entities * [metalctlv2 tenant](metalctlv2_tenant.md) - manage tenant entities * [metalctlv2 token](metalctlv2_token.md) - manage token entities diff --git a/docs/metalctlv2_api-methods.md b/docs/metalctlv2_api-methods.md index 11de69a..960ef02 100644 --- a/docs/metalctlv2_api-methods.md +++ b/docs/metalctlv2_api-methods.md @@ -21,7 +21,7 @@ metalctlv2 api-methods [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_audit.md b/docs/metalctlv2_audit.md index 095ab64..ed95dd1 100644 --- a/docs/metalctlv2_audit.md +++ b/docs/metalctlv2_audit.md @@ -20,7 +20,7 @@ read api audit traces of a tenant -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_audit_describe.md b/docs/metalctlv2_audit_describe.md index 23e1905..cc382a5 100644 --- a/docs/metalctlv2_audit_describe.md +++ b/docs/metalctlv2_audit_describe.md @@ -23,7 +23,7 @@ metalctlv2 audit describe [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_audit_list.md b/docs/metalctlv2_audit_list.md index 3506d75..79189f7 100644 --- a/docs/metalctlv2_audit_list.md +++ b/docs/metalctlv2_audit_list.md @@ -34,7 +34,7 @@ metalctlv2 audit list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_completion.md b/docs/metalctlv2_completion.md index 5b5f52f..773da84 100644 --- a/docs/metalctlv2_completion.md +++ b/docs/metalctlv2_completion.md @@ -22,7 +22,7 @@ See each sub-command's help for details on how to use the generated script. -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_completion_bash.md b/docs/metalctlv2_completion_bash.md index 6b43f93..38a1ede 100644 --- a/docs/metalctlv2_completion_bash.md +++ b/docs/metalctlv2_completion_bash.md @@ -45,7 +45,7 @@ metalctlv2 completion bash -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_completion_fish.md b/docs/metalctlv2_completion_fish.md index 14547e6..69657e7 100644 --- a/docs/metalctlv2_completion_fish.md +++ b/docs/metalctlv2_completion_fish.md @@ -36,7 +36,7 @@ metalctlv2 completion fish [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_completion_powershell.md b/docs/metalctlv2_completion_powershell.md index bc60343..6b9c650 100644 --- a/docs/metalctlv2_completion_powershell.md +++ b/docs/metalctlv2_completion_powershell.md @@ -33,7 +33,7 @@ metalctlv2 completion powershell [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_completion_zsh.md b/docs/metalctlv2_completion_zsh.md index 4d9a9eb..9ba9e8e 100644 --- a/docs/metalctlv2_completion_zsh.md +++ b/docs/metalctlv2_completion_zsh.md @@ -47,7 +47,7 @@ metalctlv2 completion zsh [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_context.md b/docs/metalctlv2_context.md index b07774e..0f0e0b1 100644 --- a/docs/metalctlv2_context.md +++ b/docs/metalctlv2_context.md @@ -24,7 +24,7 @@ metalctlv2 context [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_context_add.md b/docs/metalctlv2_context_add.md index d60a35c..68ff412 100644 --- a/docs/metalctlv2_context_add.md +++ b/docs/metalctlv2_context_add.md @@ -24,7 +24,7 @@ metalctlv2 context add [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. ``` diff --git a/docs/metalctlv2_context_list.md b/docs/metalctlv2_context_list.md index a3f6421..6033cd2 100644 --- a/docs/metalctlv2_context_list.md +++ b/docs/metalctlv2_context_list.md @@ -20,7 +20,7 @@ metalctlv2 context list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_context_remove.md b/docs/metalctlv2_context_remove.md index 61118c7..478c662 100644 --- a/docs/metalctlv2_context_remove.md +++ b/docs/metalctlv2_context_remove.md @@ -20,7 +20,7 @@ metalctlv2 context remove [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_context_set-project.md b/docs/metalctlv2_context_set-project.md index 98a9fa5..b3a18a2 100644 --- a/docs/metalctlv2_context_set-project.md +++ b/docs/metalctlv2_context_set-project.md @@ -20,7 +20,7 @@ metalctlv2 context set-project [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_context_show-current.md b/docs/metalctlv2_context_show-current.md index cd27cd9..6146f5b 100644 --- a/docs/metalctlv2_context_show-current.md +++ b/docs/metalctlv2_context_show-current.md @@ -20,7 +20,7 @@ metalctlv2 context show-current [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_context_switch.md b/docs/metalctlv2_context_switch.md index 09177e5..0eb28a8 100644 --- a/docs/metalctlv2_context_switch.md +++ b/docs/metalctlv2_context_switch.md @@ -24,7 +24,7 @@ metalctlv2 context switch [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_context_update.md b/docs/metalctlv2_context_update.md index 0908bd5..393da6d 100644 --- a/docs/metalctlv2_context_update.md +++ b/docs/metalctlv2_context_update.md @@ -24,7 +24,7 @@ metalctlv2 context update [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. ``` diff --git a/docs/metalctlv2_health.md b/docs/metalctlv2_health.md index 99a96b4..4e607ee 100644 --- a/docs/metalctlv2_health.md +++ b/docs/metalctlv2_health.md @@ -24,7 +24,7 @@ metalctlv2 health [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_image.md b/docs/metalctlv2_image.md index e55d75d..7f1e495 100644 --- a/docs/metalctlv2_image.md +++ b/docs/metalctlv2_image.md @@ -20,7 +20,7 @@ manage images which are used to be installed on machines and firewalls -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_image_describe.md b/docs/metalctlv2_image_describe.md index ae89061..aed8321 100644 --- a/docs/metalctlv2_image_describe.md +++ b/docs/metalctlv2_image_describe.md @@ -20,7 +20,7 @@ metalctlv2 image describe [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_image_latest.md b/docs/metalctlv2_image_latest.md index 9a12e52..73d363f 100644 --- a/docs/metalctlv2_image_latest.md +++ b/docs/metalctlv2_image_latest.md @@ -21,7 +21,7 @@ metalctlv2 image latest [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_image_list.md b/docs/metalctlv2_image_list.md index 36af421..b1764ab 100644 --- a/docs/metalctlv2_image_list.md +++ b/docs/metalctlv2_image_list.md @@ -26,7 +26,7 @@ metalctlv2 image list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_ip.md b/docs/metalctlv2_ip.md index 401c938..afd5d6f 100644 --- a/docs/metalctlv2_ip.md +++ b/docs/metalctlv2_ip.md @@ -20,7 +20,7 @@ an ip address of metal-stack.io -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_ip_apply.md b/docs/metalctlv2_ip_apply.md index 088a6d8..91652d5 100644 --- a/docs/metalctlv2_ip_apply.md +++ b/docs/metalctlv2_ip_apply.md @@ -35,7 +35,7 @@ metalctlv2 ip apply [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_ip_create.md b/docs/metalctlv2_ip_create.md index 5055893..1fc1484 100644 --- a/docs/metalctlv2_ip_create.md +++ b/docs/metalctlv2_ip_create.md @@ -42,7 +42,7 @@ metalctlv2 ip create [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_ip_delete.md b/docs/metalctlv2_ip_delete.md index 61d0290..1e113d3 100644 --- a/docs/metalctlv2_ip_delete.md +++ b/docs/metalctlv2_ip_delete.md @@ -36,7 +36,7 @@ metalctlv2 ip delete [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_ip_describe.md b/docs/metalctlv2_ip_describe.md index aae77b5..b206813 100644 --- a/docs/metalctlv2_ip_describe.md +++ b/docs/metalctlv2_ip_describe.md @@ -21,7 +21,7 @@ metalctlv2 ip describe [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_ip_edit.md b/docs/metalctlv2_ip_edit.md index a9a9622..e362f7e 100644 --- a/docs/metalctlv2_ip_edit.md +++ b/docs/metalctlv2_ip_edit.md @@ -20,7 +20,7 @@ metalctlv2 ip edit [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_ip_list.md b/docs/metalctlv2_ip_list.md index 37cde45..1ac5a43 100644 --- a/docs/metalctlv2_ip_list.md +++ b/docs/metalctlv2_ip_list.md @@ -22,7 +22,7 @@ metalctlv2 ip list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_ip_update.md b/docs/metalctlv2_ip_update.md index db9ca66..1757141 100644 --- a/docs/metalctlv2_ip_update.md +++ b/docs/metalctlv2_ip_update.md @@ -40,7 +40,7 @@ metalctlv2 ip update [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_login.md b/docs/metalctlv2_login.md index 28e50a8..e961c52 100644 --- a/docs/metalctlv2_login.md +++ b/docs/metalctlv2_login.md @@ -22,7 +22,7 @@ metalctlv2 login [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_logout.md b/docs/metalctlv2_logout.md index bc7f032..560a2a4 100644 --- a/docs/metalctlv2_logout.md +++ b/docs/metalctlv2_logout.md @@ -22,7 +22,7 @@ metalctlv2 logout [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_markdown.md b/docs/metalctlv2_markdown.md index cd98b36..c298007 100644 --- a/docs/metalctlv2_markdown.md +++ b/docs/metalctlv2_markdown.md @@ -20,7 +20,7 @@ metalctlv2 markdown [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_partition.md b/docs/metalctlv2_partition.md new file mode 100644 index 0000000..cbebf79 --- /dev/null +++ b/docs/metalctlv2_partition.md @@ -0,0 +1,33 @@ +## metalctlv2 partition + +manage partition entities + +### Synopsis + +list and get partitions + +### Options + +``` + -h, --help help for partition +``` + +### Options inherited from parent commands + +``` + --api-token string the token used for api requests + --api-url string the url to the metal-stack.io api (default "https://api.metal-stack.io") + -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) + --debug debug output + --force-color force colored output even without tty + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. + --timeout duration request timeout used for api requests +``` + +### SEE ALSO + +* [metalctlv2](metalctlv2.md) - cli for managing entities in metal-stack +* [metalctlv2 partition describe](metalctlv2_partition_describe.md) - describes the partition +* [metalctlv2 partition list](metalctlv2_partition_list.md) - list all partitions + diff --git a/docs/metalctlv2_partition_describe.md b/docs/metalctlv2_partition_describe.md new file mode 100644 index 0000000..1d694d1 --- /dev/null +++ b/docs/metalctlv2_partition_describe.md @@ -0,0 +1,31 @@ +## metalctlv2 partition describe + +describes the partition + +``` +metalctlv2 partition describe [flags] +``` + +### Options + +``` + -h, --help help for describe +``` + +### Options inherited from parent commands + +``` + --api-token string the token used for api requests + --api-url string the url to the metal-stack.io api (default "https://api.metal-stack.io") + -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) + --debug debug output + --force-color force colored output even without tty + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. + --timeout duration request timeout used for api requests +``` + +### SEE ALSO + +* [metalctlv2 partition](metalctlv2_partition.md) - manage partition entities + diff --git a/docs/metalctlv2_partition_list.md b/docs/metalctlv2_partition_list.md new file mode 100644 index 0000000..8e0e030 --- /dev/null +++ b/docs/metalctlv2_partition_list.md @@ -0,0 +1,32 @@ +## metalctlv2 partition list + +list all partitions + +``` +metalctlv2 partition list [flags] +``` + +### Options + +``` + -h, --help help for list + --id string image id to filter for +``` + +### Options inherited from parent commands + +``` + --api-token string the token used for api requests + --api-url string the url to the metal-stack.io api (default "https://api.metal-stack.io") + -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) + --debug debug output + --force-color force colored output even without tty + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") + --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. + --timeout duration request timeout used for api requests +``` + +### SEE ALSO + +* [metalctlv2 partition](metalctlv2_partition.md) - manage partition entities + diff --git a/docs/metalctlv2_project.md b/docs/metalctlv2_project.md index 164d3d2..f356a7e 100644 --- a/docs/metalctlv2_project.md +++ b/docs/metalctlv2_project.md @@ -20,7 +20,7 @@ manage api projects -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_apply.md b/docs/metalctlv2_project_apply.md index a5b3eb5..1afdee1 100644 --- a/docs/metalctlv2_project_apply.md +++ b/docs/metalctlv2_project_apply.md @@ -35,7 +35,7 @@ metalctlv2 project apply [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_create.md b/docs/metalctlv2_project_create.md index 09322ed..f7e7df1 100644 --- a/docs/metalctlv2_project_create.md +++ b/docs/metalctlv2_project_create.md @@ -38,7 +38,7 @@ metalctlv2 project create [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_delete.md b/docs/metalctlv2_project_delete.md index 2df90b6..bd68477 100644 --- a/docs/metalctlv2_project_delete.md +++ b/docs/metalctlv2_project_delete.md @@ -35,7 +35,7 @@ metalctlv2 project delete [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_describe.md b/docs/metalctlv2_project_describe.md index 1173530..14a5ecc 100644 --- a/docs/metalctlv2_project_describe.md +++ b/docs/metalctlv2_project_describe.md @@ -20,7 +20,7 @@ metalctlv2 project describe [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_edit.md b/docs/metalctlv2_project_edit.md index 33f4d77..eaa80eb 100644 --- a/docs/metalctlv2_project_edit.md +++ b/docs/metalctlv2_project_edit.md @@ -20,7 +20,7 @@ metalctlv2 project edit [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_invite.md b/docs/metalctlv2_project_invite.md index 9610fbf..bfcce95 100644 --- a/docs/metalctlv2_project_invite.md +++ b/docs/metalctlv2_project_invite.md @@ -16,7 +16,7 @@ manage project invites -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_invite_delete.md b/docs/metalctlv2_project_invite_delete.md index 48e643d..963bcf4 100644 --- a/docs/metalctlv2_project_invite_delete.md +++ b/docs/metalctlv2_project_invite_delete.md @@ -21,7 +21,7 @@ metalctlv2 project invite delete [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_invite_generate-join-secret.md b/docs/metalctlv2_project_invite_generate-join-secret.md index 273cb5c..4fb7432 100644 --- a/docs/metalctlv2_project_invite_generate-join-secret.md +++ b/docs/metalctlv2_project_invite_generate-join-secret.md @@ -22,7 +22,7 @@ metalctlv2 project invite generate-join-secret [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_invite_list.md b/docs/metalctlv2_project_invite_list.md index 80dfd85..a319ffc 100644 --- a/docs/metalctlv2_project_invite_list.md +++ b/docs/metalctlv2_project_invite_list.md @@ -22,7 +22,7 @@ metalctlv2 project invite list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_join.md b/docs/metalctlv2_project_join.md index fdf2be0..945f19f 100644 --- a/docs/metalctlv2_project_join.md +++ b/docs/metalctlv2_project_join.md @@ -20,7 +20,7 @@ metalctlv2 project join [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_list.md b/docs/metalctlv2_project_list.md index edbba1a..8c956df 100644 --- a/docs/metalctlv2_project_list.md +++ b/docs/metalctlv2_project_list.md @@ -23,7 +23,7 @@ metalctlv2 project list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_member.md b/docs/metalctlv2_project_member.md index 4e5d082..5a3497d 100644 --- a/docs/metalctlv2_project_member.md +++ b/docs/metalctlv2_project_member.md @@ -16,7 +16,7 @@ manage project members -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_member_delete.md b/docs/metalctlv2_project_member_delete.md index 962cd54..b45509b 100644 --- a/docs/metalctlv2_project_member_delete.md +++ b/docs/metalctlv2_project_member_delete.md @@ -21,7 +21,7 @@ metalctlv2 project member delete [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_member_list.md b/docs/metalctlv2_project_member_list.md index d05e2a7..5527476 100644 --- a/docs/metalctlv2_project_member_list.md +++ b/docs/metalctlv2_project_member_list.md @@ -22,7 +22,7 @@ metalctlv2 project member list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_member_update.md b/docs/metalctlv2_project_member_update.md index 384f9b1..388d5ea 100644 --- a/docs/metalctlv2_project_member_update.md +++ b/docs/metalctlv2_project_member_update.md @@ -22,7 +22,7 @@ metalctlv2 project member update [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_project_update.md b/docs/metalctlv2_project_update.md index 87ec7d5..979c4ff 100644 --- a/docs/metalctlv2_project_update.md +++ b/docs/metalctlv2_project_update.md @@ -37,7 +37,7 @@ metalctlv2 project update [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant.md b/docs/metalctlv2_tenant.md index 0007e09..6f76844 100644 --- a/docs/metalctlv2_tenant.md +++ b/docs/metalctlv2_tenant.md @@ -20,7 +20,7 @@ manage api tenants -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_apply.md b/docs/metalctlv2_tenant_apply.md index 50670e4..8a6d93f 100644 --- a/docs/metalctlv2_tenant_apply.md +++ b/docs/metalctlv2_tenant_apply.md @@ -35,7 +35,7 @@ metalctlv2 tenant apply [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_create.md b/docs/metalctlv2_tenant_create.md index 86f7da7..42fd2aa 100644 --- a/docs/metalctlv2_tenant_create.md +++ b/docs/metalctlv2_tenant_create.md @@ -39,7 +39,7 @@ metalctlv2 tenant create [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_delete.md b/docs/metalctlv2_tenant_delete.md index 5a80b42..38ee3c2 100644 --- a/docs/metalctlv2_tenant_delete.md +++ b/docs/metalctlv2_tenant_delete.md @@ -35,7 +35,7 @@ metalctlv2 tenant delete [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_describe.md b/docs/metalctlv2_tenant_describe.md index 5879c6d..7fb3c1c 100644 --- a/docs/metalctlv2_tenant_describe.md +++ b/docs/metalctlv2_tenant_describe.md @@ -20,7 +20,7 @@ metalctlv2 tenant describe [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_edit.md b/docs/metalctlv2_tenant_edit.md index 483c901..466da36 100644 --- a/docs/metalctlv2_tenant_edit.md +++ b/docs/metalctlv2_tenant_edit.md @@ -20,7 +20,7 @@ metalctlv2 tenant edit [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_invite.md b/docs/metalctlv2_tenant_invite.md index 16bea96..658268b 100644 --- a/docs/metalctlv2_tenant_invite.md +++ b/docs/metalctlv2_tenant_invite.md @@ -16,7 +16,7 @@ manage tenant invites -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_invite_delete.md b/docs/metalctlv2_tenant_invite_delete.md index 10c8b20..e1d1b3c 100644 --- a/docs/metalctlv2_tenant_invite_delete.md +++ b/docs/metalctlv2_tenant_invite_delete.md @@ -21,7 +21,7 @@ metalctlv2 tenant invite delete [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_invite_generate-join-secret.md b/docs/metalctlv2_tenant_invite_generate-join-secret.md index cf49ccc..be22cef 100644 --- a/docs/metalctlv2_tenant_invite_generate-join-secret.md +++ b/docs/metalctlv2_tenant_invite_generate-join-secret.md @@ -22,7 +22,7 @@ metalctlv2 tenant invite generate-join-secret [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_invite_list.md b/docs/metalctlv2_tenant_invite_list.md index 72cb672..01b2cfa 100644 --- a/docs/metalctlv2_tenant_invite_list.md +++ b/docs/metalctlv2_tenant_invite_list.md @@ -22,7 +22,7 @@ metalctlv2 tenant invite list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_join.md b/docs/metalctlv2_tenant_join.md index 8f57bc9..fb48fe1 100644 --- a/docs/metalctlv2_tenant_join.md +++ b/docs/metalctlv2_tenant_join.md @@ -20,7 +20,7 @@ metalctlv2 tenant join [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_list.md b/docs/metalctlv2_tenant_list.md index 863ec6e..ee7dae1 100644 --- a/docs/metalctlv2_tenant_list.md +++ b/docs/metalctlv2_tenant_list.md @@ -23,7 +23,7 @@ metalctlv2 tenant list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_member.md b/docs/metalctlv2_tenant_member.md index ebb53c4..8d119dc 100644 --- a/docs/metalctlv2_tenant_member.md +++ b/docs/metalctlv2_tenant_member.md @@ -16,7 +16,7 @@ manage tenant members -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_member_list.md b/docs/metalctlv2_tenant_member_list.md index 1aff48c..b97fa91 100644 --- a/docs/metalctlv2_tenant_member_list.md +++ b/docs/metalctlv2_tenant_member_list.md @@ -22,7 +22,7 @@ metalctlv2 tenant member list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_member_remove.md b/docs/metalctlv2_tenant_member_remove.md index 5b2ceb5..830f05b 100644 --- a/docs/metalctlv2_tenant_member_remove.md +++ b/docs/metalctlv2_tenant_member_remove.md @@ -21,7 +21,7 @@ metalctlv2 tenant member remove [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_member_update.md b/docs/metalctlv2_tenant_member_update.md index 3f66a9a..cf93cb7 100644 --- a/docs/metalctlv2_tenant_member_update.md +++ b/docs/metalctlv2_tenant_member_update.md @@ -22,7 +22,7 @@ metalctlv2 tenant member update [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_tenant_update.md b/docs/metalctlv2_tenant_update.md index 768a568..433fb06 100644 --- a/docs/metalctlv2_tenant_update.md +++ b/docs/metalctlv2_tenant_update.md @@ -37,7 +37,7 @@ metalctlv2 tenant update [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_token.md b/docs/metalctlv2_token.md index 01394f8..82cbe42 100644 --- a/docs/metalctlv2_token.md +++ b/docs/metalctlv2_token.md @@ -20,7 +20,7 @@ manage api tokens for accessing the metal-stack.io api -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_token_apply.md b/docs/metalctlv2_token_apply.md index d622e45..72b2fee 100644 --- a/docs/metalctlv2_token_apply.md +++ b/docs/metalctlv2_token_apply.md @@ -35,7 +35,7 @@ metalctlv2 token apply [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_token_create.md b/docs/metalctlv2_token_create.md index f9f33d1..f2bb26a 100644 --- a/docs/metalctlv2_token_create.md +++ b/docs/metalctlv2_token_create.md @@ -41,7 +41,7 @@ metalctlv2 token create [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_token_delete.md b/docs/metalctlv2_token_delete.md index 6e72e28..6155756 100644 --- a/docs/metalctlv2_token_delete.md +++ b/docs/metalctlv2_token_delete.md @@ -35,7 +35,7 @@ metalctlv2 token delete [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_token_describe.md b/docs/metalctlv2_token_describe.md index 2997b43..016694f 100644 --- a/docs/metalctlv2_token_describe.md +++ b/docs/metalctlv2_token_describe.md @@ -20,7 +20,7 @@ metalctlv2 token describe [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_token_edit.md b/docs/metalctlv2_token_edit.md index 051ef01..77abfb8 100644 --- a/docs/metalctlv2_token_edit.md +++ b/docs/metalctlv2_token_edit.md @@ -20,7 +20,7 @@ metalctlv2 token edit [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_token_list.md b/docs/metalctlv2_token_list.md index 64935de..6cdd69a 100644 --- a/docs/metalctlv2_token_list.md +++ b/docs/metalctlv2_token_list.md @@ -21,7 +21,7 @@ metalctlv2 token list [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_token_update.md b/docs/metalctlv2_token_update.md index 24545a6..4055f11 100644 --- a/docs/metalctlv2_token_update.md +++ b/docs/metalctlv2_token_update.md @@ -35,7 +35,7 @@ metalctlv2 token update [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_user.md b/docs/metalctlv2_user.md index 50677ce..c416e39 100644 --- a/docs/metalctlv2_user.md +++ b/docs/metalctlv2_user.md @@ -20,7 +20,7 @@ manage api users for accessing the metal-stack.io api -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_user_describe.md b/docs/metalctlv2_user_describe.md index ddcbafa..9d994bd 100644 --- a/docs/metalctlv2_user_describe.md +++ b/docs/metalctlv2_user_describe.md @@ -20,7 +20,7 @@ metalctlv2 user describe [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/docs/metalctlv2_version.md b/docs/metalctlv2_version.md index 8f98db6..40350c6 100644 --- a/docs/metalctlv2_version.md +++ b/docs/metalctlv2_version.md @@ -24,7 +24,7 @@ metalctlv2 version [flags] -c, --config string alternative config file path, (default is ~/.metal-stack/config.yaml) --debug debug output --force-color force colored output even without tty - -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact. (default "table") + -o, --output-format string output format (table|wide|markdown|json|yaml|template|jsonraw|yamlraw), wide is a table with more columns, jsonraw and yamlraw do not translate proto enums into string types but leave the original int32 values intact (for apply, create, update, delete commands from file the raw output formatters must be used). (default "table") --template string output template for template output-format, go template format. For property names inspect the output of -o json or -o yaml for reference. --timeout duration request timeout used for api requests ``` diff --git a/go.mod b/go.mod index b2ccb7f..c855deb 100644 --- a/go.mod +++ b/go.mod @@ -7,9 +7,9 @@ require ( connectrpc.com/connect v1.19.1 connectrpc.com/validate v0.6.0 github.com/dustin/go-humanize v1.0.1 - github.com/fatih/color v1.18.0 + github.com/fatih/color v1.19.0 github.com/google/go-cmp v0.7.0 - github.com/metal-stack/api v0.0.55 + github.com/metal-stack/api v0.0.56 github.com/metal-stack/metal-lib v0.24.0 github.com/metal-stack/v v1.0.3 github.com/spf13/afero v1.15.0 @@ -17,7 +17,7 @@ require ( github.com/spf13/pflag v1.0.10 github.com/spf13/viper v1.21.0 github.com/stretchr/testify v1.11.1 - google.golang.org/grpc v1.79.1 + google.golang.org/grpc v1.79.3 google.golang.org/protobuf v1.36.11 sigs.k8s.io/yaml v1.6.0 ) @@ -28,32 +28,32 @@ require ( cel.dev/expr v0.25.1 // indirect github.com/antlr4-go/antlr/v4 v4.13.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/clipperhouse/displaywidth v0.6.2 // indirect - github.com/clipperhouse/stringish v0.1.1 // indirect - github.com/clipperhouse/uax29/v2 v2.3.0 // indirect + github.com/clipperhouse/displaywidth v0.11.0 // indirect + github.com/clipperhouse/uax29/v2 v2.7.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect - github.com/go-openapi/errors v0.22.6 // indirect - github.com/go-openapi/strfmt v0.25.0 // indirect + github.com/go-openapi/errors v0.22.7 // indirect + github.com/go-openapi/strfmt v0.26.1 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/go-viper/mapstructure/v2 v2.5.0 // indirect + github.com/goccy/go-json v0.10.6 // indirect github.com/goccy/go-yaml v1.19.2 // indirect github.com/golang-jwt/jwt/v5 v5.3.1 // indirect github.com/google/cel-go v0.27.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/klauspost/compress v1.18.4 // indirect + github.com/klauspost/compress v1.18.5 // indirect github.com/klauspost/connect-compress/v2 v2.1.1 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.20 // indirect + github.com/mattn/go-runewidth v0.0.21 // indirect github.com/minio/minlz v1.1.0 // indirect - github.com/oklog/ulid v1.3.1 // indirect + github.com/oklog/ulid/v2 v2.1.1 // indirect github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6 // indirect github.com/olekukonko/errors v1.2.0 // indirect - github.com/olekukonko/ll v0.1.6 // indirect - github.com/olekukonko/tablewriter v1.1.3 // indirect + github.com/olekukonko/ll v0.1.7 // indirect + github.com/olekukonko/tablewriter v1.1.4 // indirect github.com/pelletier/go-toml/v2 v2.2.4 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect @@ -61,17 +61,16 @@ require ( github.com/spf13/cast v1.10.0 // indirect github.com/stretchr/objx v0.5.3 // indirect github.com/subosito/gotenv v1.6.0 // indirect - go.mongodb.org/mongo-driver v1.17.9 // indirect - go.yaml.in/yaml/v2 v2.4.3 // indirect + go.yaml.in/yaml/v2 v2.4.4 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 // indirect - golang.org/x/net v0.50.0 // indirect - golang.org/x/sys v0.41.0 // indirect + golang.org/x/net v0.52.0 // indirect + golang.org/x/sys v0.42.0 // indirect golang.org/x/text v0.35.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260311181403-84a4fc48630c // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260311181403-84a4fc48630c // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260319201613-d00831a3d3e7 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260319201613-d00831a3d3e7 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apimachinery v0.35.1 // indirect + k8s.io/apimachinery v0.35.3 // indirect sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect ) diff --git a/go.sum b/go.sum index 62e0050..0190ca4 100644 --- a/go.sum +++ b/go.sum @@ -14,14 +14,14 @@ github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYW github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4= github.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs= +github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw= +github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/clipperhouse/displaywidth v0.6.2 h1:ZDpTkFfpHOKte4RG5O/BOyf3ysnvFswpyYrV7z2uAKo= -github.com/clipperhouse/displaywidth v0.6.2/go.mod h1:R+kHuzaYWFkTm7xoMmK1lFydbci4X2CicfbGstSGg0o= -github.com/clipperhouse/stringish v0.1.1 h1:+NSqMOr3GR6k1FdRhhnXrLfztGzuG+VuFDfatpWHKCs= -github.com/clipperhouse/stringish v0.1.1/go.mod h1:v/WhFtE1q0ovMta2+m+UbpZ+2/HEXNWYXQgCt4hdOzA= -github.com/clipperhouse/uax29/v2 v2.3.0 h1:SNdx9DVUqMoBuBoW3iLOj4FQv3dN5mDtuqwuhIGpJy4= -github.com/clipperhouse/uax29/v2 v2.3.0/go.mod h1:Wn1g7MK6OoeDT0vL+Q0SQLDz/KpfsVRgg6W7ihQeh4g= +github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSEFgwIwO+UVM8= +github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0= +github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk= +github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo= github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= @@ -29,22 +29,24 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= -github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/fatih/color v1.19.0 h1:Zp3PiM21/9Ld6FzSKyL5c/BULoe/ONr9KlbYVOfG8+w= +github.com/fatih/color v1.19.0/go.mod h1:zNk67I0ZUT1bEGsSGyCZYZNrHuTkJJB+r6Q9VuMi0LE= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= -github.com/go-openapi/errors v0.22.6 h1:eDxcf89O8odEnohIXwEjY1IB4ph5vmbUsBMsFNwXWPo= -github.com/go-openapi/errors v0.22.6/go.mod h1:z9S8ASTUqx7+CP1Q8dD8ewGH/1JWFFLX/2PmAYNQLgk= -github.com/go-openapi/strfmt v0.25.0 h1:7R0RX7mbKLa9EYCTHRcCuIPcaqlyQiWNPTXwClK0saQ= -github.com/go-openapi/strfmt v0.25.0/go.mod h1:nNXct7OzbwrMY9+5tLX4I21pzcmE6ccMGXl3jFdPfn8= -github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls= -github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= +github.com/go-openapi/errors v0.22.7 h1:JLFBGC0Apwdzw3484MmBqspjPbwa2SHvpDm0u5aGhUA= +github.com/go-openapi/errors v0.22.7/go.mod h1://QW6SD9OsWtH6gHllUCddOXDL0tk0ZGNYHwsw4sW3w= +github.com/go-openapi/strfmt v0.26.1 h1:7zGCHji7zSYDC2tCXIusoxYQz/48jAf2q+sF6wXTG+c= +github.com/go-openapi/strfmt v0.26.1/go.mod h1:Zslk5VZPOISLwmWTMBIS7oiVFem1o1EI6zULY8Uer7Y= +github.com/go-openapi/testify/v2 v2.4.1 h1:zB34HDKj4tHwyUQHrUkpV0Q0iXQ6dUCOQtIqn8hE6Iw= +github.com/go-openapi/testify/v2 v2.4.1/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro= github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/goccy/go-json v0.10.6 h1:p8HrPJzOakx/mn/bQtjgNjdTcN+/S6FcG2CTtQOrHVU= +github.com/goccy/go-json v0.10.6/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/goccy/go-yaml v1.19.2 h1:PmFC1S6h8ljIz6gMRBopkjP1TVT7xuwrButHID66PoM= github.com/goccy/go-yaml v1.19.2/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY= @@ -57,8 +59,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/klauspost/compress v1.18.4 h1:RPhnKRAQ4Fh8zU2FY/6ZFDwTVTxgJ/EMydqSTzE9a2c= -github.com/klauspost/compress v1.18.4/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= +github.com/klauspost/compress v1.18.5 h1:/h1gH5Ce+VWNLSWqPzOVn6XBO+vJbCNGvjoaGBFW2IE= +github.com/klauspost/compress v1.18.5/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= github.com/klauspost/connect-compress/v2 v2.1.1 h1:ycZNp4rWOZBodVE2Ls5AzK4aHkyK+GteEfzRZgKNs+c= github.com/klauspost/connect-compress/v2 v2.1.1/go.mod h1:9oilsPHJMzGKkjafSBk9J7iVo4mO+dw0G0KSdVpnlVE= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -69,26 +71,27 @@ github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHP github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.20 h1:WcT52H91ZUAwy8+HUkdM3THM6gXqXuLJi9O3rjcQQaQ= -github.com/mattn/go-runewidth v0.0.20/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= -github.com/metal-stack/api v0.0.55 h1:n5Y91x+B5/rh6j9rai6CAgVWenLgEzAQwFD2nYbVDXA= -github.com/metal-stack/api v0.0.55/go.mod h1:OU8KDSOw5JEfeEs9q8FY5TcaklBAiGx+Q9Em0BMZrlY= +github.com/mattn/go-runewidth v0.0.21 h1:jJKAZiQH+2mIinzCJIaIG9Be1+0NR+5sz/lYEEjdM8w= +github.com/mattn/go-runewidth v0.0.21/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= +github.com/metal-stack/api v0.0.56 h1:wrW2zUKAOQd2qsRMyEg4Km7jkI688OZGzqas9agxMro= +github.com/metal-stack/api v0.0.56/go.mod h1:hEgtKVD7UnUwUExdA7pbFvVRxNRxSGUnU+bZce46//c= github.com/metal-stack/metal-lib v0.24.0 h1:wvQQPWIXcA2tP+I6zAHUNdtVLLJfQnnV9yG2SoqUkz4= github.com/metal-stack/metal-lib v0.24.0/go.mod h1:oITaqj/BtB9vDKM66jCXkeA+4D0eTZElgIKal5vtiNY= github.com/metal-stack/v v1.0.3 h1:Sh2oBlnxrCUD+mVpzfC8HiqL045YWkxs0gpTvkjppqs= github.com/metal-stack/v v1.0.3/go.mod h1:YTahEu7/ishwpYKnp/VaW/7nf8+PInogkfGwLcGPdXg= github.com/minio/minlz v1.1.0 h1:rUOGu3EP4EqJC5k3qCsIwEnZiJULKqtRyDdqbhlvMmQ= github.com/minio/minlz v1.1.0/go.mod h1:qT0aEB35q79LLornSzeDH75LBf3aH1MV+jB5w9Wasec= -github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/oklog/ulid/v2 v2.1.1 h1:suPZ4ARWLOJLegGFiZZ1dFAkqzhMjL3J1TzI+5wHz8s= +github.com/oklog/ulid/v2 v2.1.1/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ= github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6 h1:zrbMGy9YXpIeTnGj4EljqMiZsIcE09mmF8XsD5AYOJc= github.com/olekukonko/cat v0.0.0-20250911104152-50322a0618f6/go.mod h1:rEKTHC9roVVicUIfZK7DYrdIoM0EOr8mK1Hj5s3JjH0= github.com/olekukonko/errors v1.2.0 h1:10Zcn4GeV59t/EGqJc8fUjtFT/FuUh5bTMzZ1XwmCRo= github.com/olekukonko/errors v1.2.0/go.mod h1:ppzxA5jBKcO1vIpCXQ9ZqgDh8iwODz6OXIGKU8r5m4Y= -github.com/olekukonko/ll v0.1.6 h1:lGVTHO+Qc4Qm+fce/2h2m5y9LvqaW+DCN7xW9hsU3uA= -github.com/olekukonko/ll v0.1.6/go.mod h1:NVUmjBb/aCtUpjKk75BhWrOlARz3dqsM+OtszpY4o88= -github.com/olekukonko/tablewriter v1.1.3 h1:VSHhghXxrP0JHl+0NnKid7WoEmd9/urKRJLysb70nnA= -github.com/olekukonko/tablewriter v1.1.3/go.mod h1:9VU0knjhmMkXjnMKrZ3+L2JhhtsQ/L38BbL3CRNE8tM= +github.com/olekukonko/ll v0.1.7 h1:WyK1YZwOTUKHEXZz3VydBDT5t3zDqa9yI8iJg5PHon4= +github.com/olekukonko/ll v0.1.7/go.mod h1:RPRC6UcscfFZgjo1nulkfMH5IM0QAYim0LfnMvUuozw= +github.com/olekukonko/tablewriter v1.1.4 h1:ORUMI3dXbMnRlRggJX3+q7OzQFDdvgbN9nVWj1drm6I= +github.com/olekukonko/tablewriter v1.1.4/go.mod h1:+kedxuyTtgoZLwif3P1Em4hARJs+mVnzKxmsCL/C5RY= +github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= @@ -118,27 +121,25 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -go.mongodb.org/mongo-driver v1.17.9 h1:IexDdCuuNJ3BHrELgBlyaH9p60JXAvdzWR128q+U5tU= -go.mongodb.org/mongo-driver v1.17.9/go.mod h1:LlOhpH5NUEfhxcAwG0UEkMqwYcc4JU18gtCdGudk/tQ= -go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= -go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= +go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ= +go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 h1:jiDhWWeC7jfWqR9c/uplMOqJ0sbNlNWv0UkzE0vX1MA= golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90/go.mod h1:xE1HEv6b+1SCZ5/uscMRjUBKtIxworgEcEi+/n9NQDQ= -golang.org/x/net v0.50.0 h1:ucWh9eiCGyDR3vtzso0WMQinm2Dnt8cFMuQa9K33J60= -golang.org/x/net v0.50.0/go.mod h1:UgoSli3F/pBgdJBHCTc+tp3gmrU4XswgGRgtnwWTfyM= +golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0= +golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= -golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo= +golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8= golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA= -google.golang.org/genproto/googleapis/api v0.0.0-20260311181403-84a4fc48630c h1:OyQPd6I3pN/9gDxz6L13kYGJgqkpdrAohJRBeXyxlgI= -google.golang.org/genproto/googleapis/api v0.0.0-20260311181403-84a4fc48630c/go.mod h1:X2gu9Qwng7Nn009s/r3RUxqkzQNqOrAy79bluY7ojIg= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260311181403-84a4fc48630c h1:xgCzyF2LFIO/0X2UAoVRiXKU5Xg6VjToG4i2/ecSswk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260311181403-84a4fc48630c/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= -google.golang.org/grpc v1.79.1 h1:zGhSi45ODB9/p3VAawt9a+O/MULLl9dpizzNNpq7flY= -google.golang.org/grpc v1.79.1/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ= +google.golang.org/genproto/googleapis/api v0.0.0-20260319201613-d00831a3d3e7 h1:41r6JMbpzBMen0R/4TZeeAmGXSJC7DftGINUodzTkPI= +google.golang.org/genproto/googleapis/api v0.0.0-20260319201613-d00831a3d3e7/go.mod h1:EIQZ5bFCfRQDV4MhRle7+OgjNtZ6P1PiZBgAKuxXu/Y= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260319201613-d00831a3d3e7 h1:ndE4FoJqsIceKP2oYSnUZqhTdYufCYYkqwtFzfrhI7w= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260319201613-d00831a3d3e7/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/grpc v1.79.3 h1:sybAEdRIEtvcD68Gx7dmnwjZKlyfuc61Dyo9pGXXkKE= +google.golang.org/grpc v1.79.3/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -148,8 +149,8 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/apimachinery v0.35.1 h1:yxO6gV555P1YV0SANtnTjXYfiivaTPvCTKX6w6qdDsU= -k8s.io/apimachinery v0.35.1/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns= +k8s.io/apimachinery v0.35.3 h1:MeaUwQCV3tjKP4bcwWGgZ/cp/vpsRnQzqO6J6tJyoF8= +k8s.io/apimachinery v0.35.3/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= diff --git a/pkg/test/common.go b/pkg/test/common.go new file mode 100644 index 0000000..50b3879 --- /dev/null +++ b/pkg/test/common.go @@ -0,0 +1,313 @@ +package test + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "os" + "strings" + "testing" + + "slices" + + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + apitests "github.com/metal-stack/api/go/tests" + "github.com/metal-stack/cli/cmd" + "github.com/metal-stack/cli/cmd/completion" + "github.com/metal-stack/cli/cmd/config" + "github.com/metal-stack/metal-lib/pkg/pointer" + "github.com/metal-stack/metal-lib/pkg/testcommon" + "github.com/spf13/afero" + "github.com/spf13/pflag" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "google.golang.org/protobuf/runtime/protoimpl" + "sigs.k8s.io/yaml" +) + +type Test[R any] struct { + Name string + Cmd func(want R) []string + + ClientMocks *apitests.ClientMockFns + FsMocks func(fs afero.Fs, want R) + MockStdin *bytes.Buffer + + DisableMockClient bool // can switch off mock client creation + + WantErr error + Want R // for json and yaml + WantTable *string // for table printer + WantWideTable *string // for wide table printer + Template *string // for template printer + WantTemplate *string // for template printer + WantMarkdown *string // for markdown printer +} + +func (c *Test[R]) TestCmd(t *testing.T) { + require.NotEmpty(t, c.Name, "test name must not be empty") + require.NotEmpty(t, c.Cmd, "cmd must not be empty") + + if c.WantErr != nil { + _, _, conf := c.newMockConfig(t) + + cmd := cmd.NewRootCmd(conf) + os.Args = append([]string{config.BinaryName}, c.Cmd(c.Want)...) + + err := cmd.Execute() + if diff := cmp.Diff(c.WantErr, err, testcommon.IgnoreUnexported(), testcommon.ErrorStringComparer()); diff != "" { + t.Errorf("error diff (+got -want):\n %s", diff) + } + } + + for _, format := range outputFormats(c) { + t.Run(fmt.Sprintf("%v", format.Args()), func(t *testing.T) { + _, out, conf := c.newMockConfig(t) + + cmd := cmd.NewRootCmd(conf) + os.Args = append([]string{config.BinaryName}, c.Cmd(c.Want)...) + os.Args = append(os.Args, format.Args()...) + + err := cmd.Execute() + require.NoError(t, err) + + format.Validate(t, out.Bytes()) + }) + } +} + +func (c *Test[R]) newMockConfig(t *testing.T) (any, *bytes.Buffer, *config.Config) { + mock := apitests.New(t) + + fs := afero.NewMemMapFs() + if c.FsMocks != nil { + c.FsMocks(fs, c.Want) + } + + var in io.Reader + if c.MockStdin != nil { + in = bytes.NewReader(c.MockStdin.Bytes()) + } + + var ( + out bytes.Buffer + config = &config.Config{ + Fs: fs, + Out: &out, + In: in, + PromptOut: io.Discard, + Completion: &completion.Completion{}, + Client: mock.Client(c.ClientMocks), + } + ) + + if c.DisableMockClient { + config.Client = nil + } + + return nil, &out, config +} + +func AssertExhaustiveArgs(t *testing.T, args []string, exclude ...string) { + assertContainsPrefix := func(ss []string, prefix string) error { + for _, s := range ss { + if strings.HasPrefix(s, prefix) { + return nil + } + } + return fmt.Errorf("not exhaustive: does not contain %q", prefix) + } + + root := cmd.NewRootCmd(&config.Config{}) + cmd, args, err := root.Find(args) + require.NoError(t, err) + + cmd.LocalFlags().VisitAll(func(f *pflag.Flag) { + if slices.Contains(exclude, f.Name) { + return + } + require.NoError(t, assertContainsPrefix(args, "--"+f.Name), "please ensure you all available args are used in order to increase coverage or exclude them explicitly") + }) +} + +func MustMarshal(t *testing.T, d any) []byte { + b, err := json.MarshalIndent(d, "", " ") + require.NoError(t, err) + return b +} + +func MustMarshalToMultiYAML[R any](t *testing.T, data []R) []byte { + var parts []string + for _, elem := range data { + parts = append(parts, string(MustMarshal(t, elem))) + } + return []byte(strings.Join(parts, "\n---\n")) +} + +func MustJsonDeepCopy[O any](t *testing.T, object O) O { + raw, err := json.Marshal(&object) + require.NoError(t, err) + var copy O + err = json.Unmarshal(raw, ©) + require.NoError(t, err) + return copy +} + +func outputFormats[R any](c *Test[R]) []outputFormat[R] { + var formats []outputFormat[R] + + if !pointer.IsZero(c.Want) { + formats = append(formats, &jsonOutputFormat[R]{want: c.Want}, &yamlOutputFormat[R]{want: c.Want}) + } + + if c.WantTable != nil { + formats = append(formats, &tableOutputFormat[R]{table: *c.WantTable}) + } + + if c.WantWideTable != nil { + formats = append(formats, &wideTableOutputFormat[R]{table: *c.WantWideTable}) + } + + if c.Template != nil && c.WantTemplate != nil { + formats = append(formats, &templateOutputFormat[R]{template: *c.Template, templateOutput: *c.WantTemplate}) + } + + if c.WantMarkdown != nil { + formats = append(formats, &markdownOutputFormat[R]{table: *c.WantMarkdown}) + } + + return formats +} + +type outputFormat[R any] interface { + Args() []string + Validate(t *testing.T, output []byte) +} + +type jsonOutputFormat[R any] struct { + want R +} + +func (o *jsonOutputFormat[R]) Args() []string { + return []string{"-o", "jsonraw"} +} + +func (o *jsonOutputFormat[R]) Validate(t *testing.T, output []byte) { + var got R + + err := json.Unmarshal(output, &got) + require.NoError(t, err, string(output)) + + if diff := cmp.Diff(o.want, got, testcommon.IgnoreUnexported(), cmpopts.IgnoreTypes(protoimpl.MessageState{})); diff != "" { + t.Errorf("diff (+got -want):\n %s", diff) + } +} + +type yamlOutputFormat[R any] struct { + want R +} + +func (o *yamlOutputFormat[R]) Args() []string { + return []string{"-o", "yamlraw"} +} + +func (o *yamlOutputFormat[R]) Validate(t *testing.T, output []byte) { + var got R + + err := yaml.Unmarshal(output, &got) + require.NoError(t, err) + + if diff := cmp.Diff(o.want, got, testcommon.IgnoreUnexported(), cmpopts.IgnoreTypes(protoimpl.MessageState{})); diff != "" { + t.Errorf("diff (+got -want):\n %s", diff) + } +} + +type tableOutputFormat[R any] struct { + table string +} + +func (o *tableOutputFormat[R]) Args() []string { + return []string{"-o", "table"} +} + +func (o *tableOutputFormat[R]) Validate(t *testing.T, output []byte) { + validateTableRows(t, o.table, string(output)) +} + +type wideTableOutputFormat[R any] struct { + table string +} + +func (o *wideTableOutputFormat[R]) Args() []string { + return []string{"-o", "wide"} +} + +func (o *wideTableOutputFormat[R]) Validate(t *testing.T, output []byte) { + validateTableRows(t, o.table, string(output)) +} + +type templateOutputFormat[R any] struct { + template string + templateOutput string +} + +func (o *templateOutputFormat[R]) Args() []string { + return []string{"-o", "template", "--template", o.template} +} + +func (o *templateOutputFormat[R]) Validate(t *testing.T, output []byte) { + t.Logf("got following template output:\n\n%s\n\nconsider using this for test comparison if it looks correct.", string(output)) + + if diff := cmp.Diff(strings.TrimSpace(o.templateOutput), strings.TrimSpace(string(output))); diff != "" { + t.Errorf("diff (+got -want):\n %s", diff) + } +} + +type markdownOutputFormat[R any] struct { + table string +} + +func (o *markdownOutputFormat[R]) Args() []string { + return []string{"-o", "markdown"} +} + +func (o *markdownOutputFormat[R]) Validate(t *testing.T, output []byte) { + validateTableRows(t, o.table, string(output)) +} + +func validateTableRows(t *testing.T, want, got string) { + trimAll := func(ss []string) []string { + var res []string + for _, s := range ss { + res = append(res, strings.TrimSpace(s)) + } + return res + } + + var ( + trimmedWant = strings.TrimSpace(want) + trimmedGot = strings.TrimSpace(string(got)) + + wantRows = trimAll(strings.Split(trimmedWant, "\n")) + gotRows = trimAll(strings.Split(trimmedGot, "\n")) + ) + + t.Logf("got following table output:\n\n%s\n\nconsider using this for test comparison if it looks correct.", trimmedGot) + + t.Log(cmp.Diff(trimmedWant, trimmedGot)) + + require.Equal(t, len(wantRows), len(gotRows), "tables have different lengths") + + for i := range wantRows { + wantFields := trimAll(strings.Split(wantRows[i], " ")) + gotFields := trimAll(strings.Split(gotRows[i], " ")) + + require.Equal(t, len(wantFields), len(gotFields), "table fields have different lengths") + + for i := range wantFields { + assert.Equal(t, wantFields[i], gotFields[i]) + } + } +}