Esempio n. 1
0
 def test_next_link(self):
     """
     :func:`otter.indexer.next_link` finds the next link in the
     simple sample atom feed.
     """
     self.assertEqual(
         next_link(self.simple_atom),
         ('http://example.org/feed/?'
          'marker=urn:uuid:e5caea3a-188c-11e6-8692-acbc32badee9'))
Esempio n. 2
0
 def test_next_link(self):
     """
     :func:`otter.indexer.next_link` finds the next link in the
     simple sample atom feed.
     """
     self.assertEqual(
         next_link(self.simple_atom),
         ('http://example.org/feed/?'
          'marker=urn:uuid:e5caea3a-188c-11e6-8692-acbc32badee9')
     )
Esempio n. 3
0
def get_clb_node_feed(lb_id, node_id):
    """
    Get the atom feed associated with a CLB node.

    :param int lb_id: Cloud Load balancer ID
    :param int node_id: Node ID of in loadbalancer node

    :returns: Effect of ``list`` of atom entry :class:`Element`
    :rtype: ``Effect``
    """
    all_entries = []
    params = {}
    while True:
        feed_str = yield _node_feed_page(lb_id, node_id, params)
        feed = atom.parse(feed_str)
        entries = atom.entries(feed)
        if entries == []:
            break
        all_entries.extend(entries)
        next_link = atom.next_link(feed)
        if not next_link:
            break
        params = parse_qs(urlparse(next_link).query)
    yield do_return(all_entries)