dmwm / PHEDEX

CMS data-placement suite
8 stars 18 forks source link

Add "Unsubscribe dataset" API for datasvc and webpage #887

Open ericvaandering opened 10 years ago

ericvaandering commented 10 years ago

Original Savannah ticket 94395 reported by None on Mon May 7 12:10:28 2012.

Hi,

the PHEDEX_4_X schema and agents support the possibility to "unsubscribe" a dataset, removing the growing dataset-level subscription but keeping all existing block-level subscriptions. This can be used to prevent new data from flowing in, without deleting already transferred data.

However, the datasvc and website were never updated to support this feature. Since CompOps has a use-case for this, I'm now opening an official feature request.

There are two possible ways to implement this:

First possibility:

1) Implement an "unsubscribe" API, taking as argument "dataset" and "node" ("block" not allowed). This API simply uses the following method to remove the subscription PHEDEX::RequestAllocator::Core::deleteSubscription

2) Add a new "unsubscribe dataset" action to the "Action" menu on the Data::Subscriptions page. This action invokes the "unsubscribe" datasvc API for the selected dataset subscriptions.

Pros: could be implemented now, with just a datasvc and website upgrade Cons: the "unsubscribe" action would only be tracked in the datasvc logs, not in the DB. It would be difficult to understand a-posteriori why the dataset-level subscription turned into a block-level subscription.

Second possibility:

1) Implement a new request type "unsubscribe". This requires an extension of the request schema. It could be a new subtype of deletion request, or a completely new type of request.

2) Implement new API and webpage to create "unsubscribe" type requests. The "unsubscribe" API would take "node", "data", "no_mail", "comments" as arguments (with the same meaning as in the "subscribe" and "delete" APIs).

3) Change the "updateRequest" API, adding a new action for the approval of "unsubscribe" type requests. On approval, the API should call PHEDEX::RequestAllocator::Core::deleteSubscriptionsForRequest

3) In the Data::Subscriptions page, add a new "unsubscribe these datasets" action to the "Action" menu. This action will open a new page Data::BulkUnsubscribe similar to Data::BulkDelete. On confirmation, the page will send "unsubscribe" type requests for all selected datasets.

Pros: "unsubscribe" actions will be fully logged in the DB Cons: requires a schema update and many more APIs

Cheers Nicolo'

ericvaandering commented 10 years ago

Comment by wildish on Mon Nov 5 10:02:04 2012

this should be revisited in the light of the new Generalised Requests project, it's an interesting candidate.