Example #1
0
 def get_logs(self, context, filters=None, fields=None, sorts=None,
              limit=None, marker=None, page_reverse=False):
     """Return information for available log objects"""
     filters = filters or {}
     pager = base_obj.Pager(sorts, limit, page_reverse, marker)
     return log_object.Log.get_objects(context, _pager=pager, **filters)
Example #2
0
 def test_get_objects_sort_by_address_asc_using_pager(self):
     self._create_dnsnameservers()
     pager = obj_base.Pager(sorts=[('address', True)])
     objs = self._test_class.get_objects(self.context, _pager=pager)
     fields_sorted = sorted([obj['address'] for obj in self.obj_fields])
     self.assertEqual(fields_sorted, [obj.address for obj in objs])
Example #3
0
 def setUp(self):
     super(DNSNameServerObjectIfaceTestCase, self).setUp()
     self.pager_map[self._test_class.obj_name()] = (obj_base.Pager(
         sorts=[('order', True)]))
Example #4
0
 def setUp(self):
     super(SubnetObjectIfaceTestCase, self).setUp()
     self.pager_map[subnet.DNSNameServer.obj_name()] = (obj_base.Pager(
         sorts=[('order', True)]))
Example #5
0
 def get_ha_network(self, context, tenant_id):
     pager = base.Pager(limit=1)
     results = l3_hamode.L3HARouterNetwork.get_objects(context,
                                                       _pager=pager,
                                                       project_id=tenant_id)
     return results.pop() if results else None
Example #6
0
 def setUp(self):
     super(NetworkObjectIfaceTestCase, self).setUp()
     self.pager_map[network.NetworkSegment.obj_name()] = (
         obj_base.Pager(
             sorts=[('network_id', True), ('segment_index', True)]))