Enabling policy registry service swagger
Learn how to enable the policy registry service swagger.
Procedure
-
Swagger can be enabled for the policy registry service by adding the following lines to the NOI
custom resource (CR) YAML file under the
spec
section, as in the following example.spec: helmValuesNOI: ibm-hdm-analytics-dev.policyregistryservice.swagger.enabled: true
Note:You can edit the NOI CR YAML file from one of the following two ways.- Edit from the command line with the oc edit noi or oc edit noihybrid command, depending on whether your deployment is full cloud or hybrid.
- Edit the deployment from Red Hat® OpenShift® with the Operator Lifecycle Manager (OLM) console: Operators > Installed Operators > IBM Cloud Pak for AIOps Event Manager. Click the NOI or NOIHybrid tab and select your deployment. Then, click the YAML tab to edit and save the YAML file. Your changes are auto-deployed.
- Delete the noi-operator pod to have it recreated. Get the noi-operator pod name.
oc get pod | grep operator
Delete the noi-operator pod with the oc delete command.oc delete pod <noi-operator pod name>
- After the policy registry pod restarts, it updates the deployments and adds the following
value for the policy registry service.
You can verify the setting by running the following command.- name: ENABLE_SWAGGER_UI value: "1"
oc edit deployment <policyregistryservice pod name>
- To access the policy registry swagger, you can find the route by running the following
command. Run the command on the Openshift CLI when logged into the namespace where IBM® Netcool® Operations Insight® on Red Hat OpenShift is
installed.
This command outputs a URL similar to the following example:FULL_ROUTE=$(oc get route | grep policyregistry.ibm-netcool-prod.aiops.io) && echo $FULL_ROUTE | awk '{ print "https://"$2$3"/docs/v1alpha/system/#/"}'
https://netcool-evtmanager.apps.sub.mydomain.com/policyregistry.ibm-netcool-prod.aiops.io/docs/v1alpha/system/#/
- The swagger UI is accessible in the following format for the policy registry service. Version 1 cloud native analytics policies
Version 2 cloud native analytics policieshttps://<host>/api/policies/docs/policies/system/v1/
https://<host>/api/policies/docs/policies/system/v2/
Where <host> is the hostname for the policy registry service, which can be found by running the following command.
Similarly, for user policies, construct the swagger UI with the following format: https://<host>/api/policies/docs/policies/user/v1 or https://<host>/api/policies/docs/policies/user/v2oc get route | grep policies
Note: Authorization for the API can be obtained from the NOI systemauth-secret in the NOI namespace. For more information, see Configure aggregation settings.