File indexing completed on 2026-11-09 10:47:31
0001 """Remove datasets from one disk RSE (swf-epicprod docs/STORAGE.md,
0002 Removing datasets from an RSE), reached from the Storage doors page.
0003
0004 The page computes nothing and holds no credential: it posts a pattern,
0005 the production operations agent previews it against the live catalog,
0006 and a typed confirmation queues the removal of what the preview found
0007 eligible. Acting is for the operations role on the internal monitor. The
0008 RSE's previews and removals are listed below the form from the action
0009 stream, the record that stands (panda/rse_deletions.py).
0010 """
0011 from django.http import Http404
0012 from django.shortcuts import render
0013
0014 from monitor_app.middleware import is_tunnel_request
0015
0016
0017 def panda_rse_deletion(request, rse):
0018 from swf_epicprod.rse_deletion import DISK_RSES, TAPE_RSE
0019 from monitor_app.authority import get_authority, is_ops
0020 from monitor_app.panda.rse_deletions import recent
0021 if rse not in DISK_RSES:
0022 raise Http404(f'{rse} is not a production disk RSE')
0023 signed_in = request.user.is_authenticated
0024 ops = signed_in and is_ops(get_authority(request.user.username))
0025 return render(request, 'monitor_app/panda_rse_deletion.html', {
0026 'rse': rse,
0027 'tape_rse': TAPE_RSE,
0028 'recent': recent(rse),
0029 'is_ops': ops,
0030 'can_act': ops and not is_tunnel_request(request),
0031 'active_nav': {'panda_storage_doors': True},
0032 })