Skip to content

Commit 017c1e1

Browse files
author
jxiaobin
committed
1. set "POST" for server actions
2. RebootAction does not need return type
1 parent c33ced2 commit 017c1e1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

nova-client/src/main/java/org/openstack/nova/api/ServersResource.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public UpdateServer(String id, Server server) {
126126
public abstract class Action<T> extends OpenStackRequest<T> {
127127

128128
public Action(String id, Entity<?> entity, Class<T> returnType) {
129-
super(CLIENT, HttpMethod.GET, new StringBuilder("/servers/").append(id).append("/action").toString(), entity, returnType);
129+
super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(id).append("/action").toString(), entity, returnType);
130130
}
131131

132132
}
@@ -141,12 +141,12 @@ public ChangePasswordAction(String id, ChangePassword action) {
141141

142142
}
143143

144-
public class RebootAction extends Action<Server> {
144+
public class RebootAction extends Action<Void> {
145145

146146
private Reboot action;
147147

148148
public RebootAction(String id, Reboot action) {
149-
super(id, Entity.json(action), Server.class);
149+
super(id, Entity.json(action), Void.class);
150150
}
151151

152152
}
@@ -290,7 +290,7 @@ public static GetConsoleOutputServer getConsoleOutput(String id, int length) {
290290
return new GetConsoleOutputServer(id, action);
291291
}
292292

293-
public class PauseServer extends OpenStackRequest {
293+
public class PauseServer extends OpenStackRequest {
294294

295295
private Pause action;
296296

@@ -441,7 +441,7 @@ public CreateBackupServer createBackup(String serverId, CreateBackup action) {
441441
return new CreateBackupServer(serverId, action);
442442
}
443443

444-
public class RescueServer extends OpenStackRequest {
444+
public class RescueServer extends OpenStackRequest {
445445

446446
private Rescue action;
447447

0 commit comments

Comments
 (0)