Differences between revisions 42 and 45 (spanning 3 versions)
Revision 42 as of 2010-01-01 01:21:14
Size: 31900
Editor: solpc
Comment:
Revision 45 as of 2010-01-01 02:43:08
Size: 33851
Editor: solpc
Comment:
Deletions are marked like this. Additions are marked like this.
Line 33: Line 33:
{ - need to add keywords for export method (URL, tape, etc) and export function requested (i.e. convert to fits, rebin, extract, etc.)}
Line 41: Line 40:
 * The [http://www.qdecoder.org/ qDecoder] library is used to support cgi-bin programs for GET and POST processing.
Line 42: Line 42:
The operations now supported are:

 * series_list -- Implemented within "show_series". Expects a single parameter "filter" which is used in regex to limit the number of seriesnames returned. See the man page for show_series. If e.g. all series with the word "mdi" are desired then the URL will be: http://jsoc.stanford.edu/cgi-bin/ajax/show_series?filter=mdi
 * series_struct -- Implemented in jsoc_info. Expects parameters as described below. Example URL for e.g. the series mdi.vw_V_lev18 is: http://jsoc.stanford.edu/cgi-bin/ajax/jsoc_info?op=series_struct&ds=mdi.vw_V_lev18 which returns the JSON version of the information in the shell commands "show_info -l mdi.vw_V_lev18" and "show_info -s mdi.vw_V_lev18" combined.
 * rs_summary -- Implemented in jsoc_info. Expects parameters as below. Example URL is http://jsoc.stanford.edu/cgi-bin/ajax/jsoc_info?op=rs_summary&ds=mdi.vw_V_lev18
 * rs_list -- Implemented in jsoc_info. Expects parameters as below. The lookdata call limits the recordset to 10,000 records. The present implementation can take a minute or more for 10,000 records. Use care. This and following functions expect an explicit recordset query which will resolve to a subset of the records in the given series. The example URL here returns a few keywords for 5 minutes (5 records) from the mdi.vw_V_lev18 data.
{{{

The operations now supported at http://jsoc.stanford.edu/cgi-bin/ajax are:

 * Implemented via show_series
  * series_list -- Implemented within "show_series". Expects a single parameter "filter" which is used in regex to limit the number of seriesnames returned. See the man page for show_series. If e.g. all series with the word "mdi" are desired then the URL will be: {{{ http://jsoc.stanford.edu/cgi-bin/ajax/show_series?filter=mdi%5C. }}}
 * Implemented via jsoc_info
  * series_struct -- Like "show_info -l -s" Example URL for e.g. the series mdi.vw_V_lev18 is: {{{ http://jsoc.stanford.edu/cgi-bin/ajax/jsoc_info?op=series_struct&ds=mdi.vw_V_lev18 }}} which returns the JSON version of the information in the shell commands "show_info -l mdi.vw_V_lev18" and "show_info -s mdi.vw_V_lev18" combined.
  * rs_summary -- Implemented in jsoc_info. Example URL is {{{ http://jsoc.stanford.edu/cgi-bin/ajax/jsoc_info?op=rs_summary&ds=mdi.vw_V_lev18 }}} At present returns first and last record information.
  * rs_list -- Implemented in jsoc_info. Functions similar to the shell command "show_info" to get dataseries record attributes.
 * Implemented via jsoc_fetch
  * exp_request -- Primary data export request tool. Expects a recordset specification and desired export method. Exported data will be either delivered immediately or kept online for 7 days depending on calling parameters and online status of the data. If a the data is not immediately available a "RequestID" is returned to the user for later access to the exported data.
  * exp_repeat -- Repeats the request for an expired (export data package is gone after 7 days). Expects RequestID.
  * exp_status -- Checks on status of prior request, expects RequestID.
  * exp_su -- Special tool for export of SUMS "Storage Units" to remote DRMS sites.

The details are below, but some examples here may help.
The lookdata call limits the recordset to 10,000 records. The present implementation can take a minute or more for 10,000 records. Use care. This and following functions expect an explicit recordset query which will resolve to a subset of the records in the given series.

The example URL here returns a few keywords for 5 minutes (5 records) from the mdi.vw_V_lev18 data. {{{
Line 50: Line 62:
}}}
Note the excape characters for URL encoding: '[' to '%5B', ']' to '%5D', '/' to %2F, ',' to '%2C' etc.

== Draft Implementation Plan ==
One of the access tools to initiate an export will be a set of web cgi-bin modules using get and post methods. These will allow simple browser access via direct html, javascript, or shell access via wget. Later we may use higher level tools such as GWT to build more capable interfaces.

These web modules will communicate using the JSON protocols (the functionality of a stripped down XML) and later XML if needed. These are not expected to be directly usable browser tools, they are components to be used by web pages to be provided separately.

To support exports several related functions are needed:

 * There will be a function to write a fits file from a record a jsoc.exports segment.
 * There will be a way to generate usable filenames that identify the data by
  . series, record, and segment.
== Draft suggestion for JSOC cgi-bin export programs ==
A set of basic operations is needed to allow identification of series, lists and meaning of keyword metadata in those series, the range of date present, etc. Another set of operations is needed to allow access to keyword values and direct access to the files containing the buld of the data. These could be operations in a single program with an "opcode" first parameter as shown here or perhaps as several separate programs with a single purpose for each. In the draft implementation several server-side programs have been implemented.
}}} Note the excape characters for URL encoding: '[' to '%5B', ']' to '%5D', '/' to %2F, ',' to '%2C' etc. The return json text from this query, with white space added, is: {{{{
  "keywords":[{"name":"DATAMEAN",
               "values":["321.424972",
                         "320.428355",
                         "320.296396",
                         "319.591784",
                         "320.101514"] },
              {"name":"T_OBS",
               "values":["1996.05.01_00:01:00_TAI",
                         "1996.05.01_00:02:00_TAI",
                         "1996.05.01_00:03:00_TAI",
                         "1996.05.01_00:04:00_TAI",
                         "1996.05.01_00:05:00_TAI"] } ],
  "segments":[],
  "links":[],
  "count":5,
  "status":0
} }}}

Note that the same query can be made to the shell command, 'show_info' which is also available as a cgi-bin call alongside jsoc_info. Show_info returns text while jsoc_info returns json. In this example "wget" is used to get the response as plain text in the file "pt"
{{{
wget -O pt 'http://jsoc.stanford.edu/cgi-bin/ajax/show_info?ds=mdi.vw_V_lev18%5B1996.05.01%2F5m%5D&key=DATAMEAN%2CT_OBS'
}}}
with the response in pt:
{{{
DATAMEAN T_OBS
321.424972 1996.05.01_00:01:00_TAI
320.428355 1996.05.01_00:02:00_TAI
320.296396 1996.05.01_00:03:00_TAI
319.591784 1996.05.01_00:04:00_TAI
320.101514 1996.05.01_00:05:00_TAI
}}}

The prototype access web tool "http://jsoc.stanford.edu/ajax/lookdata.html" uses show_series and jsoc_info. The prototype export tool "http://jsoc.stanford.edu/ajax/exportdata.html" uses jsoc_fetch. Development versions, sometimes not even 'beta' level and possibly unstable, but possibly useful are lookdata2.html and exportdata2.html.

NOTE: The browser tools lookdata.html and exportdata.html are intended to work with standards compliant browsers. Functionality with non-standards based browsers, e.g. IE, will be nice but accidental.
== Implementation Plan ==
One of the access tools to initiate an export are a set of web cgi-bin modules using get and post methods. These allow simple browser access via direct html, javascript, or shell access via wget or curl.

These web accessible modules communicate using the JSON protocols (the functionality of a stripped down XML) and later XML if needed. These are not expected to be directly usable browser tools, they are components to be used by web pages provided separately, e.g. lookdata.html.

== JSOC cgi-bin export programs ==
A set of basic operations to allow identification of series, lists and meaning of keyword metadata in those series, the range of dates present, etc. is now available. Another set of operations needed to allow access to keyword values and direct access to the files containing the bulk of the data are alos functional. These are built as operations with an "opcode" first parameter as shown and implemented via several cgi-bin programs.
Line 67: Line 107:
The basic idea is that the user (here meaning browser javascript or shell script wget calls) will make a sequence of requests to build up a fully specified JSOC DRMS "record set" query. Then that query will be used to fetch some desired data or metadata. If only metadata is needed, the response will be "immediate". If file data is needed and is online then the request can also be provided immediately. If the online status is not known or is known to be offline then an export request can be submitted, a RequestID returned to the user, then that RequestID can be used in subsequent polling to determine when the data is actually available and to get the link for data access. In both the immediate and request-respond methods the data will in the end be provided via a URL.  At the beginning only http access can be used to fetch the data. At a later date sftp access should also be available. Also, at some later date alternate delivery methods will be provided for large requests. The basic idea is that the user (here meaning browser javascript or shell script wget calls) will make a sequence of requests to build up a fully specified JSOC DRMS "record set" query. Then that query will be used to fetch some desired data or metadata. If only metadata is needed, the response will be "immediate". If file data is needed and is online then the request can also be provided immediately. If the online status is not known or is known to be offline then an export request can be submitted, a RequestID is returned to the user, then that RequestID can be used in subsequent polling to determine when the data is actually available and to get the link for data access. In both the immediate and request-respond methods the data will in the end be provided via a URL or FTP address.
Line 70: Line 110:

Under certain modes (ie., op=exp_su), jsoc_fetch will accept either HTTP GET or HTTP POST requests. Handling of the latter type of requests was implemented using API calls into the qDecoder library.
Line 77: Line 115:
Each of these commands can be executed locally, via a browser presumably from a Javascript

 .
program, or via "wget" or similar program.
Each of these commands can be executed locally, via a browser presumably from a Javascript program, or via "wget" or similar program.

AJAX Interface for JSOC

Plan:

  • Implement basic access to keywords and segment information via CGI-BIN GET and POST server programs to allow Javascript access to basic JSOC functions.
  • Provide basic browser side html to demonstrate capability and serve as a starting point for simple use and development.
  • Publish the spec for the interface to allow others to build better Client-side tools.

Overview of Export Management

Exports will be managed in the series jsoc.exports Each request will be given a RequestID which can be used to track status. Data to be exported can be requested via several methods. The data requested will be collected (e.g. tar) and placed in a data segment in a record in jsoc.exports. It will be exported (i.e. picked up by the requestor) directly from the SUMS directory.

Series: jsoc.exports will not be archived and retention time of 7 days. Thus the Requestor will have one week to fetch the data. The export record will be retained for a history log of exports.

The jsoc.exports series looks like:

P% show_info jsoc.exports -l
Prime Keys are:
        RequestID
DB Index Keys are:
        RequestID
All Keywords for series jsoc.exports:
        DataSet         (string)        Dataset requested
        ExpTime         (time)  Time of export
        FilenameFmt     (string)        File basname format
        Format          (int)   Data format code
        Notify          (string)        Notification address
        ReqTime         (time)  Time of request
        RequestID       (int)   Export request identifier
        Requestor       (string)        Name of requestor
        Size            (int)   Volume of data requested
        Status          (int)   Status of request
Segments for series jsoc.exports:
        Data                 NA generic VAR     Exported data

Status of prototype implementation of the draft plan

Many of the functions described below are now implemented in series_info and in a new module called jsoc_info which has heritage in show_info but emits JSON responses. Several open-source tools have been used in developing jsoc_info as well as http://jsoc.stanford.edu/ajax/lookdata.html which is a test client-side javascript code to use jsoc_info. These include:

The operations now supported at http://jsoc.stanford.edu/cgi-bin/ajax are:

  • Implemented via show_series
    • series_list -- Implemented within "show_series". Expects a single parameter "filter" which is used in regex to limit the number of seriesnames returned. See the man page for show_series. If e.g. all series with the word "mdi" are desired then the URL will be:  http://jsoc.stanford.edu/cgi-bin/ajax/show_series?filter=mdi%5C. 

  • Implemented via jsoc_info
    • series_struct -- Like "show_info -l -s" Example URL for e.g. the series mdi.vw_V_lev18 is:   http://jsoc.stanford.edu/cgi-bin/ajax/jsoc_info?op=series_struct&ds=mdi.vw_V_lev18  which returns the JSON version of the information in the shell commands "show_info -l mdi.vw_V_lev18" and "show_info -s mdi.vw_V_lev18" combined.

    • rs_summary -- Implemented in jsoc_info. Example URL is  http://jsoc.stanford.edu/cgi-bin/ajax/jsoc_info?op=rs_summary&ds=mdi.vw_V_lev18  At present returns first and last record information.

    • rs_list -- Implemented in jsoc_info. Functions similar to the shell command "show_info" to get dataseries record attributes.
  • Implemented via jsoc_fetch
    • exp_request -- Primary data export request tool. Expects a recordset specification and desired export method. Exported data will be either delivered immediately or kept online for 7 days depending on calling parameters and online status of the data. If a the data is not immediately available a "RequestID" is returned to the user for later access to the exported data.
    • exp_repeat -- Repeats the request for an expired (export data package is gone after 7 days). Expects RequestID.
    • exp_status -- Checks on status of prior request, expects RequestID.
    • exp_su -- Special tool for export of SUMS "Storage Units" to remote DRMS sites.

The details are below, but some examples here may help. The lookdata call limits the recordset to 10,000 records. The present implementation can take a minute or more for 10,000 records. Use care. This and following functions expect an explicit recordset query which will resolve to a subset of the records in the given series.

The example URL here returns a few keywords for 5 minutes (5 records) from the mdi.vw_V_lev18 data.

http://jsoc.stanford.edu/cgi-bin/ajax/jsoc_info_test?ds=mdi.vw_V_lev18%5B1996.05.01%2F5m%5D&op=rs_list&key=DATAMEAN%2CT_OBS

Note the excape characters for URL encoding: '[' to '%5B', ']' to '%5D', '/' to %2F, ',' to '%2C' etc. The return json text from this query, with white space added, is:

JsocWiki: AjaxJsocConnect (last edited 2022-08-23 02:53:50 by PhilScherrer)