Skip to content

Instantly share code, notes, and snippets.

@yaronp68
Created March 15, 2012 09:03
Show Gist options
  • Select an option

  • Save yaronp68/2043076 to your computer and use it in GitHub Desktop.

Select an option

Save yaronp68/2043076 to your computer and use it in GitHub Desktop.
@Override
public boolean stopMachine(final String ip, final long duration, final TimeUnit unit)
throws InterruptedException, TimeoutException, CloudProvisioningException {
final long endTime = calcEndTimeInMillis(
duration, unit);
if (isStopRequestRecent(ip)) {
return false;
}
final String token = createAuthenticationToken();
try {
terminateServerByIp(
ip, token, endTime);
return true;
} catch (final Exception e) {
throw new CloudProvisioningException(e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment