Enabling the Db2 REST interface
You can enable the Db2 REST interface for an existing Db2 deployment on Red Hat OpenShift.
Procedure
- During or after provisioning your Db2 Warehouse service instance, you can modify the
custom resources based on your deployment type. To locate your custom resources follow one of these
methods:
- If you used
db2clusterfor provisioning, run the following command:
The output will include your deployment ID. For example,oc get db2ucluster
Here,NAME STATE AGE db2wh-1603819662989 Ready 34mdb2wh-1603819662989is the name of your db2ucluster resource. - If you used
db2uinstancefor provisioning, run the following command:
The output will include your deployment ID. For example,oc get db2uinstance
Here,NAME STATE AGE db2u-wh-v2 Ready 34mdb2u-wh-v2is the name of your db2uinstance resource.
- If you used
- Edit your custom resource using one of these methods:
- If you used
db2uclusterfor provisioning, run the following command:oc edit db2ucluster deployment_ID - If you used
db2uinstancefor provisioning, run the following command:oc edit db2uinstance deployment_ID
- If you used
-
Run the following command to view the REST service and deployment information:
The results should look similar to the following example:oc get formations.db2u.databases.ibm.com db2oltp-1603819662989 -o go-template='{{range .status.components}}{{printf "%s,%s,%s\n" .kind .name .status.state}}{{end}}' | column -s, -tservice c-db2oltp-1603819662989-db2u-rest-svc Creating Deployment c-db2oltp-1603819662989-rest Creating -
Run the following command to view the newly created REST pod:
Here is an example with the REST pod highlighted:oc get pods |grep db2c-db2oltp-1603819662989-db2u-0 1/1 Running 0 39m c-db2oltp-1603819662989-etcd-0 1/1 Running 0 39m c-db2oltp-1603819662989-instdb-df7hh 0/1 Completed 0 40m c-db2oltp-1603819662989-ldap-64bc6d58dc-ms29x 1/1 Running 0 40m c-db2oltp-1603819662989-rest-66f7fcb7d4-98fbh 1/1 Running 0 86s c-db2oltp-1603819662989-restore-morph-bkfpr 0/1 Completed 0 39m c-db2oltp-1603819662989-tools-57bc7d4ddf-wz8fr 1/1 Running 0 40m db2u-operator-5999cd944b-dwgrr 1/1 Running 0 17mNote the REST pod name, which is used to run documented REST commands.