Enabling the Db2 REST interface in Db2 Big SQL
You can enable the Db2 REST interface for an existing Db2 Big SQL deployment on Cloud Pak for Data.
Procedure
- When you provision a Db2 Big
SQL service instance, you can edit the
db2ucluster
custom resource. Find yourdb2ucluster
custom resource by running the following command.[root@deploysquad2-inf ~]# oc get db2ucluster
The command results match your deployment ID. In the following example,
bigsql-<instance_id>
.NAME STATE MAINTENANCESTATE AGE bigsql-<instance_id> Ready None 34m
- Run the following command to edit the add-ons file.
oc edit db2ucluster deployment_ID
Set the spec.addOns.rest.enabled field to true. If the field does not exist, add it.
The edited file looks similar to the following example.
spec: ... addOns: rest: enabled: true
- Run the following command to view the REST service and deployment information.
oc get formations.db2u.databases.ibm.com bigsql-<instance_id> -o go-template='{{range .status.components}}{{printf "%s,%s,%s\n" .kind .name .status.state}}{{end}}' | column -s, -t
The results look similar to the following example:
service c-bigsql-<instance_id>-db2u-rest-svc Creating Deployment c-bigsql-<instance_id>-db2u-rest Creating
- Run the following command to view the REST pod as part of your deployment.
oc get pods |grep db2
The following example highlights the REST pod.
c-bigsql-<instance_id>-db2u-0 1/1 Running 0 39m c-bigsql-<instance_id>-db2u-etcd-0 1/1 Running 0 39m c-bigsql-<instance_id>-db2u-instdb-df7hh 0/1 Completed 0 40m c-bigsql-<instance_id>-db2u-ldap-64bc6d58dc-ms29x 1/1 Running 0 40m c-bigsql-<instance_id>-db2u-rest-66f7fcb7d4-98fbh 1/1 Running 0 86s c-bigsql-<instance_id>-db2u-restore-morph-bkfpr 0/1 Completed 0 39m c-bigsql-<instance_id>-db2u-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.