@@ -17,8 +17,8 @@ import (
1717 "github.com/stackitcloud/stackit-cli/internal/pkg/spinner"
1818
1919 "github.com/spf13/cobra"
20- "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex"
21- "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex/wait"
20+ mongodbflex "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex/v2api "
21+ wait "github.com/stackitcloud/stackit-sdk-go/services/mongodbflex/v2api /wait"
2222)
2323
2424const (
@@ -71,7 +71,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
7171 return err
7272 }
7373
74- instanceLabel , err := mongodbUtils .GetInstanceName (ctx , apiClient , model .ProjectId , model .InstanceId , model .Region )
74+ instanceLabel , err := mongodbUtils .GetInstanceName (ctx , apiClient . DefaultAPI , model .ProjectId , model .InstanceId , model .Region )
7575 if err != nil {
7676 params .Printer .Debug (print .ErrorLevel , "get instance name: %v" , err )
7777 instanceLabel = model .ProjectId
@@ -100,7 +100,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
100100
101101 if ! model .Async {
102102 err := spinner .Run (params .Printer , "Restoring instance" , func () error {
103- _ , err = wait .RestoreInstanceWaitHandler (ctx , apiClient , model .ProjectId , model .InstanceId , model .BackupId , model .Region ).WaitWithContext (ctx )
103+ _ , err = wait .RestoreInstanceWaitHandler (ctx , apiClient . DefaultAPI , model .ProjectId , model .InstanceId , model .BackupId , model .Region ).WaitWithContext (ctx )
104104 return err
105105 })
106106 if err != nil {
@@ -125,7 +125,7 @@ func NewCmd(params *types.CmdParams) *cobra.Command {
125125
126126 if ! model .Async {
127127 err := spinner .Run (params .Printer , "Cloning instance" , func () error {
128- _ , err = wait .CloneInstanceWaitHandler (ctx , apiClient , model .ProjectId , model .InstanceId , model .Region ).WaitWithContext (ctx )
128+ _ , err = wait .CloneInstanceWaitHandler (ctx , apiClient . DefaultAPI , model .ProjectId , model .InstanceId , model .Region ).WaitWithContext (ctx )
129129 return err
130130 })
131131 if err != nil {
@@ -183,19 +183,19 @@ func parseInput(p *print.Printer, cmd *cobra.Command, _ []string) (*inputModel,
183183}
184184
185185func buildRestoreRequest (ctx context.Context , model * inputModel , apiClient * mongodbflex.APIClient ) mongodbflex.ApiRestoreInstanceRequest {
186- req := apiClient .RestoreInstance (ctx , model .ProjectId , model .InstanceId , model .Region )
186+ req := apiClient .DefaultAPI . RestoreInstance (ctx , model .ProjectId , model .InstanceId , model .Region )
187187 req = req .RestoreInstancePayload (mongodbflex.RestoreInstancePayload {
188- BackupId : & model .BackupId ,
189- InstanceId : & model .BackupInstanceId ,
188+ BackupId : model .BackupId ,
189+ InstanceId : model .BackupInstanceId ,
190190 })
191191 return req
192192}
193193
194194func buildCloneRequest (ctx context.Context , model * inputModel , apiClient * mongodbflex.APIClient ) mongodbflex.ApiCloneInstanceRequest {
195- req := apiClient .CloneInstance (ctx , model .ProjectId , model .InstanceId , model .Region )
195+ req := apiClient .DefaultAPI . CloneInstance (ctx , model .ProjectId , model .InstanceId , model .Region )
196196 req = req .CloneInstancePayload (mongodbflex.CloneInstancePayload {
197197 Timestamp : & model .Timestamp ,
198- InstanceId : & model .BackupInstanceId ,
198+ InstanceId : model .BackupInstanceId ,
199199 })
200200 return req
201201}
0 commit comments