

def ex_create_nat_rule(self, network_domain, internal_ip, external_ip):
    '\n        Create a NAT rule\n\n        :param  network_domain: The network domain the rule belongs to\n        :type   network_domain: :class:`DimensionDataNetworkDomain`\n\n        :param  internal_ip: The IPv4 address internally\n        :type   internal_ip: ``str``\n\n        :param  external_ip: The IPv4 address externally\n        :type   external_ip: ``str``\n\n        :rtype: :class:`DimensionDataNatRule`\n        '
    create_node = ET.Element('createNatRule', {
        'xmlns': TYPES_URN,
    })
    ET.SubElement(create_node, 'networkDomainId').text = network_domain.id
    ET.SubElement(create_node, 'internalIp').text = internal_ip
    ET.SubElement(create_node, 'externalIp').text = external_ip
    result = self.connection.request_with_orgId_api_2('network/createNatRule', method='POST', data=ET.tostring(create_node)).object
    rule_id = None
    for info in findall(result, 'info', TYPES_URN):
        if (info.get('name') == 'natRuleId'):
            rule_id = create_node.get('value')
    return DimensionDataNatRule(id=rule_id, network_domain=network_domain, internal_ip=internal_ip, external_ip=external_ip, status=NodeState.RUNNING)

dataset/ETHPy150Open apache/libcloud/libcloud/compute/drivers/dimensiondata.py DimensionDataNodeDriver.ex_create_nat_rule/VarMisuse@137/363 `info`->`create_node`