@@ -15,31 +15,31 @@ type ActionRequest map[string]interface{}
15
15
// See: https://developers.digitalocean.com/documentation/v2#droplet-actions
16
16
type DropletActionsService interface {
17
17
Shutdown (context.Context , int ) (* Action , * Response , error )
18
- ShutdownByTag (context.Context , string ) (* Action , * Response , error )
18
+ ShutdownByTag (context.Context , string ) ([] Action , * Response , error )
19
19
PowerOff (context.Context , int ) (* Action , * Response , error )
20
- PowerOffByTag (context.Context , string ) (* Action , * Response , error )
20
+ PowerOffByTag (context.Context , string ) ([] Action , * Response , error )
21
21
PowerOn (context.Context , int ) (* Action , * Response , error )
22
- PowerOnByTag (context.Context , string ) (* Action , * Response , error )
22
+ PowerOnByTag (context.Context , string ) ([] Action , * Response , error )
23
23
PowerCycle (context.Context , int ) (* Action , * Response , error )
24
- PowerCycleByTag (context.Context , string ) (* Action , * Response , error )
24
+ PowerCycleByTag (context.Context , string ) ([] Action , * Response , error )
25
25
Reboot (context.Context , int ) (* Action , * Response , error )
26
26
Restore (context.Context , int , int ) (* Action , * Response , error )
27
27
Resize (context.Context , int , string , bool ) (* Action , * Response , error )
28
28
Rename (context.Context , int , string ) (* Action , * Response , error )
29
29
Snapshot (context.Context , int , string ) (* Action , * Response , error )
30
- SnapshotByTag (context.Context , string , string ) (* Action , * Response , error )
30
+ SnapshotByTag (context.Context , string , string ) ([] Action , * Response , error )
31
31
EnableBackups (context.Context , int ) (* Action , * Response , error )
32
- EnableBackupsByTag (context.Context , string ) (* Action , * Response , error )
32
+ EnableBackupsByTag (context.Context , string ) ([] Action , * Response , error )
33
33
DisableBackups (context.Context , int ) (* Action , * Response , error )
34
- DisableBackupsByTag (context.Context , string ) (* Action , * Response , error )
34
+ DisableBackupsByTag (context.Context , string ) ([] Action , * Response , error )
35
35
PasswordReset (context.Context , int ) (* Action , * Response , error )
36
36
RebuildByImageID (context.Context , int , int ) (* Action , * Response , error )
37
37
RebuildByImageSlug (context.Context , int , string ) (* Action , * Response , error )
38
38
ChangeKernel (context.Context , int , int ) (* Action , * Response , error )
39
39
EnableIPv6 (context.Context , int ) (* Action , * Response , error )
40
- EnableIPv6ByTag (context.Context , string ) (* Action , * Response , error )
40
+ EnableIPv6ByTag (context.Context , string ) ([] Action , * Response , error )
41
41
EnablePrivateNetworking (context.Context , int ) (* Action , * Response , error )
42
- EnablePrivateNetworkingByTag (context.Context , string ) (* Action , * Response , error )
42
+ EnablePrivateNetworkingByTag (context.Context , string ) ([] Action , * Response , error )
43
43
Upgrade (context.Context , int ) (* Action , * Response , error )
44
44
Get (context.Context , int , int ) (* Action , * Response , error )
45
45
GetByURI (context.Context , string ) (* Action , * Response , error )
@@ -60,7 +60,7 @@ func (s *DropletActionsServiceOp) Shutdown(ctx context.Context, id int) (*Action
60
60
}
61
61
62
62
// ShutdownByTag shuts down Droplets matched by a Tag.
63
- func (s * DropletActionsServiceOp ) ShutdownByTag (ctx context.Context , tag string ) (* Action , * Response , error ) {
63
+ func (s * DropletActionsServiceOp ) ShutdownByTag (ctx context.Context , tag string ) ([] Action , * Response , error ) {
64
64
request := & ActionRequest {"type" : "shutdown" }
65
65
return s .doActionByTag (ctx , tag , request )
66
66
}
@@ -72,7 +72,7 @@ func (s *DropletActionsServiceOp) PowerOff(ctx context.Context, id int) (*Action
72
72
}
73
73
74
74
// PowerOffByTag powers off Droplets matched by a Tag.
75
- func (s * DropletActionsServiceOp ) PowerOffByTag (ctx context.Context , tag string ) (* Action , * Response , error ) {
75
+ func (s * DropletActionsServiceOp ) PowerOffByTag (ctx context.Context , tag string ) ([] Action , * Response , error ) {
76
76
request := & ActionRequest {"type" : "power_off" }
77
77
return s .doActionByTag (ctx , tag , request )
78
78
}
@@ -84,7 +84,7 @@ func (s *DropletActionsServiceOp) PowerOn(ctx context.Context, id int) (*Action,
84
84
}
85
85
86
86
// PowerOnByTag powers on Droplets matched by a Tag.
87
- func (s * DropletActionsServiceOp ) PowerOnByTag (ctx context.Context , tag string ) (* Action , * Response , error ) {
87
+ func (s * DropletActionsServiceOp ) PowerOnByTag (ctx context.Context , tag string ) ([] Action , * Response , error ) {
88
88
request := & ActionRequest {"type" : "power_on" }
89
89
return s .doActionByTag (ctx , tag , request )
90
90
}
@@ -96,7 +96,7 @@ func (s *DropletActionsServiceOp) PowerCycle(ctx context.Context, id int) (*Acti
96
96
}
97
97
98
98
// PowerCycleByTag power cycles Droplets matched by a Tag.
99
- func (s * DropletActionsServiceOp ) PowerCycleByTag (ctx context.Context , tag string ) (* Action , * Response , error ) {
99
+ func (s * DropletActionsServiceOp ) PowerCycleByTag (ctx context.Context , tag string ) ([] Action , * Response , error ) {
100
100
request := & ActionRequest {"type" : "power_cycle" }
101
101
return s .doActionByTag (ctx , tag , request )
102
102
}
@@ -149,7 +149,7 @@ func (s *DropletActionsServiceOp) Snapshot(ctx context.Context, id int, name str
149
149
}
150
150
151
151
// SnapshotByTag snapshots Droplets matched by a Tag.
152
- func (s * DropletActionsServiceOp ) SnapshotByTag (ctx context.Context , tag string , name string ) (* Action , * Response , error ) {
152
+ func (s * DropletActionsServiceOp ) SnapshotByTag (ctx context.Context , tag string , name string ) ([] Action , * Response , error ) {
153
153
requestType := "snapshot"
154
154
request := & ActionRequest {
155
155
"type" : requestType ,
@@ -165,7 +165,7 @@ func (s *DropletActionsServiceOp) EnableBackups(ctx context.Context, id int) (*A
165
165
}
166
166
167
167
// EnableBackupsByTag enables backups for Droplets matched by a Tag.
168
- func (s * DropletActionsServiceOp ) EnableBackupsByTag (ctx context.Context , tag string ) (* Action , * Response , error ) {
168
+ func (s * DropletActionsServiceOp ) EnableBackupsByTag (ctx context.Context , tag string ) ([] Action , * Response , error ) {
169
169
request := & ActionRequest {"type" : "enable_backups" }
170
170
return s .doActionByTag (ctx , tag , request )
171
171
}
@@ -177,7 +177,7 @@ func (s *DropletActionsServiceOp) DisableBackups(ctx context.Context, id int) (*
177
177
}
178
178
179
179
// DisableBackupsByTag disables backups for Droplet matched by a Tag.
180
- func (s * DropletActionsServiceOp ) DisableBackupsByTag (ctx context.Context , tag string ) (* Action , * Response , error ) {
180
+ func (s * DropletActionsServiceOp ) DisableBackupsByTag (ctx context.Context , tag string ) ([] Action , * Response , error ) {
181
181
request := & ActionRequest {"type" : "disable_backups" }
182
182
return s .doActionByTag (ctx , tag , request )
183
183
}
@@ -213,7 +213,7 @@ func (s *DropletActionsServiceOp) EnableIPv6(ctx context.Context, id int) (*Acti
213
213
}
214
214
215
215
// EnableIPv6ByTag enables IPv6 for Droplets matched by a Tag.
216
- func (s * DropletActionsServiceOp ) EnableIPv6ByTag (ctx context.Context , tag string ) (* Action , * Response , error ) {
216
+ func (s * DropletActionsServiceOp ) EnableIPv6ByTag (ctx context.Context , tag string ) ([] Action , * Response , error ) {
217
217
request := & ActionRequest {"type" : "enable_ipv6" }
218
218
return s .doActionByTag (ctx , tag , request )
219
219
}
@@ -225,7 +225,7 @@ func (s *DropletActionsServiceOp) EnablePrivateNetworking(ctx context.Context, i
225
225
}
226
226
227
227
// EnablePrivateNetworkingByTag enables private networking for Droplets matched by a Tag.
228
- func (s * DropletActionsServiceOp ) EnablePrivateNetworkingByTag (ctx context.Context , tag string ) (* Action , * Response , error ) {
228
+ func (s * DropletActionsServiceOp ) EnablePrivateNetworkingByTag (ctx context.Context , tag string ) ([] Action , * Response , error ) {
229
229
request := & ActionRequest {"type" : "enable_private_networking" }
230
230
return s .doActionByTag (ctx , tag , request )
231
231
}
@@ -261,7 +261,7 @@ func (s *DropletActionsServiceOp) doAction(ctx context.Context, id int, request
261
261
return root .Event , resp , err
262
262
}
263
263
264
- func (s * DropletActionsServiceOp ) doActionByTag (ctx context.Context , tag string , request * ActionRequest ) (* Action , * Response , error ) {
264
+ func (s * DropletActionsServiceOp ) doActionByTag (ctx context.Context , tag string , request * ActionRequest ) ([] Action , * Response , error ) {
265
265
if tag == "" {
266
266
return nil , nil , NewArgError ("tag" , "cannot be empty" )
267
267
}
@@ -277,13 +277,13 @@ func (s *DropletActionsServiceOp) doActionByTag(ctx context.Context, tag string,
277
277
return nil , nil , err
278
278
}
279
279
280
- root := new (actionRoot )
280
+ root := new (actionsRoot )
281
281
resp , err := s .client .Do (ctx , req , root )
282
282
if err != nil {
283
283
return nil , resp , err
284
284
}
285
285
286
- return root .Event , resp , err
286
+ return root .Actions , resp , err
287
287
}
288
288
289
289
// Get an action for a particular Droplet by id.
0 commit comments