| 1 |
<HTML> |
| 2 |
<HEAD> |
| 3 |
<TITLE>XPA Programs</TITLE> |
| 4 |
</HEAD> |
| 5 |
<BODY> |
| 6 |
<H2>XPA Programs</H2> |
| 7 |
|
| 8 |
<H2>Summary</H2> |
| 9 |
|
| 10 |
<P> |
| 11 |
Use the XPA programs to send/receive data to/from XPA servers from the |
| 12 |
command line or from scripts. |
| 13 |
|
| 14 |
<P> |
| 15 |
<PRE> |
| 16 |
<data> | xpaset [-h] [-i nsinet] [-m method] [-n] [-p] [-s] [-t sval,lval] [-u users] [-v] <template> [paramlist] |
| 17 |
|
| 18 |
xpaget [-h] [-i nsinet] [-m method] [-s] [-t sval,lval] [-u users] <template> [paramlist] |
| 19 |
|
| 20 |
xpainfo [-h] [-i nsinet] [-m method] [-n] [-s] [-t sval,lval] [-u users] <template> [paramlist] |
| 21 |
|
| 22 |
xpaaccess [-c] [-h] [-i nsinet] [-m method] [-n] [-u users] [-v|-V] <template> [type] |
| 23 |
</PRE> |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
<H2><A NAME="xpaset">xpaset: send data to one or more XPA servers</A></H2> |
| 29 |
|
| 30 |
|
| 31 |
<B> |
| 32 |
<PRE> |
| 33 |
<data> | xpaset [-h] [-i nsinet] [-m method] [-n] [-p] [-s] [-t sval,lval] [-u users] [-v] <template|host:port> [paramlist] |
| 34 |
</PRE> |
| 35 |
</B> |
| 36 |
|
| 37 |
|
| 38 |
<P> |
| 39 |
<PRE> |
| 40 |
-h print help message |
| 41 |
-i access XPA point on different machine (override XPA_NSINET) |
| 42 |
-m override XPA_METHOD environment variable |
| 43 |
-n don't wait for the status message after server completes |
| 44 |
-p don't read (or send) buf data from stdin |
| 45 |
-s enter server mode |
| 46 |
-t [s,l] set short and long timeouts (override XPA_[SHORT,LONG]_TIMEOUT) |
| 47 |
-u [users] XPA points can be from specified users (override XPA_NSUSERS) |
| 48 |
-v verify message to stdout |
| 49 |
--version display version and exit |
| 50 |
</PRE> |
| 51 |
|
| 52 |
|
| 53 |
<P> |
| 54 |
Data read from stdin will be sent to access points matching the |
| 55 |
<A HREF="./template.html">template</A> |
| 56 |
or host:port. |
| 57 |
A set of qualifying parameters can be appended. |
| 58 |
<P> |
| 59 |
Normally, xpaset reads data input from stdin until EOF and sends those |
| 60 |
data to the XPA target, along with parameters entered on the command |
| 61 |
line. For example to send a FITS file to the ds9 image display: |
| 62 |
<PRE> |
| 63 |
cat foo.fits | xpaset ds9 fits |
| 64 |
</PRE> |
| 65 |
<P> |
| 66 |
Sometimes, however, it is desirable to send only parameters to an XPA |
| 67 |
access point, without sending data. For such cases, use the -p switch to |
| 68 |
indicate that there is no data being send to stdin. For example, to |
| 69 |
change the colormap used by the ds9 image display program, use: |
| 70 |
<PRE> |
| 71 |
csh> xpaset -p ds9 cmap Heat |
| 72 |
</PRE> |
| 73 |
Of course, this also can be accomplished by sending EOF to stdin in |
| 74 |
any of the usual ways: |
| 75 |
<PRE> |
| 76 |
csh> echo "" | xpaset ds9 cmap Heat |
| 77 |
csh> xpaget ds9 cmap Heat < /dev/null |
| 78 |
csh> xpaset ds9 cmap Heat |
| 79 |
^D # Ctl-D signals EOF |
| 80 |
</PRE> |
| 81 |
<P> |
| 82 |
The -s switch puts xpaset into server mode, in which commands and data |
| 83 |
can be sent to access points without having to run xpaset multiple times. |
| 84 |
(Its not clear if this buys you much!) The syntax for sending commands |
| 85 |
in server mode is: |
| 86 |
<P> |
| 87 |
<PRE> |
| 88 |
csh> xpaset -s |
| 89 |
xpaset ds9 colormap I8 |
| 90 |
^D |
| 91 |
xpaset ds9 regions |
| 92 |
circle 200 300 40 |
| 93 |
circle 300 400 50 |
| 94 |
^D |
| 95 |
etc. |
| 96 |
</PRE> |
| 97 |
After the required "xpaset" command is specified, optional ASCII data |
| 98 |
can be appended (as in the region example). A single data/command set is |
| 99 |
delimited by ^D. Note that typing ^D when a command is expected terminates |
| 100 |
the program. |
| 101 |
<P> |
| 102 |
NB: server mode only works from the terminal and only ASCII data can be |
| 103 |
sent in this way. |
| 104 |
<P> |
| 105 |
<B>Examples:</B> |
| 106 |
<PRE> |
| 107 |
csh> xpaset ds9 file < foo.fits |
| 108 |
csh> echo "stop" | xpaset myhost:12345 |
| 109 |
</PRE> |
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
<H2><A NAME="xpaget">xpaget: retrieve data from one or more XPA servers</A></H2> |
| 115 |
|
| 116 |
|
| 117 |
<B> |
| 118 |
<PRE> |
| 119 |
xpaget [-h] [-i nsinet] [-m method] [-s] [-t sval,lval] [-u users] <template|host:port> [paramlist] |
| 120 |
</PRE> |
| 121 |
</B> |
| 122 |
|
| 123 |
|
| 124 |
<P> |
| 125 |
<PRE> |
| 126 |
-h print help message |
| 127 |
-i access XPA point on different machine (override XPA_NSINET) |
| 128 |
-m override XPA_METHOD environment variable |
| 129 |
-n don't wait for the status message after server completes |
| 130 |
-s enter server mode |
| 131 |
-t [s,l] set short and long timeouts (override XPA_[SHORT,LONG]_TIMEOUT) |
| 132 |
-u [users] XPA points can be from specified users (override XPA_NSUSERS) |
| 133 |
--version display version and exit |
| 134 |
</PRE> |
| 135 |
|
| 136 |
|
| 137 |
<P> |
| 138 |
Data will be retrieved from access points matching the |
| 139 |
<A HREF="./template.html">template</A> |
| 140 |
or host:port. |
| 141 |
A set of qualifying parameters can be appended. |
| 142 |
<P> |
| 143 |
<B>Examples:</B> |
| 144 |
<PRE> |
| 145 |
csh> xpaget ds9 images |
| 146 |
csh> xpaget myhost.harvard.edu:12345 |
| 147 |
</PRE> |
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
<H2><A NAME="xpainfo">xpainfo: send short message to one or more XPA servers</A></H2> |
| 153 |
|
| 154 |
|
| 155 |
<B> |
| 156 |
<PRE> |
| 157 |
xpainfo [-h] [-i nsinet] [-m method] [-n] [-s] [-t sval,lval] [-u users] <template|host:port> [paramlist] |
| 158 |
</PRE> |
| 159 |
</B> |
| 160 |
|
| 161 |
|
| 162 |
<P> |
| 163 |
<PRE> |
| 164 |
-h print help message |
| 165 |
-i access XPA point on different machine (override XPA_NSINET) |
| 166 |
-m override XPA_METHOD environment variable |
| 167 |
-n don't wait for the status message after server completes |
| 168 |
-s enter server mode |
| 169 |
-t [s,l] set short and long timeouts (override XPA_[SHORT,LONG]_TIMEOUT) |
| 170 |
-u [users] XPA points can be from specified users (override XPA_NSUSERS) |
| 171 |
--version display version and exit |
| 172 |
</PRE> |
| 173 |
|
| 174 |
|
| 175 |
<P> |
| 176 |
Info will be sent to access points matching the |
| 177 |
<A HREF="./template.html">template</A> |
| 178 |
or host:port. |
| 179 |
A set of qualifying parameters can be appended. |
| 180 |
<P> |
| 181 |
<B>Examples:</B> |
| 182 |
<PRE> |
| 183 |
csh> xpainfo IMAGE ds9 image |
| 184 |
</PRE> |
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
<H2><A NAME="xpaaccess">xpaaccess: see if template matches registered XPA access points</A></H2> |
| 190 |
|
| 191 |
|
| 192 |
<B> |
| 193 |
<PRE> |
| 194 |
xpaaccess [-c] [-h] [-i nsinet] [-m method] [-n] [-t sval,lval] [-u users] -v <template> [type] |
| 195 |
</PRE> |
| 196 |
</B> |
| 197 |
|
| 198 |
|
| 199 |
<P> |
| 200 |
<PRE> |
| 201 |
-c contact each access point individually |
| 202 |
-h print help message |
| 203 |
-i access XPA point on different machine (override XPA_NSINET) |
| 204 |
-m override XPA_METHOD environment variable |
| 205 |
-n return number of matches instead of "yes" or "no" |
| 206 |
-t [s,l] set short and long timeouts (override XPA_[SHORT,LONG]_TIMEOUT) |
| 207 |
-u [users] XPA points can be from specified users (override XPA_NSUSERS) |
| 208 |
-v print info about each successful access point |
| 209 |
-V print info or error about each access point |
| 210 |
--version display version and exit |
| 211 |
</PRE> |
| 212 |
|
| 213 |
|
| 214 |
<P> |
| 215 |
xpaaccess returns "yes" to stdout (with a return error code if 1) if there are |
| 216 |
existing XPA access points that match the |
| 217 |
<A HREF="./template.html">template</A> |
| 218 |
(and optional access type: g,i,s). Otherwise, it returns "no" (with a |
| 219 |
return error code of 0). If -n is specified, the number of matches is |
| 220 |
returned instead (both to stdout and in the returned error code). If |
| 221 |
-v is specified, each access point is displayed to stdout instead of |
| 222 |
the number of matches. |
| 223 |
|
| 224 |
<P> |
| 225 |
By default, xpaaccess simply contacts the xpans name server to find |
| 226 |
the list of registered access points that match the specified |
| 227 |
template. It also checks to make sure the specified types are |
| 228 |
supported by that access point. This is the fastest way to determine |
| 229 |
available access points. However, an access point might registered but |
| 230 |
not yet available, if, for example, the server program has not entered |
| 231 |
its event loop to process XPA requests. To find access points that are |
| 232 |
guaranteed to be available for processing, use the -c (contact) |
| 233 |
switch. With this switch, xpaaccess contacts each matching XPA server |
| 234 |
(rather than the name server) to make sure the registered access point |
| 235 |
really is ready for processing. In this mode, if an access point is |
| 236 |
registered but not available, xpaaccess will pause for a period of |
| 237 |
time equal to the XPA_LONG_TIMEOUT, in order to give the server a |
| 238 |
chance to ready itself. By default, this timeout is 30 seconds. You |
| 239 |
can shorten the time of delay using the -t "short,long" switch. For |
| 240 |
example, to shorten the delay time to 2 seconds, use: |
| 241 |
<PRE> |
| 242 |
xpaaccess -c -t "2,2" ds9 |
| 243 |
</PRE> |
| 244 |
The first argument is the short delay value, and is ignored in this |
| 245 |
operation. The second is the long delay timeout. |
| 246 |
|
| 247 |
<P> |
| 248 |
Note also that the default xpaaccess method (no -c switch) does not |
| 249 |
check access control (acls) but rather only checks whether the access |
| 250 |
point is both registered with the xpans name server and provides the |
| 251 |
specified type of access. In other words, the default xpaaccess could |
| 252 |
return 'yes' when you might not actually have access. This mode also |
| 253 |
always returns 'yes' for the xpans name server itself, regardless of |
| 254 |
whether the name server is active. The -c (contact) switch, which |
| 255 |
contacts the access point directly, can and does check the access |
| 256 |
control (only for servers using version 2.1 and above) and also |
| 257 |
returns the real status of xpans. |
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
<P> |
| 270 |
<A HREF="./help.html">Go to XPA Help Index</A> |
| 271 |
|
| 272 |
<H5>Last updated: September 10, 2003</H5> |
| 273 |
</BODY> |
| 274 |
</HTML> |