File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed
serverless/backup/restores
mongocli/serverless/backup/restores Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import (
25
25
"github.com/mongodb/mongodb-atlas-cli/internal/store"
26
26
"github.com/mongodb/mongodb-atlas-cli/internal/usage"
27
27
"github.com/spf13/cobra"
28
+ atlasv2 "go.mongodb.org/atlas-sdk/v20230201002/admin"
28
29
)
29
30
30
31
type WatchOpts struct {
@@ -36,6 +37,7 @@ type WatchOpts struct {
36
37
}
37
38
38
39
var watchTemplate = "\n Restore completed.\n "
40
+ var result * atlasv2.DiskBackupSnapshotRestoreJob
39
41
40
42
func (opts * WatchOpts ) initStore (ctx context.Context ) func () error {
41
43
return func () error {
@@ -46,7 +48,8 @@ func (opts *WatchOpts) initStore(ctx context.Context) func() error {
46
48
}
47
49
48
50
func (opts * WatchOpts ) watcher () (bool , error ) {
49
- result , err := opts .store .RestoreJob (opts .ConfigProjectID (), opts .clusterName , opts .id )
51
+ var err error
52
+ result , err = opts .store .RestoreJob (opts .ConfigProjectID (), opts .clusterName , opts .id )
50
53
if err != nil {
51
54
return false , err
52
55
}
@@ -59,7 +62,7 @@ func (opts *WatchOpts) Run() error {
59
62
return err
60
63
}
61
64
62
- return opts .Print (nil )
65
+ return opts .Print (result )
63
66
}
64
67
65
68
// WatchBuilder atlas backup(s) restore(s) job(s) watch <restoreJobId>.
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import (
25
25
"github.com/mongodb/mongodb-atlas-cli/internal/store"
26
26
"github.com/mongodb/mongodb-atlas-cli/internal/usage"
27
27
"github.com/spf13/cobra"
28
+ atlasv2 "go.mongodb.org/atlas-sdk/v20230201002/admin"
28
29
)
29
30
30
31
type WatchOpts struct {
@@ -36,6 +37,7 @@ type WatchOpts struct {
36
37
}
37
38
38
39
var watchTemplate = "\n Restore completed.\n "
40
+ var result * atlasv2.ServerlessBackupRestoreJob
39
41
40
42
func (opts * WatchOpts ) initStore (ctx context.Context ) func () error {
41
43
return func () error {
@@ -46,7 +48,8 @@ func (opts *WatchOpts) initStore(ctx context.Context) func() error {
46
48
}
47
49
48
50
func (opts * WatchOpts ) watcher () (bool , error ) {
49
- result , err := opts .store .ServerlessRestoreJob (opts .ConfigProjectID (), opts .clusterName , opts .id )
51
+ var err error
52
+ result , err = opts .store .ServerlessRestoreJob (opts .ConfigProjectID (), opts .clusterName , opts .id )
50
53
if err != nil {
51
54
return false , err
52
55
}
@@ -58,7 +61,7 @@ func (opts *WatchOpts) Run() error {
58
61
return err
59
62
}
60
63
61
- return opts .Print (nil )
64
+ return opts .Print (result )
62
65
}
63
66
64
67
// WatchBuilder atlas serverless backup(s) restore(s) watch.
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import (
25
25
"github.com/mongodb/mongodb-atlas-cli/internal/store"
26
26
"github.com/mongodb/mongodb-atlas-cli/internal/usage"
27
27
"github.com/spf13/cobra"
28
+ atlasv2 "go.mongodb.org/atlas-sdk/v20230201002/admin"
28
29
)
29
30
30
31
type WatchOpts struct {
@@ -35,6 +36,8 @@ type WatchOpts struct {
35
36
store store.ServerlessRestoreJobsDescriber
36
37
}
37
38
39
+ var result * atlasv2.ServerlessBackupRestoreJob
40
+
38
41
func (opts * WatchOpts ) initStore (ctx context.Context ) func () error {
39
42
return func () error {
40
43
var err error
@@ -44,7 +47,8 @@ func (opts *WatchOpts) initStore(ctx context.Context) func() error {
44
47
}
45
48
46
49
func (opts * WatchOpts ) watcher () (bool , error ) {
47
- result , err := opts .store .ServerlessRestoreJob (opts .ConfigProjectID (), opts .clusterName , opts .id )
50
+ var err error
51
+ result , err = opts .store .ServerlessRestoreJob (opts .ConfigProjectID (), opts .clusterName , opts .id )
48
52
if err != nil {
49
53
return false , err
50
54
}
@@ -56,7 +60,7 @@ func (opts *WatchOpts) Run() error {
56
60
return err
57
61
}
58
62
59
- return opts .Print (nil )
63
+ return opts .Print (result )
60
64
}
61
65
62
66
// WatchBuilder atlas serverless backup(s) restore(s) watch.
You can’t perform that action at this time.
0 commit comments