Start of change

-STOP RESTSVC command (Db2)

The Db2 command STOP RESTSVC prevents Db2 from accepting any new discover details or invoke requests for one or more REST services. You can qualify REST service names with a collection ID name.

On successful completion of the command, the specified REST services will be stopped and any new requests for the specified REST services will fail with an HTTP 503 (Resource unavailable) return status.

Abbreviation: -STO 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:
  • System DBADM authority
  • 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

Syntax

Read syntax diagramSkip visual syntax diagram STOP RESTSVC (*.*)(,collection-id.service-name.version-idcollection-id.service-namecollection-id.partial-name*service-namepartial-name*) ACTION(REJECT)SCOPE(GROUP)

Option descriptions

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

( *.* )
Marks all versions of all REST services in all collection-ids as stopped and unavailable to be called. Note: when specified, *.* can be the only SERVICE parameter.
(collection-id.service-name.version-id)
Stops a specific version of the specified REST service in the specified collection-id.
(collection-id.service-name)
Stops all versions of the specified REST service in the specified collection-id.
(collection-id.partial-name*)
Stops all versions in 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)
Stops all versions of the specified REST service in the SYSIBMSERVICE collection-id.
(partial-name*)
Marks all versions in a set of REST services in the SYSIBMSERVICE collection-id as stopped and unavailable to be called. 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.
ACTION
Indicates what to do with a REST discover or invoke request that is received while the REST service is stopped.
(REJECT)
Rejects the request.
SCOPE
Specifies the scope of the command.
(GROUP)
Stops the specified REST services in all members of the data sharing group.

Usage notes

Affected services

The STOP RESTSVC command affects all versions of the REST services that you specify in the command.

The STOP RESTSVC command only affects the REST services that already exist when the command is issued.

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.

Output

Message DSNL601I indicates the beginning of the output of a STOP 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.

Examples

Example: No authority for a STOP RESTSVC command
The following command attempts to use the STOP RESTSVC command on a service that the user does not have the proper authorities for:
-DB2A STO RESTSVC('DB2zRESTServiceTestCollectionID.simpleSelect3') 

The output is similar to this output:

DSNL601I  -DB2A STOP RESTSVC REPORT FOLLOWS-
DSNL604I  -DB2A USER HAS INSUFFICIENT AUTHORITY FOR STOP RESTSVC OF
DB2zRESTServiceTestCollectionID.simpleSelect3                      
DSN9022I  -DB2A DSNLJDSS 'STOP RESTSVC' NORMAL COMPLETION    
Example: Stop all services with the BankDemo collection ID name
The following command successfully uses the STOP RESTSVC command on all services within the BankDemo collection:
-DB2A STOP RESTSVC('BankDemo.*') 

The output is similar to this output:

DSNL601I  -DB2A STOP RESTSVC REPORT FOLLOWS-                 
DSNL607I  -DB2A ALL SERVICES HAVE BEEN STOPREJ FOR BankDemo.*
DSN9022I  -DB2A DSNLJDSS 'STOP RESTSVC' NORMAL COMPLETION      
End of change