federation_url

requests_pelican.federation.federation_url(url)

Parse a federation discovery URL from a federation name or a Pelican URL.

This function just matches known federation names and returns their cached discovery URL, otherwise returns the input unmodified.

Parameters

urlstr

The URL to parse, or the common name of a known federation.

Returns

fedurlstr

The federation URL of the known federation.

Examples

>>> federation_url("osdf")
'osg-htc.org'
>>> federation_url("osdf:///igwn/ligo/README")
'osg-htc.org'
>>> federation_url("pelican://osg-htc.org/igwn/ligo/README")
'osg-htc.org'
>>> federation_url("my-federation.org")
'my-federation.org'
>>> federation_url("pelican://my-federation.org/igwn/ligo/README")
'my-federation.org'