You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by mikezaccardo <gi...@git.apache.org> on 2015/11/17 22:29:59 UTC
[GitHub] incubator-brooklyn pull request: Add YAML port range support
GitHub user mikezaccardo opened a pull request:
https://github.com/apache/incubator-brooklyn/pull/1038
Add YAML port range support
All values supported by `org.apache.brooklyn.core.location.PortRanges.fromString(String)` can now be included in `inboundPorts` in YAML blueprints.
Example:
```
name: "Port Range Example"
location: <cloud provider>
services:
- type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
name: VM
provisioning.properties:
inboundPorts:
- 88
- 100-200
- 8080+
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/mikezaccardo/incubator-brooklyn yaml-port-range-support
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-brooklyn/pull/1038.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1038
----
commit 6ce957d87627cfffbab2195b01846711badae2dd
Author: Mike Zaccardo <mi...@cloudsoftcorp.com>
Date: 2015-11-17T21:22:13Z
Add YAML port range support
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: Add YAML port range support
Posted by mikezaccardo <gi...@git.apache.org>.
Github user mikezaccardo commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/1038#issuecomment-157954905
@neykov @ahgittin I expanded the `fromIterable` method to support all of the previously supported formats, added some additional formats that previously would not work, and of course preserved port ranges. There are tests that verify all of these.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: Add YAML port range support
Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/1038#issuecomment-159026217
Looks good, will merge.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: Add YAML port range support
Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on the pull request:
https://github.com/apache/incubator-brooklyn/pull/1038#issuecomment-157686515
also see:
PortRanges.fromString
StringEscapes.unwrapJsonishListIfPossible
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: Add YAML port range support
Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/1038#discussion_r45458645
--- Diff: locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsLocationTest.java ---
@@ -47,6 +49,8 @@
import org.jclouds.scriptbuilder.domain.OsFamily;
import org.jclouds.scriptbuilder.domain.StatementList;
import org.mockito.Mockito;
+import org.python.google.common.collect.Lists;
+import org.python.google.common.primitives.Ints;
--- End diff --
And `com.google.common.primitives.Ints`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: Add YAML port range support
Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/1038#discussion_r45187377
--- Diff: locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java ---
@@ -3004,6 +3006,14 @@ protected static double toDouble(Object v) {
}
}
+ protected static int[] toIntPortArray(Object v) {
+ Collection<String> inboundPortEntries = toListOfStrings(v);
--- End diff --
Not fully backwards compatible. `toIntArray` supports the format `[1,2,3]`. Also accepts int arrays if passed from Java code. The first one should definitely be supported, no hard opinion on the second one.
Would be nice to have a test for the new method.
Otherwise looks very useful.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: Add YAML port range support
Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/1038#discussion_r45458607
--- Diff: locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsLocationTest.java ---
@@ -47,6 +49,8 @@
import org.jclouds.scriptbuilder.domain.OsFamily;
import org.jclouds.scriptbuilder.domain.StatementList;
import org.mockito.Mockito;
+import org.python.google.common.collect.Lists;
+import org.python.google.common.primitives.Ints;
--- End diff --
Wrong imports. Use `com.google.common.collect`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: Add YAML port range support
Posted by mikezaccardo <gi...@git.apache.org>.
Github user mikezaccardo commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/1038#discussion_r45247328
--- Diff: locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java ---
@@ -3004,6 +3006,14 @@ protected static double toDouble(Object v) {
}
}
+ protected static int[] toIntPortArray(Object v) {
+ Collection<String> inboundPortEntries = toListOfStrings(v);
--- End diff --
Thanks, @neykov. I will add support for the `[1, 2, 3]` format and Java int arrays. I'll also add test(s) in `JcloudsLocationTest`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] incubator-brooklyn pull request: Add YAML port range support
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/incubator-brooklyn/pull/1038
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---