diff --git a/cmd/base/hooks.go b/cmd/base/hooks.go index d0bfc13..13c7a9f 100644 --- a/cmd/base/hooks.go +++ b/cmd/base/hooks.go @@ -81,9 +81,6 @@ func CheckFormatterFlags(cmdContext *CmdContext, entities map[string]entities.En if entity == nil { return fmt.Errorf("can't find entity") } - if err := entity.SetCmdDefaultFields(cmd.Name()); err != nil { - return err - } if fieldList { formatter.ListEntityFields(entity.GetFields()) os.Exit(0) diff --git a/cmd/entities/cloud-instances/ptr.go b/cmd/entities/cloud-instances/ptr.go index 59511b5..fbd7466 100644 --- a/cmd/entities/cloud-instances/ptr.go +++ b/cmd/entities/cloud-instances/ptr.go @@ -25,9 +25,9 @@ func newAddPTRCmd(cmdContext *base.CmdContext) *cobra.Command { base.SetupProxy(cmd, manager) - input := serverscom.PTRRecordCreateInput{ - Domain: data, - IP: ip, + input := serverscom.CloudComputingInstancePTRRecordCreateInput{ + Data: data, + IP: ip, } if cmd.Flags().Changed("ttl") { input.TTL = &ttl diff --git a/cmd/entities/cloud-instances/ptr_test.go b/cmd/entities/cloud-instances/ptr_test.go index a75f335..3a22448 100644 --- a/cmd/entities/cloud-instances/ptr_test.go +++ b/cmd/entities/cloud-instances/ptr_test.go @@ -161,8 +161,8 @@ func TestAddPTRCmd(t *testing.T) { output: "json", expectedOutput: testutils.ReadFixture(filepath.Join(ptrFixtureBasePath, "get.json")), configureMock: func(mock *mocks.MockCloudComputingInstancesService) { - in := serverscom.PTRRecordCreateInput{ - Domain: testPTR.Domain, + in := serverscom.CloudComputingInstancePTRRecordCreateInput{ + Data: testPTR.Domain, IP: testPTR.IP, TTL: &testPTR.TTL, Priority: &testPTR.Priority, @@ -177,9 +177,9 @@ func TestAddPTRCmd(t *testing.T) { args: []string{testInstanceID, "--data", testPTR.Domain, "--ip", testPTR.IP}, expectError: true, configureMock: func(mock *mocks.MockCloudComputingInstancesService) { - in := serverscom.PTRRecordCreateInput{ - Domain: testPTR.Domain, - IP: testPTR.IP, + in := serverscom.CloudComputingInstancePTRRecordCreateInput{ + Data: testPTR.Domain, + IP: testPTR.IP, } mock.EXPECT(). CreatePTRRecord(gomock.Any(), testInstanceID, in). diff --git a/cmd/entities/cloud-volumes/update.go b/cmd/entities/cloud-volumes/update.go index a6fd0ba..a8c6cac 100644 --- a/cmd/entities/cloud-volumes/update.go +++ b/cmd/entities/cloud-volumes/update.go @@ -11,8 +11,6 @@ import ( func newUpdateCmd(cmdContext *base.CmdContext) *cobra.Command { var name string var description string - var imageID string - var snapshotID string var labels []string cmd := &cobra.Command{ @@ -35,8 +33,6 @@ func newUpdateCmd(cmdContext *base.CmdContext) *cobra.Command { input := serverscom.CloudBlockStorageVolumeUpdateInput{ Name: name, Description: description, - ImageID: imageID, - SnapshotID: snapshotID, Labels: labelsMap, } @@ -58,8 +54,6 @@ func newUpdateCmd(cmdContext *base.CmdContext) *cobra.Command { cmd.Flags().StringVarP(&name, "name", "n", "", "A name of the cloud volume") cmd.Flags().StringVar(&description, "description", "", "Description of the volume") - cmd.Flags().StringVar(&imageID, "image-id", "", "ID of the image") - cmd.Flags().StringVar(&snapshotID, "snapshot-id", "", "ID of the snapshot") cmd.Flags().StringArrayVarP(&labels, "label", "l", []string{}, "string in key=value format") return cmd diff --git a/cmd/entities/l2_segments/l2_segments.go b/cmd/entities/l2_segments/l2_segments.go index af081b7..f2b9065 100644 --- a/cmd/entities/l2_segments/l2_segments.go +++ b/cmd/entities/l2_segments/l2_segments.go @@ -14,8 +14,13 @@ func NewCmd(cmdContext *base.CmdContext) *cobra.Command { if err != nil { log.Fatal(err) } + l2NetworkEntity, err := entities.Registry.GetEntityFromValue(serverscom.L2SegmentNetwork{}) + if err != nil { + log.Fatal(err) + } entitiesMap := make(map[string]entities.EntityInterface) entitiesMap["l2-segments"] = l2Entity + entitiesMap["list-networks"] = l2NetworkEntity cmd := &cobra.Command{ Use: "l2-segments", Short: "Manage L2 segments", diff --git a/cmd/entities/l2_segments/l2_segments_test.go b/cmd/entities/l2_segments/l2_segments_test.go index da549be..160b897 100644 --- a/cmd/entities/l2_segments/l2_segments_test.go +++ b/cmd/entities/l2_segments/l2_segments_test.go @@ -59,7 +59,7 @@ var ( cidr = "127.1.182.0/24" title = "testNetwork" - testNetwork = serverscom.Network{ + testNetwork = serverscom.L2SegmentNetwork{ ID: testID, Title: &title, Status: "new", @@ -882,17 +882,17 @@ func TestListL2NetworksCmd(t *testing.T) { args []string expectedOutput []byte expectError bool - configureMock func(*mocks.MockCollection[serverscom.Network]) + configureMock func(*mocks.MockCollection[serverscom.L2SegmentNetwork]) }{ { name: "list all l2 networks", output: "json", args: []string{testID, "-A"}, expectedOutput: testutils.ReadFixture(filepath.Join(fixtureBasePath, "list_networks_all.json")), - configureMock: func(mock *mocks.MockCollection[serverscom.Network]) { + configureMock: func(mock *mocks.MockCollection[serverscom.L2SegmentNetwork]) { mock.EXPECT(). Collect(gomock.Any()). - Return([]serverscom.Network{n1, n2}, nil) + Return([]serverscom.L2SegmentNetwork{n1, n2}, nil) }, }, { @@ -900,37 +900,37 @@ func TestListL2NetworksCmd(t *testing.T) { output: "json", args: []string{testID}, expectedOutput: testutils.ReadFixture(filepath.Join(fixtureBasePath, "list_networks.json")), - configureMock: func(mock *mocks.MockCollection[serverscom.Network]) { + configureMock: func(mock *mocks.MockCollection[serverscom.L2SegmentNetwork]) { mock.EXPECT(). List(gomock.Any()). - Return([]serverscom.Network{n1}, nil) + Return([]serverscom.L2SegmentNetwork{n1}, nil) }, }, { name: "list l2 networks with template", args: []string{testID, "--template", "{{range .}}ID: {{.ID}} Title: {{.Title}}\n{{end}}"}, expectedOutput: testutils.ReadFixture(filepath.Join(fixtureBasePath, "list_networks_template.txt")), - configureMock: func(mock *mocks.MockCollection[serverscom.Network]) { + configureMock: func(mock *mocks.MockCollection[serverscom.L2SegmentNetwork]) { mock.EXPECT(). List(gomock.Any()). - Return([]serverscom.Network{n1, n2}, nil) + Return([]serverscom.L2SegmentNetwork{n1, n2}, nil) }, }, { name: "list l2 networks with pageView", args: []string{testID, "--page-view"}, expectedOutput: testutils.ReadFixture(filepath.Join(fixtureBasePath, "list_networks_pageview.txt")), - configureMock: func(mock *mocks.MockCollection[serverscom.Network]) { + configureMock: func(mock *mocks.MockCollection[serverscom.L2SegmentNetwork]) { mock.EXPECT(). List(gomock.Any()). - Return([]serverscom.Network{n1, n2}, nil) + Return([]serverscom.L2SegmentNetwork{n1, n2}, nil) }, }, { name: "list l2 networks error", args: []string{testID}, expectError: true, - configureMock: func(mock *mocks.MockCollection[serverscom.Network]) { + configureMock: func(mock *mocks.MockCollection[serverscom.L2SegmentNetwork]) { mock.EXPECT(). List(gomock.Any()). Return(nil, errors.New("some error")) @@ -941,7 +941,7 @@ func TestListL2NetworksCmd(t *testing.T) { mockCtrl := gomock.NewController(t) defer mockCtrl.Finish() - collectionHandler := mocks.NewMockCollection[serverscom.Network](mockCtrl) + collectionHandler := mocks.NewMockCollection[serverscom.L2SegmentNetwork](mockCtrl) l2ServiceHandler := mocks.NewMockL2SegmentsService(mockCtrl) l2ServiceHandler.EXPECT(). Networks(testID). diff --git a/cmd/entities/l2_segments/list.go b/cmd/entities/l2_segments/list.go index 50f4459..5cca14e 100644 --- a/cmd/entities/l2_segments/list.go +++ b/cmd/entities/l2_segments/list.go @@ -54,14 +54,14 @@ func newListMembersCmd(cmdContext *base.CmdContext) *cobra.Command { func newListNetworksCmd(cmdContext *base.CmdContext) *cobra.Command { - factory := func(verbose bool, args ...string) serverscom.Collection[serverscom.Network] { + factory := func(verbose bool, args ...string) serverscom.Collection[serverscom.L2SegmentNetwork] { scClient := cmdContext.GetClient().SetVerbose(verbose).GetScClient() return scClient.L2Segments.Networks(args[0]) } opts := base.NewListOptions( - &base.BaseListOptions[serverscom.Network]{}, - &base.L2SegmentGroupTypeOption[serverscom.Network]{}, + &base.BaseListOptions[serverscom.L2SegmentNetwork]{}, + &base.L2SegmentGroupTypeOption[serverscom.L2SegmentNetwork]{}, ) cmd := base.NewListCmd("list-networks", "l2 segment networks", factory, cmdContext, opts...) diff --git a/cmd/entities/load_balancer_clusters/load_balancer_clusters_test.go b/cmd/entities/load_balancer_clusters/load_balancer_clusters_test.go index 60cccf2..02cb089 100644 --- a/cmd/entities/load_balancer_clusters/load_balancer_clusters_test.go +++ b/cmd/entities/load_balancer_clusters/load_balancer_clusters_test.go @@ -24,7 +24,6 @@ var ( Name: "test-lb-cluster", LocationID: 1, LocationCode: testLocationCode, - Status: "active", Created: fixedTime, Updated: fixedTime, } diff --git a/docs/srvctl-lb-l4-add/examples.md b/docs/srvctl-lb-l4-add/examples.md index 30e42f1..0ca4b53 100644 --- a/docs/srvctl-lb-l4-add/examples.md +++ b/docs/srvctl-lb-l4-add/examples.md @@ -18,7 +18,7 @@ JSON structure example: "location_id": "", "cluster_id": "", "store_logs": true, - "store_logs_region_id": "", + "store_logs_region_id": 0, "vhost_zones": [ { "id": "", diff --git a/docs/srvctl-lb-l4-update/examples.md b/docs/srvctl-lb-l4-update/examples.md index 5b3af31..c3a1400 100644 --- a/docs/srvctl-lb-l4-update/examples.md +++ b/docs/srvctl-lb-l4-update/examples.md @@ -18,7 +18,7 @@ JSON structure example: "shared_cluster": "", "name": "", "store_logs": true, - "store_logs_region_id": "", + "store_logs_region_id": 0, "new_external_ips_count": "", "delete_external_ips": [], "vhost_zones": [ diff --git a/docs/srvctl-lb-l7-add/examples.md b/docs/srvctl-lb-l7-add/examples.md index 33319ed..dfa2d6f 100644 --- a/docs/srvctl-lb-l7-add/examples.md +++ b/docs/srvctl-lb-l7-add/examples.md @@ -18,7 +18,7 @@ JSON structure example: "location_id": "", "cluster_id": "", "store_logs": true, - "store_logs_region_id": "", + "store_logs_region_id": 0, "geoip": "true", "vhost_zones": [ { diff --git a/docs/srvctl-lb-l7-update/examples.md b/docs/srvctl-lb-l7-update/examples.md index 69f36af..21d01d7 100644 --- a/docs/srvctl-lb-l7-update/examples.md +++ b/docs/srvctl-lb-l7-update/examples.md @@ -18,7 +18,7 @@ JSON structure example: "cluster_id": "", "shared_cluster": "", "store_logs": true, - "store_logs_region_id": "", + "store_logs_region_id": 0, "geoip": "true", "new_external_ips_count": "", "delete_external_ips": [], diff --git a/go.mod b/go.mod index e878ff5..9f6552b 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/creack/pty v1.1.24 github.com/jmespath/go-jmespath v0.4.0 github.com/onsi/gomega v1.42.1 - github.com/serverscom/serverscom-go-client v1.0.33 + github.com/serverscom/serverscom-go-client v1.1.2 github.com/spf13/cobra v1.10.2 github.com/spf13/pflag v1.0.10 github.com/spf13/viper v1.21.0 @@ -33,5 +33,5 @@ require ( go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/net v0.57.0 // indirect golang.org/x/sys v0.47.0 // indirect - gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect ) diff --git a/go.sum b/go.sum index f7105f8..978a146 100644 --- a/go.sum +++ b/go.sum @@ -22,8 +22,11 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/onsi/gomega v1.42.1 h1:iN1rCUX+44NZ1Dc97MPoeFYbFR0vh8zxoxMFwKdyZ6I= @@ -38,8 +41,8 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagikazarmark/locafero v0.12.0 h1:/NQhBAkUb4+fH1jivKHWusDYFjMOOKU88eegjfxfHb4= github.com/sagikazarmark/locafero v0.12.0/go.mod h1:sZh36u/YSZ918v0Io+U9ogLYQJ9tLLBmM4eneO6WwsI= -github.com/serverscom/serverscom-go-client v1.0.33 h1:JdpzoJnOjUEappDxxGSzhHC4At7RaZItrg7o7wVQZpg= -github.com/serverscom/serverscom-go-client v1.0.33/go.mod h1:/Nf+XygKOxm19Sl2gvMzT55O4X+tWDkj/UM4mjzfKgM= +github.com/serverscom/serverscom-go-client v1.1.2 h1:ddSKFrHRu38zdkk8OXg9Ugr5oTQX1ESfanTls8vb7vI= +github.com/serverscom/serverscom-go-client v1.1.2/go.mod h1:RVmx6+Dop/gvs7FETe6TrzdSEzQZGOzImyUTgUwsBoU= github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg= github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY= @@ -78,8 +81,8 @@ golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY= golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/mocks/cloud_instances_service.go b/internal/mocks/cloud_instances_service.go index 389eed7..3d1503d 100644 --- a/internal/mocks/cloud_instances_service.go +++ b/internal/mocks/cloud_instances_service.go @@ -86,7 +86,7 @@ func (mr *MockCloudComputingInstancesServiceMockRecorder) Create(ctx, input any) } // CreatePTRRecord mocks base method. -func (m *MockCloudComputingInstancesService) CreatePTRRecord(ctx context.Context, cloudInstanceID string, input serverscom.PTRRecordCreateInput) (*serverscom.PTRRecord, error) { +func (m *MockCloudComputingInstancesService) CreatePTRRecord(ctx context.Context, cloudInstanceID string, input serverscom.CloudComputingInstancePTRRecordCreateInput) (*serverscom.PTRRecord, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreatePTRRecord", ctx, cloudInstanceID, input) ret0, _ := ret[0].(*serverscom.PTRRecord) diff --git a/internal/mocks/hosts_service.go b/internal/mocks/hosts_service.go index fb757e8..9b335bb 100644 --- a/internal/mocks/hosts_service.go +++ b/internal/mocks/hosts_service.go @@ -191,6 +191,21 @@ func (mr *MockHostsServiceMockRecorder) ActivatePrivateIpxeBootFeature(ctx, serv return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ActivatePrivateIpxeBootFeature", reflect.TypeOf((*MockHostsService)(nil).ActivatePrivateIpxeBootFeature), ctx, serverID, input) } +// ActivatePublicIpxeBootFeature mocks base method. +func (m *MockHostsService) ActivatePublicIpxeBootFeature(ctx context.Context, serverID string, input serverscom.PublicIpxeBootFeatureInput) (*serverscom.DedicatedServerFeature, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ActivatePublicIpxeBootFeature", ctx, serverID, input) + ret0, _ := ret[0].(*serverscom.DedicatedServerFeature) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ActivatePublicIpxeBootFeature indicates an expected call of ActivatePublicIpxeBootFeature. +func (mr *MockHostsServiceMockRecorder) ActivatePublicIpxeBootFeature(ctx, serverID, input any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ActivatePublicIpxeBootFeature", reflect.TypeOf((*MockHostsService)(nil).ActivatePublicIpxeBootFeature), ctx, serverID, input) +} + // AddDedicatedServerPrivateIPv4Network mocks base method. func (m *MockHostsService) AddDedicatedServerPrivateIPv4Network(ctx context.Context, id string, input serverscom.NetworkInput) (*serverscom.Network, error) { m.ctrl.T.Helper() @@ -221,6 +236,21 @@ func (mr *MockHostsServiceMockRecorder) AddDedicatedServerPublicIPv4Network(ctx, return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddDedicatedServerPublicIPv4Network", reflect.TypeOf((*MockHostsService)(nil).AddDedicatedServerPublicIPv4Network), ctx, id, input) } +// AddSBMServerPrivateIPv4Network mocks base method. +func (m *MockHostsService) AddSBMServerPrivateIPv4Network(ctx context.Context, id string, input serverscom.NetworkInput) (*serverscom.Network, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AddSBMServerPrivateIPv4Network", ctx, id, input) + ret0, _ := ret[0].(*serverscom.Network) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AddSBMServerPrivateIPv4Network indicates an expected call of AddSBMServerPrivateIPv4Network. +func (mr *MockHostsServiceMockRecorder) AddSBMServerPrivateIPv4Network(ctx, id, input any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddSBMServerPrivateIPv4Network", reflect.TypeOf((*MockHostsService)(nil).AddSBMServerPrivateIPv4Network), ctx, id, input) +} + // AttachSSHKeysToDedicatedServer mocks base method. func (m *MockHostsService) AttachSSHKeysToDedicatedServer(ctx context.Context, id string, input serverscom.SSHKeyAttachInput) ([]serverscom.SSHKey, error) { m.ctrl.T.Helper() @@ -430,6 +460,21 @@ func (mr *MockHostsServiceMockRecorder) DeactivatePrivateIpxeBootFeature(ctx, se return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeactivatePrivateIpxeBootFeature", reflect.TypeOf((*MockHostsService)(nil).DeactivatePrivateIpxeBootFeature), ctx, serverID) } +// DeactivatePublicIpxeBootFeature mocks base method. +func (m *MockHostsService) DeactivatePublicIpxeBootFeature(ctx context.Context, serverID string) (*serverscom.DedicatedServerFeature, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeactivatePublicIpxeBootFeature", ctx, serverID) + ret0, _ := ret[0].(*serverscom.DedicatedServerFeature) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeactivatePublicIpxeBootFeature indicates an expected call of DeactivatePublicIpxeBootFeature. +func (mr *MockHostsServiceMockRecorder) DeactivatePublicIpxeBootFeature(ctx, serverID any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeactivatePublicIpxeBootFeature", reflect.TypeOf((*MockHostsService)(nil).DeactivatePublicIpxeBootFeature), ctx, serverID) +} + // DedicatedServerConnections mocks base method. func (m *MockHostsService) DedicatedServerConnections(id string) serverscom.Collection[serverscom.HostConnection] { m.ctrl.T.Helper() @@ -572,6 +617,21 @@ func (mr *MockHostsServiceMockRecorder) DeletePTRRecordForSBMServer(ctx, serverI return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePTRRecordForSBMServer", reflect.TypeOf((*MockHostsService)(nil).DeletePTRRecordForSBMServer), ctx, serverID, ptrRecordID) } +// DeleteSBMServerNetwork mocks base method. +func (m *MockHostsService) DeleteSBMServerNetwork(ctx context.Context, serverID, networkID string) (*serverscom.Network, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteSBMServerNetwork", ctx, serverID, networkID) + ret0, _ := ret[0].(*serverscom.Network) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteSBMServerNetwork indicates an expected call of DeleteSBMServerNetwork. +func (mr *MockHostsServiceMockRecorder) DeleteSBMServerNetwork(ctx, serverID, networkID any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteSBMServerNetwork", reflect.TypeOf((*MockHostsService)(nil).DeleteSBMServerNetwork), ctx, serverID, networkID) +} + // DetachSSHKeyFromDedicatedServer mocks base method. func (m *MockHostsService) DetachSSHKeyFromDedicatedServer(ctx context.Context, serverID, fingerprint string) error { m.ctrl.T.Helper() @@ -646,6 +706,21 @@ func (mr *MockHostsServiceMockRecorder) GetDedicatedServerOOBCredentials(ctx, id return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDedicatedServerOOBCredentials", reflect.TypeOf((*MockHostsService)(nil).GetDedicatedServerOOBCredentials), ctx, id, params) } +// GetDedicatedServerSSHKey mocks base method. +func (m *MockHostsService) GetDedicatedServerSSHKey(ctx context.Context, serverID, fingerprint string) (*serverscom.SSHKey, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetDedicatedServerSSHKey", ctx, serverID, fingerprint) + ret0, _ := ret[0].(*serverscom.SSHKey) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetDedicatedServerSSHKey indicates an expected call of GetDedicatedServerSSHKey. +func (mr *MockHostsServiceMockRecorder) GetDedicatedServerSSHKey(ctx, serverID, fingerprint any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDedicatedServerSSHKey", reflect.TypeOf((*MockHostsService)(nil).GetDedicatedServerSSHKey), ctx, serverID, fingerprint) +} + // GetKubernetesBaremetalNode mocks base method. func (m *MockHostsService) GetKubernetesBaremetalNode(ctx context.Context, id string) (*serverscom.KubernetesBaremetalNode, error) { m.ctrl.T.Helper() @@ -676,6 +751,36 @@ func (mr *MockHostsServiceMockRecorder) GetSBMServer(ctx, id any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSBMServer", reflect.TypeOf((*MockHostsService)(nil).GetSBMServer), ctx, id) } +// GetSBMServerNetwork mocks base method. +func (m *MockHostsService) GetSBMServerNetwork(ctx context.Context, serverID, networkID string) (*serverscom.Network, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetSBMServerNetwork", ctx, serverID, networkID) + ret0, _ := ret[0].(*serverscom.Network) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetSBMServerNetwork indicates an expected call of GetSBMServerNetwork. +func (mr *MockHostsServiceMockRecorder) GetSBMServerNetwork(ctx, serverID, networkID any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSBMServerNetwork", reflect.TypeOf((*MockHostsService)(nil).GetSBMServerNetwork), ctx, serverID, networkID) +} + +// GetSBMServerNetworkUsage mocks base method. +func (m *MockHostsService) GetSBMServerNetworkUsage(ctx context.Context, id string) (*serverscom.NetworkUsage, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetSBMServerNetworkUsage", ctx, id) + ret0, _ := ret[0].(*serverscom.NetworkUsage) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetSBMServerNetworkUsage indicates an expected call of GetSBMServerNetworkUsage. +func (mr *MockHostsServiceMockRecorder) GetSBMServerNetworkUsage(ctx, id any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSBMServerNetworkUsage", reflect.TypeOf((*MockHostsService)(nil).GetSBMServerNetworkUsage), ctx, id) +} + // KubernetesBaremetalNodeDriveSlots mocks base method. func (m *MockHostsService) KubernetesBaremetalNodeDriveSlots(id string) serverscom.Collection[serverscom.HostDriveSlot] { m.ctrl.T.Helper() @@ -956,6 +1061,20 @@ func (mr *MockHostsServiceMockRecorder) ReleaseSBMServer(ctx, id any) *gomock.Ca return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReleaseSBMServer", reflect.TypeOf((*MockHostsService)(nil).ReleaseSBMServer), ctx, id) } +// SBMServerNetworks mocks base method. +func (m *MockHostsService) SBMServerNetworks(id string) serverscom.Collection[serverscom.Network] { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SBMServerNetworks", id) + ret0, _ := ret[0].(serverscom.Collection[serverscom.Network]) + return ret0 +} + +// SBMServerNetworks indicates an expected call of SBMServerNetworks. +func (mr *MockHostsServiceMockRecorder) SBMServerNetworks(id any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SBMServerNetworks", reflect.TypeOf((*MockHostsService)(nil).SBMServerNetworks), id) +} + // SBMServerPTRRecords mocks base method. func (m *MockHostsService) SBMServerPTRRecords(id string) serverscom.Collection[serverscom.PTRRecord] { m.ctrl.T.Helper() diff --git a/internal/mocks/kubernetes_clusters_service.go b/internal/mocks/kubernetes_clusters_service.go index cb559c1..99af754 100644 --- a/internal/mocks/kubernetes_clusters_service.go +++ b/internal/mocks/kubernetes_clusters_service.go @@ -55,6 +55,35 @@ func (mr *MockKubernetesClustersServiceMockRecorder) Collection() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Collection", reflect.TypeOf((*MockKubernetesClustersService)(nil).Collection)) } +// CreateNodeGroup mocks base method. +func (m *MockKubernetesClustersService) CreateNodeGroup(ctx context.Context, clusterID string, input serverscom.KubernetesClusterNodeGroupCreateInput) (*serverscom.KubernetesClusterNodeGroup, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateNodeGroup", ctx, clusterID, input) + ret0, _ := ret[0].(*serverscom.KubernetesClusterNodeGroup) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateNodeGroup indicates an expected call of CreateNodeGroup. +func (mr *MockKubernetesClustersServiceMockRecorder) CreateNodeGroup(ctx, clusterID, input any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateNodeGroup", reflect.TypeOf((*MockKubernetesClustersService)(nil).CreateNodeGroup), ctx, clusterID, input) +} + +// DeleteNodeGroup mocks base method. +func (m *MockKubernetesClustersService) DeleteNodeGroup(ctx context.Context, clusterID, nodeGroupID string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteNodeGroup", ctx, clusterID, nodeGroupID) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteNodeGroup indicates an expected call of DeleteNodeGroup. +func (mr *MockKubernetesClustersServiceMockRecorder) DeleteNodeGroup(ctx, clusterID, nodeGroupID any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteNodeGroup", reflect.TypeOf((*MockKubernetesClustersService)(nil).DeleteNodeGroup), ctx, clusterID, nodeGroupID) +} + // Get mocks base method. func (m *MockKubernetesClustersService) Get(ctx context.Context, id string) (*serverscom.KubernetesCluster, error) { m.ctrl.T.Helper() @@ -85,6 +114,35 @@ func (mr *MockKubernetesClustersServiceMockRecorder) GetNode(ctx, clusterID, nod return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNode", reflect.TypeOf((*MockKubernetesClustersService)(nil).GetNode), ctx, clusterID, nodeID) } +// MoveNodes mocks base method. +func (m *MockKubernetesClustersService) MoveNodes(ctx context.Context, clusterID string, input serverscom.KubernetesClusterMoveNodesInput) ([]serverscom.KubernetesClusterNode, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MoveNodes", ctx, clusterID, input) + ret0, _ := ret[0].([]serverscom.KubernetesClusterNode) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MoveNodes indicates an expected call of MoveNodes. +func (mr *MockKubernetesClustersServiceMockRecorder) MoveNodes(ctx, clusterID, input any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MoveNodes", reflect.TypeOf((*MockKubernetesClustersService)(nil).MoveNodes), ctx, clusterID, input) +} + +// NodeGroups mocks base method. +func (m *MockKubernetesClustersService) NodeGroups(id string) serverscom.Collection[serverscom.KubernetesClusterNodeGroup] { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NodeGroups", id) + ret0, _ := ret[0].(serverscom.Collection[serverscom.KubernetesClusterNodeGroup]) + return ret0 +} + +// NodeGroups indicates an expected call of NodeGroups. +func (mr *MockKubernetesClustersServiceMockRecorder) NodeGroups(id any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeGroups", reflect.TypeOf((*MockKubernetesClustersService)(nil).NodeGroups), id) +} + // Nodes mocks base method. func (m *MockKubernetesClustersService) Nodes(id string) serverscom.Collection[serverscom.KubernetesClusterNode] { m.ctrl.T.Helper() @@ -113,3 +171,33 @@ func (mr *MockKubernetesClustersServiceMockRecorder) Update(ctx, id, input any) mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockKubernetesClustersService)(nil).Update), ctx, id, input) } + +// UpdateNode mocks base method. +func (m *MockKubernetesClustersService) UpdateNode(ctx context.Context, clusterID, nodeID string, input serverscom.KubernetesClusterNodeUpdateInput) (*serverscom.KubernetesClusterNode, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateNode", ctx, clusterID, nodeID, input) + ret0, _ := ret[0].(*serverscom.KubernetesClusterNode) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateNode indicates an expected call of UpdateNode. +func (mr *MockKubernetesClustersServiceMockRecorder) UpdateNode(ctx, clusterID, nodeID, input any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateNode", reflect.TypeOf((*MockKubernetesClustersService)(nil).UpdateNode), ctx, clusterID, nodeID, input) +} + +// UpdateNodeGroup mocks base method. +func (m *MockKubernetesClustersService) UpdateNodeGroup(ctx context.Context, clusterID, nodeGroupID string, input serverscom.KubernetesClusterNodeGroupUpdateInput) (*serverscom.KubernetesClusterNodeGroup, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateNodeGroup", ctx, clusterID, nodeGroupID, input) + ret0, _ := ret[0].(*serverscom.KubernetesClusterNodeGroup) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateNodeGroup indicates an expected call of UpdateNodeGroup. +func (mr *MockKubernetesClustersServiceMockRecorder) UpdateNodeGroup(ctx, clusterID, nodeGroupID, input any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateNodeGroup", reflect.TypeOf((*MockKubernetesClustersService)(nil).UpdateNodeGroup), ctx, clusterID, nodeGroupID, input) +} diff --git a/internal/mocks/l2_segment_service.go b/internal/mocks/l2_segment_service.go index 68b8b75..0daefea 100644 --- a/internal/mocks/l2_segment_service.go +++ b/internal/mocks/l2_segment_service.go @@ -143,10 +143,10 @@ func (mr *MockL2SegmentsServiceMockRecorder) Members(segmentID any) *gomock.Call } // Networks mocks base method. -func (m *MockL2SegmentsService) Networks(segmentID string) serverscom.Collection[serverscom.Network] { +func (m *MockL2SegmentsService) Networks(segmentID string) serverscom.Collection[serverscom.L2SegmentNetwork] { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Networks", segmentID) - ret0, _ := ret[0].(serverscom.Collection[serverscom.Network]) + ret0, _ := ret[0].(serverscom.Collection[serverscom.L2SegmentNetwork]) return ret0 } diff --git a/internal/output/entities/cloud_instances.go b/internal/output/entities/cloud_instances.go index 13d3183..ff3f5ca 100644 --- a/internal/output/entities/cloud_instances.go +++ b/internal/output/entities/cloud_instances.go @@ -34,8 +34,8 @@ func RegisterCloudComputingInstanceDefinition() { {ID: "BackupCopies", Name: "BackupCopies", Path: "BackupCopies", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler}, {ID: "PublicPortBlocked", Name: "PublicPortBlocked", Path: "PublicPortBlocked", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler}, {ID: "Labels", Name: "Labels", Path: "Labels", PageViewHandlerFunc: mapPvHandler}, - {ID: "Created", Name: "Created", Path: "Created", ListHandlerFunc: timeHandler, PageViewHandlerFunc: timeHandler}, - {ID: "Updated", Name: "Updated", Path: "Updated", ListHandlerFunc: timeHandler, PageViewHandlerFunc: timeHandler}, + {ID: "Created", Name: "Created", Path: "Created", ListHandlerFunc: timeHandler, PageViewHandlerFunc: timeHandler, Default: true}, + {ID: "Updated", Name: "Updated", Path: "Updated", ListHandlerFunc: timeHandler, PageViewHandlerFunc: timeHandler, Default: true}, }, cmdDefaultFields: map[string][]string{ "list": CloudComputingInstanceListDefaultFields, diff --git a/internal/output/entities/interface.go b/internal/output/entities/interface.go index 0e4f11a..142d34c 100644 --- a/internal/output/entities/interface.go +++ b/internal/output/entities/interface.go @@ -4,7 +4,6 @@ import ( "fmt" "io" "reflect" - "slices" ) // RegistryInterface represents the interface for the EntityRegistry @@ -20,9 +19,9 @@ type EntityRegistry map[reflect.Type]EntityInterface type EntityInterface interface { GetType() reflect.Type GetDefaultFields() []string + GetCmdDefaultFields(cmd string) []string GetFields() []Field Validate(fields []string) error - SetCmdDefaultFields(cmd string) error } // Entity represents the base entity structure @@ -134,26 +133,14 @@ func (e *Entity) Validate(fields []string) error { return nil } -// SetCmdDefaultFields sets the default fields for an entity based on cmd -func (e *Entity) SetCmdDefaultFields(cmd string) error { +// GetCmdDefaultFields returns the default field IDs to show for the given +// command. If the command has an explicit set in cmdDefaultFields it is returned, otherwise it +// falls back to the registration-time defaults (fields marked Field.Default). +func (e *Entity) GetCmdDefaultFields(cmd string) []string { if defaultFields, ok := e.cmdDefaultFields[cmd]; ok { - fieldSet := make(map[string]struct{}, len(e.fields)) - for i, f := range e.fields { - e.fields[i].Default = false - fieldSet[f.ID] = struct{}{} - } - - for _, df := range defaultFields { - if _, exists := fieldSet[df]; !exists { - return fmt.Errorf("can't find field %s in entity field set", df) - } - } - - for i := range e.fields { - e.fields[i].Default = slices.Contains(defaultFields, e.fields[i].ID) - } + return defaultFields } - return nil + return e.GetDefaultFields() } // fieldInChildFields checks if a field is in the list of child fields diff --git a/internal/output/entities/l2_segments.go b/internal/output/entities/l2_segments.go index b2d4f4a..888942d 100644 --- a/internal/output/entities/l2_segments.go +++ b/internal/output/entities/l2_segments.go @@ -8,12 +8,13 @@ import ( ) var ( - L2SegmentType = reflect.TypeFor[serverscom.L2Segment]() - L2SegmentLocationGroupType = reflect.TypeFor[serverscom.L2LocationGroup]() - L2SegmentMemberType = reflect.TypeFor[serverscom.L2Member]() - L2SegmentNetworkType = reflect.TypeFor[serverscom.Network]() - L2SegmentListDefaultFields = []string{"ID", "Name", "Type", "Status", "LocationGroupID", "LocationGroupCode"} - L2SegmentMemberListDefaultFields = []string{"ID", "Title", "Mode", "VLAN", "Status"} + L2SegmentType = reflect.TypeFor[serverscom.L2Segment]() + L2SegmentLocationGroupType = reflect.TypeFor[serverscom.L2LocationGroup]() + L2SegmentMemberType = reflect.TypeFor[serverscom.L2Member]() + L2SegmentNetworkType = reflect.TypeFor[serverscom.L2SegmentNetwork]() + L2SegmentListDefaultFields = []string{"ID", "Name", "Type", "Status", "LocationGroupID", "LocationGroupCode"} + L2SegmentMemberListDefaultFields = []string{"ID", "Title", "Mode", "VLAN", "Status"} + L2SegmentNetworkListDefaultFields = []string{"ID", "Title", "Status", "CIDR", "Family", "InterfaceType", "DistributionMethod", "Additional"} ) func RegisterL2SegmentDefinitions() { @@ -75,4 +76,26 @@ func RegisterL2SegmentDefinitions() { if err := Registry.Register(l2SegmentMemberEntity); err != nil { log.Fatal(err) } + + l2SegmentNetworkEntity := &Entity{ + fields: []Field{ + {ID: "ID", Name: "ID", Path: "ID", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true}, + {ID: "Title", Name: "Title", Path: "Title", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true}, + {ID: "Status", Name: "Status", Path: "Status", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true}, + {ID: "CIDR", Name: "CIDR", Path: "Cidr", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true}, + {ID: "Family", Name: "Family", Path: "Family", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true}, + {ID: "InterfaceType", Name: "InterfaceType", Path: "InterfaceType", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true}, + {ID: "DistributionMethod", Name: "DistributionMethod", Path: "DistributionMethod", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true}, + {ID: "Additional", Name: "Additional", Path: "Additional", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true}, + {ID: "Created", Name: "Created", Path: "Created", ListHandlerFunc: timeHandler, PageViewHandlerFunc: timeHandler, Default: true}, + {ID: "Updated", Name: "Updated", Path: "Updated", ListHandlerFunc: timeHandler, PageViewHandlerFunc: timeHandler, Default: true}, + }, + cmdDefaultFields: map[string][]string{ + "list-networks": L2SegmentNetworkListDefaultFields, + }, + eType: L2SegmentNetworkType, + } + if err := Registry.Register(l2SegmentNetworkEntity); err != nil { + log.Fatal(err) + } } diff --git a/internal/output/entities/load_balancer_clusters.go b/internal/output/entities/load_balancer_clusters.go index 672f243..b833f58 100644 --- a/internal/output/entities/load_balancer_clusters.go +++ b/internal/output/entities/load_balancer_clusters.go @@ -16,7 +16,6 @@ func RegisterLoadBalancerClusterDefinition() { fields: []Field{ {ID: "ID", Name: "ID", Path: "ID", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true}, {ID: "Name", Name: "Name", Path: "Name", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true}, - {ID: "Status", Name: "Status", Path: "Status", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true}, {ID: "LocationID", Name: "LocationID", Path: "LocationID", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true}, {ID: "LocationCode", Name: "LocationCode", Path: "LocationCode", ListHandlerFunc: stringHandler, PageViewHandlerFunc: stringHandler, Default: true}, {ID: "Created", Name: "Created", Path: "Created", ListHandlerFunc: timeHandler, PageViewHandlerFunc: timeHandler, Default: true}, diff --git a/internal/output/formatter.go b/internal/output/formatter.go index 1bf5b22..bdbc33b 100644 --- a/internal/output/formatter.go +++ b/internal/output/formatter.go @@ -21,6 +21,7 @@ type Formatter struct { fieldsToShow []string fieldList bool header bool + cmdName string } // NewFormatter creates new formatter with specified io.Writer @@ -40,6 +41,7 @@ func NewFormatter(cmd *cobra.Command, manager *config.Manager) *Formatter { fieldsToShow: fields, fieldList: fieldList, header: !noHeader, + cmdName: cmd.Name(), } } diff --git a/internal/output/skeletons/templates/lb/add_l4.json b/internal/output/skeletons/templates/lb/add_l4.json index 421deb8..b4d1158 100644 --- a/internal/output/skeletons/templates/lb/add_l4.json +++ b/internal/output/skeletons/templates/lb/add_l4.json @@ -3,7 +3,7 @@ "location_id": "", "cluster_id": "", "store_logs": true, - "store_logs_region_id": "", + "store_logs_region_id": 0, "vhost_zones": [ { "id": "", diff --git a/internal/output/skeletons/templates/lb/add_l7.json b/internal/output/skeletons/templates/lb/add_l7.json index c0ff224..acc0171 100644 --- a/internal/output/skeletons/templates/lb/add_l7.json +++ b/internal/output/skeletons/templates/lb/add_l7.json @@ -3,7 +3,7 @@ "location_id": "", "cluster_id": "", "store_logs": true, - "store_logs_region_id": "", + "store_logs_region_id": 0, "geoip": "true", "vhost_zones": [ { diff --git a/internal/output/skeletons/templates/lb/update_l4.json b/internal/output/skeletons/templates/lb/update_l4.json index 6e5c512..89d5149 100644 --- a/internal/output/skeletons/templates/lb/update_l4.json +++ b/internal/output/skeletons/templates/lb/update_l4.json @@ -3,7 +3,7 @@ "shared_cluster": "", "name": "", "store_logs": true, - "store_logs_region_id": "", + "store_logs_region_id": 0, "new_external_ips_count": "", "delete_external_ips": [], "vhost_zones": [ diff --git a/internal/output/skeletons/templates/lb/update_l7.json b/internal/output/skeletons/templates/lb/update_l7.json index 73ddc54..e93ba3c 100644 --- a/internal/output/skeletons/templates/lb/update_l7.json +++ b/internal/output/skeletons/templates/lb/update_l7.json @@ -3,7 +3,7 @@ "cluster_id": "", "shared_cluster": "", "store_logs": true, - "store_logs_region_id": "", + "store_logs_region_id": 0, "geoip": "true", "new_external_ips_count": "", "delete_external_ips": [], diff --git a/internal/output/utils.go b/internal/output/utils.go index fa4000f..7f41f10 100644 --- a/internal/output/utils.go +++ b/internal/output/utils.go @@ -50,7 +50,7 @@ func (f *Formatter) getOrderedFields(entity entities.EntityInterface) []entities if f.pageView { return entity.GetFields() } - fieldsToShow = entity.GetDefaultFields() + fieldsToShow = entity.GetCmdDefaultFields(f.cmdName) } availableFields := entity.GetFields() diff --git a/testdata/entities/cloud-instances/get.json b/testdata/entities/cloud-instances/get.json index f4b6c29..cfcb6c0 100644 --- a/testdata/entities/cloud-instances/get.json +++ b/testdata/entities/cloud-instances/get.json @@ -20,6 +20,7 @@ "labels": { "env": "test" }, + "vpn2gpn_instance": null, "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" } diff --git a/testdata/entities/cloud-instances/get.txt b/testdata/entities/cloud-instances/get.txt index 2433656..772bdcc 100644 --- a/testdata/entities/cloud-instances/get.txt +++ b/testdata/entities/cloud-instances/get.txt @@ -1,2 +1,2 @@ -ID Name RegionCode Status PublicIPv4Address -test-instance-id test-instance AMS1 active 1.2.3.4 +ID Name RegionCode Status PublicIPv4Address Created Updated +test-instance-id test-instance AMS1 active 1.2.3.4 2025-01-01T12:00:00Z 2025-01-01T12:00:00Z diff --git a/testdata/entities/cloud-instances/get.yaml b/testdata/entities/cloud-instances/get.yaml index b9db1a2..df9505a 100644 --- a/testdata/entities/cloud-instances/get.yaml +++ b/testdata/entities/cloud-instances/get.yaml @@ -18,5 +18,6 @@ backupcopies: 2 publicportblocked: false labels: env: test +vpn2gpninstance: null created: 2025-01-01T12:00:00Z updated: 2025-01-01T12:00:00Z diff --git a/testdata/entities/cloud-instances/list.json b/testdata/entities/cloud-instances/list.json index 8c528e6..1604c05 100644 --- a/testdata/entities/cloud-instances/list.json +++ b/testdata/entities/cloud-instances/list.json @@ -21,6 +21,7 @@ "labels": { "env": "test" }, + "vpn2gpn_instance": null, "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" } diff --git a/testdata/entities/cloud-instances/list_all.json b/testdata/entities/cloud-instances/list_all.json index 9551a69..d0ddf1e 100644 --- a/testdata/entities/cloud-instances/list_all.json +++ b/testdata/entities/cloud-instances/list_all.json @@ -21,6 +21,7 @@ "labels": { "env": "test" }, + "vpn2gpn_instance": null, "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" }, @@ -46,6 +47,7 @@ "labels": { "env": "test" }, + "vpn2gpn_instance": null, "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" } diff --git a/testdata/entities/cloud-regions/list_flavors.json b/testdata/entities/cloud-regions/list_flavors.json index d86c005..6d9a46e 100644 --- a/testdata/entities/cloud-regions/list_flavors.json +++ b/testdata/entities/cloud-regions/list_flavors.json @@ -1,6 +1,9 @@ [ { "id": "flavor-123", - "name": "Test Flavor" + "name": "Test Flavor", + "disk": 0, + "ram": 0, + "vcpus": 0 } ] diff --git a/testdata/entities/cloud-regions/list_flavors_all.json b/testdata/entities/cloud-regions/list_flavors_all.json index f8cd084..ecc8632 100644 --- a/testdata/entities/cloud-regions/list_flavors_all.json +++ b/testdata/entities/cloud-regions/list_flavors_all.json @@ -1,10 +1,16 @@ [ { "id": "flavor-123", - "name": "Test Flavor" + "name": "Test Flavor", + "disk": 0, + "ram": 0, + "vcpus": 0 }, { "id": "flavor-456", - "name": "Test Flavor 2" + "name": "Test Flavor 2", + "disk": 0, + "ram": 0, + "vcpus": 0 } ] diff --git a/testdata/entities/cloud-regions/list_images.json b/testdata/entities/cloud-regions/list_images.json index 9228627..220fcdd 100644 --- a/testdata/entities/cloud-regions/list_images.json +++ b/testdata/entities/cloud-regions/list_images.json @@ -1,6 +1,9 @@ [ { "id": "img-123", - "name": "Test Image" + "name": "Test Image", + "allowed_flavors": null, + "image_size": 0, + "min_disk": 0 } ] diff --git a/testdata/entities/cloud-regions/list_images_all.json b/testdata/entities/cloud-regions/list_images_all.json index 9e5995f..783d34f 100644 --- a/testdata/entities/cloud-regions/list_images_all.json +++ b/testdata/entities/cloud-regions/list_images_all.json @@ -1,10 +1,16 @@ [ { "id": "img-123", - "name": "Test Image" + "name": "Test Image", + "allowed_flavors": null, + "image_size": 0, + "min_disk": 0 }, { "id": "img-456", - "name": "Test Image 2" + "name": "Test Image 2", + "allowed_flavors": null, + "image_size": 0, + "min_disk": 0 } ] diff --git a/testdata/entities/hosts/create_ebm_resp.json b/testdata/entities/hosts/create_ebm_resp.json index 3fc68a6..2d974cf 100644 --- a/testdata/entities/hosts/create_ebm_resp.json +++ b/testdata/entities/hosts/create_ebm_resp.json @@ -29,6 +29,8 @@ "operating_system_full_name": "CentOS 7 x86_64" }, "labels": null, + "ipxe_config": null, + "userdata_sha256": null, "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" } diff --git a/testdata/entities/hosts/get_ebm.json b/testdata/entities/hosts/get_ebm.json index d79f41f..3da118b 100644 --- a/testdata/entities/hosts/get_ebm.json +++ b/testdata/entities/hosts/get_ebm.json @@ -28,6 +28,8 @@ "operating_system_full_name": "CentOS 7 x86_64" }, "labels": null, + "ipxe_config": null, + "userdata_sha256": null, "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" } diff --git a/testdata/entities/hosts/get_ebm.yaml b/testdata/entities/hosts/get_ebm.yaml index c0b84cd..34a0ccd 100644 --- a/testdata/entities/hosts/get_ebm.yaml +++ b/testdata/entities/hosts/get_ebm.yaml @@ -26,5 +26,7 @@ configurationdetails: operatingsystemid: 5 operatingsystemfullname: CentOS 7 x86_64 labels: {} +ipxeconfig: null +userdatasha256: null created: 2025-01-01T12:00:00Z updated: 2025-01-01T12:00:00Z diff --git a/testdata/entities/hosts/get_ebm_network.json b/testdata/entities/hosts/get_ebm_network.json index 12661cc..6b7ab4f 100644 --- a/testdata/entities/hosts/get_ebm_network.json +++ b/testdata/entities/hosts/get_ebm_network.json @@ -8,6 +8,5 @@ "distribution_method": "gateway", "additional": false, "created_at": "2025-01-01T12:00:00Z", - "updated_at": "2025-01-01T12:00:00Z", - "state": "" + "updated_at": "2025-01-01T12:00:00Z" } diff --git a/testdata/entities/hosts/get_ebm_network.yaml b/testdata/entities/hosts/get_ebm_network.yaml index 130e2cc..1def980 100644 --- a/testdata/entities/hosts/get_ebm_network.yaml +++ b/testdata/entities/hosts/get_ebm_network.yaml @@ -6,6 +6,7 @@ family: ipv4 interfacetype: public distributionmethod: gateway additional: false +firstip: null +gateway: null created: 2025-01-01T12:00:00Z updated: 2025-01-01T12:00:00Z -state: "" diff --git a/testdata/entities/hosts/list_ebm.json b/testdata/entities/hosts/list_ebm.json index 3fc68a6..2d974cf 100644 --- a/testdata/entities/hosts/list_ebm.json +++ b/testdata/entities/hosts/list_ebm.json @@ -29,6 +29,8 @@ "operating_system_full_name": "CentOS 7 x86_64" }, "labels": null, + "ipxe_config": null, + "userdata_sha256": null, "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" } diff --git a/testdata/entities/hosts/list_ebm_all.json b/testdata/entities/hosts/list_ebm_all.json index d25ef74..abd722c 100644 --- a/testdata/entities/hosts/list_ebm_all.json +++ b/testdata/entities/hosts/list_ebm_all.json @@ -29,6 +29,8 @@ "operating_system_full_name": "CentOS 7 x86_64" }, "labels": null, + "ipxe_config": null, + "userdata_sha256": null, "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" }, @@ -62,6 +64,8 @@ "operating_system_full_name": "CentOS 7 x86_64" }, "labels": null, + "ipxe_config": null, + "userdata_sha256": null, "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" } diff --git a/testdata/entities/hosts/list_ebm_networks.json b/testdata/entities/hosts/list_ebm_networks.json index 669c5bf..e2b6a08 100644 --- a/testdata/entities/hosts/list_ebm_networks.json +++ b/testdata/entities/hosts/list_ebm_networks.json @@ -9,7 +9,6 @@ "distribution_method": "gateway", "additional": false, "created_at": "2025-01-01T12:00:00Z", - "updated_at": "2025-01-01T12:00:00Z", - "state": "" + "updated_at": "2025-01-01T12:00:00Z" } ] diff --git a/testdata/entities/hosts/list_ebm_networks_all.json b/testdata/entities/hosts/list_ebm_networks_all.json index a9aca37..1ffc14e 100644 --- a/testdata/entities/hosts/list_ebm_networks_all.json +++ b/testdata/entities/hosts/list_ebm_networks_all.json @@ -9,8 +9,7 @@ "distribution_method": "gateway", "additional": false, "created_at": "2025-01-01T12:00:00Z", - "updated_at": "2025-01-01T12:00:00Z", - "state": "" + "updated_at": "2025-01-01T12:00:00Z" }, { "id": "testNetId2", @@ -22,7 +21,6 @@ "distribution_method": "gateway", "additional": false, "created_at": "2025-01-01T12:00:00Z", - "updated_at": "2025-01-01T12:00:00Z", - "state": "" + "updated_at": "2025-01-01T12:00:00Z" } ] diff --git a/testdata/entities/hosts/list_hosts.json b/testdata/entities/hosts/list_hosts.json index f7004a0..900db5a 100644 --- a/testdata/entities/hosts/list_hosts.json +++ b/testdata/entities/hosts/list_hosts.json @@ -12,6 +12,10 @@ "private_ipv4_address": null, "public_ipv4_address": "1.2.3.4", "scheduled_release_at": null, + "lease_start_at": null, + "oob_ipv4_address": null, + "rack_id": null, + "labels": null, "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" }, @@ -28,6 +32,10 @@ "private_ipv4_address": null, "public_ipv4_address": "1.2.3.4", "scheduled_release_at": null, + "lease_start_at": null, + "oob_ipv4_address": null, + "rack_id": null, + "labels": null, "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" } diff --git a/testdata/entities/hosts/list_kbm_networks.json b/testdata/entities/hosts/list_kbm_networks.json index 669c5bf..e2b6a08 100644 --- a/testdata/entities/hosts/list_kbm_networks.json +++ b/testdata/entities/hosts/list_kbm_networks.json @@ -9,7 +9,6 @@ "distribution_method": "gateway", "additional": false, "created_at": "2025-01-01T12:00:00Z", - "updated_at": "2025-01-01T12:00:00Z", - "state": "" + "updated_at": "2025-01-01T12:00:00Z" } ] diff --git a/testdata/entities/hosts/list_kbm_networks_all.json b/testdata/entities/hosts/list_kbm_networks_all.json index a9aca37..1ffc14e 100644 --- a/testdata/entities/hosts/list_kbm_networks_all.json +++ b/testdata/entities/hosts/list_kbm_networks_all.json @@ -9,8 +9,7 @@ "distribution_method": "gateway", "additional": false, "created_at": "2025-01-01T12:00:00Z", - "updated_at": "2025-01-01T12:00:00Z", - "state": "" + "updated_at": "2025-01-01T12:00:00Z" }, { "id": "testNetId2", @@ -22,7 +21,6 @@ "distribution_method": "gateway", "additional": false, "created_at": "2025-01-01T12:00:00Z", - "updated_at": "2025-01-01T12:00:00Z", - "state": "" + "updated_at": "2025-01-01T12:00:00Z" } ] diff --git a/testdata/entities/hosts/release_ebm_resp.json b/testdata/entities/hosts/release_ebm_resp.json index d79f41f..3da118b 100644 --- a/testdata/entities/hosts/release_ebm_resp.json +++ b/testdata/entities/hosts/release_ebm_resp.json @@ -28,6 +28,8 @@ "operating_system_full_name": "CentOS 7 x86_64" }, "labels": null, + "ipxe_config": null, + "userdata_sha256": null, "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" } diff --git a/testdata/entities/hosts/release_ebm_scheduled_resp.json b/testdata/entities/hosts/release_ebm_scheduled_resp.json index 30d3238..fee760c 100644 --- a/testdata/entities/hosts/release_ebm_scheduled_resp.json +++ b/testdata/entities/hosts/release_ebm_scheduled_resp.json @@ -28,6 +28,8 @@ "operating_system_full_name": "CentOS 7 x86_64" }, "labels": null, + "ipxe_config": null, + "userdata_sha256": null, "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" } diff --git a/testdata/entities/hosts/update_ebm_resp.json b/testdata/entities/hosts/update_ebm_resp.json index 271d8c3..2ab7077 100644 --- a/testdata/entities/hosts/update_ebm_resp.json +++ b/testdata/entities/hosts/update_ebm_resp.json @@ -30,6 +30,8 @@ "labels": { "new": "label" }, + "ipxe_config": null, + "userdata_sha256": null, "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" } diff --git a/testdata/entities/k8s/get_node.json b/testdata/entities/k8s/get_node.json index 251cf71..d63e7ab 100644 --- a/testdata/entities/k8s/get_node.json +++ b/testdata/entities/k8s/get_node.json @@ -10,6 +10,16 @@ "public_ipv4_address": "127.0.0.1", "ref_id": "1", "cluster_id": "testId", + "location_id": 0, + "location_code": "", + "node_group": { + "id": "", + "name": "", + "description": null, + "node_count": 0, + "created_at": "0001-01-01T00:00:00Z", + "updated_at": "0001-01-01T00:00:00Z" + }, "labels": null, "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" diff --git a/testdata/entities/k8s/get_node.yaml b/testdata/entities/k8s/get_node.yaml index 410c3c8..28e2f87 100644 --- a/testdata/entities/k8s/get_node.yaml +++ b/testdata/entities/k8s/get_node.yaml @@ -9,6 +9,15 @@ privateipv4address: 10.0.0.1 publicipv4address: 127.0.0.1 refid: "1" clusterid: testId +locationid: 0 +locationcode: "" +nodegroup: + id: "" + name: "" + description: null + nodecount: 0 + created: 0001-01-01T00:00:00Z + updated: 0001-01-01T00:00:00Z labels: {} created: 2025-01-01T12:00:00Z updated: 2025-01-01T12:00:00Z diff --git a/testdata/entities/k8s/list_all_nodes.json b/testdata/entities/k8s/list_all_nodes.json index 3830021..ed70db5 100644 --- a/testdata/entities/k8s/list_all_nodes.json +++ b/testdata/entities/k8s/list_all_nodes.json @@ -11,6 +11,16 @@ "public_ipv4_address": "127.0.0.1", "ref_id": "1", "cluster_id": "testId", + "location_id": 0, + "location_code": "", + "node_group": { + "id": "", + "name": "", + "description": null, + "node_count": 0, + "created_at": "0001-01-01T00:00:00Z", + "updated_at": "0001-01-01T00:00:00Z" + }, "labels": null, "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" @@ -27,6 +37,16 @@ "public_ipv4_address": "127.0.0.1", "ref_id": "1", "cluster_id": "testId", + "location_id": 0, + "location_code": "", + "node_group": { + "id": "", + "name": "", + "description": null, + "node_count": 0, + "created_at": "0001-01-01T00:00:00Z", + "updated_at": "0001-01-01T00:00:00Z" + }, "labels": null, "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" diff --git a/testdata/entities/k8s/list_nodes.json b/testdata/entities/k8s/list_nodes.json index 31ab3dd..bde440f 100644 --- a/testdata/entities/k8s/list_nodes.json +++ b/testdata/entities/k8s/list_nodes.json @@ -11,6 +11,16 @@ "public_ipv4_address": "127.0.0.1", "ref_id": "1", "cluster_id": "testId", + "location_id": 0, + "location_code": "", + "node_group": { + "id": "", + "name": "", + "description": null, + "node_count": 0, + "created_at": "0001-01-01T00:00:00Z", + "updated_at": "0001-01-01T00:00:00Z" + }, "labels": null, "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" diff --git a/testdata/entities/l2-segments/list_networks.json b/testdata/entities/l2-segments/list_networks.json index 4534467..c33b704 100644 --- a/testdata/entities/l2-segments/list_networks.json +++ b/testdata/entities/l2-segments/list_networks.json @@ -9,7 +9,6 @@ "distribution_method": "route", "additional": true, "created_at": "2025-01-01T12:00:00Z", - "updated_at": "2025-01-01T12:00:00Z", - "state": "" + "updated_at": "2025-01-01T12:00:00Z" } ] diff --git a/testdata/entities/l2-segments/list_networks_all.json b/testdata/entities/l2-segments/list_networks_all.json index c1251c7..8295f5f 100644 --- a/testdata/entities/l2-segments/list_networks_all.json +++ b/testdata/entities/l2-segments/list_networks_all.json @@ -9,8 +9,7 @@ "distribution_method": "route", "additional": true, "created_at": "2025-01-01T12:00:00Z", - "updated_at": "2025-01-01T12:00:00Z", - "state": "" + "updated_at": "2025-01-01T12:00:00Z" }, { "id": "testId2", @@ -22,7 +21,6 @@ "distribution_method": "route", "additional": true, "created_at": "2025-01-01T12:00:00Z", - "updated_at": "2025-01-01T12:00:00Z", - "state": "" + "updated_at": "2025-01-01T12:00:00Z" } ] diff --git a/testdata/entities/lb-clusters/get.json b/testdata/entities/lb-clusters/get.json index e2cf999..f5f85a9 100644 --- a/testdata/entities/lb-clusters/get.json +++ b/testdata/entities/lb-clusters/get.json @@ -3,7 +3,6 @@ "name": "test-lb-cluster", "location_id": 1, "location_code": "test", - "status": "active", "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" } diff --git a/testdata/entities/lb-clusters/get.txt b/testdata/entities/lb-clusters/get.txt index 0207050..ccf1995 100644 --- a/testdata/entities/lb-clusters/get.txt +++ b/testdata/entities/lb-clusters/get.txt @@ -1,2 +1,2 @@ -ID Name Status LocationID LocationCode Created Updated -testId test-lb-cluster active 1 test 2025-01-01T12:00:00Z 2025-01-01T12:00:00Z +ID Name LocationID LocationCode Created Updated +testId test-lb-cluster 1 test 2025-01-01T12:00:00Z 2025-01-01T12:00:00Z diff --git a/testdata/entities/lb-clusters/get.yaml b/testdata/entities/lb-clusters/get.yaml index c9221d2..116554f 100644 --- a/testdata/entities/lb-clusters/get.yaml +++ b/testdata/entities/lb-clusters/get.yaml @@ -2,6 +2,5 @@ id: testId name: test-lb-cluster locationid: 1 locationcode: test -status: active created: 2025-01-01T12:00:00Z updated: 2025-01-01T12:00:00Z diff --git a/testdata/entities/lb-clusters/list.json b/testdata/entities/lb-clusters/list.json index c1d78a0..ed24a27 100644 --- a/testdata/entities/lb-clusters/list.json +++ b/testdata/entities/lb-clusters/list.json @@ -4,7 +4,6 @@ "name": "test-lb-cluster-1", "location_id": 1, "location_code": "test", - "status": "active", "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" } diff --git a/testdata/entities/lb-clusters/list_all.json b/testdata/entities/lb-clusters/list_all.json index fe1580e..a3d04fa 100644 --- a/testdata/entities/lb-clusters/list_all.json +++ b/testdata/entities/lb-clusters/list_all.json @@ -4,7 +4,6 @@ "name": "test-lb-cluster-1", "location_id": 1, "location_code": "test", - "status": "active", "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" }, @@ -13,7 +12,6 @@ "name": "test-lb-cluster-2", "location_id": 1, "location_code": "test", - "status": "active", "created_at": "2025-01-01T12:00:00Z", "updated_at": "2025-01-01T12:00:00Z" } diff --git a/testdata/entities/lb-clusters/list_pageview.txt b/testdata/entities/lb-clusters/list_pageview.txt index ec15f54..9f50d6c 100644 --- a/testdata/entities/lb-clusters/list_pageview.txt +++ b/testdata/entities/lb-clusters/list_pageview.txt @@ -1,6 +1,5 @@ ID: testId1 Name: test-lb-cluster-1 -Status: active LocationID: 1 LocationCode: test Created: 2025-01-01T12:00:00Z @@ -8,7 +7,6 @@ Updated: 2025-01-01T12:00:00Z --- ID: testId2 Name: test-lb-cluster-2 -Status: active LocationID: 1 LocationCode: test Created: 2025-01-01T12:00:00Z diff --git a/testdata/entities/lb/get_l4.json b/testdata/entities/lb/get_l4.json index e8bd4dd..2a7b9a1 100644 --- a/testdata/entities/lb/get_l4.json +++ b/testdata/entities/lb/get_l4.json @@ -9,7 +9,11 @@ "location_id": 1, "location_code": "test", "store_logs": false, + "store_logs_region_id": 0, "cluster_id": null, + "shared_cluster": false, + "vhost_zones": null, + "upstream_zones": null, "labels": { "foo": "bar" }, diff --git a/testdata/entities/lb/get_l4.yaml b/testdata/entities/lb/get_l4.yaml index be7b421..77d65df 100644 --- a/testdata/entities/lb/get_l4.yaml +++ b/testdata/entities/lb/get_l4.yaml @@ -7,7 +7,11 @@ externaladdresses: locationid: 1 locationcode: test storelogs: false +storelogsregionid: 0 clusterid: null +sharedcluster: false +vhostzones: [] +upstreamzones: [] labels: foo: bar created: 2025-01-01T12:00:00Z diff --git a/testdata/entities/lb/get_l7.json b/testdata/entities/lb/get_l7.json index 8774921..17a662c 100644 --- a/testdata/entities/lb/get_l7.json +++ b/testdata/entities/lb/get_l7.json @@ -15,6 +15,9 @@ "store_logs": false, "store_logs_region_id": 0, "cluster_id": null, + "shared_cluster": false, + "vhost_zones": null, + "upstream_zones": null, "labels": { "foo": "bar" }, diff --git a/testdata/entities/lb/get_l7.yaml b/testdata/entities/lb/get_l7.yaml index 5cbf62b..67cf5c8 100644 --- a/testdata/entities/lb/get_l7.yaml +++ b/testdata/entities/lb/get_l7.yaml @@ -12,6 +12,9 @@ geoip: false storelogs: false storelogsregionid: 0 clusterid: null +sharedcluster: false +vhostzones: [] +upstreamzones: [] labels: foo: bar created: 2025-01-01T12:00:00Z diff --git a/testdata/entities/lb/list_all.json b/testdata/entities/lb/list_all.json index 89e9356..93a6ea8 100644 --- a/testdata/entities/lb/list_all.json +++ b/testdata/entities/lb/list_all.json @@ -10,6 +10,7 @@ "location_id": 1, "location_code": "test", "cluster_id": null, + "shared_cluster": false, "labels": { "foo": "bar" }, @@ -27,6 +28,7 @@ "location_id": 1, "location_code": "test", "cluster_id": null, + "shared_cluster": false, "labels": { "foo": "bar" }, diff --git a/testdata/entities/lb/list_l4.json b/testdata/entities/lb/list_l4.json index 18b1906..d8c763d 100644 --- a/testdata/entities/lb/list_l4.json +++ b/testdata/entities/lb/list_l4.json @@ -10,6 +10,7 @@ "location_id": 1, "location_code": "test", "cluster_id": null, + "shared_cluster": false, "labels": { "foo": "bar" }, diff --git a/testdata/entities/lb/list_l7.json b/testdata/entities/lb/list_l7.json index 2e7782e..f225044 100644 --- a/testdata/entities/lb/list_l7.json +++ b/testdata/entities/lb/list_l7.json @@ -10,6 +10,7 @@ "location_id": 1, "location_code": "test", "cluster_id": null, + "shared_cluster": false, "labels": { "foo": "bar" }, diff --git a/testdata/entities/lb/update_l4.json b/testdata/entities/lb/update_l4.json index 04e8ee2..c3ff2cf 100644 --- a/testdata/entities/lb/update_l4.json +++ b/testdata/entities/lb/update_l4.json @@ -9,7 +9,11 @@ "location_id": 1, "location_code": "test", "store_logs": false, + "store_logs_region_id": 0, "cluster_id": null, + "shared_cluster": false, + "vhost_zones": null, + "upstream_zones": null, "labels": { "new": "label" }, diff --git a/testdata/entities/lb/update_l7.json b/testdata/entities/lb/update_l7.json index 4a46127..d09fdd5 100644 --- a/testdata/entities/lb/update_l7.json +++ b/testdata/entities/lb/update_l7.json @@ -15,6 +15,9 @@ "store_logs": false, "store_logs_region_id": 0, "cluster_id": null, + "shared_cluster": false, + "vhost_zones": null, + "upstream_zones": null, "labels": { "new": "label" },