find_url

gwdatafind.find_url(
framefile,
urltype='file',
on_missing='error',
host=None,
api='v1',
session=None,
**request_kw,
)

Query a GWDataFind host for the URL of a single filename.

Parameters:
  • framefile (str) – the name of the file to match; note that only the basename of the file is relevant.

  • urltype (str, optional) – URL scheme to search for

  • on_missing (str, optional) –

    what to do when the requested file isn’t found, one of:

    • 'error': raise a RuntimeError

    • 'warn': print a warning but return an empty list

    • 'ignore': return an empty list with no warnings

  • host (str, optional) – the URL/name of the GWDataFind host to query; if not given get_default_host() will be used to discover the default host.

  • api (str, optional) – The API version to use. Defaults to the value of the GWDATAFIND_API environment variable, or "v1" if not set.

  • session (requests.Session, optional) – the connection session to use; if not given, a igwn_auth_utils.Session will be created on-the-fly

  • token – passed directly to igwn_auth_utils.Session, see SciTokens for more details.

  • token_audience – passed directly to igwn_auth_utils.Session, see SciTokens for more details.

  • token_scope – passed directly to igwn_auth_utils.Session, see SciTokens for more details.

  • cert – passed directly to igwn_auth_utils.Session, see X.509 for more details.

  • request_kw – other keywords are passed to igwn_auth_utils.get()

Returns:

urls (list of str) – a list of URLs for all instances of filename

Raises: