jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From najtmar <notificati...@github.com>
Subject Re: [jclouds-examples] Adding an example to run a simple program on a GCE VM. (#56)
Date Fri, 01 Aug 2014 09:11:09 GMT
> +
> +      // 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
Mime
View raw message