Enabling the Db2 REST interface

You can enable the Db2 REST interface for an existing Db2 deployment on Red Hat OpenShift.

Procedure

  1. 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:
    1. If you used db2cluster for provisioning, run the following command:
      oc get db2ucluster
      The output will include your deployment ID. For example,
      NAME                  STATE   AGE
      db2wh-1603819662989   Ready   34m
      Here, db2wh-1603819662989 is the name of your db2ucluster resource.

    2. If you used db2uinstance for provisioning, run the following command:
      oc get db2uinstance
      The output will include your deployment ID. For example,
      NAME                  STATE   AGE
      db2u-wh-v2            Ready   34m
      Here, db2u-wh-v2 is the name of your db2uinstance resource.
  2. Edit your custom resource using one of these methods:
    1. If you used db2ucluster for provisioning, run the following command:
      oc edit db2ucluster deployment_ID
    2. If you used db2uinstance for provisioning, run the following command:
      oc edit db2uinstance deployment_ID
  3. Run the following command to view the REST service and deployment information:
    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, -t 
    The results should look similar to the following example:
    service                c-db2oltp-1603819662989-db2u-rest-svc          Creating
    Deployment             c-db2oltp-1603819662989-rest                   Creating
  4. Run the following command to view the newly created REST pod:
    oc get pods |grep db2
    Here is an example with the REST pod highlighted:
    c-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          17m
    Note the REST pod name, which is used to run documented REST commands.