'Constructor.
:keyword    id: Rule id.
:type       id: ``str``
:keyword    parent_group_id: ID of the parent security group.
:type       parent_group_id: ``str``
:keyword    ip_protocol: IP Protocol (icmp, tcp, udp, etc).
:type       ip_protocol: ``str``
:keyword    from_port: Port at start of range.
:type       from_port: ``int``
:keyword    to_port: Port at end of range.
:type       to_port: ``int``
:keyword    ip_range: CIDR for address range.
:type       ip_range: ``str``
:keyword    group: Name of a source security group to apply to rule.
:type       group: ``str``
:keyword    tenant_id: Owner of the security group.
:type       tenant_id: ``str``
:keyword    extra: Extra attributes associated with this rule.
:type       extra: ``dict``'

def __init__(self, id, parent_group_id, ip_protocol, from_port, to_port, driver, ip_range=None, group=None, tenant_id=None, extra=None):

    self.id = id
    self.parent_group_id = parent_group_id
    self.ip_protocol = ip_protocol
    self.from_port = from_port
    self.to_port = to_port
    self.driver = driver
    self.ip_range = ''
    self.group = {}
    if (group is None):
        self.ip_range = ip_range
    else:
        self.group = {'name': group, 'tenant_id': tenant_id}
    self.tenant_id = tenant_id
    self.extra = (extra or {})
