Add loadBalancingScheme parameter for ex_create_forwarding_rule method in GCE driver.
Closes
@@ -3126,7 +3126,8 @@ class GCENodeDriver(NodeDriver):
def ex_create_forwarding_rule(self, name, target=None, region=None,
protocol='tcp', port_range=None,
address=None, description=None,
- global_rule=False, targetpool=None):
+ global_rule=False, targetpool=None,
+ lb_scheme=None):
"""
Create a forwarding rule.
@@ -3168,6 +3169,10 @@ class GCENodeDriver(NodeDriver):
Use target instead.
:type targetpool: ``str`` or :class:`GCETargetPool`
+ :keyword lb_scheme: Load balancing scheme, can be 'EXTERNAL' or
+ 'INTERNAL'. Defaults to 'EXTERNAL'.
+ :type lb_scheme: ``str`` or ``None``
+
:return: Forwarding Rule object
:rtype: :class:`GCEForwardingRule`
"""
@@ -3198,6 +3203,9 @@ class GCENodeDriver(NodeDriver):
if description:
forwarding_rule_data['description'] = description
+ if lb_scheme:
+ forwarding_rule_data['loadBalancingScheme'] = lb_scheme
+
if global_rule:
request = '/global/forwardingRules'
else:
