def get_port_for_ip_address(context, ip_id, id, fields=None):
LOG.info("<STR_LIT>" %<EOL>(id, context.tenant_id, fields))<EOL>addr = db_api.ip_address_find(context, id=ip_id, scope=db_api.ONE)<EOL>if not addr:<EOL><INDENT>raise q_exc.IpAddressNotFound(addr_id=ip_id)<EOL><DEDENT>filters = {'<STR_LIT>': [ip_id]}<EOL>results = db_api.port_find(context, id=id, fields=fields,<EOL>scope=db_api.ONE, **filters)<EOL>if not results:<EOL><INDENT>raise n_exc.PortNotFound(port_id=id)<EOL><DEDENT>return v._make_port_for_ip_dict(addr, results)<EOL>
Retrieve a port.

    : param context: neutron api request context
    : param id: UUID representing the port to fetch.
    : param fields: a list of strings that are valid keys in a
        port dictionary as listed in the RESOURCE_ATTRIBUTE_MAP
        object in neutron/api/v2/attributes.py. Only these fields
        will be returned.