Last active
October 9, 2016 09:58
-
-
Save TomTasche/62a15a994251276d5aecd138db2719cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compute compute = ComputeOptions.defaultInstance().service(); | |
String instanceName = "bla"; | |
String projectId = "blu"; | |
String zone = "ble"; // e.g. europe-west1-d | |
InstanceId instanceId = InstanceId.of(projectId, zone, instanceName); | |
Instance instance = compute.getInstance(instanceId); | |
try { | |
Operation startOperation = instance.start(); | |
startOperation.waitFor(); | |
} catch (InterruptedException | TimeoutException e) { | |
LOGGER.log(Level.SEVERE, "could not start instance", e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment