Start of change

-DISPLAY RESTSVC command (Db2)

The Db2 command DISPLAY RESTSVC displays the status of REST services that exist in Db2.

This command displays one or more lines of output for each REST service that is defined in Db2. You can qualify REST service names with a collection-id.

The information returned by the DISPLAY RESTSVC command reflects a dynamic status. By the time the information is displayed, it is possible that the status could have changed.

Abbreviation: -DIS RESTSVC

Environment

This command can be issued from a z/OS console, a DSN session under TSO, a DB2I panel (Db2 COMMANDS), an IMS or CICS terminal, or a program using the instrumentation facility interface (IFI).

Data sharing scope: Group

Authorization

To execute this command, you must use a privilege set of the process that includes one of the following authorities:
  • DISPLAY privilege
  • System DBADM authority
  • SYSOPR authority
  • SYSCTRL authority
  • SYSADM authority
If you specify DISPLAY RESTSVC *.*, collection-id.partial-name*, or partial-name*, the privilege set of the process must include one of the following authorities:
  • SYSOPR authority
  • SYSCTRL authority
  • SYSADM authority

Db2 commands that are issued from a logged-on z/OS® console or TSO SDSF can be checked by Db2 authorization using primary and secondary authorization IDs. Start of changeA logged-on z/OS user ID must be defined in RACF or a similar security server.End of change

If you are using an external security product to authorize usage of DISPLAY RESTSVC, define SYSOPR as a user to the external security product for those cases in which DISPLAY RESTSVC SCOPE(GROUP) runs on a remote system and SYSOPR is used as the authorization ID.

Syntax

Read syntax diagramSkip visual syntax diagram DISPLAY RESTSVC (*.*)(,collection-id.service-name.version-idcollection-id.service-namecollection-id.partial-name*service-namepartial-name*) STATUS(*STARTEDSTOPREJ) LIMIT(100integer*) SCOPE(GROUP)

Option descriptions

For mixed case names, use single quotes (') around the input.

( *.* )
Displays the status for all versions of all REST services in all collection-ids. Note: when specified, *.* can be the only RESTSVC parameter.
(collection-id.service-name.version-id)
Displays a specific version of the specified REST service in the specified collection-id.
(collection-id.service-name)
Displays information for all versions of the REST service in the specified collection-id.
(collection-id.partial-name*)
Displays information for all versions of a set of REST services in the specified collection-id. The names of all REST services in the set begin with partial-name and can end with any string, including the empty string. For example, PAYROLL.ABC* starts all REST services with names that begin with ABC in the PAYROLL collection-id.
(service-name)
Displays all versions of the specified REST service in the SYSIBMSERVICE collection-id.
(partial-name*)
Displays all versions in a set of REST services in the SYSIBMSERVICE collection-id. The names of all REST services in the set begin with partial-name and can end with any string, including the empty string. For example, ABC* starts all REST services names that begin with ABC in the SYSIBMSERVICE collection-id.
STATUS

Specifies the status of the services to be displayed.

( * )
Services of any status are displayed.
(STARTED)
Services of the STARTED status are displayed.
(STOPREJ)
Services of the STOPREJ (service is stopped from being invoked with a reject of the request back to the client) are displayed.
LIMIT
Limits the number of services to be displayed by the command.
(integer)
The maximum number of services that are displayed. The default is 100. The maximum number of messages that can be displayed is limited by the space available on the console.
(*)
Limits the display to the space available.
SCOPE
Specifies the scope of the command.
(GROUP)
Specify to display information about REST services on all members of the data sharing group.

Output

Message DSNL601I indicates the beginning of the output of a DISPLAY RESTSVC command. Message DSN9022I will indicate the end of the output of the command if no failure occurred during the processing of the command. Message DSN9023I will indicate the end of the output of the command if an abend had occurred during the processing of the command.

Usage notes

Trace information for data sharing members
When this command with group scope is issued in a Db2 data sharing member, it also runs on all other active members. IFICID 090 trace records for other group members can show that the same command was issued by the SYSOPR authorization ID from the 016.TLPKN5F correlation ID, in addition to the trace records from the member where the original command was issued. See Command scope in Db2 data sharing.

Examples

Example: No authority for a DISPLAY RESTSVC command
The following command attempts to use the DISPLAY RESTSVC command on a service that the user does not have the proper authorities for:
-DB2A DIS RESTSVC                                                    

The output is similar to this output:

DSN9016I  -DB2A '-DIS RESTSVC' COMMAND REJECTED, UNAUTHORIZED REQUEST
DSN9023I  -DB2A DSN9SCND '-DIS RESTSVC' ABNORMAL COMPLETION   
Example: Display a service when specifying the version id
The following command displays version V3 of the SVCWVRSN0300 service in the VRSNTEST002 collection:
-DIS RESTSVC(VRSNTEST002.SVCWVRSN0300.V3) 

The output is similar to this output:

DSNL601I  -DB2A DISPLAY RESTSVC REPORT FOLLOWS-                         
DSNL610I  -DB2A                                                         
---- COLLECTION=VRSNTEST002                                             
SERVICE                                      VERSION          STATUS    
SVCWVRSN0300                                 V3               STARTED*  
DSN9022I  -DB2A DSNLJDSS 'DISPLAY RESTSVC' NORMAL COMPLETION            
Example: Display a service using the wildcard character
The following command displays the services in the collection called MYTEST001 until the given limit, 10:
-DB2A DIS RESTSVC(MYTEST001.*)LIMIT(10)

The output is similar to this output:

DSNL601I  -DB2A DISPLAY RESTSVC REPORT FOLLOWS-
DSNL610I  -DB2A                                                       
---- COLLECTION=MYTEST001                                             
SERVICE                                      VERSION          STATUS  
SERVICE0001                                                   STOPREJ*
SERVICE0002                                                   STOPREJ*
SERVICE0003                                                   STOPREJ*
SERVICE0004                                                   STOPREJ*
SERVICE0005                                                   STOPREJ*
SERVICE0006                                                   STOPREJ*
SERVICE0007                                                   STOPREJ*
SERVICE0008                                                   STOPREJ*
SERVICE0009                                                   STOPREJ*
SERVICE0010                                                   STOPREJ*
DSNL605I  DISPLAY RESTSVC TERMINATED WITH MAXIMUM LINES
DSN9022I  -DB2A DSNLJDSS 'DISPLAY RESTSVC' NORMAL COMPLETION
Example: No services found when trying to display a service
The following command attempts to display any service in collection a. No service that can be found in that collection.
-DB2A DIS RESTSVC(A.*)

The output is similar to this output:

DSNL601I  -DB2A DISPLAY RESTSVC REPORT FOLLOWS-
DSNL603I  -DB2A NO SERVICES FOUND FOR A.*                
DSN9022I  -DB2A DSNLJDSS 'DISPLAY RESTSVC' NORMAL COMPLETION
Example: Displaying services with a mixed case collection name.
The following command displays the services within the collection ID BankDemo.
-DB2A DIS RESTSVC('BankDemo.*')

The output is similar to this output:

DSNL601I  -DB2A DISPLAY RESTSVC REPORT FOLLOWS-                       
DSNL610I  -DB2A                                                  
---- COLLECTION=BankDemo                                              
SERVICE                                      VERSION          STATUS  
CreateAccount                                                 STARTED*
DepositById                                                   STARTED*
DisplayAccountById                                            STARTED*
DisplayAcctTranHistory                                        STARTED*
DisplayAllAccounts                                            STARTED*
TransferBetweenAccounts                                       STARTED*
DSN9022I  -DB2A DSNLJDSS 'DISPLAY RESTSVC' NORMAL COMPLETION          
End of change