Skip to content

Commit

Permalink
refactor: dataplatform to bundle (#490)
Browse files Browse the repository at this point in the history
* refactor: rename imports

* refactor: replace import

* refactor: remove pointers

* refactor: create cluster dont use allocate

* doc: update docs

* fix: conflicts
  • Loading branch information
avirtopeanu-ionos authored Feb 3, 2025
1 parent ca6c200 commit e72cab2
Show file tree
Hide file tree
Showing 58 changed files with 3,057 additions and 3,797 deletions.
40 changes: 22 additions & 18 deletions commands/dataplatform/cluster/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"

"github.com/cilium/fake"
"github.com/cjrd/allocate"
"github.com/ionos-cloud/ionosctl/v6/commands/cloudapi-v6/completer"
"github.com/ionos-cloud/ionosctl/v6/commands/dataplatform/version"
"github.com/ionos-cloud/ionosctl/v6/internal/client"
Expand All @@ -14,13 +13,11 @@ import (
"github.com/ionos-cloud/ionosctl/v6/internal/printer/json2table/resource2table"
"github.com/ionos-cloud/ionosctl/v6/internal/printer/jsontabwriter"
"github.com/ionos-cloud/ionosctl/v6/internal/printer/tabheaders"
sdkdataplatform "github.com/ionos-cloud/sdk-go-dataplatform"
"github.com/ionos-cloud/sdk-go-bundle/products/dataplatform/v2"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)

var createProperties = sdkdataplatform.CreateClusterProperties{}

func ClusterCreateCmd() *core.Command {
cmd := core.NewCommand(context.TODO(), nil, core.CommandBuilder{
Namespace: "dataplatform",
Expand Down Expand Up @@ -48,25 +45,32 @@ func ClusterCreateCmd() *core.Command {
CmdRun: func(c *core.CommandConfig) error {
fmt.Fprintf(c.Command.Command.ErrOrStderr(), jsontabwriter.GenerateVerboseOutput("Creating Cluster..."))

input := dataplatform.CreateClusterProperties{}

if fn := core.GetFlagName(c.NS, constants.FlagName); viper.IsSet(fn) {
input.Name = viper.GetString(fn)
}

if fn := core.GetFlagName(c.NS, constants.FlagDatacenterId); viper.IsSet(fn) {
input.DatacenterId = viper.GetString(fn)
}

day := viper.GetString(core.GetFlagName(c.NS, constants.FlagMaintenanceDay))
time := viper.GetString(core.GetFlagName(c.NS, constants.FlagMaintenanceTime))

maintenanceWindow := sdkdataplatform.MaintenanceWindow{}

maintenanceWindow := dataplatform.MaintenanceWindow{}
maintenanceWindow.SetDayOfTheWeek(day)
maintenanceWindow.SetTime(time)
createProperties.SetMaintenanceWindow(maintenanceWindow)
input.SetMaintenanceWindow(maintenanceWindow)

v := viper.GetString(core.GetFlagName(c.NS, constants.FlagVersion))
if v == "latest" {
v = version.Latest(version.Versions())
}
createProperties.SetDataPlatformVersion(v)

input := sdkdataplatform.CreateClusterRequest{}
input.SetProperties(createProperties)
input.SetDataPlatformVersion(v)

cr, _, err := client.Must().DataplatformClient.DataPlatformClusterApi.ClustersPost(context.Background()).CreateClusterRequest(input).Execute()
cr, _, err := client.Must().DataplatformClient.DataPlatformClusterApi.ClustersPost(context.Background()).
CreateClusterRequest(dataplatform.CreateClusterRequest{input}).Execute()
if err != nil {
return err
}
Expand All @@ -90,24 +94,24 @@ func ClusterCreateCmd() *core.Command {
InitClient: true,
})

// Linked to properties struct
_ = allocate.Zero(&createProperties)
cmd.AddStringVarFlag(createProperties.Name, constants.FlagName, constants.FlagNameShort, "", "The name of your cluster")
cmd.AddStringFlag(constants.FlagName, constants.FlagNameShort, "", "The name of your cluster", core.RequiredFlagOption())
_ = cmd.Command.RegisterFlagCompletionFunc(constants.FlagName, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return fake.Names(10), cobra.ShellCompDirectiveNoFileComp
})
cmd.AddStringFlag(constants.FlagVersion, "", "latest", "The version of your dataplatform cluster")
cmd.AddStringVarFlag(createProperties.DatacenterId, constants.FlagDatacenterId, constants.FlagIdShort, "", "The ID of the connected datacenter")
cmd.AddStringFlag(constants.FlagDatacenterId, constants.FlagIdShort, "", "The ID of the connected datacenter", core.RequiredFlagOption())
_ = cmd.Command.RegisterFlagCompletionFunc(constants.FlagDatacenterId, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return completer.DataCentersIds(), cobra.ShellCompDirectiveNoFileComp
})

// Maintenance
cmd.AddStringFlag(constants.FlagMaintenanceTime, "", "", "Time for the MaintenanceWindows. The MaintenanceWindow is a weekly 4 hour-long windows, during which maintenance might occur. e.g.: 16:30:59", core.RequiredFlagOption())
cmd.AddStringFlag(constants.FlagMaintenanceTime, "", "",
"Time for the MaintenanceWindows. The MaintenanceWindow is a weekly 4 hour-long windows, during which maintenance might occur. e.g.: 16:30:59", core.RequiredFlagOption())
_ = cmd.Command.RegisterFlagCompletionFunc(constants.FlagMaintenanceTime, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return []string{"00:00:00", "08:00:00", "10:00:00", "12:00:00", "16:00:00"}, cobra.ShellCompDirectiveNoFileComp
})
cmd.AddStringFlag(constants.FlagMaintenanceDay, "", "", "Day Of the Week for the MaintenanceWindows. The MaintenanceWindow is a weekly 4 hour-long windows, during which maintenance might occur", core.RequiredFlagOption())
cmd.AddStringFlag(constants.FlagMaintenanceDay, "", "",
"Day Of the Week for the MaintenanceWindows. The MaintenanceWindow is a weekly 4 hour-long windows, during which maintenance might occur", core.RequiredFlagOption())
_ = cmd.Command.RegisterFlagCompletionFunc(constants.FlagMaintenanceDay, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return []string{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}, cobra.ShellCompDirectiveNoFileComp
})
Expand Down
10 changes: 5 additions & 5 deletions commands/dataplatform/cluster/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/ionos-cloud/ionosctl/v6/internal/printer/jsontabwriter"
"github.com/ionos-cloud/ionosctl/v6/pkg/confirm"
"github.com/ionos-cloud/ionosctl/v6/pkg/functional"
ionoscloud "github.com/ionos-cloud/sdk-go-dataplatform"
"github.com/ionos-cloud/sdk-go-bundle/products/dataplatform/v2"

"github.com/ionos-cloud/ionosctl/v6/commands/dataplatform/completer"
"github.com/ionos-cloud/ionosctl/v6/internal/core"
Expand Down Expand Up @@ -68,12 +68,12 @@ func deleteAll(c *core.CommandConfig) error {
return err
}

err = functional.ApplyAndAggregateErrors(*xs.GetItems(), func(x ionoscloud.ClusterResponseData) error {
yes := confirm.FAsk(c.Command.Command.InOrStdin(), fmt.Sprintf("delete cluster %s (%s)", *x.Id, *x.Properties.Name), viper.GetBool(constants.ArgForce))
err = functional.ApplyAndAggregateErrors(xs.GetItems(), func(x dataplatform.ClusterResponseData) error {
yes := confirm.FAsk(c.Command.Command.InOrStdin(), fmt.Sprintf("delete cluster %s (%s)", x.Id, *x.Properties.Name), viper.GetBool(constants.ArgForce))
if yes {
_, _, delErr := client.Must().DataplatformClient.DataPlatformClusterApi.ClustersDelete(c.Context, *x.Id).Execute()
_, _, delErr := client.Must().DataplatformClient.DataPlatformClusterApi.ClustersDelete(c.Context, x.Id).Execute()
if delErr != nil {
return fmt.Errorf("failed deleting %s: %w", *x.Id, delErr)
return fmt.Errorf("failed deleting %s: %w", x.Id, delErr)
}
}
return nil
Expand Down
11 changes: 7 additions & 4 deletions commands/dataplatform/cluster/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

"github.com/ionos-cloud/ionosctl/v6/commands/dataplatform/completer"
"github.com/ionos-cloud/ionosctl/v6/internal/core"
sdkdataplatform "github.com/ionos-cloud/sdk-go-dataplatform"
"github.com/ionos-cloud/sdk-go-bundle/products/dataplatform/v2"
"github.com/spf13/cobra"
)

Expand All @@ -38,7 +38,7 @@ func ClusterUpdateCmd() *core.Command {

fmt.Fprintf(c.Command.Command.ErrOrStderr(), jsontabwriter.GenerateVerboseOutput("Getting Cluster by id: %s", clusterId))

updateProperties := sdkdataplatform.PatchClusterProperties{}
updateProperties := dataplatform.PatchClusterProperties{}
if viper.IsSet(core.GetFlagName(c.NS, constants.FlagName)) {
updateProperties.SetName(viper.GetString(core.GetFlagName(c.NS, constants.FlagName)))
}
Expand All @@ -49,13 +49,16 @@ func ClusterUpdateCmd() *core.Command {

if viper.IsSet(core.GetFlagName(c.NS, constants.FlagMaintenanceDay)) &&
viper.IsSet(core.GetFlagName(c.NS, constants.FlagMaintenanceTime)) {
maintenanceWindow := sdkdataplatform.MaintenanceWindow{}
maintenanceWindow := dataplatform.MaintenanceWindow{}
maintenanceWindow.SetTime(viper.GetString(core.GetFlagName(c.NS, constants.FlagMaintenanceTime)))
maintenanceWindow.SetDayOfTheWeek(viper.GetString(core.GetFlagName(c.NS, constants.FlagMaintenanceDay)))
updateProperties.SetMaintenanceWindow(maintenanceWindow)
}

cluster, _, err := client.Must().DataplatformClient.DataPlatformClusterApi.ClustersPatch(c.Context, clusterId).PatchClusterRequest(sdkdataplatform.PatchClusterRequest{Properties: &updateProperties}).Execute()
cluster, _, err := client.Must().DataplatformClient.DataPlatformClusterApi.
ClustersPatch(c.Context, clusterId).PatchClusterRequest(
dataplatform.PatchClusterRequest{Properties: updateProperties},
).Execute()
if err != nil {
return err
}
Expand Down
10 changes: 5 additions & 5 deletions commands/dataplatform/completer/ids.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import (
"github.com/ionos-cloud/ionosctl/v6/internal/client"
"github.com/ionos-cloud/ionosctl/v6/pkg/functional"

sdkgo "github.com/ionos-cloud/sdk-go-dataplatform"
"github.com/ionos-cloud/sdk-go-bundle/products/dataplatform/v2"
)

func DataplatformClusterIds() []string {
ls, _, err := client.Must().DataplatformClient.DataPlatformClusterApi.ClustersGet(context.Background()).Execute()
if err != nil {
return nil
}
return functional.Map(*ls.GetItems(), func(t sdkgo.ClusterResponseData) string {
return *t.GetId()
return functional.Map(ls.GetItems(), func(t dataplatform.ClusterResponseData) string {
return t.GetId()
})
}

Expand All @@ -24,7 +24,7 @@ func DataplatformNodepoolsIds(clusterId string) []string {
if err != nil {
return nil
}
return functional.Map(*ls.GetItems(), func(t sdkgo.NodePoolResponseData) string {
return *t.GetId()
return functional.Map(ls.GetItems(), func(t dataplatform.NodePoolResponseData) string {
return t.GetId()
})
}
6 changes: 3 additions & 3 deletions commands/dataplatform/dataplatform_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/ionos-cloud/ionosctl/v6/internal/client"
"github.com/ionos-cloud/ionosctl/v6/internal/constants"
"github.com/ionos-cloud/ionosctl/v6/pkg/functional"
ionoscloud "github.com/ionos-cloud/sdk-go-dataplatform"
"github.com/ionos-cloud/sdk-go-bundle/products/dataplatform/v2"

"github.com/cilium/fake"
"github.com/ionos-cloud/ionosctl/v6/commands/dataplatform/cluster"
Expand Down Expand Up @@ -92,10 +92,10 @@ func testNodepoolOk(t *testing.T) {
ls, resp, err := client.Must().DataplatformClient.DataPlatformNodePoolApi.ClustersNodepoolsGet(context.Background(), createdClusterId).Execute()
assert.NoError(t, err)
assert.False(t, resp.HttpNotFound())
var foundNodepool ionoscloud.NodePoolResponseData
var foundNodepool dataplatform.NodePoolResponseData
// Filter by name, as API doesn't support this :(
assert.True(t,
functional.Fold(*ls.GetItems(), func(found bool, x ionoscloud.NodePoolResponseData) bool {
functional.Fold(ls.GetItems(), func(found bool, x dataplatform.NodePoolResponseData) bool {
if *x.Properties.Name == uniqueResourceName {
foundNodepool = x
return true
Expand Down
32 changes: 15 additions & 17 deletions commands/dataplatform/nodepool/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,12 @@ import (
"github.com/ionos-cloud/ionosctl/v6/internal/printer/json2table/resource2table"
"github.com/ionos-cloud/ionosctl/v6/internal/printer/jsontabwriter"
"github.com/ionos-cloud/ionosctl/v6/internal/printer/tabheaders"
sdkdataplatform "github.com/ionos-cloud/sdk-go-dataplatform"
"github.com/ionos-cloud/sdk-go-bundle/products/dataplatform/v2"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)

func NodepoolCreateCmd() *core.Command {
var (
// forward declaring required opts is fine, as we don't mind bad defaults
name string
nodeCount int32
createProperties = sdkdataplatform.CreateNodePoolProperties{}
)

cmd := core.NewCommand(context.TODO(), nil, core.CommandBuilder{
Namespace: "dataplatform",
Resource: "nodepool",
Expand Down Expand Up @@ -52,15 +45,21 @@ func NodepoolCreateCmd() *core.Command {
},
CmdRun: func(c *core.CommandConfig) error {
fmt.Fprintf(c.Command.Command.ErrOrStderr(), jsontabwriter.GenerateVerboseOutput("Creating Nodepool..."))

createProperties := dataplatform.CreateNodePoolProperties{}
clusterId := viper.GetString(core.GetFlagName(c.NS, constants.FlagClusterId))

createProperties.Name = &name
createProperties.NodeCount = &nodeCount
if f := core.GetFlagName(c.NS, constants.FlagName); viper.IsSet(f) {
createProperties.SetName(viper.GetString(f))
}
if f := core.GetFlagName(c.NS, constants.FlagNodeCount); viper.IsSet(f) {
createProperties.SetNodeCount(viper.GetInt32(f))
}

fd := core.GetFlagName(c.NS, constants.FlagMaintenanceDay)
ft := core.GetFlagName(c.NS, constants.FlagMaintenanceTime)
if viper.IsSet(fd) && viper.IsSet(ft) {
maintenanceWindow := sdkdataplatform.MaintenanceWindow{}
maintenanceWindow := dataplatform.MaintenanceWindow{}
maintenanceWindow.SetDayOfTheWeek(viper.GetString(fd))
maintenanceWindow.SetTime(viper.GetString(ft))
createProperties.SetMaintenanceWindow(maintenanceWindow)
Expand All @@ -84,13 +83,13 @@ func NodepoolCreateCmd() *core.Command {
createProperties.SetStorageSize(viper.GetInt32(f))
}
if f := core.GetFlagName(c.NS, constants.FlagStorageType); viper.IsSet(f) {
createProperties.SetStorageType(sdkdataplatform.StorageType(viper.GetString(f)))
createProperties.SetStorageType(dataplatform.StorageType(viper.GetString(f)))
}
if f := core.GetFlagName(c.NS, constants.FlagAvailabilityZone); viper.IsSet(f) {
createProperties.SetAvailabilityZone(sdkdataplatform.AvailabilityZone(f))
createProperties.SetAvailabilityZone(dataplatform.AvailabilityZone(f))
}

input := sdkdataplatform.CreateNodePoolRequest{}
input := dataplatform.CreateNodePoolRequest{}
input.SetProperties(createProperties)

cr, _, err := client.Must().DataplatformClient.DataPlatformNodePoolApi.ClustersNodepoolsPost(context.Background(), clusterId).CreateNodePoolRequest(input).Execute()
Expand Down Expand Up @@ -121,12 +120,11 @@ func NodepoolCreateCmd() *core.Command {
return completer.DataplatformClusterIds(), cobra.ShellCompDirectiveNoFileComp
})

// Linked to properties struct
cmd.AddStringVarFlag(&name, constants.FlagName, constants.FlagNameShort, "", "The name of your nodepool", core.RequiredFlagOption())
cmd.AddStringFlag(constants.FlagName, constants.FlagNameShort, "", "The name of your nodepool", core.RequiredFlagOption())
_ = cmd.Command.RegisterFlagCompletionFunc(constants.FlagName, func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return fake.Names(10), cobra.ShellCompDirectiveNoFileComp
})
cmd.AddInt32VarFlag(&nodeCount, constants.FlagNodeCount, "", 0, "The number of nodes that make up the node pool", core.RequiredFlagOption())
cmd.AddInt32Flag(constants.FlagNodeCount, "", 0, "The number of nodes that make up the node pool", core.RequiredFlagOption())
cmd.AddStringFlag(constants.FlagCpuFamily, "", "", "A valid CPU family name or AUTO if the platform shall choose the best fitting option. Available CPU architectures can be retrieved from the datacenter resource")
cmd.AddInt32Flag(constants.FlagCores, "", 0, "The number of CPU cores per node")
cmd.AddInt32Flag(constants.FlagRam, "", 0, "The RAM size for one node in MB. Must be set in multiples of 1024 MB, with a minimum size is of 2048 MB")
Expand Down
14 changes: 7 additions & 7 deletions commands/dataplatform/nodepool/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"github.com/ionos-cloud/ionosctl/v6/commands/dataplatform/completer"
"github.com/ionos-cloud/ionosctl/v6/internal/core"
ionoscloud "github.com/ionos-cloud/sdk-go-dataplatform"
"github.com/ionos-cloud/sdk-go-bundle/products/dataplatform/v2"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down Expand Up @@ -81,8 +81,8 @@ func deleteAll(c *core.CommandConfig, clusterId string) error {
}

// accumulate the error. If it's not nil break out of the fold
return functional.ApplyAndAggregateErrors(*ls.GetItems(), func(x ionoscloud.ClusterResponseData) error {
return deleteNodePools(c, *x.Id)
return functional.ApplyAndAggregateErrors(ls.GetItems(), func(x dataplatform.ClusterResponseData) error {
return deleteNodePools(c, x.Id)
})
}

Expand All @@ -91,12 +91,12 @@ func deleteNodePools(c *core.CommandConfig, clusterId string) error {
if err != nil {
return err
}
return functional.ApplyAndAggregateErrors(*xs.GetItems(), func(x ionoscloud.NodePoolResponseData) error {
ok := confirm.FAsk(c.Command.Command.InOrStdin(), fmt.Sprintf("delete nodepool %s (%s)", *x.Id, *x.Properties.Name), viper.GetBool(constants.ArgForce))
return functional.ApplyAndAggregateErrors(xs.GetItems(), func(x dataplatform.NodePoolResponseData) error {
ok := confirm.FAsk(c.Command.Command.InOrStdin(), fmt.Sprintf("delete nodepool %s (%s)", x.Id, *x.Properties.Name), viper.GetBool(constants.ArgForce))
if !ok {
return fmt.Errorf("canceled deletion for %s (%s): invalid input", *x.Id, *x.Properties.Name)
return fmt.Errorf("canceled deletion for %s (%s): invalid input", x.Id, *x.Properties.Name)
}
_, _, err := client.Must().DataplatformClient.DataPlatformNodePoolApi.ClustersNodepoolsDelete(context.Background(), clusterId, *x.Id).Execute()
_, _, err := client.Must().DataplatformClient.DataPlatformNodePoolApi.ClustersNodepoolsDelete(context.Background(), clusterId, x.Id).Execute()
return err
})
}
10 changes: 5 additions & 5 deletions commands/dataplatform/nodepool/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/ionos-cloud/ionosctl/v6/internal/printer/jsontabwriter"
"github.com/ionos-cloud/ionosctl/v6/internal/printer/tabheaders"
"github.com/ionos-cloud/ionosctl/v6/pkg/functional"
ionoscloud "github.com/ionos-cloud/sdk-go-dataplatform"
"github.com/ionos-cloud/sdk-go-bundle/products/dataplatform/v2"

"github.com/ionos-cloud/ionosctl/v6/commands/dataplatform/completer"
"github.com/ionos-cloud/ionosctl/v6/internal/core"
Expand Down Expand Up @@ -81,11 +81,11 @@ func listAll(c *core.CommandConfig) error {
if err != nil {
return err
}
clusterIds := functional.Map(*ls.GetItems(), func(t ionoscloud.ClusterResponseData) string {
return *t.GetId()
clusterIds := functional.Map(ls.GetItems(), func(t dataplatform.ClusterResponseData) string {
return t.GetId()
})

nps := make([]ionoscloud.NodePoolResponseData, 0)
nps := make([]dataplatform.NodePoolResponseData, 0)
npsConverted := make([]map[string]interface{}, 0)
for _, cID := range clusterIds {
np, _, err := client.Must().DataplatformClient.DataPlatformNodePoolApi.ClustersNodepoolsGet(c.Context, cID).Execute()
Expand All @@ -99,7 +99,7 @@ func listAll(c *core.CommandConfig) error {
}

npsConverted = append(npsConverted, temp...)
nps = append(nps, *np.GetItems()...)
nps = append(nps, np.GetItems()...)
}

cols, _ := c.Command.Command.Flags().GetStringSlice(constants.ArgCols)
Expand Down
8 changes: 4 additions & 4 deletions commands/dataplatform/nodepool/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import (
"github.com/ionos-cloud/ionosctl/v6/internal/printer/json2table/resource2table"
"github.com/ionos-cloud/ionosctl/v6/internal/printer/jsontabwriter"
"github.com/ionos-cloud/ionosctl/v6/internal/printer/tabheaders"
sdkdataplatform "github.com/ionos-cloud/sdk-go-dataplatform"
"github.com/ionos-cloud/sdk-go-bundle/products/dataplatform/v2"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)

func NodepoolUpdateCmd() *core.Command {
var (
updateProperties = sdkdataplatform.PatchNodePoolProperties{}
updateProperties = dataplatform.PatchNodePoolProperties{}
)

cmd := core.NewCommand(context.TODO(), nil, core.CommandBuilder{
Expand Down Expand Up @@ -51,7 +51,7 @@ func NodepoolUpdateCmd() *core.Command {
fd := core.GetFlagName(c.NS, constants.FlagMaintenanceDay)
ft := core.GetFlagName(c.NS, constants.FlagMaintenanceTime)
if viper.IsSet(fd) && viper.IsSet(ft) {
maintenanceWindow := sdkdataplatform.MaintenanceWindow{}
maintenanceWindow := dataplatform.MaintenanceWindow{}
maintenanceWindow.SetDayOfTheWeek(viper.GetString(fd))
maintenanceWindow.SetTime(viper.GetString(ft))
updateProperties.SetMaintenanceWindow(maintenanceWindow)
Expand All @@ -66,7 +66,7 @@ func NodepoolUpdateCmd() *core.Command {
updateProperties.SetLabels(viper.GetStringMap(f))
}

input := sdkdataplatform.PatchNodePoolRequest{}
input := dataplatform.PatchNodePoolRequest{}
input.SetProperties(updateProperties)

cr, _, err := client.Must().DataplatformClient.DataPlatformNodePoolApi.ClustersNodepoolsPatch(context.Background(), clusterId, npId).PatchNodePoolRequest(input).Execute()
Expand Down
Loading

0 comments on commit e72cab2

Please sign in to comment.