[
https://issues.apache.org/jira/browse/JCLOUDS-668?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chris Custine reassigned JCLOUDS-668:
-------------------------------------
Assignee: Chris Custine
> 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
>
> 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)