Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2017-01-17 Thread Andrea Turli
merged at 
[master](http://git-wip-us.apache.org/repos/asf/jclouds-examples/commit/5662aae4)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90#issuecomment-273051042

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2017-01-17 Thread Andrea Turli
Closed #90.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90#event-925347966

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2017-01-17 Thread Andrea Turli
thanks, merging!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90#issuecomment-273050187

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-28 Thread Zack Shoylev
+1

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90#issuecomment-263264615

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-26 Thread Andrew Phillips
> are you happy with the status of this PR?

@andreaturli Looks good to me - thanks for the updates, Andrea

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90#issuecomment-263085886

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-26 Thread Andrew Phillips
demobox approved this pull request.





-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90#pullrequestreview-10220721

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-26 Thread Andrea Turli
@demobox are you happy with the status of this PR?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90#issuecomment-263066699

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-25 Thread Andrea Turli
Could you merge it please? Not at my laptop just now. Thanks

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90#issuecomment-263021863

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-25 Thread Andrew Gaul
andrewgaul approved this pull request.





-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90#pullrequestreview-10201682

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-25 Thread Andrew Gaul
andrewgaul commented on this pull request.



>   // Create Container
- BlobStore blobStore = context.getBlobStore();
  Location location = null;

Let's leave this as-is.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-24 Thread Andrea Turli
@andreaturli pushed 1 commit.

7bbd5fc  addressing more comments


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90/files/31184ff15c5d8aa6f2b2c7af0f10f17e811c33b0..7bbd5fc5d7f14d7ed12b76cadf37bf9757ff936e


Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-24 Thread Andrea Turli
andreaturli commented on this pull request.



>// note that you can check if a provider is present ahead of time
   checkArgument(contains(allKeys, provider), "provider %s not in supported 
list: %s", provider, allKeys);
-
-  String identity = args[1];
-  String credential = args[2];
-  String containerName = args[3];
+  identity = args[1];
+  credential = args[2];
+  containerName = args[3];
+  if (args.length > 4) endpoint = args[4];

great suggestion, thanks!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-24 Thread Andrea Turli
andreaturli commented on this pull request.



>   // Create Container
- BlobStore blobStore = context.getBlobStore();
  Location location = null;

not sure I follow, looking at the git history I can see this commit 
https://github.com/jclouds/jclouds-examples/commit/8a0718e7761a1af2f14f3d1dcc93c7da47ae7d2e
 introduced this snippet of code, do you think it is better to refactor it? if 
yes, how?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-24 Thread Andrea Turli
andreaturli commented on this pull request.



> @@ -51,6 +51,11 @@
   google-compute-engine
   ${jclouds.version}
 
+
+  io.cloudsoft.jclouds.api
+  openstack-mitaka-nova
+  1.9.3-cloudsoft.20160831
+

oh, don't know why it's there, I'll remove it right away

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-24 Thread Andrew Gaul
andrewgaul requested changes on this pull request.



> @@ -51,6 +51,11 @@
   google-compute-engine
   ${jclouds.version}
 
+
+  io.cloudsoft.jclouds.api
+  openstack-mitaka-nova
+  1.9.3-cloudsoft.20160831
+

What is this for?

>   // Create Container
- BlobStore blobStore = context.getBlobStore();
  Location location = null;

These changes disappeared in the latest PR, but you could allow 
`jclouds.region` property to set a non-default `location`.

>// note that you can check if a provider is present ahead of time
   checkArgument(contains(allKeys, provider), "provider %s not in supported 
list: %s", provider, allKeys);
-
-  String identity = args[1];
-  String credential = args[2];
-  String containerName = args[3];
+  identity = args[1];
+  credential = args[2];
+  containerName = args[3];
+  if (args.length > 4) endpoint = args[4];

Could use `jclouds.endpoint` property.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90#pullrequestreview-10093871

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-24 Thread Andrea Turli
andreaturli commented on this pull request.



> @@ -138,6 +154,10 @@ public static void main(String[] args) throws 
> IOException {
  }
  
   } finally {
+ // delete cointainer
+ if (blobStore.containerExists(containerName)) {

ok

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-24 Thread Andrea Turli
@andreaturli pushed 1 commit.

df0e785  address comments


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90/files/70f574af20bc8f30d5835d907411fe85ab259945..df0e785adec6ca32582aef2d942190cfb4370fa4


Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-24 Thread Andrea Turli
andreaturli commented on this pull request.



> @@ -69,35 +73,47 @@
 
public static void main(String[] args) throws IOException {
 
-  if (args.length < PARAMETERS)
+  String provider;
+  String identity;
+  String credential;
+  String containerName;
+  String endpoint = null;
+  boolean isSwiftv1 = Boolean.FALSE;
+  
+  List parameters = Lists.newArrayList(args);
+  if (parameters.size() < PARAMETERS)
  throw new IllegalArgumentException(INVALID_SYNTAX);

ok

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-24 Thread Andrea Turli
andreaturli commented on this pull request.



>  
   // Init
-  BlobStoreContext context = ContextBuilder.newBuilder(provider)
-   .credentials(identity, 
credential)
-   
.buildView(BlobStoreContext.class);
+  ContextBuilder contextBuilder = ContextBuilder.newBuilder(provider)
+  .credentials(identity, credential);
+  if (isSwiftv1) {
+ Properties properties = new Properties();
+ properties.setProperty("jclouds.keystone.credential-type", 
"tempAuthCredentials");

I like the properties more, thanks!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-24 Thread Andrea Turli
andreaturli commented on this pull request.



>   Location location = null;
  if (apiMetadata instanceof SwiftApiMetadata) {
 location = Iterables.getFirst(blobStore.listAssignableLocations(), 
null);
  }
- blobStore.createContainerInLocation(location, containerName);
+ blobStore.createContainerInLocation(null, containerName);

not sure I follow your idea, @andrewgaul -- what kind of property you have in 
mind?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-24 Thread Andrea Turli
andreaturli commented on this pull request.



> @@ -69,35 +73,47 @@
 
public static void main(String[] args) throws IOException {
 
-  if (args.length < PARAMETERS)
+  String provider;
+  String identity;
+  String credential;
+  String containerName;
+  String endpoint = null;
+  boolean isSwiftv1 = Boolean.FALSE;
+  
+  List parameters = Lists.newArrayList(args);
+  if (parameters.size() < PARAMETERS)

agreed, better

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-24 Thread Andrew Gaul
andrewgaul requested changes on this pull request.



> @@ -138,6 +154,10 @@ public static void main(String[] args) throws 
> IOException {
  }
  
   } finally {
+ // delete cointainer
+ if (blobStore.containerExists(containerName)) {

Should be OK to remove `containerExists`.

>  
   // Init
-  BlobStoreContext context = ContextBuilder.newBuilder(provider)
-   .credentials(identity, 
credential)
-   
.buildView(BlobStoreContext.class);
+  ContextBuilder contextBuilder = ContextBuilder.newBuilder(provider)
+  .credentials(identity, credential);
+  if (isSwiftv1) {
+ Properties properties = new Properties();
+ properties.setProperty("jclouds.keystone.credential-type", 
"tempAuthCredentials");

I don't want to bikeshed over this but using properties throughout might be 
more obvious.  OK to use `true`/`false` as well.

>   Location location = null;
  if (apiMetadata instanceof SwiftApiMetadata) {
 location = Iterables.getFirst(blobStore.listAssignableLocations(), 
null);
  }
- blobStore.createContainerInLocation(location, containerName);
+ blobStore.createContainerInLocation(null, containerName);

Would be nice to have a property for location.

> @@ -69,35 +73,47 @@
 
public static void main(String[] args) throws IOException {
 
-  if (args.length < PARAMETERS)
+  String provider;
+  String identity;
+  String credential;
+  String containerName;
+  String endpoint = null;
+  boolean isSwiftv1 = Boolean.FALSE;
+  
+  List parameters = Lists.newArrayList(args);
+  if (parameters.size() < PARAMETERS)
  throw new IllegalArgumentException(INVALID_SYNTAX);

Update `INVALID_SYNTAX` with new arguments.

> @@ -69,35 +73,47 @@
 
public static void main(String[] args) throws IOException {
 
-  if (args.length < PARAMETERS)
+  String provider;
+  String identity;
+  String credential;
+  String containerName;
+  String endpoint = null;
+  boolean isSwiftv1 = Boolean.FALSE;
+  
+  List parameters = Lists.newArrayList(args);
+  if (parameters.size() < PARAMETERS)

You can keep this as an array and just use `args.length`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90#pullrequestreview-10082299

Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-24 Thread Andrew Phillips
demobox requested changes on this pull request.



>// note that you can check if a provider is present ahead of time
   checkArgument(contains(allKeys, provider), "provider %s not in supported 
list: %s", provider, allKeys);
-
-  String identity = args[1];
-  String credential = args[2];
-  String containerName = args[3];
+  identity = parameters.get(1);
+  credential = parameters.get(2);
+  containerName = parameters.get(3);
+  if (parameters.size() > 4) endpoint = parameters.get(4);
+  if (parameters.size() > 5) isSwiftv1 = 
Boolean.parseBoolean(parameters.get(5));

Rather odd provider-specific argument here? Is there some other way we can get 
this information, e.g. from the provider name?

>  
   // Init
-  BlobStoreContext context = ContextBuilder.newBuilder(provider)
-   .credentials(identity, 
credential)
-   
.buildView(BlobStoreContext.class);
+  ContextBuilder contextBuilder = ContextBuilder.newBuilder(provider)
+  .credentials(identity, credential);
+  if (isSwiftv1) {
+ Properties properties = new Properties();
+ properties.setProperty("jclouds.keystone.credential-type", 
"tempAuthCredentials");

Can we add instructions to the README to somehow set this property when using 
Swift v1? Or change the 6th argument to be less Swift-specific, and more like 
"if you set this argument, we will add it as a property"?. Then you might 
invoke this as:
```
java -jar  jclouds.keystone.credential-type=tempAuthCredentials
```
rather than:
```
java -jar  true
```
?

>   Location location = null;
  if (apiMetadata instanceof SwiftApiMetadata) {
 location = Iterables.getFirst(blobStore.listAssignableLocations(), 
null);
  }
- blobStore.createContainerInLocation(location, containerName);
+ blobStore.createContainerInLocation(null, containerName);

Is `location` above ignored now? If so, move lines 112-115 to where it is first 
used, or remove if unneeded?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90#pullrequestreview-10070898

[jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)

2016-11-24 Thread Andrea Turli
update README.md
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds-examples/pull/90

-- Commit Summary --

  * update blobstore-basics to use 2.0.0

-- File Changes --

M blobstore-basics/README.md (11)
M blobstore-basics/pom.xml (4)
M 
blobstore-basics/src/main/java/org/jclouds/examples/blobstore/basics/MainApp.java
 (50)

-- Patch Links --

https://github.com/jclouds/jclouds-examples/pull/90.patch
https://github.com/jclouds/jclouds-examples/pull/90.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90