Closed belforte closed 9 years ago
Tony's instructions for the new API:
*\ Discussion title: Computing Operations
Hi,
as discussed in the meeting today I've extended the API:
the return structure is a hash of (node,protocol,sename) triplets.
Examples: wget --no-check-certificate -O - 'https://phedex-web-dev.cern.ch/phedex/datasvc/perl/prod/senames?sename=eoscms' wget --no-check-certificate -O - 'https://phedex-web-dev.cern.ch/phedex/datasvc/perl/prod/senames?sename=eoscms&node=T1_CH_CERN_MSS' wget --no-check-certificate -O - 'https://phedex-web-dev.cern.ch/phedex/datasvc/perl/prod/senames?sename=eoscms&node=T1_CH_CERN_MSS&protocol=rfio' wget --no-check-certificate -O - 'https://phedex-web-dev.cern.ch/phedex/datasvc/perl/prod/senames?node=T1_CH_CERN_MSS'
Cases of non-matching arguments are handled in ways that now look a bit odd:
a non-matching protocol returns an array with one entry for that protocol, with the 'node' and 'sename' undefined (or HTTP error 400, if the protocol name is malformed)
Examples: wget --no-check-certificate -O - 'https://phedex-web-dev.cern.ch/phedex/datasvc/perl/prod/senames?sename=no-such-sename' wget --no-check-certificate -O - 'https://phedex-web-dev.cern.ch/phedex/datasvc/perl/prod/senames?node=T3_NO_SUCH_NODE' wget --no-check-certificate -O - 'https://phedex-web-dev.cern.ch/phedex/datasvc/perl/prod/senames?protocol=nosuchprotocol'
Suggestions on how to improve on that are welcome. Adopting the style for 'protocol=nosuchprotocol' for the other arguments, or their combinations, is one option, but if all three arguments are given that breaks down. An alternative is to return a triplet in which unset parameters are 'undef', and set-but-not-matched parameters are returned as 'unmatched', or something similar?
Cheers, Tony.
Visit this CMS message (to reply or unsubscribe) at: https://hypernews.cern.ch/HyperNews/CMS/get/comp-ops/1710/2/1/1.html
see small discussion at https://github.com/dmwm/CRAB2/issues/927#issuecomment-51933468