Skip to content

Commit

Permalink
No hard-reboot operation in AWS (related to #191)
Browse files Browse the repository at this point in the history
  • Loading branch information
vania-pooh committed Jan 31, 2017
1 parent 238afaf commit 5af393c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ public interface Api {

boolean rebootInstance(String instanceId);

boolean hardRebootInstance(String instanceId);

boolean startInstance(String instanceId);

boolean shutdownInstance(String instanceId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,6 @@ public boolean rebootInstance(String instanceId) {
return isResponseSuccessful(client.rebootInstances(request));
}

@Override
public boolean hardRebootInstance(String instanceId) {
//TODO: to be implemented!!!
throw new UnsupportedOperationException();
}

@Override
public boolean startInstance(String instanceId) {
StartInstancesRequest request = new StartInstancesRequest(Collections.singletonList(instanceId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import java.util.function.BiFunction;

import static org.meridor.perspective.config.OperationType.HARD_REBOOT_INSTANCE;
import static org.meridor.perspective.config.OperationType.REBOOT_INSTANCE;

@Component
Expand Down Expand Up @@ -34,6 +35,7 @@ protected String getErrorMessage(Instance instance) {

@Override
public OperationType[] getTypes() {
return new OperationType[]{REBOOT_INSTANCE};
//AWS tries to reboot instance then in 4 minutes hard-reboots automatically
return new OperationType[]{REBOOT_INSTANCE, HARD_REBOOT_INSTANCE};
}
}

0 comments on commit 5af393c

Please sign in to comment.