Beispiel #1
0
 def get_all(cls, context, search_opts, marker=None, limit=None,
             sort_keys=None, sort_dirs=None, offset=None):
     snapshots = db.snapshot_get_all(context, search_opts, marker, limit,
                                     sort_keys, sort_dirs, offset)
     expected_attrs = Snapshot._get_expected_attrs(context)
     return base.obj_make_list(context, cls(context), objects.Snapshot,
                               snapshots, expected_attrs=expected_attrs)
Beispiel #2
0
 def get_all(cls, context, search_opts):
     snapshots = db.snapshot_get_all(context, search_opts)
     return base.obj_make_list(context,
                               cls(),
                               objects.Snapshot,
                               snapshots,
                               expected_attrs=['metadata'])
Beispiel #3
0
    def get_all(cls, context, filters, marker=None, limit=None,
                sort_keys=None, sort_dirs=None, offset=None):
        """Get all snapshot given some search_opts (filters).

        Special filters accepted are host and cluster_name, that refer to the
        volume's fields.
        """
        snapshots = db.snapshot_get_all(context, filters, marker, limit,
                                        sort_keys, sort_dirs, offset)
        expected_attrs = Snapshot._get_expected_attrs(context)
        return base.obj_make_list(context, cls(context), objects.Snapshot,
                                  snapshots, expected_attrs=expected_attrs)
Beispiel #4
0
    def get_all(cls, context, search_opts, marker=None, limit=None,
                sort_keys=None, sort_dirs=None, offset=None):
        """Get all snapshot given some search_opts (filters).

        Special search options accepted are host and cluster_name, that refer
        to the volume's fields.
        """
        snapshots = db.snapshot_get_all(context, search_opts, marker, limit,
                                        sort_keys, sort_dirs, offset)
        expected_attrs = Snapshot._get_expected_attrs(context)
        return base.obj_make_list(context, cls(context), objects.Snapshot,
                                  snapshots, expected_attrs=expected_attrs)
 def get_all(cls,
             context,
             search_opts,
             marker=None,
             limit=None,
             sort_keys=None,
             sort_dirs=None,
             offset=None):
     snapshots = db.snapshot_get_all(context, search_opts, marker, limit,
                                     sort_keys, sort_dirs, offset)
     return base.obj_make_list(context,
                               cls(),
                               objects.Snapshot,
                               snapshots,
                               expected_attrs=['metadata'])
Beispiel #6
0
 def test_snapshot_get_all(self):
     db.volume_create(self.ctxt, {'id': 1})
     snapshot = db.snapshot_create(self.ctxt, {'id': 1, 'volume_id': 1})
     self._assertEqualListsOfObjects([snapshot],
                                     db.snapshot_get_all(self.ctxt),
                                     ignored_keys=['metadata', 'volume'])
Beispiel #7
0
 def get_all(cls, context, search_opts):
     snapshots = db.snapshot_get_all(context, search_opts)
     return base.obj_make_list(context, cls(), objects.Snapshot,
                               snapshots,
                               expected_attrs=['metadata'])
Beispiel #8
0
 def test_snapshot_get_all(self):
     db.volume_create(self.ctxt, {'id': 1})
     snapshot = db.snapshot_create(self.ctxt, {'id': 1, 'volume_id': 1})
     self._assertEqualListsOfObjects([snapshot],
                                     db.snapshot_get_all(self.ctxt),
                                     ignored_keys=['metadata', 'volume'])
Beispiel #9
0
 def test_snapshot_get_all(self):
     db.volume_create(self.ctxt, {"id": 1})
     snapshot = db.snapshot_create(self.ctxt, {"id": 1, "volume_id": 1})
     self._assertEqualListsOfObjects([snapshot], db.snapshot_get_all(self.ctxt), ignored_keys=["metadata", "volume"])
Beispiel #10
0
 def get_all(cls, context):
     snapshots = db.snapshot_get_all(context)
     return base.obj_make_list(context, cls(), objects.Snapshot, snapshots, expected_attrs=["metadata"])