Activating and initializing REST capability

Before application programmers can create REST services, you need to activate and initialize the REST capability.

To initialize the REST capability and set up the REST server metadata, issue the following commands in the order shown:
docker exec containername /opt/ibm/dbrest/scripts/db2rest-stop.sh
docker exec containername /opt/ibm/dbrest/scripts/db2rest-setup.sh hostname dbname port isSSLConnection schema username password sslKeystorePath sslKeystashPath
docker exec containername /opt/ibm/dbrest/scripts/db2rest-start.sh
where:
Parameter Name Description
containername The name of the Db2 container.
hostname The hostname of the database.
dbname The name of the database (for example, BLUDB).
port The database listener port (for example, 50001).
isSSLConnection Whether the port identifies an TLS connection (Y) or does not (N).
schema The schema for the metadata table (for example, DB2REST).
username The username under which the metadata table will be created.
password The password to connect to the database.
sslKeystorePath The fully qualified TLS keystore path within the Db2® REST container. This parameter is optional and is only required if your TLS configuration uses certificate based authentication. For example:
 /opt/ibm/dbrest/ssl/bludb_ssl.kdb
sslKeystashPath The fully qualified TLS key stash path within the Db2 REST container. This parameter is optional and is only required if your TLS configuration uses certificate based authentication. For example:
 /opt/ibm/dbrest/ssl/bludb_ssl.sth
Alternatively, you can call the setup_metadata REST API as described in Defining a REST SQL service.
Note: Once the REST server has been started, you can view the API documentation by accessing https://<hostname>:50050/docs.