TS/MP 2.5 Management Programming Manual

== Set the SSID (subsystem ID) value, which tells SPI what product you are
== interfacing with.
#SET zpwy^val^ssid [zspi^val^tandem].[zspi^ssn^zpwy].[zpwy^val^version]
== Initialize the buffer (spi^buf) with the SSID value and the command
== that is to be executed.
SINK [#SSINIT /TYPE 0/ spi^buf [zpwy^val^ssid]
[zpwy^cmd^[command^]] /OBJECT [zpwy^obj^sc]/]
== Initialize the ZPWY^DDL^SEL^SC token with null values using
== ZPWY^MAP^SEL^SC to determine how each field is to be initialized. That
== is, ZPWY^MAP^SEL^SC has the information to determine if the fields
== be nulled to "0" or " ".
SINK [#SSNULL zpwy^map^sel^sc zpwy^ddl^sel^sc]
SINK [#SSNULL zpwy^map^def^sc zpwy^ddl^def^sc]
== Load the buffer (spi^buf). First, set the server name then load it
== into the buffer using #SSPUTV. Then set the server attributes and load
== them into the buffer.
#SET zpwy^ddl^sel^sc:zname:zserverclass [svr^name]
SINK [#SSPUTV spi^buf zpwy^map^sel^sc zpwy^ddl^sel^sc]
[#IF [#MATCH [command^] ADD] |THEN|
#SET zpwy^ddl^def^sc:zcpuinfo:zcpupaircount 1
#SET zpwy^ddl^def^sc:zcpuinfo:zcpupair:zprimary 6
#SET zpwy^ddl^def^sc:zcpuinfo:zcpupair:zbackup 7
#SET zpwy^ddl^def^sc:zmaxservers 2
#SET zpwy^ddl^def^sc:zmaxlinks 2
#SET zpwy^ddl^def^sc:znumstatic 1
#SET zpwy^ddl^def^sc:zprogram [#defaults].object
#SET zpwy^ddl^def^sc:zdefaultvolume [#defaults]
|ELSE|
== alter a couple of values
#SET zpwy^ddl^def^sc:zmaxservers 10
#SET zpwy^ddl^def^sc:zpriority 135
] == end if [match [command^] add] .....
SINK [#SSPUTV spi^buf zpwy^map^def^sc zpwy^ddl^def^sc]
== To communicate with the PATHMON environment, use #REQUESTER to open the
== Pathway environment. Use #APPENDV to send the request in the SPI
== buffer to the PATHMON environment. Use #EXTRACTV to copy the reply from
== Pathway back into the SPI buffer. Finally, terminate the open request to
== Pathway with #REQUESTER CLOSE.
#SET read^err [#REQUESTER/ WAIT [zpwy^val^buflen]/READ &
[pmon^name].#ZSPI io^err reply request]
[#IF read^err |THEN|
#OUTPUT
#OUTPUT **** Error [read^err] opening Pathmon [pmon^name] ****
[#IF not [#EMPTYV io^err] |THEN|
#OUTPUT Error [io^err] is the culprit...
] == end if not [emptyv io^err] ...
|ELSE|
#APPENDV request spi^buf == send the request
#EXTRACTV reply spi^buf == receive the reply
SINK [#REQUESTER CLOSE request]
== Now display the results. Use #SSGETV to extract tokens from the SPI
== buffer. In this case, the ZPWY^DDL^SEL^SC token is extracted using
== ZPWY^MAP^SEL^SC to interpret the token values returned. Finally, use
== #OUTPUTV to display the contents of ZPWY^DDL^SEL^SC. If Pathway
== returns an error via the ZSPI^TKN^RETCODE token, it is captured in the
== result^3 variable.
#SETMANY result^1 result^2 result^3, [#SSGET/ INDEX 1 /spi^buf
zspi^tkn^retcode]
== If an error is encountered, open the error list in the response buffer
== for access, extract the command from the response buffer, and extract the
== object type from the response buffer.
338 Management Programming Examples