@@ -70,7 +70,7 @@ func NewCmd(params *params.CmdParams) *cobra.Command {
7070 return err
7171 }
7272
73- instanceLabel , err := mongodbUtils .GetInstanceName (ctx , apiClient , model .ProjectId , model .InstanceId )
73+ instanceLabel , err := mongodbUtils .GetInstanceName (ctx , apiClient , model .ProjectId , model .InstanceId , model . Region )
7474 if err != nil {
7575 params .Printer .Debug (print .ErrorLevel , "get instance name: %v" , err )
7676 instanceLabel = model .ProjectId
@@ -102,7 +102,7 @@ func NewCmd(params *params.CmdParams) *cobra.Command {
102102 if ! model .Async {
103103 s := spinner .New (params .Printer )
104104 s .Start ("Restoring instance" )
105- _ , err = wait .RestoreInstanceWaitHandler (ctx , apiClient , model .ProjectId , model .InstanceId , model .BackupId ).WaitWithContext (ctx )
105+ _ , err = wait .RestoreInstanceWaitHandler (ctx , apiClient , model .ProjectId , model .InstanceId , model .BackupId , model . Region ).WaitWithContext (ctx )
106106 if err != nil {
107107 return fmt .Errorf ("wait for MongoDB Flex instance restoration: %w" , err )
108108 }
@@ -123,7 +123,7 @@ func NewCmd(params *params.CmdParams) *cobra.Command {
123123 if ! model .Async {
124124 s := spinner .New (params .Printer )
125125 s .Start ("Cloning instance" )
126- _ , err = wait .CloneInstanceWaitHandler (ctx , apiClient , model .ProjectId , model .InstanceId ).WaitWithContext (ctx )
126+ _ , err = wait .CloneInstanceWaitHandler (ctx , apiClient , model .ProjectId , model .InstanceId , model . Region ).WaitWithContext (ctx )
127127 if err != nil {
128128 return fmt .Errorf ("wait for MongoDB Flex instance cloning: %w" , err )
129129 }
@@ -184,7 +184,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command) (*inputModel, error) {
184184}
185185
186186func buildRestoreRequest (ctx context.Context , model * inputModel , apiClient * mongodbflex.APIClient ) mongodbflex.ApiRestoreInstanceRequest {
187- req := apiClient .RestoreInstance (ctx , model .ProjectId , model .InstanceId )
187+ req := apiClient .RestoreInstance (ctx , model .ProjectId , model .InstanceId , model . Region )
188188 req = req .RestoreInstancePayload (mongodbflex.RestoreInstancePayload {
189189 BackupId : & model .BackupId ,
190190 InstanceId : & model .BackupInstanceId ,
@@ -193,7 +193,7 @@ func buildRestoreRequest(ctx context.Context, model *inputModel, apiClient *mong
193193}
194194
195195func buildCloneRequest (ctx context.Context , model * inputModel , apiClient * mongodbflex.APIClient ) mongodbflex.ApiCloneInstanceRequest {
196- req := apiClient .CloneInstance (ctx , model .ProjectId , model .InstanceId )
196+ req := apiClient .CloneInstance (ctx , model .ProjectId , model .InstanceId , model . Region )
197197 req = req .CloneInstancePayload (mongodbflex.CloneInstancePayload {
198198 Timestamp : & model .Timestamp ,
199199 InstanceId : & model .BackupInstanceId ,
0 commit comments