@@ -11,7 +11,7 @@ import (
11
11
)
12
12
13
13
var groupAwsMigrationCmd = & cobra.Command {
14
- Use : "migration" ,
14
+ Use : "aws- migration" ,
15
15
Short : "Manage AWS migration of the group" ,
16
16
}
17
17
@@ -50,13 +50,13 @@ var groupAwsMigrationInfoCmd = &cobra.Command{
50
50
}
51
51
52
52
if info .Status == "pending" {
53
- fmt .Printf ("Migration is %v\n %v\n " , internal .Emph ("in progress" ), info .Comment )
53
+ fmt .Printf ("AWS migration is %v\n %v\n " , internal .Emph ("in progress" ), info .Comment )
54
54
} else if info .Status == "finished" {
55
- fmt .Printf ("Migration is %v\n " , internal .Emph ("finished" ))
55
+ fmt .Printf ("AWS migration is %v\n " , internal .Emph ("finished" ))
56
56
} else if info .Status == "aborted" {
57
- fmt .Printf ("Migration was %v\n " , internal .Emph ("aborted" ))
57
+ fmt .Printf ("AWS migration was %v\n " , internal .Emph ("aborted" ))
58
58
} else if info .Status == "none" {
59
- fmt .Printf ("Migration is %v\n " , internal .Emph ("not started" ))
59
+ fmt .Printf ("AWS migration is %v\n " , internal .Emph ("not started" ))
60
60
}
61
61
62
62
return nil
@@ -65,7 +65,7 @@ var groupAwsMigrationInfoCmd = &cobra.Command{
65
65
66
66
var groupAwsMigrationStartCmd = & cobra.Command {
67
67
Use : "start <group-name>" ,
68
- Short : "Start migration process of the group" ,
68
+ Short : "Start AWS migration process of the group" ,
69
69
Args : cobra .ExactArgs (1 ),
70
70
ValidArgsFunction : noFilesArg ,
71
71
RunE : func (cmd * cobra.Command , args []string ) error {
@@ -91,13 +91,13 @@ var groupAwsMigrationStartCmd = &cobra.Command{
91
91
}
92
92
93
93
if info .Status == "pending" {
94
- fmt .Printf ("Migration is %v\n %v\n " , internal .Emph ("in progress" ), info .Comment )
94
+ fmt .Printf ("AWS migration is %v\n %v\n " , internal .Emph ("in progress" ), info .Comment )
95
95
return nil
96
96
} else if info .Status == "finished" {
97
- fmt .Printf ("Migration is %v\n " , internal .Emph ("finished" ))
97
+ fmt .Printf ("AWS migration is %v\n " , internal .Emph ("finished" ))
98
98
return nil
99
99
} else if info .Status == "aborted" {
100
- fmt .Printf ("Migration was %v\n Please, contact with support@turso.tech for further assistance with group migration\n " , internal .Emph ("aborted" ))
100
+ fmt .Printf ("AWS migration was %v\n Please, contact with support@turso.tech for further assistance with group migration\n " , internal .Emph ("aborted" ))
101
101
return nil
102
102
}
103
103
@@ -113,22 +113,25 @@ var groupAwsMigrationStartCmd = &cobra.Command{
113
113
return nil
114
114
}
115
115
116
- spinner := prompt .Spinner (fmt .Sprintf ("Migration of group %v is in progress" , group ))
116
+ spinner := prompt .Spinner (fmt .Sprintf ("AWS migration of group %v is in progress" , group ))
117
117
defer spinner .Stop ()
118
118
119
119
err = client .Groups .StartAwsMigration (group )
120
120
if err != nil {
121
121
return err
122
122
}
123
123
124
- ctx , cancel := context .WithTimeout (cmd .Context (), 5 * time .Minute )
124
+ ctx , cancel := context .WithTimeout (cmd .Context (), 5 * time .Millisecond )
125
125
defer cancel ()
126
126
127
127
for {
128
128
select {
129
129
case <- ctx .Done ():
130
130
spinner .Stop ()
131
- fmt .Printf ("Group %v migration still on-going\n Check status few minutes later and contact support@turso.tech in case of any issues" , internal .Emph (group ))
131
+ fmt .Printf ("AWS migration for group %v still on-going.\n \n " +
132
+ "You can check status of the migration with: `turso group migration info <group-name>`.\n " +
133
+ "If migrations for certain databases haven't started, you can abort the group migration with: `turso group migration abort <group-name>`.\n \n " +
134
+ "Contact support@turso.tech in case of any issues\n " , internal .Emph (group ))
132
135
return nil
133
136
case <- time .NewTimer (5 * time .Second ).C :
134
137
info , err := client .Groups .GetAwsMigrationInfo (group )
@@ -149,7 +152,7 @@ var groupAwsMigrationStartCmd = &cobra.Command{
149
152
150
153
var groupAwsMigrationAbortCmd = & cobra.Command {
151
154
Use : "abort <group-name>" ,
152
- Short : "Abort migration process of the group" ,
155
+ Short : "Abort AWS migration process of the group" ,
153
156
Args : cobra .ExactArgs (1 ),
154
157
ValidArgsFunction : noFilesArg ,
155
158
RunE : func (cmd * cobra.Command , args []string ) error {
@@ -175,13 +178,13 @@ var groupAwsMigrationAbortCmd = &cobra.Command{
175
178
}
176
179
177
180
if info .Status == "none" {
178
- fmt .Printf ("Migration is %v" , internal .Emph ("not started" ))
181
+ fmt .Printf ("AWS migration is %v" , internal .Emph ("not started" ))
179
182
return nil
180
183
} else if info .Status == "aborted" {
181
- fmt .Printf ("Migration is already %v" , internal .Emph ("aborted" ))
184
+ fmt .Printf ("AWS migration was already %v" , internal .Emph ("aborted" ))
182
185
return nil
183
186
} else if info .Status == "finished" {
184
- fmt .Printf ("Migration is already %v" , internal .Emph ("finished" ))
187
+ fmt .Printf ("AWS migration was already %v" , internal .Emph ("finished" ))
185
188
return nil
186
189
}
187
190
@@ -195,7 +198,7 @@ var groupAwsMigrationAbortCmd = &cobra.Command{
195
198
return nil
196
199
}
197
200
198
- spinner := prompt .Spinner (fmt .Sprintf ("Migration of group %v aborted" , group ))
201
+ spinner := prompt .Spinner (fmt .Sprintf ("AWS migration of group %v aborted" , group ))
199
202
defer spinner .Stop ()
200
203
201
204
return client .Groups .AbortAwsMigration (group )
0 commit comments