[ https://issues.apache.org/jira/browse/JCLOUDS-668?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chris Custine resolved JCLOUDS-668. ----------------------------------- Resolution: Duplicate Fix Version/s: 2.0.0 1.8.1 We had this reported a few days ago with along with a PR: https://github.com/jclouds/jclouds-labs-google/pull/39 Should be merged soon. > Create IpPermission for a single port > ------------------------------------- > > Key: JCLOUDS-668 > URL: https://issues.apache.org/jira/browse/JCLOUDS-668 > Project: jclouds > Issue Type: Improvement > Components: jclouds-labs-google > Affects Versions: 1.7.3 > Reporter: Sunil Shah > Assignee: Chris Custine > Fix For: 1.8.1, 2.0.0 > > > There doesn't appear to be an easy way to add a single port firewall rule on > GCE. (e.g. UDP:1194) > We get an IllegalStateException exception when trying to add a rule as > follows: > IpPermission.builder() > .ipProtocol(protocol) > .cidrBlock(Cidr.WORLD) > .fromPort(number) > .toPort(number) > .build() > securityGroupsExtension.addIpPermission(ipPermission, securityGroup) > Exception: > java.lang.IllegalStateException: start of range must be lower than end of > range > at com.google.common.base.Preconditions.checkState(Preconditions.java:150) > ~[poseidon-0.2-SNAPSHOT-jar-with-dependencies.jar:na] > at > org.jclouds.googlecomputeengine.domain.Firewall$Rule$Builder.addPortRange(Firewall.java:354) > ~[poseidon-0.2-SNAPSHOT-jar-with-dependencies.jar:na] > at > org.jclouds.googlecomputeengine.compute.extensions.GoogleComputeEngineSecurityGroupExtension.addIpPermission(GoogleComputeEngineSecurityGroupExtension.java:224) > ~[poseidon-0.2-SNAPSHOT-jar-with-dependencies.jar:na] -- This message was sent by Atlassian JIRA (v6.2#6252)