コード例 #1
0
ファイル: snapshot.py プロジェクト: C2python/cinder
 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)
コード例 #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'])
コード例 #3
0
ファイル: snapshot.py プロジェクト: j-griffith/cinder
    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)
コード例 #4
0
ファイル: snapshot.py プロジェクト: liuhaijie/cinder
    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)
コード例 #5
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)
     return base.obj_make_list(context,
                               cls(),
                               objects.Snapshot,
                               snapshots,
                               expected_attrs=['metadata'])
コード例 #6
0
ファイル: test_db_api.py プロジェクト: medlefsen/cinder
 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'])
コード例 #7
0
ファイル: snapshot.py プロジェクト: rahul4-jain/cinder
 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'])
コード例 #8
0
ファイル: test_db_api.py プロジェクト: afliu/cinder
 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'])
コード例 #9
0
ファイル: test_db_api.py プロジェクト: AsherBond/cinder
 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"])
コード例 #10
0
ファイル: snapshot.py プロジェクト: simplivity/cinder
 def get_all(cls, context):
     snapshots = db.snapshot_get_all(context)
     return base.obj_make_list(context, cls(), objects.Snapshot, snapshots, expected_attrs=["metadata"])