Re: [jclouds/jclouds] [JCLOUDS-1318] fix based on nodeTerminatePredicate (#1117)

2017-07-11 Thread Geoff Macartney
geomacy approved this pull request.

LGTM at a quick read. Still have a feeling it shouldn't throw exceptions if 
`destroyNode` fails but will defer to you on this.



-- 
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/pull/1117#pullrequestreview-49209337

Re: [jclouds/jclouds] [JCLOUDS-1318] fix based on nodeTerminatePredicate (#1117)

2017-07-11 Thread Geoff Macartney
geomacy commented on this pull request.



> @@ -95,6 +101,7 @@ public Boolean apply(String id) {
   }
 
   boolean serverDeleted = 
novaApi.getServerApi(regionAndId.getRegion()).delete(regionAndId.getId());
+  checkState(nodeTerminatedPredicate.apply(id), "server was not destroyed 
in the configured timeout");

No real opinion on that to be honest!   I would say though, that if the 
`cleanupServer.apply()` is being invoked as per the link above (inside 
`cleanUpIncidentalResourcesOfDeadNodes`), then you probably want to avoid the 
exception here, as otherwise the first exception when iterating over 
`deadNodes` will prevent any remaining nodes even being attempted.

-- 
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/pull/1117#discussion_r126630432

Re: [jclouds/jclouds] [JCLOUDS-1318] fix based on nodeTerminatePredicate (#1117)

2017-07-07 Thread Geoff Macartney
geomacy commented on this pull request.



> @@ -95,6 +101,7 @@ public Boolean apply(String id) {
   }
 
   boolean serverDeleted = 
novaApi.getServerApi(regionAndId.getRegion()).delete(regionAndId.getId());
+  checkState(nodeTerminatedPredicate.apply(id), "server was not destroyed 
in the configured timeout");

Is it desirable to throw an exception here, or should we just log a warning? 

-- 
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/pull/1117#pullrequestreview-48575884

[jira] [Updated] (JCLOUDS-1315) Add InternetGatewayApi to AWSEC2Api

2017-06-30 Thread Geoff Macartney (JIRA)

 [ 
https://issues.apache.org/jira/browse/JCLOUDS-1315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Geoff Macartney updated JCLOUDS-1315:
-
Summary: Add InternetGatewayApi to AWSEC2Api  (was: Add InternetGatewayApi)

> Add InternetGatewayApi to AWSEC2Api
> ---
>
> Key: JCLOUDS-1315
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1315
> Project: jclouds
>  Issue Type: New Feature
>  Components: jclouds-compute
>Affects Versions: 2.1.0, 2.0.2
>    Reporter: Geoff Macartney
>Priority: Minor
> Fix For: 2.1.0, 2.0.2
>
>
> Add an InternetGatewayApi to AWSEC2Api.
> This is a follow-up to https://github.com/jclouds/jclouds/pull/1091
> and particularly the comment at
> https://github.com/jclouds/jclouds/pull/1091#issuecomment-299202429:
> I have been trying this out and I think we will need to extend it for
> practical purposes; if you want to create a VPC and subnet and then
> deploy a machine on to it, you also need to jump through a few other
> hoops apart from creating the subnet:
>  - modify the subnet attributes to permit auto-assign public
>IP ("ModifySubnetAttribute")
>  - create an Internet Gateway on the VPC ("CreateInternetGateway")
>  - get and then modify the routing table of the subnet to add a public
>(0.0.0.0/0) route through the newly added gateway ("CreateRoute" and
>friends)
> This issue is to track the InternetGatewayApi.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Resolved] (JCLOUDS-1317) Add ModifySubnetAttribute to AWSSubnetApi

2017-06-30 Thread Geoff Macartney (JIRA)

 [ 
https://issues.apache.org/jira/browse/JCLOUDS-1317?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Geoff Macartney resolved JCLOUDS-1317.
--
Resolution: Fixed

Resolved in 
https://git-wip-us.apache.org/repos/asf?p=jclouds.git;a=commit;h=ce0a0ad213a331cec53fae6309b32d73388adf7e

> Add ModifySubnetAttribute to AWSSubnetApi
> -
>
> Key: JCLOUDS-1317
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1317
> Project: jclouds
>  Issue Type: New Feature
>  Components: jclouds-compute
>Affects Versions: 2.1.0, 2.0.2
>    Reporter: Geoff Macartney
>Priority: Minor
> Fix For: 2.1.0, 2.0.2
>
>
> This is a follow-up to https://github.com/jclouds/jclouds/pull/1091
> and particularly the comment at
> https://github.com/jclouds/jclouds/pull/1091#issuecomment-299202429:
> I have been trying this out and I think we will need to extend it for
> practical purposes; if you want to create a VPC and subnet and then
> deploy a machine on to it, you also need to jump through a few other
> hoops apart from creating the subnet:
> * modify the subnet attributes to permit auto-assign public
> IP ("ModifySubnetAttribute")
> * create an Internet Gateway on the VPC ("CreateInternetGateway")
> * get and then modify the routing table of the subnet to add a public
> (0.0.0.0/0) route through the newly added gateway ("CreateRoute" and
> friends)
> This issue is to track the ModifySubnetAttribute API



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (JCLOUDS-1317) Add ModifySubnetAttribute to AWSSubnetApi

2017-06-30 Thread Geoff Macartney (JIRA)
Geoff Macartney created JCLOUDS-1317:


 Summary: Add ModifySubnetAttribute to AWSSubnetApi
 Key: JCLOUDS-1317
 URL: https://issues.apache.org/jira/browse/JCLOUDS-1317
 Project: jclouds
  Issue Type: New Feature
  Components: jclouds-compute
Affects Versions: 2.1.0, 2.0.2
Reporter: Geoff Macartney
Priority: Minor
 Fix For: 2.1.0, 2.0.2


This is a follow-up to https://github.com/jclouds/jclouds/pull/1091
and particularly the comment at
https://github.com/jclouds/jclouds/pull/1091#issuecomment-299202429:
I have been trying this out and I think we will need to extend it for
practical purposes; if you want to create a VPC and subnet and then
deploy a machine on to it, you also need to jump through a few other
hoops apart from creating the subnet:
* modify the subnet attributes to permit auto-assign public
IP ("ModifySubnetAttribute")
* create an Internet Gateway on the VPC ("CreateInternetGateway")
* get and then modify the routing table of the subnet to add a public
(0.0.0.0/0) route through the newly added gateway ("CreateRoute" and
friends)

This issue is to track the ModifySubnetAttribute API



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Resolved] (JCLOUDS-1316) Add a RouteTableApi to AWSEC2Api

2017-06-30 Thread Geoff Macartney (JIRA)

 [ 
https://issues.apache.org/jira/browse/JCLOUDS-1316?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Geoff Macartney resolved JCLOUDS-1316.
--
Resolution: Fixed

Resolved in 
https://git-wip-us.apache.org/repos/asf?p=jclouds.git;a=commit;h=b3d21f965288b44cadc750ff1dde2ec7ac45fff6

Limitations: Does not contain support for VgwRoutePropagation.


> Add a RouteTableApi to AWSEC2Api
> 
>
> Key: JCLOUDS-1316
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1316
> Project: jclouds
>  Issue Type: New Feature
>  Components: jclouds-compute
>Affects Versions: 2.1.0, 2.0.2
>    Reporter: Geoff Macartney
>Priority: Minor
> Fix For: 2.1.0, 2.0.2
>
>
> This is a follow-up to https://github.com/jclouds/jclouds/pull/1091
> and particularly the comment at
> https://github.com/jclouds/jclouds/pull/1091#issuecomment-299202429:
> I have been trying this out and I think we will need to extend it for
> practical purposes; if you want to create a VPC and subnet and then
> deploy a machine on to it, you also need to jump through a few other
> hoops apart from creating the subnet:
> * modify the subnet attributes to permit auto-assign public
> IP ("ModifySubnetAttribute")
> * create an Internet Gateway on the VPC ("CreateInternetGateway")
> * get and then modify the routing table of the subnet to add a public
> (0.0.0.0/0) route through the newly added gateway ("CreateRoute" and
> friends)
> This issue is to track the RouteTableApi



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (JCLOUDS-1316) Add a RouteTableApi to AWSEC2Api

2017-06-30 Thread Geoff Macartney (JIRA)
Geoff Macartney created JCLOUDS-1316:


 Summary: Add a RouteTableApi to AWSEC2Api
 Key: JCLOUDS-1316
 URL: https://issues.apache.org/jira/browse/JCLOUDS-1316
 Project: jclouds
  Issue Type: New Feature
  Components: jclouds-compute
Affects Versions: 2.1.0, 2.0.2
Reporter: Geoff Macartney
Priority: Minor
 Fix For: 2.1.0, 2.0.2


This is a follow-up to https://github.com/jclouds/jclouds/pull/1091
and particularly the comment at
https://github.com/jclouds/jclouds/pull/1091#issuecomment-299202429:
I have been trying this out and I think we will need to extend it for
practical purposes; if you want to create a VPC and subnet and then
deploy a machine on to it, you also need to jump through a few other
hoops apart from creating the subnet:
* modify the subnet attributes to permit auto-assign public
IP ("ModifySubnetAttribute")
* create an Internet Gateway on the VPC ("CreateInternetGateway")
* get and then modify the routing table of the subnet to add a public
(0.0.0.0/0) route through the newly added gateway ("CreateRoute" and
friends)

This issue is to track the RouteTableApi



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Resolved] (JCLOUDS-1315) Add InternetGatewayApi

2017-06-30 Thread Geoff Macartney (JIRA)

 [ 
https://issues.apache.org/jira/browse/JCLOUDS-1315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Geoff Macartney resolved JCLOUDS-1315.
--
Resolution: Fixed

Resolved by 
https://git-wip-us.apache.org/repos/asf?p=jclouds.git;a=commit;h=cff2f87e113307a304fe10b1d6d850f1df91bc53

> Add InternetGatewayApi
> --
>
> Key: JCLOUDS-1315
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1315
> Project: jclouds
>  Issue Type: New Feature
>  Components: jclouds-compute
>Affects Versions: 2.1.0, 2.0.2
>    Reporter: Geoff Macartney
>Priority: Minor
> Fix For: 2.1.0, 2.0.2
>
>
> Add an InternetGatewayApi to AWSEC2Api.
> This is a follow-up to https://github.com/jclouds/jclouds/pull/1091
> and particularly the comment at
> https://github.com/jclouds/jclouds/pull/1091#issuecomment-299202429:
> I have been trying this out and I think we will need to extend it for
> practical purposes; if you want to create a VPC and subnet and then
> deploy a machine on to it, you also need to jump through a few other
> hoops apart from creating the subnet:
>  - modify the subnet attributes to permit auto-assign public
>IP ("ModifySubnetAttribute")
>  - create an Internet Gateway on the VPC ("CreateInternetGateway")
>  - get and then modify the routing table of the subnet to add a public
>(0.0.0.0/0) route through the newly added gateway ("CreateRoute" and
>friends)
> This issue is to track the InternetGatewayApi.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (JCLOUDS-1315) Add InternetGatewayApi

2017-06-30 Thread Geoff Macartney (JIRA)
Geoff Macartney created JCLOUDS-1315:


 Summary: Add InternetGatewayApi
 Key: JCLOUDS-1315
 URL: https://issues.apache.org/jira/browse/JCLOUDS-1315
 Project: jclouds
  Issue Type: New Feature
  Components: jclouds-compute
Affects Versions: 2.1.0, 2.0.2
Reporter: Geoff Macartney
Priority: Minor
 Fix For: 2.1.0, 2.0.2


Add an InternetGatewayApi to AWSEC2Api.

This is a follow-up to https://github.com/jclouds/jclouds/pull/1091
and particularly the comment at
https://github.com/jclouds/jclouds/pull/1091#issuecomment-299202429:

I have been trying this out and I think we will need to extend it for
practical purposes; if you want to create a VPC and subnet and then
deploy a machine on to it, you also need to jump through a few other
hoops apart from creating the subnet:

 - modify the subnet attributes to permit auto-assign public
   IP ("ModifySubnetAttribute")
 - create an Internet Gateway on the VPC ("CreateInternetGateway")
 - get and then modify the routing table of the subnet to add a public
   (0.0.0.0/0) route through the newly added gateway ("CreateRoute" and
   friends)

This issue is to track the InternetGatewayApi.





--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


Re: [jclouds/jclouds] Add ModifySubnetAttribute (#1102)

2017-05-26 Thread Geoff Macartney
p.s. I tested the Live tests for AWSEC2SubnetApi again successfully with this, 
as well as the mock tests

-- 
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/pull/1102#issuecomment-304312096

Re: [jclouds/jclouds] Add ModifySubnetAttribute (#1102)

2017-05-26 Thread Geoff Macartney
hi @nacx, per our conversation on IRC I have reverted to using a custom 
annotation, but put a 
[comment](https://github.com/jclouds/jclouds/pull/1102/files#diff-d646d0465e56af59039c3489721bf61aR29)
 on it explaining that it is meant only as a temporary measure to decouple the 
new function in `FormSigner*` from other APIs for the moment.

I have squashed the other commits from this PR into one, and left the custom 
annotation as a separate commit, so that it's easy to tell it apart, and 
hopefully even just revert it when the tests are working again.

How do you think that looks?
 

-- 
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/pull/1102#issuecomment-304297240

Re: [jclouds/jclouds] Add first draft of a RouteTable API. (#1100)

2017-05-26 Thread Geoff Macartney
Thanks @nacx, changes squashed.

-- 
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/pull/1100#issuecomment-304282154

Re: [jclouds/jclouds] Add first draft of a RouteTable API. (#1100)

2017-05-26 Thread Geoff Macartney
hi @nacx, @andreaturli, I hope this is good to go now, do you think it can be 
merged?

-- 
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/pull/1100#issuecomment-304269821

Re: [jclouds/jclouds] Add first draft of a RouteTable API. (#1100)

2017-05-23 Thread Geoff Macartney
Note the new test util [enqueueXml(Response.Status, String, 
String)](https://github.com/jclouds/jclouds/pull/1100/files#diff-8c2525316d73049be95880788b72ccd1R161)
 in BaseAWSEC2ApiMockTest which may be of use elsewhere.

-- 
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/pull/1100#issuecomment-303395117

Re: [jclouds/jclouds] Add first draft of a RouteTable API. (#1100)

2017-05-23 Thread Geoff Macartney
hi @nacx, @andreaturli, I have pushed changes for the review comments made. For 
convenience of review I have left these as separate commits.  I can squash them 
before merge.

-- 
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/pull/1100#issuecomment-303393491

Re: [jclouds/jclouds] Add first draft of a RouteTable API. (#1100)

2017-05-23 Thread Geoff Macartney
@geomacy pushed 13 commits.

8a84ac6  Remove autoBuild where not needed.
b6a3772  Remove unusable logger.
ac03910  Add 'origin' to Route and remove unused hidden accessors.
f02436d  Remove another unused logger, and unused imports.
b002ed6  Have a separate RouteTableOptions and RouteOptions.
f1552e7  Get live test region from a system property.
4c2cefc  Use more idiomatic Iterables.tryFind to search results.
77953c2  Verify requests are sent in mock tests.
41346ad  Add "NotFound" tests for 404 responses.
0fa2590  Add some options tests
72ac742  Add more options tests
9791645  Live options tests
48270c5  Make deleteRoute only depend on createRoute


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/jclouds/jclouds/pull/1100/files/024843132066d56a2b9a3221edf03a964a275b5a..48270c56a9d1783ddbc4f969ddd2b4be05c3f94e


Re: [jclouds/jclouds] Add first draft of a RouteTable API. (#1100)

2017-05-23 Thread Geoff Macartney
Thanks for the comments @andreaturli, @nacx, will address them as soon as I can

-- 
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/pull/1100#issuecomment-303331717

Re: [jclouds/jclouds] Add first draft of a RouteTable API. (#1100)

2017-05-23 Thread Geoff Macartney
geomacy commented on this pull request.



> +   @AutoValue.Builder
+   public abstract static class Builder {
+  public abstract Builder destinationCidrBlock(String 
destinationCidrBlock);
+
+  public abstract Builder gatewayId(String gatewayId);
+
+  public abstract Builder state(RouteState state);
+
+  public abstract Builder origin(String origin);
+
+  @Nullable abstract String destinationCidrBlock();
+  @Nullable abstract String gatewayId();
+  @Nullable abstract RouteState state();
+  @Nullable abstract String origin();
+
+  abstract Route autoBuild();

Ah I see the point now.  Thanks gents.

-- 
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/pull/1100#discussion_r117932702

Re: [jclouds/jclouds] Add ModifySubnetAttribute (#1102)

2017-05-22 Thread Geoff Macartney
@nacx ok; I'll try to take a look at the tests to see if I can contribute 
anything to a fix. I'd be keen to get this merged so I can start using it.

-- 
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/pull/1102#issuecomment-303091946

Re: [jclouds/jclouds] Add ModifySubnetAttribute (#1102)

2017-05-22 Thread Geoff Macartney
Ah, so it's something to do with the tests themselves then, not just my 
environment being wrong?  I take it you get the error in `master` too?



-- 
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/pull/1102#issuecomment-303077228

Re: [jclouds/jclouds] Add ModifySubnetAttribute (#1102)

2017-05-22 Thread Geoff Macartney
p.s. I have checked the same tests as above in `master` and they fail in the 
same way for me, so it is something to do with my environment or AWS account, 
not a feature of the PR itself.

-- 
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/pull/1102#issuecomment-303026521

Re: [jclouds/jclouds] Add first draft of a RouteTable API. (#1100)

2017-05-19 Thread Geoff Macartney
hi @andreaturli, I've added a commit addressing the comments you made.

-- 
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/pull/1100#issuecomment-302707715

Re: [jclouds/jclouds] Add first draft of a RouteTable API. (#1100)

2017-05-19 Thread Geoff Macartney
@geomacy pushed 1 commit.

0248431  Add code review comments.


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/jclouds/jclouds/pull/1100/files/49c5c47adaf80efff8b722c3a3efd278ae2d4781..024843132066d56a2b9a3221edf03a964a275b5a


Re: [jclouds/jclouds] Add first draft of a RouteTable API. (#1100)

2017-05-19 Thread Geoff Macartney
geomacy commented on this pull request.



> +   @AutoValue.Builder
+   public abstract static class Builder {
+  public abstract Builder destinationCidrBlock(String 
destinationCidrBlock);
+
+  public abstract Builder gatewayId(String gatewayId);
+
+  public abstract Builder state(RouteState state);
+
+  public abstract Builder origin(String origin);
+
+  @Nullable abstract String destinationCidrBlock();
+  @Nullable abstract String gatewayId();
+  @Nullable abstract RouteState state();
+  @Nullable abstract String origin();
+
+  abstract Route autoBuild();

I tried this but a concrete `build()` is needed in `RouteSetApi`.

-- 
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/pull/1100#discussion_r117478803

Re: [jclouds/jclouds] Add first draft of a RouteTable API. (#1100)

2017-05-19 Thread Geoff Macartney
geomacy commented on this pull request.



> +  return new AutoValue_RouteTableAssociation.Builder();
+   }
+
+   @AutoValue.Builder
+   public abstract static class Builder {
+  public abstract Builder id(String id);
+  public abstract Builder routeTableId(String routeTableId);
+  public abstract Builder subnetId(String subnetId);
+  public abstract Builder main(Boolean main);
+
+  @Nullable abstract String id();
+  @Nullable abstract String routeTableId();
+  @Nullable abstract String subnetId();
+  @Nullable abstract Boolean main();
+
+  abstract RouteTableAssociation autoBuild();

It's needed here for use in `create()`. 

-- 
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/pull/1100#discussion_r117475334

Re: [jclouds/jclouds] Add ModifySubnetAttribute (#1102)

2017-05-19 Thread Geoff Macartney
@geomacy pushed 1 commit.

70860c7  Add comment explaining the @SinceApiVersion override.


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/jclouds/jclouds/pull/1102/files/74e424557e70ed227270ea77f7887dc5f1119cc7..70860c72e9a78adea2f800bbbc2cfc701815ea19


Re: [jclouds/jclouds] Add ModifySubnetAttribute (#1102)

2017-05-19 Thread Geoff Macartney
hi @nacx 

thanks for the explanation of the wiring.

I've tried to run live tests, but may not be set up for it - the tests have 
`@SinceApiVersion` are 
```
find . -name '*Api.java' | xargs grep -l SinceApiVersion | sed 's#.*/##' | 
while read file ; do   find . -name ${file%.java}LiveTest.java; done
./apis/chef/src/test/java/org/jclouds/chef/ChefApiLiveTest.java
./apis/chef/src/test/java/org/jclouds/chef/features/OrganizationApiLiveTest.java
./apis/ec2/src/test/java/org/jclouds/ec2/features/ElasticIPAddressApiLiveTest.java
./apis/ec2/src/test/java/org/jclouds/ec2/features/InstanceApiLiveTest.java
./apis/openstack-trove/src/test/java/org/jclouds/openstack/trove/v1/features/InstanceApiLiveTest.java
./providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiLiveTest.java
./apis/ec2/src/test/java/org/jclouds/ec2/features/SubnetApiLiveTest.java
./apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/TagApiLiveTest.java
./apis/ec2/src/test/java/org/jclouds/ec2/features/WindowsApiLiveTest.java
./providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/AWSSubnetApiLiveTest.java
```
I can run `/providers/aws-ec2/.../AWSSubnetApiLiveTest` and 
`/apis/ec2/.../SubnetApiLiveTest` successfully.

I've tried running `/apis/ec2/.../ElasticIPAddressApiLiveTest` with the same 
credentials, and I get `org.jclouds.rest.AuthorizationException: POST 
https://ec2.eu-west-2.amazonaws.com/ HTTP/1.1 -> HTTP/1.1 401 Unauthorized` 
results for both operations; I have also tried this with a different Amazon 
account, with the same result.   I suspect I need to do something else to run 
the test correctly but I'm not sure what? I'm running them as e.g:
```
mvn clean install  -Dtest.ec2.identity= -Dtest.ec2.credential="..." 
-Dtest=InstanceApiLiveTest -Plive
```

When running the Chef tests I get errors complaining about `No such file or 
directory` for my `.chef` folder, so must need some more setup there, but 
haven't found any instructions on how to set up the chef tests.

I haven't tried the tests in `/apis/openstack-trove`, 
`/providers/google-compute-engine`, or `/apis/cloudstack` as the `FormSignerV4` 
is only used for AWS.

Have you any links to info that I might be able to use to get those ec2 tests 
going?



-- 
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/pull/1102#issuecomment-302682049

Re: [jclouds/jclouds] Add ModifySubnetAttribute (#1102)

2017-05-18 Thread Geoff Macartney
Updates made.

I was able to switch to using `@SinceApiVersion`, very pleased with that.   The 
[key 
thing](https://github.com/jclouds/jclouds/pull/1102/commits/3bff59d28c5260e18504c6570ad5cb47117a3d48#diff-7d8365e45e83df7988b1084146439d71R158)
 is that I needed to change the override from  a just-override-it approach to 
one that will allow the annotation to _upgrade_ the version as compared to 
`apiVersion` but not _downgrade_ it, which is much safer.  All the unit tests 
now pass, and my live subnet test too.

By the way how is the `@ApiVersion` actually injected in places like 
[FormSigner](https://github.com/jclouds/jclouds/blob/master/apis/sts/src/main/java/org/jclouds/aws/filters/FormSignerV4.java#L96),
 for example?  I think the value is being taken from 
[AWSEC2ApiMetadata](https://github.com/jclouds/jclouds/blob/master/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2ApiMetadata.java#L62)
 but I couldn't work out how jclouds configures Guice (or whatever) to actually 
wire them together.



-- 
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/pull/1102#issuecomment-302513209

Re: [jclouds/jclouds] Add ModifySubnetAttribute (#1102)

2017-05-18 Thread Geoff Macartney
@geomacy pushed 3 commits.

3bff59d  Use @SinceApiVersion rather than a custom annotation.
110b188  Use Optional rather than returning null.
74e4245  Apply the version check in FormSignerV2 as well as V4


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/jclouds/jclouds/pull/1102/files/cd499fe68ffcad211345d2a0969fe41ab8ebe2cc..74e424557e70ed227270ea77f7887dc5f1119cc7


Re: [jclouds/jclouds] Add ModifySubnetAttribute (#1102)

2017-05-18 Thread Geoff Macartney
@nacx 

I can add the annotation at class level.

I originally started using `@SinceApiVersion`, and having the annotation at 
both method and class level,  but found that various tests broke, because 
various APIs are annotated `@SinceApiVersion`.I will take a look at that 
again, but switched to having a separate annotation as I thought it was safer. 

-- 
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/pull/1102#issuecomment-302447066

[jclouds/jclouds] Add ModifySubnetAttribute (#1102)

2017-05-17 Thread Geoff Macartney
This is a follow-up to 
https://github.com/jclouds/jclouds/pull/1091#issuecomment-299202429.

>   +1 to merging this but I have been trying this out and I think we will need 
> to extend it for practical purposes; if you want to create a VPC and subnet 
> and then depl>oy a machine on to it, you also need to jump through a few 
> other hoops apart from creating the subnet:
>   
>   modify the subnet attributes to permit auto-assign public IP 
> ("ModifySubnetAttribute")
>   create an Internet Gateway on the VPC ("CreateInternetGateway")
>   get and then modify the routing table of the subnet to add a public 
> (0.0.0.0/0) route through the newly added gateway ("CreateRoute" and friends)
>   But as mentioned let's merge this as-is, and do any such new stuff as a new 
> PR!

This PR adds the capability to modify the subnet to auto-assign the public IP 
via `ModifySubnetAttribute`.

It turned out that the `ModifySubnetAttribute` is a method that has been added 
to the AWS API subsequent to the version `2012-06-01` of the other subnet 
methods; to allow the selective specification of a different version I am 
proposing in this PR the introduction of a new annotation `ApiVersionOverride`, 
q.v. and see its use in 
https://github.com/jclouds/jclouds/compare/master...geomacy:modify-subnet-attribute?expand=1#diff-aa0b3b1bb310c30b9f8fdbab82794412R145

The annotation is processed by `FormSignerV4`; should I do this in 
`FormSignerV2` as well?


You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds/pull/1102

-- Commit Summary --

  * Add ModifySubnetAttribute

-- File Changes --

M apis/sts/src/main/java/org/jclouds/aws/filters/FormSignerV4.java (27)
A core/src/main/java/org/jclouds/rest/annotations/ApiVersionOverride.java 
(44)
M 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/features/AWSSubnetApi.java 
(23)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/options/ModifySubnetAttributeOptions.java
 (86)
M 
providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/AWSSubnetApiLiveTest.java
 (24)
M 
providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/AWSSubnetApiMockTest.java
 (20)
M 
providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/internal/BaseAWSEC2ApiMockTest.java
 (9)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/1102.patch
https://github.com/jclouds/jclouds/pull/1102.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/pull/1102


Re: [jclouds/jclouds] Add first draft of a RouteTable API. (#1100)

2017-05-17 Thread Geoff Macartney
@geomacy pushed 1 commit.

49c5c47  Add ReplaceRoute


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/jclouds/jclouds/pull/1100/files/b3d302d3f21e5853c517de7a1c5c2d6c35d0a6ea..49c5c47adaf80efff8b722c3a3efd278ae2d4781


Re: [jclouds/jclouds] Add first draft of a RouteTable API. (#1100)

2017-05-17 Thread Geoff Macartney
geomacy commented on this pull request.



> + * (if needed):
+ * 
+ * 
+ * import static org.jclouds.ec2.options.RouteTableOptions.Builder.*
+ * 
+ * EC2Api connection = // get connection
+ * RouteTable table = 
connection.getRouteTableApi().get().createRouteTable(vpcId, dryRun());
+ * 
+ *
+ * @see http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateRouteTable.html";
+ * />
+ */
+public class RouteTableOptions extends BaseEC2RequestOptions {
+
+   public static final RouteTableOptions NONE = new RouteTableOptions();

Here I was copying the pattern used in other classes, but `NONE` is probably 
not needed, especially since I've tried to provide the operation methods in 
each appropriate case with two overloads - one with options, one without. I'll 
get rid of it.

-- 
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/pull/1100#discussion_r116925763

Re: [jclouds/jclouds] Add first draft of a RouteTable API. (#1100)

2017-05-17 Thread Geoff Macartney
geomacy commented on this pull request.



> @@ -40,17 +40,17 @@
   /**
* The subnet is not yet available for use.
*/
-  PENDING, UNRECOGNIZED;

Hm, hadn't meant to change VPC, just the classes I introduced - my thought was 
to throw an exception rather than accept an unknown value (what use would it 
be?).  However, I see that pattern is used quite extensively in the domain 
packages; so I'll just stick with that existing way of doing things.

-- 
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/pull/1100#discussion_r116925461

Re: [jclouds/jclouds] Add first draft of a RouteTable API. (#1100)

2017-05-17 Thread Geoff Macartney
geomacy commented on this pull request.



> +   @AutoValue.Builder
+   public abstract static class Builder {
+  public abstract Builder destinationCidrBlock(String 
destinationCidrBlock);
+
+  public abstract Builder gatewayId(String gatewayId);
+
+  public abstract Builder state(RouteState state);
+
+  public abstract Builder origin(String origin);
+
+  @Nullable abstract String destinationCidrBlock();
+  @Nullable abstract String gatewayId();
+  @Nullable abstract RouteState state();
+  @Nullable abstract String origin();
+
+  abstract Route autoBuild();

Not sure; I just copied the pattern elsewhere. I'll give it a go!

-- 
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/pull/1100#discussion_r116924567

[jclouds/jclouds] Add first draft of a RouteTable API. (#1100)

2017-05-16 Thread Geoff Macartney
Implements the AWS RouteTable API.

Limitations:
- Does not contain ReplaceRoute.
- Does not contain support for VgwRoutePropagation, because I'm not too 
familiar with this myself. I propose that this could be done as a later PR.
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds/pull/1100

-- Commit Summary --

  * Add first draft of a RouteTable API.

-- File Changes --

M providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2Api.java (17)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/binders/BindRouteTableIdsToIndexedFormParams.java
 (32)
A providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/domain/Route.java 
(106)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/domain/RouteTable.java (101)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/domain/RouteTableAssociation.java
 (80)
M providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/domain/VPC.java (20)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/features/RouteTableApi.java 
(256)
M 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/options/InternetGatewayOptions.java
 (5)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/options/RouteTableOptions.java
 (255)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/xml/AssociateRouteTableResponseHandler.java
 (40)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/xml/CreateRouteTableResponseHandler.java
 (55)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/xml/DescribeRouteTablesResponseHandler.java
 (100)
A providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/xml/RouteHandler.java 
(48)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/xml/RouteSetHandler.java 
(77)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/xml/RouteTableAssociationSetHandler.java
 (79)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/xml/RouteTableHandler.java 
(116)
M 
providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/InternetGatewayApiLiveTest.java
 (2)
A 
providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/RouteTableApiLiveTest.java
 (233)
A 
providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/RouteTableApiMockTest.java
 (140)
M 
providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/internal/BaseAWSEC2ApiMockTest.java
 (8)
A providers/aws-ec2/src/test/resources/associate_route_table.xml (4)
A providers/aws-ec2/src/test/resources/create_route.xml (4)
A providers/aws-ec2/src/test/resources/create_route_table.xml (24)
A providers/aws-ec2/src/test/resources/delete_route.xml (4)
A providers/aws-ec2/src/test/resources/delete_route_table.xml (4)
A providers/aws-ec2/src/test/resources/describe_route_tables.xml (74)
A providers/aws-ec2/src/test/resources/disassociate_route_table.xml (4)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/1100.patch
https://github.com/jclouds/jclouds/pull/1100.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/pull/1100


Re: [jclouds/jclouds] Add an InternetGatewayApi to AWSEC2Api (#1097)

2017-05-10 Thread Geoff Macartney
@nacx thanks, changes squashed

-- 
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/pull/1097#issuecomment-300532323

Re: [jclouds/jclouds] Add an InternetGatewayApi to AWSEC2Api (#1097)

2017-05-10 Thread Geoff Macartney
hi @nacx I have made the changes you suggested, thanks very much for those.  
They're done as individual commits for ease of review; I will squash this 
before any merge, however. 

-- 
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/pull/1097#issuecomment-300522168

Re: [jclouds/jclouds] Add an InternetGatewayApi to AWSEC2Api (#1097)

2017-05-09 Thread Geoff Macartney
Worth mentioning that I restricted the API to the general purpose gateway - 
didn't do the egress only one. Could be added later. 

-- 
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/pull/1097#issuecomment-300262641

[jclouds/jclouds] Fix CRLF on google-cloud-storage logback.xml (#1098)

2017-05-09 Thread Geoff Macartney
I fetched `master` and git status told me 

modified:   
providers/google-cloud-storage/src/test/resources/logback.xml

This just recommits the file with git configured as `core.autocrlf=input`  
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds/pull/1098

-- Commit Summary --

  * Fix CRLF on google-cloud-storage logback.xml

-- File Changes --

M providers/google-cloud-storage/src/test/resources/logback.xml (166)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/1098.patch
https://github.com/jclouds/jclouds/pull/1098.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/pull/1098


[jclouds/jclouds] Add an InternetGatewayApi to AWSEC2Api (#1097)

2017-05-09 Thread Geoff Macartney
This is a follow-up to https://github.com/jclouds/jclouds/pull/1091 and 
particularly the comment at 
https://github.com/jclouds/jclouds/pull/1091#issuecomment-299202429:

> I have been trying this out and I think we will need to extend it for 
> practical purposes; if you want to create a VPC and subnet and then deploy a 
> machine on to it, you also need to jump through a few other hoops apart from 
> creating the subnet:
> 
> - modify the subnet attributes to permit auto-assign public IP 
> ("ModifySubnetAttribute")
> - create an Internet Gateway on the VPC ("CreateInternetGateway")
> - get and then modify the routing table of the subnet to add a public 
> (0.0.0.0/0) route through the newly added gateway ("CreateRoute" and friends)

There are three AWS APIs needed for the above, an `InternetGatewayApi`, a 
`RouteTableApi` and a method in the subnet API, I guess, for modifying 
attributes on subnets. This PR contains the `InternetGatewayApi`.  If this 
looks good, I can add the others.

@neykov, @andreaturli, this will be of interest to you.


You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds/pull/1097

-- Commit Summary --

  * Add an InternetGatewayApi to AWSEC2Api.

-- File Changes --

M providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/AWSEC2Api.java (8)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/binders/BindInternetGatewayIdsToIndexedFormParams.java
 (32)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/domain/InternetGateway.java 
(84)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/domain/InternetGatewayAttachment.java
 (85)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/features/InternetGatewayApi.java
 (141)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/options/InternetGatewayOptions.java
 (64)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/xml/DescribeInternetGatewaysResponseHandler.java
 (84)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/xml/InternetGatewayAttachmentSetHandler.java
 (70)
A 
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/xml/InternetGatewayHandler.java
 (100)
A 
providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/InternetGatewayApiLiveTest.java
 (146)
A 
providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/InternetGatewayApiMockTest.java
 (143)
A providers/aws-ec2/src/test/resources/attach_internet_gateway.xml (5)
A providers/aws-ec2/src/test/resources/attach_internet_gateway_failed.xml 
(5)
A providers/aws-ec2/src/test/resources/create_internet_gateway.xml (9)
A providers/aws-ec2/src/test/resources/delete_internet_gateway.xml (6)
A providers/aws-ec2/src/test/resources/describe_internet_gateways.xml (37)
A providers/aws-ec2/src/test/resources/detach_internet_gateway.xml (5)
A providers/aws-ec2/src/test/resources/get_internet_gateway.xml (21)
A providers/aws-ec2/src/test/resources/logback-test.xml (42)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/1097.patch
https://github.com/jclouds/jclouds/pull/1097.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/pull/1097


Re: [jclouds/jclouds] JCLOUDS-1269; JCLOUDS-1120: ec2 subnet/securityGroups in non-default vpc (#1091)

2017-05-04 Thread Geoff Macartney
+1 to merging this but I have been trying this out and I think we will need to 
extend it for practical purposes; if you want to create a VPC and subnet and 
then deploy a machine on to it, you also need to jump through a few other hoops 
apart from creating the subnet:
- modify the subnet attributes to permit auto-assign public IP 
("ModifySubnetAttribute")
- create an Internet Gateway on the VPC ("CreateInternetGateway")
- get and then modify the routing table of the subnet to add a public 
(0.0.0.0/0) route through the newly added gateway ("CreateRoute" and friends)

-- 
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/pull/1091#issuecomment-299202429

Re: [jclouds/jclouds] JCLOUDS-1269; JCLOUDS-1120: ec2 subnet/securityGroups in non-default vpc (#1091)

2017-05-03 Thread Geoff Macartney
+1 looks good to me

-- 
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/pull/1091#issuecomment-298859600

Re: [jclouds/jclouds] JCLOUDS-1269; JCLOUDS-1120: ec2 subnet/securityGroups in non-default vpc (#1091)

2017-05-02 Thread Geoff Macartney
geomacy commented on this pull request.



> +import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.jclouds.ec2.options.internal.BaseEC2RequestOptions;
+
+/**
+ * Contains options supported in the Form API for the CreateSubnet
+ * operation. 
+ * Usage The recommended way to instantiate a CreateSubnetOptions
+ * object is to statically import CreateSubnetOptions.Builder.* and
+ * invoke a static creation method followed by an instance mutator (if needed):
+ * 
+ * 
+ * import static org.jclouds.aws.ec2.options.CreateSubnetOptions.Builder.*
+ * 
+ * AWSEC2Api connection = // get connection
+ * group = 
connection.getAWSSubnetApi().createSubnet(vpcId("123125").noReboot());

Is this right?  `createSubnetInRegion` is there but not `createSubnet`, and 
this class doesn't contain `vpcId()` or `noReboot()` methods?

-- 
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/pull/1091#pullrequestreview-35826799

Re: [jclouds/jclouds] JCLOUDS-1269; JCLOUDS-1120: ec2 subnet/securityGroups in non-default vpc (#1091)

2017-05-02 Thread Geoff Macartney
geomacy commented on this pull request.



> @@ -220,10 +223,16 @@ void deleteSecurityGroup(String region, String group) {
   checkNotNull(emptyToNull(group), "group must be defined");
   String groupName = namingConvention.create().sharedNameForGroup(group);
 
-  if 
(!client.getSecurityGroupApi().get().describeSecurityGroupsInRegion(region, 
groupName).isEmpty()) {
+  Multimap securityGroupFilterByName = 
ImmutableMultimap.of("group-name", groupName);
+  Set securityGroupsToDelete = 
client.getSecurityGroupApi().get()
+  .describeSecurityGroupsInRegionWithFilter(region, 
securityGroupFilterByName);

I guess this is already including the region value so maybe this is fine 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/pull/1091#discussion_r114362734

Re: [jclouds/jclouds] JCLOUDS-1269; JCLOUDS-1120: ec2 subnet/securityGroups in non-default vpc (#1091)

2017-05-02 Thread Geoff Macartney
geomacy commented on this pull request.



> @@ -220,10 +223,16 @@ void deleteSecurityGroup(String region, String group) {
   checkNotNull(emptyToNull(group), "group must be defined");
   String groupName = namingConvention.create().sharedNameForGroup(group);
 
-  if 
(!client.getSecurityGroupApi().get().describeSecurityGroupsInRegion(region, 
groupName).isEmpty()) {
+  Multimap securityGroupFilterByName = 
ImmutableMultimap.of("group-name", groupName);
+  Set securityGroupsToDelete = 
client.getSecurityGroupApi().get()
+  .describeSecurityGroupsInRegionWithFilter(region, 
securityGroupFilterByName);

@neykov will your comment about security group name filtering 
[here](https://github.com/jclouds/jclouds/pull/1091/files#r113952626) also 
apply in this code?

-- 
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/pull/1091#pullrequestreview-35822178

Re: [jclouds/jclouds] JCLOUDS-1269; JCLOUDS-1120: ec2 subnet/securityGroups in non-default vpc (#1091)

2017-05-02 Thread Geoff Macartney
geomacy commented on this pull request.



> +
+   /**
+* Creates a subnet in an existing VPC.
+*
+* @param region
+* @param vpcId The ID of the VPC.
+* @param cidrBlock The network range for the subnet, in CIDR notation. For 
example, 10.0.0.0/24.
+* @param options
+* @return AWS Subnet
+*/
+   @Named("CreateSubnet")
+   @POST
+   @Path("/")
+   @XMLResponseParser(SubnetHandler.class)
+   @FormParams(keys = ACTION, values = "CreateSubnet")
+   Subnet createSubnetInRegion(

you will need to add `DeleteSubnet` as well - this class will not be very 
usable if it can only create subnets

-- 
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/pull/1091#pullrequestreview-35775065

Re: [jclouds/jclouds-labs] JCLOUDS-1278: Allow to configure virtual machine NICs in Azure ARM (#386)

2017-04-27 Thread Geoff Macartney
I can't really say if it's good to merge as such, as I haven't reviewed the 
code in detail, but the updated java docs per our conversations do address the 
point I made, so find by me.

-- 
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-labs/pull/386#issuecomment-297808483

Re: [jclouds/jclouds-labs] JCLOUDS-1278: Allow to configure virtual machine NICs in Azure ARM (#386)

2017-04-27 Thread Geoff Macartney
geomacy commented on this pull request.



> @@ -75,13 +75,26 @@ public AzureTemplateOptions dataDisks(DataDisk... 
> dataDisks) {
   return dataDisks(ImmutableList.copyOf(checkNotNull(dataDisks, 
"dataDisks")));
}

+   /**
+* Configure the NICs that will be attached to the created nodes.
+* 
+* Note that the number of NICs that can be attached depends on the size of
+* the virtual machine, and that the guest operating system needs to be
+* prepared to setup ont only the first network interface.
+* 
+* Depending on the image being used, a cloud-init or bootstrap script might
+* be needed to make the interface setup.

I see; that's a good explanation. Why not copy-and-paste it into the javadocs?!

-- 
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-labs/pull/386#discussion_r113776457

Re: [jclouds/jclouds-labs] JCLOUDS-1278: Allow to configure virtual machine NICs in Azure ARM (#386)

2017-04-27 Thread Geoff Macartney
geomacy commented on this pull request.



> @@ -75,13 +75,26 @@ public AzureTemplateOptions dataDisks(DataDisk... 
> dataDisks) {
   return dataDisks(ImmutableList.copyOf(checkNotNull(dataDisks, 
"dataDisks")));
}

+   /**
+* Configure the NICs that will be attached to the created nodes.
+* 
+* Note that the number of NICs that can be attached depends on the size of
+* the virtual machine, and that the guest operating system needs to be
+* prepared to setup ont only the first network interface.
+* 
+* Depending on the image being used, a cloud-init or bootstrap script might
+* be needed to make the interface setup.

is it worth adding a distinction between the main NIC which will normally(?) be 
attached, and additional ones that won't?  Or do you mean above 
"and that the guest operating system will typically set up only the first 
network interface."


-- 
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-labs/pull/386#pullrequestreview-35138766

Re: [jclouds/jclouds-labs] JCLOUDS-1278: Allow to configure virtual machine NICs in Azure ARM (#386)

2017-04-27 Thread Geoff Macartney
geomacy commented on this pull request.



> @@ -75,13 +75,26 @@ public AzureTemplateOptions dataDisks(DataDisk... 
> dataDisks) {
   return dataDisks(ImmutableList.copyOf(checkNotNull(dataDisks, 
"dataDisks")));
}

+   /**
+* Configure the NICs that will be attached to the created nodes.
+* 
+* Note that the number of NICs that can be attached depends on the size of
+* the virtual machine, and that the guest operating system needs to be
+* prepared to setup ont only the first network interface.

typo `ont`

-- 
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-labs/pull/386#pullrequestreview-35137765

Re: [jclouds/jclouds-labs] JCLOUDS-1278: Allow to configure virtual machine NICs in Azure ARM (#386)

2017-04-27 Thread Geoff Macartney
> I agree that some OSs need to be prepared to enable the network interfaces on 
> boot, but that can easily be achieved with bootstrap scripts and/or cloud 
> init?

I guess so long as it is understood that this may be necessary, depending on 
the image, then that's ok.   It may be worth adding this note in the javadoc. 
Otherwise users may think that just configuring the NICs on the node may mean 
that they automatically get interfaces connected to the various subnets, and 
may then wonder what they are doing wrong if in some cases they don't.

-- 
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-labs/pull/386#issuecomment-297737524

Re: [jclouds/jclouds-labs] JCLOUDS-1278: Allow to configure virtual machine NICs in Azure ARM (#386)

2017-04-27 Thread Geoff Macartney
@neykov this will interest you I'm sure

-- 
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-labs/pull/386#issuecomment-297717745

Re: [jclouds/jclouds-labs] JCLOUDS-1278: Allow to configure virtual machine NICs in Azure ARM (#386)

2017-04-27 Thread Geoff Macartney
This sounds good but I think it may run into the problem we in Apache Brooklyn 
found when experimenting with arrangements for multiple NICs in Azure - just 
because you attach the NIC to the machine, that does not mean that the image 
will actually recognise and enable it when the operating system boots. E.g. 
we attached one extra NIC to a node but on boot when you used `ifconfig` you 
could only see the one, default, interface.  You would have to do additional 
machine configurations to actually attach the second NIC.

-- 
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-labs/pull/386#issuecomment-297717523

Re: [jclouds/jclouds] JCLOUDS-1237 Add compareTo() for IpPermission. (#1064)

2017-02-22 Thread Geoff Macartney
thanks @nacx !

-- 
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/pull/1064#issuecomment-281614735

[jira] [Commented] (JCLOUDS-1237) IpPermission#compareTo is inconsistent with equals

2017-02-18 Thread Geoff Macartney (JIRA)

[ 
https://issues.apache.org/jira/browse/JCLOUDS-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15873367#comment-15873367
 ] 

Geoff Macartney commented on JCLOUDS-1237:
--

I've PRed https://github.com/jclouds/jclouds/pull/1064 as a candidate fix for 
this.

> IpPermission#compareTo is inconsistent with equals
> --
>
> Key: JCLOUDS-1237
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1237
> Project: jclouds
>  Issue Type: Bug
>Reporter: Sam Corbett
>Priority: Minor
>
> {{org.jclouds.net.domain.IpPermission#compareTo}} is inconsistent with its 
> definition of equals. {{compareTo}} only compares protocols whereas 
> {{equals}} compares all fields in the class. The class does not behave in 
> sorted sets.
> From {{Comparable's}} 
> [documentation|https://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html]:
> {quote}
> It is strongly recommended (though not required) that natural orderings be 
> consistent with equals. This is so because sorted sets (and sorted maps) 
> without explicit comparators behave "strangely" when they are used with 
> elements (or keys) whose natural ordering is inconsistent with equals. In 
> particular, such a sorted set (or sorted map) violates the general contract 
> for set (or map), which is defined in terms of the equals method.
> For example, if one adds two keys a and b such that (!a.equals(b) && 
> a.compareTo(b) == 0) to a sorted set that does not use an explicit 
> comparator, the second add operation returns false (and the size of the 
> sorted set does not increase) because a and b are equivalent from the sorted 
> set's perspective.
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jclouds/jclouds] Add compareTo() for IpPermission. (#1064)

2017-02-18 Thread Geoff Macartney
Regarding https://issues.apache.org/jira/browse/JCLOUDS-1237
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds/pull/1064

-- Commit Summary --

  * Add compareTo() for IpPermission.

-- File Changes --

M compute/src/main/java/org/jclouds/net/domain/IpPermission.java (164)
A compute/src/test/java/org/jclouds/net/domain/IpPermissionTest.java (243)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/1064.patch
https://github.com/jclouds/jclouds/pull/1064.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/pull/1064


Re: [jclouds/jclouds] Fix O(n^2) response time for "list-security-groups" on openstack-nova. (#1059)

2017-02-13 Thread Geoff Macartney
hi @andreaturli, changes squashed.  Yes, it would be good to have this ported 
to 2.0.x as well if that is possible.

-- 
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/pull/1059#issuecomment-279360454

Re: [jclouds/jclouds] Fix O(n^2) response time for "list-security-groups" on openstack-nova. (#1059)

2017-02-13 Thread Geoff Macartney
hi @andreaturli , @nacx , I have updates the PR with changes as suggested in 
the comments above, improving the additional test and now deleting unused 
classes.

-- 
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/pull/1059#issuecomment-279342461

Re: [jclouds/jclouds] Fix O(n^2) response time for "list-security-groups" on openstack-nova. (#1059)

2017-02-13 Thread Geoff Macartney
@geomacy pushed 2 commits.

23b60cd  review comments and  test fixes
33f1a74  Delete now-unused classes.


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/jclouds/jclouds/pull/1059/files/6d4f69776e3b8a6bbcbc9f6e317ed85bb714c974..33f1a74e1c14fac2d4b45dcb97cd0ecea83116d5


Re: [jclouds/jclouds] Fix O(n^2) response time for "list-security-groups" on openstack-nova. (#1059)

2017-02-10 Thread Geoff Macartney
geomacy commented on this pull request.



> @@ -135,8 +136,9 @@ public NovaSecurityGroupExtension(NovaApi api,
   }
 
   Set groupNames = instance.getSecurityGroupNames();
-  Set rawGroups =
-  
sgApi.get().list().filter(nameIn(groupNames)).transform(groupToGroupInRegion(region)).toSet();
+   final 
FluentIterable allGroups 
= sgApi.get().list();
+   Set rawGroups =
+  
allGroups.filter(nameIn(groupNames)).transform(groupToGroupInRegion(allGroups, 
region)).toSet();

We do need the variable, as it is used both as the root of the iteration and as 
a parameter to it (so that all groups have knowledge of all other groups).

-- 
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/pull/1059

Re: [jclouds/jclouds] Fix O(n^2) response time for "list-security-groups" on openstack-nova. (#1059)

2017-02-10 Thread Geoff Macartney
geomacy commented on this pull request.



> @@ -153,7 +155,8 @@ public SecurityGroup getSecurityGroupById(String id) {
  return null;
   }
 
-  SecurityGroupInRegion rawGroup = new 
SecurityGroupInRegion(sgApi.get().get(groupId), region);
+   final 
FluentIterable allGroups 
= sgApi.get().list();

Dang, thought I had got all of those! :-)

-- 
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/pull/1059

Re: [jclouds/jclouds] Fix O(n^2) response time for "list-security-groups" on openstack-nova. (#1059)

2017-02-10 Thread Geoff Macartney
Thanks for the comments @andreaturli and @nacx, - will add a couple of 
responses above, and update the PR with corresponding changes. 

-- 
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/pull/1059#issuecomment-278919152

Re: [jclouds/jclouds] Fix O(n^2) response time for "list-security-groups" on openstack-nova. (#1059)

2017-02-07 Thread Geoff Macartney
hi @nacx, thanks for the suggestions.  A couple of thoughts/questions:

- Would the `Supplier>` be a singleton similar to 
[FindSecurityGroupWithNameAndReturnTrue](https://github.com/jclouds/jclouds/blob/rel/jclouds-2.0.0/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/predicates/FindSecurityGroupWithNameAndReturnTrue.java#L52-L55)
 - I assume it would have to inject the `NovaApi` in the same way?
- I'm not familiar with the memoizing as used in jclouds, but I did think about 
some sort of memo/cache for this; however, I wondered if that would be right 
for this scenario.  does it cope with the need to invalidate the memo when 
mutating operations are performed? e.g. if I add a group A, then another, B, 
then add an ingress rule to B permitting access from A, each of these three 
operations modifies the set of security groups that is defined, so each will 
require a fresh fetch of the list of groups.  If the list is cached per 
‘session’ (not sure what that is) then the sequence above won’t work.  
- I guess we could add accessors to support keeping the memo up-to-date on the 
fly as operations were carried out, but (a) I have bad experiences in the past 
with trying to keep caches in-sync with their back-ends, and (b) in any case I 
don't think that applies here, as in my example, the back end cloud will 
generate the ID for group A when it gets created, so the only way to get its 
value into the memo is to do the fetch again, so the memo isn't saving you an 
operation.  For this reason I thought it might be safest to stick with doing a 
single `list` operation prior to each of the actions above.  

I shall try to read up in the code on how the memoizers are used, and maybe we 
can work out together what to do.



-- 
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/pull/1059#issuecomment-277966551

[jira] [Commented] (JCLOUDS-1235) openstack-nova: list-security-groups request is slow, with O(n^2) behaviour

2017-02-06 Thread Geoff Macartney (JIRA)

[ 
https://issues.apache.org/jira/browse/JCLOUDS-1235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15854616#comment-15854616
 ] 

Geoff Macartney commented on JCLOUDS-1235:
--

I have raised a candidate fix for this in 
https://github.com/jclouds/jclouds/pull/1059.

> openstack-nova: list-security-groups request is slow, with O(n^2) behaviour
> ---
>
> Key: JCLOUDS-1235
> URL: https://issues.apache.org/jira/browse/JCLOUDS-1235
> Project: jclouds
>  Issue Type: Bug
>  Components: jclouds-compute
>Affects Versions: 2.0.0
>    Reporter: Geoff Macartney
>
> On an Openstack cloud with more than a trivial number of security groups, the 
> “list security groups” operation takes a very long time, displaying an 
> “O(n^2)” response behaviour.  For example a simple live test like this, 
> against an Openstack deployment I am using which has around 160 security 
> groups, some with up to about 40 rules permitting access from other groups:
> {code}
> @Test(groups = { "integration", "live" }, singleThreaded = true)
> public void testListSecurityGroups() throws RunNodesException, 
> InterruptedException, ExecutionException {
> skipIfSecurityGroupsNotSupported();
> ComputeService computeService = view.getComputeService();
> Optional securityGroupExtension = 
> computeService.getSecurityGroupExtension();
> assertTrue(securityGroupExtension.isPresent(), "security extension 
> was not present");
> Set groups = 
> securityGroupExtension.get().listSecurityGroups();
> System.out.println(groups.size());
> for (SecurityGroup group : groups) {
> System.out.println(group);
> }
> }
> {code}
> ran for up to an hour before I gave up waiting. The problem can be seen in 
> the following stack trace:
> {code}
> at 
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440)
> at 
> sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
> - locked <0x170a> (a 
> sun.net.www.protocol.https.HttpsURLConnectionImpl)
> at 
> org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.invoke(JavaUrlHttpCommandExecutorService.java:97)
> at 
> org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.invoke(JavaUrlHttpCommandExecutorService.java:65)
> at 
> org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:100)
> at 
> org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90)
> at 
> org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73)
> at 
> org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44)
> at 
> org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117)
> at 
> com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87)
> at com.sun.proxy.$Proxy88.list(Unknown Source:-1)
> at 
> org.jclouds.openstack.nova.v2_0.predicates.FindSecurityGroupWithNameAndReturnTrue.apply(FindSecurityGroupWithNameAndReturnTrue.java:66)
> at 
> org.jclouds.openstack.nova.v2_0.predicates.FindSecurityGroupWithNameAndReturnTrue.apply(FindSecurityGroupWithNameAndReturnTrue.java:44)
> at 
> org.jclouds.util.Predicates2$RetryablePredicate.apply(Predicates2.java:117)
> at 
> org.jclouds.openstack.nova.v2_0.compute.functions.SecurityGroupRuleToIpPermission$1.apply(SecurityGroupRuleToIpPermission.java:92)
> at 
> org.jclouds.openstack.nova.v2_0.compute.functions.SecurityGroupRuleToIpPermission$1.apply(SecurityGroupRuleToIpPermission.java:87)
> at 
> com.google.common.collect.Iterators$7.computeNext(Iterators.java:652)
> at 
> com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
> at 
> com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
> at com.google.common.collect.Iterators.getNext(Iterators.java:865)
> at com.google.common.collect.Iterables.getFirst(Iterables.java:775)
> at 
> org.jclouds.openstack.nova.v2_0.compute.functions.SecurityGroupRuleToIpPermission.apply(SecurityGroupRuleToIpPermission.java:73)
> at 
> org.jclouds.openstack.nova.v2_0.compute.functions.SecurityGroupRuleToIpPermission.apply(SecurityGroupRuleToIpPermission.java:48)
>  

[jclouds/jclouds] Fix O(n^2) response time for "list-security-groups" on openstack-nova. (#1059)

2017-02-06 Thread Geoff Macartney
Proposed fix for https://issues.apache.org/jira/browse/JCLOUDS-1235.

This change takes the approach of storing the information about the
overall list of groups within the `SecurityGroupInRegion` when it is
created, so that any subsequent conversion operation has access to all
the groups in the same region as the one to be converted.

It also collapses the functionality of `NovaSecurityGroupToSecurityGroup`,
`SecurityGroupRuleToIpPermission` and `FindSecurityGroupWithNameAndReturnTrue`
all into `NovaSecurityGroupInRegionToSecurityGroup`.
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds/pull/1059

-- Commit Summary --

  * Fix O(n^2) response time for "list-security-groups" on openstack-nova.

-- File Changes --

M 
apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/extensions/NovaSecurityGroupExtension.java
 (18)
M 
apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/CreateSecurityGroupIfNeeded.java
 (16)
M 
apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/NovaSecurityGroupInRegionToSecurityGroup.java
 (103)
M 
apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/SecurityGroupInRegion.java
 (34)
M 
apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/predicates/FindSecurityGroupWithNameAndReturnTrue.java
 (6)
M 
apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/extensions/NovaSecurityGroupExtensionExpectTest.java
 (87)
M 
apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/extensions/NovaSecurityGroupExtensionLiveTest.java
 (24)
M 
apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/functions/NovaSecurityGroupInRegionToSecurityGroupTest.java
 (11)
M 
apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/functions/NovaSecurityGroupToSecurityGroupTest.java
 (26)
M 
apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/functions/CreateSecurityGroupIfNeededTest.java
 (30)
M 
apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/functions/FindSecurityGroupWithNameAndReturnTrueExpectTest.java
 (9)
M core/src/test/java/org/jclouds/rest/internal/BaseRestApiExpectTest.java 
(3)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/1059.patch
https://github.com/jclouds/jclouds/pull/1059.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/pull/1059


[jira] [Created] (JCLOUDS-1235) openstack-nova: list-security-groups request is slow, with O(n^2) behaviour

2017-02-06 Thread Geoff Macartney (JIRA)
Geoff Macartney created JCLOUDS-1235:


 Summary: openstack-nova: list-security-groups request is slow, 
with O(n^2) behaviour
 Key: JCLOUDS-1235
 URL: https://issues.apache.org/jira/browse/JCLOUDS-1235
 Project: jclouds
  Issue Type: Bug
  Components: jclouds-compute
Affects Versions: 2.0.0
Reporter: Geoff Macartney


On an Openstack cloud with more than a trivial number of security groups, the 
“list security groups” operation takes a very long time, displaying an “O(n^2)” 
response behaviour.  For example a simple live test like this, against an 
Openstack deployment I am using which has around 160 security groups, some with 
up to about 40 rules permitting access from other groups:

{code}
@Test(groups = { "integration", "live" }, singleThreaded = true)
public void testListSecurityGroups() throws RunNodesException, 
InterruptedException, ExecutionException {
skipIfSecurityGroupsNotSupported();

ComputeService computeService = view.getComputeService();
Optional securityGroupExtension = 
computeService.getSecurityGroupExtension();
assertTrue(securityGroupExtension.isPresent(), "security extension was 
not present");

Set groups = 
securityGroupExtension.get().listSecurityGroups();
System.out.println(groups.size());
for (SecurityGroup group : groups) {
System.out.println(group);
}
}
{code}

ran for up to an hour before I gave up waiting. The problem can be seen in the 
following stack trace:
{code}
  at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440)
  at 
sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
  - locked <0x170a> (a 
sun.net.www.protocol.https.HttpsURLConnectionImpl)
  at 
org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.invoke(JavaUrlHttpCommandExecutorService.java:97)
  at 
org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.invoke(JavaUrlHttpCommandExecutorService.java:65)
  at 
org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:100)
  at 
org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90)
  at 
org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73)
  at 
org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44)
  at 
org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117)
  at 
com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87)
  at com.sun.proxy.$Proxy88.list(Unknown Source:-1)
  at 
org.jclouds.openstack.nova.v2_0.predicates.FindSecurityGroupWithNameAndReturnTrue.apply(FindSecurityGroupWithNameAndReturnTrue.java:66)
  at 
org.jclouds.openstack.nova.v2_0.predicates.FindSecurityGroupWithNameAndReturnTrue.apply(FindSecurityGroupWithNameAndReturnTrue.java:44)
  at 
org.jclouds.util.Predicates2$RetryablePredicate.apply(Predicates2.java:117)
  at 
org.jclouds.openstack.nova.v2_0.compute.functions.SecurityGroupRuleToIpPermission$1.apply(SecurityGroupRuleToIpPermission.java:92)
  at 
org.jclouds.openstack.nova.v2_0.compute.functions.SecurityGroupRuleToIpPermission$1.apply(SecurityGroupRuleToIpPermission.java:87)
  at 
com.google.common.collect.Iterators$7.computeNext(Iterators.java:652)
  at 
com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
  at 
com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
  at com.google.common.collect.Iterators.getNext(Iterators.java:865)
  at com.google.common.collect.Iterables.getFirst(Iterables.java:775)
  at 
org.jclouds.openstack.nova.v2_0.compute.functions.SecurityGroupRuleToIpPermission.apply(SecurityGroupRuleToIpPermission.java:73)
  at 
org.jclouds.openstack.nova.v2_0.compute.functions.SecurityGroupRuleToIpPermission.apply(SecurityGroupRuleToIpPermission.java:48)
  at com.google.common.collect.Iterators$8.transform(Iterators.java:799)
  at 
com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
  at 
com.google.common.collect.ImmutableCollection$Builder.addAll(ImmutableCollection.java:281)
  at 
com.google.common.collect.ImmutableCollection$ArrayBasedBuilder.addAll(ImmutableCollection.java:360)
  at 
com.google.common.collect.ImmutableSet$Builder.addAll(ImmutableSet.java:508)
  at 
org.jclouds.compute.domain.SecurityGroupBuilder.ipPermissions(SecurityGroupBuilder.java:43)
  at 
org.jclouds.openstack.nova.v2_0.compute.functions.No

[jira] [Created] (JCLOUDS-1234) openstack-nova - Indeterminate/invalid group reference created in ingress rule if duplicate groups in region

2017-02-06 Thread Geoff Macartney (JIRA)
Geoff Macartney created JCLOUDS-1234:


 Summary: openstack-nova - Indeterminate/invalid group reference 
created in ingress rule if duplicate groups in region
 Key: JCLOUDS-1234
 URL: https://issues.apache.org/jira/browse/JCLOUDS-1234
 Project: jclouds
  Issue Type: Bug
  Components: jclouds-compute
Affects Versions: 2.0.0
Reporter: Geoff Macartney


When converting a Nova security group to its jclouds representation, the class 
{{FindSecurityGroupWithNameAndReturnTrue}} is used to find a security group in 
the list of groups in a location by matching on name with a “query object”:

https://github.com/apache/jclouds/blob/rel/jclouds-2.0.0/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/predicates/FindSecurityGroupWithNameAndReturnTrue.java#L66-L73

{code}
SecurityGroup returnVal = Iterables.find(api.get().list(), new 
Predicate() {

@Override
public boolean apply(SecurityGroup input) {
   return input.getName().equals(securityGroupInRegion.getName());
}

 });
{code}

However, it is possible for there to be duplicate group names among the 
security groups in a location. Say we have a location with two groups, G1 and 
G2, both with name “foobar”. In such a case, if a security group G3 has ingress 
rules permitting access from “foobar”, then it is not possible with the Nova 
{{/v2/12345/os-security-groups}} API to know which group is intended, as the 
only  information it returns about referred groups is the tenant id and name:
{code}
"group": {
   "tenant_id": "12345abcde12345abcde12345abcde",
   "name": "foobar"
},
{code}

With this definition of the API the ingress rule is ambiguous. The code for 
{{FindSecurityGroupWithNameAndReturnTrue}} above implicitly assumes that group 
names are distinct, and so it will arbitrarily assign the security access to 
whichever of G1 and G2 it encounters first in the {{find}}, possibly the wrong 
group, thus mapping the rule incorrectly.

The fix for this is probably to switch to using the v3 security groups API in 
Neutron, which returns the actual security group id in the definitions of 
ingress rules and not just the name.







--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


Re: [jclouds/jclouds-karaf] [DO NOT MERGE] Improvements/feature (#92)

2017-01-05 Thread Geoff Macartney
Looks good; one thought - maybe it would be useful at this point to split the 
feature file into several more modular files, e.g. at least to factor out the 
jclouds labs features.  Was going to suggest splitting apis and providers but 
you will always need both, so not much point in that.

-- 
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-karaf/pull/92#issuecomment-270684205