Example #1
0
    def create_clones(self, task):
        # Set up ZFS and Target management
        zfs = ZFS()
        mgr = TargetManager()
        num_created = 0

        task.set_status_start_creating_clones()

        for arg in task.details['clones']:
            self.create_clone(zfs, arg)
            task.increment_num_clones()

        task.set_status_done_creating_clones()

        # Give udevd a chance to settle down and create associated devices
        task.set_status_start_waiting_udevd()
        zfs.udevd_settle_down()
        task.set_status_done_waiting_udevd()

        task.set_status_start_creating_targets()

        for arg in task.details['clones']:
            self.create_target(mgr, arg)
            task.increment_num_targets()
            task.increment_num_completed()

        task.set_status_done_creating_targets()
        mgr.save()
Example #2
0
    def create_clones(self, task):
        # Set up ZFS and Target management
        zfs = ZFS()
        mgr = TargetManager()
        num_created = 0

        task.set_status_start_creating_clones()

        for arg in task.details['clones']:
            self.create_clone(zfs, arg)
            task.increment_num_clones()

        task.set_status_done_creating_clones()

        # Give udevd a chance to settle down and create associated devices
        task.set_status_start_waiting_udevd()
        zfs.udevd_settle_down()
        task.set_status_done_waiting_udevd()

        task.set_status_start_creating_targets()

        for arg in task.details['clones']:
            self.create_target(mgr, arg)
            task.increment_num_targets()
            task.increment_num_completed()

        task.set_status_done_creating_targets()
        mgr.save()
Example #3
0
 def delete(self):
     try:
         zfs = ZFS()
         args = self.deleteParser.parse_args()
         self.deleteHandler(args)
     except (TypeError, ValueError, CommandError), e:
         return {'status': str(e)}, 501
Example #4
0
    def delete_clones(self, task):
        # Set up ZFS and Target management
        zfs = ZFS()
        mgr = TargetManager()

        task.set_status_start_deleting_targets()

        for arg in task.details['clones']:
            self.remove_target(mgr, arg)
            task.increment_num_clones()

        task.set_status_done_deleting_targets()

        task.set_status_start_deleting_clones()

        for arg in task.details['clones']:
            self.remove_clone(task, zfs, arg)
            task.increment_num_targets()
            task.increment_num_completed()

        task.set_status_done_deleting_clones()
        mgr.save()
Example #5
0
 def deleteHandler(self, args):
     zfs = ZFS()
     zfs.destroy(args)
Example #6
0
 def postHandler(self, args):
     zfs = ZFS()
     zfs.create(args)
Example #7
0
 def get(self):
     zfs = ZFS()
     return jsonify(zfs.attributes)
Example #8
0
 def get(self):
     zfs = ZFS()
     return jsonify(zfs.filesystems)
Example #9
0
 def get(self):
     zfs = ZFS()
     return jsonify(zfs.volumes)
Example #10
0
 def get(self):
     zfs = ZFS()
     return jsonify(zfs.snapshots)
Example #11
0
 def postHandler(self, args):
     zfs = ZFS()
     zfs.clone(args)
Example #12
0
 def postHandler(self, args):
     zfs = ZFS()
     zfs.snapshot(args)
Example #13
0
 def deleteHandler(self, args):
     zfs = ZFS()
     zfs.destroy(args)
Example #14
0
 def postHandler(self, args):
     zfs = ZFS()
     zfs.create(args)
Example #15
0
 def postHandler(self, args):
     zfs = ZFS()
     zfs.clone(args)
Example #16
0
 def postHandler(self, args):
     zfs = ZFS()
     zfs.snapshot(args)