Dropping a Db2 REST service
You can use the Db2 REST service manager API to drop a user-defined service if you have the required authority. Dropping a service removes the service, frees its associated package, and deletes the corresponding row from the SYSIBM.DSNSERVICE catalog table. You can also issue the FREE SERVICE subcommand to drop a REST service.
Before you begin
When you drop a service, you must have a privilege that allows the runner to free or drop the associated package. For required authorization, see FREE SERVICE (DSN).
Procedure
Example
This example shows how to drop the V1 version of service simpleSelect1
, including setting the Db2-Client-ApplName and Db2-Client-WrkStnName HTTP request header fields to the values "Customer Service" and "CS Laptop-47", respectively. Enter the following URI to start an HTTPS POST request:
POST https://<host>:<port>/services/DB2ServiceManager
Specify the following HTTP header fields for the request:
Accept:application/json
Content-Type:application/json
Db2-Client-ApplName:Customer Service
Db2-Client-WrkStnName:CS Laptop-47
Specify the following HTTP body for the request:
{
"requestType": "dropService",
"collectionID": "SYSIBMSERVICE",
"serviceName": "simpleSelect1",
"version": "V1"
}
Db2 returns the following response in JSON:
{
"StatusCode":200,
"StatusDescription": "DB2 Rest Service SYSIBMSERVICE.simpleSelect1.(V1) was dropped successfully."
}
The response shows that service simpleSelect1
was successfully removed.