@classmethod
def list_by_node_id(cls, context, node_id, limit=None, marker=None,
    sort_key=None, sort_dir=None, owner=None):
    """Return a list of Port objects associated with a given node ID.

        :param context: Security context.
        :param node_id: the ID of the node.
        :param limit: maximum number of resources to return in a single result.
        :param marker: pagination marker for large data sets.
        :param sort_key: column to sort results by.
        :param sort_dir: direction to sort. "asc" or "desc".
        :param owner: a node owner to match against
        :returns: a list of :class:`Port` object.

        """
    db_ports = cls.dbapi.get_ports_by_node_id(node_id, limit=limit, marker=
        marker, sort_key=sort_key, sort_dir=sort_dir, owner=owner)
    return cls._from_db_object_list(context, db_ports)
