1
1
/*
2
- Copyright 2016 The Doctl Authors All rights reserved.
2
+ Copyright 2018 The Doctl Authors All rights reserved.
3
3
Licensed under the Apache License, Version 2.0 (the "License");
4
4
you may not use this file except in compliance with the License.
5
5
You may obtain a copy of the License at
@@ -19,6 +19,7 @@ import (
19
19
"time"
20
20
21
21
"github.com/digitalocean/doctl"
22
+ "github.com/digitalocean/doctl/commands/displayers"
22
23
"github.com/digitalocean/doctl/do"
23
24
"github.com/spf13/cobra"
24
25
)
@@ -36,10 +37,10 @@ func Actions() *Command {
36
37
}
37
38
38
39
CmdBuilder (cmd , RunCmdActionGet , "get <action-id>" , "get action" , Writer ,
39
- aliasOpt ("g" ), displayerType (& action {}), docCategories ("action" ))
40
+ aliasOpt ("g" ), displayerType (& displayers. Action {}), docCategories ("action" ))
40
41
41
42
cmdActionList := CmdBuilder (cmd , RunCmdActionList , "list" , "list actions" , Writer ,
42
- aliasOpt ("ls" ), displayerType (& action {}), docCategories ("action" ))
43
+ aliasOpt ("ls" ), displayerType (& displayers. Action {}), docCategories ("action" ))
43
44
AddStringFlag (cmdActionList , doctl .ArgActionResourceType , "" , "" , "Action resource type" )
44
45
AddStringFlag (cmdActionList , doctl .ArgActionRegion , "" , "" , "Action region" )
45
46
AddStringFlag (cmdActionList , doctl .ArgActionAfter , "" , "" , "Action completed after in RFC3339 format" )
@@ -48,7 +49,7 @@ func Actions() *Command {
48
49
AddStringFlag (cmdActionList , doctl .ArgActionType , "" , "" , "Action type" )
49
50
50
51
cmdActionWait := CmdBuilder (cmd , RunCmdActionWait , "wait <action-id>" , "wait for action to complete" , Writer ,
51
- aliasOpt ("w" ), displayerType (& action {}), docCategories ("action" ))
52
+ aliasOpt ("w" ), displayerType (& displayers. Action {}), docCategories ("action" ))
52
53
AddIntFlag (cmdActionWait , doctl .ArgPollTime , "" , 5 , "Re-poll time in seconds" )
53
54
54
55
return cmd
@@ -68,7 +69,7 @@ func RunCmdActionList(c *CmdConfig) error {
68
69
69
70
sort .Sort (actionsByCompletedAt (actions ))
70
71
71
- item := & action { actions : actions }
72
+ item := & displayers. Action { Actions : actions }
72
73
return c .Display (item )
73
74
}
74
75
@@ -190,7 +191,7 @@ func RunCmdActionGet(c *CmdConfig) error {
190
191
return err
191
192
}
192
193
193
- return c .Display (& action { actions : do.Actions {* a }})
194
+ return c .Display (& displayers. Action { Actions : do.Actions {* a }})
194
195
}
195
196
196
197
// RunCmdActionWait waits for an action to complete or error.
@@ -214,7 +215,7 @@ func RunCmdActionWait(c *CmdConfig) error {
214
215
return err
215
216
}
216
217
217
- return c .Display (& action { actions : do.Actions {* a }})
218
+ return c .Display (& displayers. Action { Actions : do.Actions {* a }})
218
219
}
219
220
220
221
func actionWait (c * CmdConfig , actionID , pollTime int ) (* do.Action , error ) {
0 commit comments