> +
> + // Set up credentials.
> + RunScriptOptions options = overrideLoginCredentials((new
> LoginCredentials.Builder())
> + .user(googleUserName)
> + .privateKey(sshPrivateKey)
> + .build())
> + .blockOnComplete(true)
> + .runAsRoot(false);
> +
> + ExecResponse response =
> computeService.runScriptOnNode(instance.getId(), script, options);
> +
> + if (response.getExitStatus() == 0) {
> + System.out.format("Exit Status:%n============%n%s%n%n",
> response.getExitStatus());
> + System.out.format("Output:%n======%n%s%n%n", response.getOutput());
> + } else {
> + System.out.format("Error:%n======%n%s%n%n", response.getOutput());
Done.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/56/files#r15687509