Server Interfaces

Client interface / telnet

CAPS provides a line based client interface for requesting data and showing available streams. The telnet command may be used to connect to the server:

telnet localhost 18002

The following commands are supported by the server:

  • HELLO - prints server name and version
  • HELP prints descriptive help
  • BYE - disconnects from server
  • AUTH <user> <password> - performs authentication
  • INFO STREAMS [stream id filter] - lists available streams and time spans, see section ref{sec:ci_info_streams}
  • BEGIN REQUEST - starts a request block, followed by request parameters, see section ref{sec:ci_request}
    • REALTIME ON|OFF - enables/disables real-time mode, if disabled the connection is closed if all archive data was sent
    • STREAM ADD|REMOVE <NET.STA.LOC.CHA> - adds/removes a stream from the request, may be repeated in one request block
    • TIME [<starttime>]:[endtime] - defines start and end time of the request, open boundaries are allowed
  • END - finalizes a request and starts acquisition
  • PRINT REQUESTS - prints active request of current session

Requests to server are separated by a new line. For the response data the server prepends the message length to the data. In this way non ASCII characters or binary content can be returned.

List available streams

The following example shows a telnet conversation of a request for available streams. The first line contains the request command. All other lines represent the server response. The response is 124 characters long. The length parameter is interpreted by telnet and converted to its ASCII representation, in this case: |.

1
2
3
4
5
INFO STREAMS VZ.HILO.*
|STREAMS
VZ.HILO.WLS.CAM 2013-07-26T00:00:01 2013-08-02T09:28:17
VZ.HILO.WLS.SSH 2008-06-06T00:00:00 2013-08-02T09:04:00
END

Data requests

Data request are initiated by a request block which defines the stream and the time span to fetch.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
BEGIN REQUEST
REALTIME OFF
STREAM ADD VZ.HILO.WLS.SSH
TIME 2013,08,02,09,00,02:
END
DSTATUS OK
SESSION_TABLE VERSION:1
PACKET_HEADER IDSIZE:2,DATASIZE:4
FREQUESTS
ID:1,SID:VZ.HILO.WLS.SSH,SFREQ:1/60,UOM:mm,FMT:RAW/FLOAT
END
[unprintable data]
'REQUESTS
ID:-1,SID:VZ.HILO.WLS.SSH
END
�EOD

The listing above shows such a request block in lines 1-5. Line 2 disables the real-time mode which will close the session after all data was read. Line 3 adds the stream to the request set. More streams may be added in successive lines. Line 4 specifies a start time and an open end time.

The first response chunk starts at line 6 and ends at line 11. I has a length of 68 byte (= ACCII D) and contains version information and a session table. The table maps a 2 byte integer id to data stream meta information. In this way following data chunks can be distinguished by only 2 bytes and the header information has to be transmitted only once.

Line 12 contains the data chunks. It is omitted here because it contains unprintable characters. A data chunk starts with the 2 id bytes followed by the 4 byte chunk size.

After all data was transmitted the server reports the end of the stream (line 13-15) and the end of the session (line 16).

Web interface

CAPS ships with a read-only Web interface which provides server traffic statistics (figure 13) and which allows to view and filter the available streams (figure 14). For the RAW and MiniSeed packets it is also possible to view the waveform data by clicking on a an entry of the stream table. The Web interface is disabled by default and may be enabled by configuring a valid port number under AS.http.port.

../_images/web_overview.png

Overview perspective of CAPS Web interface showing traffic and file statistics

../_images/web_streams.png

Stream perspective of CAPS Web interface allowing to filter availability streams and to view waveform data for RAW and MiniSeed records