예제 #1
0
파일: views.py 프로젝트: AthinaB/synnefo
def delete_snapshot(request, snapshot_id):
    log.debug("delete_snapshot snapshot_id: %s", snapshot_id)

    snapshot = util.get_snapshot(request.user_uniq, snapshot_id)
    snapshots.delete(snapshot)

    return HttpResponse(status=202)
예제 #2
0
def delete_snapshot(request, snapshot_id):
    log.debug("delete_snapshot snapshot_id: %s", snapshot_id)

    snapshot = util.get_snapshot(request.user_uniq, snapshot_id)
    snapshots.delete(snapshot)

    return HttpResponse(status=202)
예제 #3
0
파일: views.py 프로젝트: kpelelis/synnefo
def delete_snapshot(request, snapshot_id):
    util.assert_snapshots_enabled(request)
    log.debug("User: %s, Snapshot: %s Action: delete", request.user_uniq,
              snapshot_id)

    snapshot = util.get_snapshot(request.user_uniq, snapshot_id)
    snapshots.delete(snapshot)

    log.info("User %s deleted snapshot %s", request.user_uniq, snapshot["id"])

    return HttpResponse(status=202)
예제 #4
0
파일: views.py 프로젝트: grnet/synnefo
def delete_snapshot(request, snapshot_id):
    credentials = request.credentials
    util.assert_snapshots_enabled(request)
    log.debug("User: %s, Snapshot: %s Action: delete",
              credentials.userid, snapshot_id)

    snapshot = util.get_snapshot(credentials.userid, snapshot_id)
    snapshots.delete(snapshot)

    log.info("User %s deleted snapshot %s", credentials.userid, snapshot["id"])

    return HttpResponse(status=202)
예제 #5
0
    def handle(self, *args, **options):
        if not args:
            raise CommandError("Please provide a snapshot ID")

        force = options['force']
        message = "snapshots" if len(args) > 1 else "snapshot"
        self.confirm_deletion(force, message, args)
        userid = options["user"]

        for snapshot_id in args:
            self.stdout.write("\n")
            try:
                snapshot = util.get_snapshot(userid, snapshot_id)

                snapshots.delete(snapshot)
                self.stdout.write("Successfully removed snapshot %s\n"
                                  % snapshot_id)
            except CommandError as e:
                self.stdout.write("Error -- %s\n" % e.message)
예제 #6
0
    def handle(self, *args, **options):
        if not args:
            raise CommandError("Please provide a snapshot ID")

        force = options['force']
        message = "snapshots" if len(args) > 1 else "snapshot"
        self.confirm_deletion(force, message, args)
        userid = options["user"]

        for snapshot_id in args:
            self.stdout.write("\n")
            try:
                snapshot = util.get_snapshot(userid, snapshot_id)

                snapshots.delete(snapshot)
                self.stdout.write("Successfully removed snapshot %s\n" %
                                  snapshot_id)
            except CommandError as e:
                self.stdout.write("Error -- %s\n" % e.message)