HttpJsonClient#
- class drms.HttpJsonClient(server='jsoc')[source]#
Bases:
object
HTTP/JSON communication with the DRMS server CGIs.
- Parameters:
server (str or drms.config.ServerConfig) – Registered server ID or ServerConfig instance. Defaults to JSOC.
Attributes Summary
Methods Summary
check_address
(email)Check if an email address is registered for export data requests.
exp_request
(*args, **kwargs)Request data export.
exp_status
(requestid)Query data export status.
rs_list
(ds, *[, key, seg, link, recinfo, n, uid])Get detailed information about a record set.
rs_summary
(ds)Get summary (i.e. count) of a given record set.
series_struct
(ds)Get information about the content of a data series.
show_series
([ds_filter])List available data series.
show_series_wrapper
([ds_filter, info])List available data series.
Attributes Documentation
- server#
Methods Documentation
- exp_request(*args, **kwargs)[source]#
Request data export.
- Parameters:
ds (str) – Data export record set query.
notify (str) – Registered email address.
method (str) – Export method. Supported methods are: ‘url_quick’, ‘url’, and ‘url-tar’. Default is ‘url_quick’.
protocol (str) – Export protocol. Supported protocols are: ‘as-is’, ‘fits’, ‘jpg’, ‘mpg’ and ‘mp4’. Default is ‘as-is’.
protocol_args (dict or None) – Extra protocol arguments for protocols ‘jpg’, ‘mpg’ and ‘mp4’. Valid arguments are: ‘ct’, ‘scaling’, ‘min’, ‘max’ and ‘size’.
filenamefmt (str, None) – Custom filename format string for exported files. This is ignored for ‘url_quick’/’as-is’ data exports.
process (
dict
, None) – Dictionary of processing commands. Each entry is also adict
containing all of the applicable options for that processing command.n (int or None) – Limits the number of records requested. For positive values, the first n records of the record set are returned, for negative values the last abs(n) records. If set to None (default), no limit is applied.
requester (str, None or bool) – Export user ID. Default is None, in which case the user name is determined from the email address. If set to False, the requester argument will be omitted in the export request.
- Returns:
result – Dictionary containing the server response to the export request.
- Return type:
- rs_list(ds, *, key=None, seg=None, link=None, recinfo=False, n=None, uid=None)[source]#
Get detailed information about a record set.
- Parameters:
ds (str) – Record set query.
key (str, list or None) – List of requested keywords, optional.
seg (str, list or None) – List of requested segments, optional.
link (str or None) – List of requested Links, optional.
recinfo (bool) – Request record info for each record in the record set.
n (int or None) – Record set limit. For positive values, the first n records of the record set are returned, for negative values the last abs(n) records. If set to None (default), no limit is applied.
uid (str or None) – Session ID used when calling rs_list CGI, optional.
- Returns:
result – Dictionary containing the requested record set information.
- Return type: