Re: [jclouds-examples] support for GCE provider (#34)

2014-04-02 Thread suriyapriya
@demobox @nacx 
Thanks for the comments. I will fix it. Should i create a new PR or reopen this 
PR ?.


---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/34#issuecomment-39297101

Re: [jclouds-examples] support for GCE provider (#34)

2014-04-02 Thread Ignasi Barrera
Thanks! As I already merged this PR, I'd open a new one.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/34#issuecomment-39300260

Re: [jclouds-examples] support for GCE provider (#34)

2014-03-21 Thread Andrew Phillips
  To destroy all nodes of the group *mygroup*:
  
  java -jar target/compute-basics-jar-with-dependencies.jar provider 
 identity credential mygroup destroy
  
 +To list the nodes:  *groupname* parameter is not used

[minor] To list all nodes (the *groupname* parameter is not used):?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/34/files#r10860316

Re: [jclouds-examples] support for GCE provider (#34)

2014-03-21 Thread Andrew Phillips
  /dependency
  dependency
groupIdorg.apache.jclouds.driver/groupId
artifactIdjclouds-enterprise/artifactId
 -  version1.7.1/version
 +  version${jclouds.version}/version

Thanks for this cleanup!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/34/files#r10860320

Re: [jclouds-examples] support for GCE provider (#34)

2014-03-21 Thread Andrew Phillips
 @@ -202,6 +214,20 @@ public static void main(String[] args) {
Predicates.NodeMetadata and(not(TERMINATED), 
 inGroup(groupName)));
  System.out.printf( destroyed nodes %s%n, destroyed);
  break;
 + case LISTIMAGES:
 +Set? extends Image imageList = compute.listImages();
 +System.out.printf( No of images %d\n, imageList.size());

Use `%n` rather than `\n` for consistency throughout this class?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/34/files#r10860328

Re: [jclouds-examples] support for GCE provider (#34)

2014-03-21 Thread Andrew Phillips
 @@ -202,6 +214,20 @@ public static void main(String[] args) {
Predicates.NodeMetadata and(not(TERMINATED), 
 inGroup(groupName)));
  System.out.printf( destroyed nodes %s%n, destroyed);
  break;
 + case LISTIMAGES:
 +Set? extends Image imageList = compute.listImages();
 +System.out.printf( No of images %d\n, imageList.size());
 +for (Image img : imageList) {
 +   System.out.println(   + img);
 +}
 +break;
 + case LISTNODES:
 +Set? extends ComputeMetadata nodeList = compute.listNodes();

`nodes` rather than `nodeList`?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/34/files#r10860331

Re: [jclouds-examples] support for GCE provider (#34)

2014-03-21 Thread Andrew Phillips
 @@ -202,6 +214,20 @@ public static void main(String[] args) {
Predicates.NodeMetadata and(not(TERMINATED), 
 inGroup(groupName)));
  System.out.printf( destroyed nodes %s%n, destroyed);
  break;
 + case LISTIMAGES:
 +Set? extends Image imageList = compute.listImages();
 +System.out.printf( No of images %d\n, imageList.size());
 +for (Image img : imageList) {
 +   System.out.println(   + img);
 +}
 +break;
 + case LISTNODES:
 +Set? extends ComputeMetadata nodeList = compute.listNodes();
 +System.out.printf( No of nodes/instances %d\n, 
 nodeList.size());

Use `%n` rather than `\n` for consistency throughout this class?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/34/files#r10860333

Re: [jclouds-examples] support for GCE provider (#34)

2014-03-21 Thread Andrew Phillips
 @@ -218,6 +244,16 @@ public static void main(String[] args) {
}
 }
  
 +   private static String getPrivateKeyFromFile(String filename) {
 +  try {
 + return Strings2.toStringAndClose(new FileInputStream(filename));
 +  } catch (java.io.IOException e) {
 + System.err.println(Exception :  + e);

Change message to something like `format(Exception reading private key from 
'%s':, filename)`

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/34/files#r10860337

Re: [jclouds-examples] support for GCE provider (#34)

2014-03-17 Thread Ignasi Barrera
Thanks @suriyapriya. Merged!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/34#issuecomment-37796883

Re: [jclouds-examples] support for GCE provider (#34)

2014-03-17 Thread Ignasi Barrera
Closed #34.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/34

Re: [jclouds-examples] support for GCE provider (#34)

2014-03-16 Thread suriyapriya
 @@ -135,6 +144,9 @@ public static void main(String[] args) {
  // Default template chooses the smallest size on an operating 
 system
  // that tested to work with java, which tends to be Ubuntu or 
 CentOS
  TemplateBuilder templateBuilder = compute.templateBuilder();
 +
 +if(provider.equalsIgnoreCase(google-compute-engine))
 +templateBuilder.osFamily(OsFamily.CENTOS);

[JCLOUDS-495](https://issues.apache.org/jira/browse/JCLOUDS-495) is the jira 
issue

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/34/files#r10641502

Re: [jclouds-examples] support for GCE provider (#34)

2014-03-16 Thread Ignasi Barrera
 @@ -135,6 +144,9 @@ public static void main(String[] args) {
  // Default template chooses the smallest size on an operating 
 system
  // that tested to work with java, which tends to be Ubuntu or 
 CentOS
  TemplateBuilder templateBuilder = compute.templateBuilder();
 +
 +if(provider.equalsIgnoreCase(google-compute-engine))
 +templateBuilder.osFamily(OsFamily.CENTOS);

I have a horrible memory :) Thx!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/34/files#r10641977

Re: [jclouds-examples] support for GCE provider (#34)

2014-03-15 Thread Ignasi Barrera
 @@ -135,6 +144,9 @@ public static void main(String[] args) {
  // Default template chooses the smallest size on an operating 
 system
  // that tested to work with java, which tends to be Ubuntu or 
 CentOS
  TemplateBuilder templateBuilder = compute.templateBuilder();
 +
 +if(provider.equalsIgnoreCase(google-compute-engine))
 +templateBuilder.osFamily(OsFamily.CENTOS);

IIRC this was needed because the GCE [default template 
filter](https://github.com/jclouds/jclouds-labs-google/blob/master/google-compute-engine/src/main/java/org/jclouds/googlecomputeengine/GoogleComputeEngineApiMetadata.java#L68-L69)
 wasn't finding any template. Mind opening a JIRA issue (if it does not exist 
yet) so we can properly fix it?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/34/files#r10634688